contentful-management 10.2.0 → 10.4.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.
@@ -8860,7 +8860,7 @@ var create = function create(http, params, payload) {
8860
8860
  /*!***************************************************!*\
8861
8861
  !*** ./adapters/REST/endpoints/app-definition.ts ***!
8862
8862
  \***************************************************/
8863
- /*! exports provided: getAppDefinitionUrl, get, getMany, create, update, del */
8863
+ /*! exports provided: getAppDefinitionUrl, get, getMany, create, update, del, getInstallationsForOrg */
8864
8864
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
8865
8865
 
8866
8866
  "use strict";
@@ -8871,6 +8871,7 @@ __webpack_require__.r(__webpack_exports__);
8871
8871
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "create", function() { return create; });
8872
8872
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "update", function() { return update; });
8873
8873
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "del", function() { return del; });
8874
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getInstallationsForOrg", function() { return getInstallationsForOrg; });
8874
8875
  /* harmony import */ var _raw__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./raw */ "./adapters/REST/endpoints/raw.ts");
8875
8876
  /* harmony import */ var fast_copy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fast-copy */ "../node_modules/fast-copy/dist/fast-copy.js");
8876
8877
  /* harmony import */ var fast_copy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fast_copy__WEBPACK_IMPORTED_MODULE_1__);
@@ -8892,6 +8893,11 @@ var getBaseUrl = function getBaseUrl(params) {
8892
8893
  var getAppDefinitionUrl = function getAppDefinitionUrl(params) {
8893
8894
  return getBaseUrl(params) + "/".concat(params.appDefinitionId);
8894
8895
  };
8896
+
8897
+ var getBaseUrlForOrgInstallations = function getBaseUrlForOrgInstallations(params) {
8898
+ return "/app_definitions/".concat(params.appDefinitionId, "/app_installations?sys.organization.sys.id[in]=").concat(params.organizationId || '');
8899
+ };
8900
+
8895
8901
  var get = function get(http, params) {
8896
8902
  return _raw__WEBPACK_IMPORTED_MODULE_0__["get"](http, getAppDefinitionUrl(params), {
8897
8903
  params: Object(_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeSelect"])(params.query)
@@ -8920,6 +8926,11 @@ var update = function update(http, params, rawData, headers) {
8920
8926
  var del = function del(http, params) {
8921
8927
  return _raw__WEBPACK_IMPORTED_MODULE_0__["del"](http, getAppDefinitionUrl(params));
8922
8928
  };
8929
+ var getInstallationsForOrg = function getInstallationsForOrg(http, params) {
8930
+ return _raw__WEBPACK_IMPORTED_MODULE_0__["get"](http, getBaseUrlForOrgInstallations(params), {
8931
+ params: Object(_utils__WEBPACK_IMPORTED_MODULE_2__["normalizeSelect"])(params.query)
8932
+ });
8933
+ };
8923
8934
 
8924
8935
  /***/ }),
8925
8936
 
@@ -12573,7 +12584,7 @@ function createClient(params) {
12573
12584
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
12574
12585
  var sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
12575
12586
  var userAgent = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__["getUserAgentHeader"])( // @ts-expect-error
12576
- "".concat(sdkMain, "/").concat("10.2.0"), params.application, params.integration, params.feature);
12587
+ "".concat(sdkMain, "/").concat("10.4.0"), params.application, params.integration, params.feature);
12577
12588
  var adapter = Object(_create_adapter__WEBPACK_IMPORTED_MODULE_1__["createAdapter"])(params); // Parameters<?> and ReturnType<?> only return the types of the last overload
12578
12589
  // https://github.com/microsoft/TypeScript/issues/26591
12579
12590
  // @ts-expect-error
@@ -12728,7 +12739,7 @@ function createAppDefinitionApi(makeRequest) {
12728
12739
  *
12729
12740
  * client.getOrganization('<org_id>')
12730
12741
  * .then((org) => org.getAppDefinition('<app_def_id>'))
12731
- * .then((appDefinition) => appDefinition.getAppBundle('<app_upload_id>')
12742
+ * .then((appDefinition) => appDefinition.getAppBundle('<app_upload_id>'))
12732
12743
  * .then((appBundle) => console.log(appBundle))
12733
12744
  * .catch(console.error)
12734
12745
  * ```
@@ -12759,7 +12770,7 @@ function createAppDefinitionApi(makeRequest) {
12759
12770
  *
12760
12771
  * client.getOrganization('<org_id>')
12761
12772
  * .then((org) => org.getAppDefinition('<app_def_id>'))
12762
- * .then((appDefinition) => appDefinition.getAppBundles()
12773
+ * .then((appDefinition) => appDefinition.getAppBundles())
12763
12774
  * .then((response) => console.log(response.items))
12764
12775
  * .catch(console.error)
12765
12776
  * ```
@@ -12791,7 +12802,7 @@ function createAppDefinitionApi(makeRequest) {
12791
12802
  * })
12792
12803
  * client.getOrganization('<org_id>')
12793
12804
  * .then((org) => org.getAppDefinition('<app_def_id>'))
12794
- * .then((appDefinition) => appDefinition.createAppBundle('<app_upload_id>')
12805
+ * .then((appDefinition) => appDefinition.createAppBundle('<app_upload_id>'))
12795
12806
  * .then((appBundle) => console.log(appBundle))
12796
12807
  * .catch(console.error)
12797
12808
  * ```
@@ -12809,6 +12820,35 @@ function createAppDefinitionApi(makeRequest) {
12809
12820
  }).then(function (data) {
12810
12821
  return wrapAppBundle(makeRequest, data);
12811
12822
  });
12823
+ },
12824
+
12825
+ /**
12826
+ * Gets a list of App Installations across an org for given App Definition Id
12827
+ * Can be any organizationId the user has access to, where the App is installed
12828
+ * @param Object - organizationId and appDefinitionId
12829
+ * @return Promise for the newly created AppBundle
12830
+ * @example ```javascript
12831
+ * const contentful = require('contentful-management')
12832
+ * const client = contentful.createClient({
12833
+ * accessToken: '<content_management_api_key>'
12834
+ * })
12835
+ * client.getAppDefinition('<organizationId>', '<appDefinitionId>')
12836
+ * .then((appDefinition) => appDefinition.getInstallationsForOrg(<{organizationId: string, appDefinitionId: string}>))
12837
+ * .then((appInstallationsForOrg) => console.log(appInstallationsForOrg.items))
12838
+ * .catch(console.error)
12839
+ * ```
12840
+ */
12841
+ getInstallationsForOrg: function getInstallationsForOrg(_ref) {
12842
+ var organizationId = _ref.organizationId,
12843
+ appDefinitionId = _ref.appDefinitionId;
12844
+ return makeRequest({
12845
+ entityType: 'AppDefinition',
12846
+ action: 'getInstallationsForOrg',
12847
+ params: {
12848
+ appDefinitionId: appDefinitionId,
12849
+ organizationId: organizationId
12850
+ }
12851
+ });
12812
12852
  }
12813
12853
  };
12814
12854
  }
@@ -12851,6 +12891,7 @@ function createClientApi(makeRequest) {
12851
12891
  wrapOrganization = _entities$organizatio.wrapOrganization,
12852
12892
  wrapOrganizationCollection = _entities$organizatio.wrapOrganizationCollection;
12853
12893
  var wrapUsageCollection = _entities__WEBPACK_IMPORTED_MODULE_1__["default"].usage.wrapUsageCollection;
12894
+ var wrapAppDefinition = _entities__WEBPACK_IMPORTED_MODULE_1__["default"].appDefinition.wrapAppDefinition;
12854
12895
  return {
12855
12896
  /**
12856
12897
  * Gets all spaces
@@ -13025,6 +13066,33 @@ function createClientApi(makeRequest) {
13025
13066
  });
13026
13067
  },
13027
13068
 
13069
+ /**
13070
+ * Gets App Definition
13071
+ * @return Promise for App Definition
13072
+ * @param organizationId - Id of the organization where the app is installed
13073
+ * @param appDefinitionId - Id of the app that will be returned
13074
+ * @example ```javascript
13075
+ * const contentful = require('contentful-management')
13076
+ *
13077
+ * const client = contentful.createClient({
13078
+ * accessToken: '<content_management_api_key>'
13079
+ * })
13080
+ *
13081
+ * client.getAppDefinition(<'org_id'>, <'app_id'>)
13082
+ * .then(appDefinition => console.log(appDefinition.name))
13083
+ * .catch(console.error)
13084
+ * ```
13085
+ */
13086
+ getAppDefinition: function getAppDefinition(params) {
13087
+ return makeRequest({
13088
+ entityType: 'AppDefinition',
13089
+ action: 'get',
13090
+ params: params
13091
+ }).then(function (data) {
13092
+ return wrapAppDefinition(makeRequest, data);
13093
+ });
13094
+ },
13095
+
13028
13096
  /**
13029
13097
  * Creates a personal access token
13030
13098
  * @param data - personal access token config
@@ -18783,12 +18851,12 @@ function wrapAppActionCall(_makeRequest, data) {
18783
18851
  /*!********************************!*\
18784
18852
  !*** ./entities/app-action.ts ***!
18785
18853
  \********************************/
18786
- /*! exports provided: AppActionCategory, wrapAppAction, wrapAppActionCollection */
18854
+ /*! exports provided: AppActionCategoryType, wrapAppAction, wrapAppActionCollection */
18787
18855
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
18788
18856
 
18789
18857
  "use strict";
18790
18858
  __webpack_require__.r(__webpack_exports__);
18791
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AppActionCategory", function() { return AppActionCategory; });
18859
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AppActionCategoryType", function() { return AppActionCategoryType; });
18792
18860
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapAppAction", function() { return wrapAppAction; });
18793
18861
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapAppActionCollection", function() { return wrapAppActionCollection; });
18794
18862
  /* harmony import */ var contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! contentful-sdk-core */ "../node_modules/contentful-sdk-core/dist/index.es-modules.js");
@@ -18800,13 +18868,13 @@ __webpack_require__.r(__webpack_exports__);
18800
18868
 
18801
18869
 
18802
18870
 
18803
- var AppActionCategory;
18871
+ var AppActionCategoryType;
18804
18872
 
18805
- (function (AppActionCategory) {
18806
- AppActionCategory["EntryListV1Beta"] = "EntryList.v1.0-beta";
18807
- AppActionCategory["NotificationV1Beta"] = "Notification.v1.0-beta";
18808
- AppActionCategory["Custom"] = "Custom";
18809
- })(AppActionCategory || (AppActionCategory = {}));
18873
+ (function (AppActionCategoryType) {
18874
+ AppActionCategoryType["EntryListV1Beta"] = "EntryList.v1.0-beta";
18875
+ AppActionCategoryType["NotificationV1Beta"] = "Notification.v1.0-beta";
18876
+ AppActionCategoryType["Custom"] = "Custom";
18877
+ })(AppActionCategoryType || (AppActionCategoryType = {}));
18810
18878
 
18811
18879
  /**
18812
18880
  * @private
@@ -23037,7 +23105,8 @@ var createPlainClient = function createPlainClient(makeRequest, defaults, alphaF
23037
23105
  getMany: Object(_wrappers_wrap__WEBPACK_IMPORTED_MODULE_2__["wrap"])(wrapParams, 'AppDefinition', 'getMany'),
23038
23106
  create: Object(_wrappers_wrap__WEBPACK_IMPORTED_MODULE_2__["wrap"])(wrapParams, 'AppDefinition', 'create'),
23039
23107
  update: Object(_wrappers_wrap__WEBPACK_IMPORTED_MODULE_2__["wrap"])(wrapParams, 'AppDefinition', 'update'),
23040
- delete: Object(_wrappers_wrap__WEBPACK_IMPORTED_MODULE_2__["wrap"])(wrapParams, 'AppDefinition', 'delete')
23108
+ delete: Object(_wrappers_wrap__WEBPACK_IMPORTED_MODULE_2__["wrap"])(wrapParams, 'AppDefinition', 'delete'),
23109
+ getInstallationsForOrg: Object(_wrappers_wrap__WEBPACK_IMPORTED_MODULE_2__["wrap"])(wrapParams, 'AppDefinition', 'getInstallationsForOrg')
23041
23110
  },
23042
23111
  appInstallation: {
23043
23112
  get: Object(_wrappers_wrap__WEBPACK_IMPORTED_MODULE_2__["wrap"])(wrapParams, 'AppInstallation', 'get'),