@contentstack/marketplace-sdk 1.1.0 → 1.2.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 CHANGED
@@ -1,7 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [v1.2.0](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.1.1) (2024-06-21)
4
+ - Added disconnect hosting function
5
+
6
+ ## [v1.1.1](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.1.1) (2024-06-11)
7
+ - Added GCP Region support
8
+
3
9
  ## [v1.1.0](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.1.0) (2024-06-05)
4
- - added reinstall app function
10
+ - Added reinstall app function
5
11
 
6
12
  ## [v1.0.2](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.0.2) (2024-01-16)
7
13
  - Updated dependencies
@@ -2,6 +2,7 @@ var Region = {
2
2
  EU: 'eu',
3
3
  NA: '',
4
4
  AZURE_NA: 'azure-na',
5
- AZURE_EU: 'azure-eu'
5
+ AZURE_EU: 'azure-eu',
6
+ GCP_NA: 'gcp-na'
6
7
  };
7
8
  export default Region;
@@ -281,4 +281,54 @@ export function Hosting(http, data, params) {
281
281
  return new Deployment(http, content, _this.params);
282
282
  };
283
283
  }
284
+
285
+ /**
286
+ * @description this disconnects the hosting.
287
+ * @memberof Hosting
288
+ * @func disconnect
289
+ * @returns {disconnect}
290
+ *
291
+ * @example
292
+ * import * as contentstack from '@contentstack/marketplace'
293
+ * const client = contentstack.client({ authtoken: 'TOKEN'})
294
+ * client.marketplace('organization_uid').app('manifest_uid').hosting().disconnect({ 'provider': 'launch' })
295
+ *
296
+ */
297
+ this.disconnect = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
298
+ var data,
299
+ headers,
300
+ response,
301
+ _args6 = arguments;
302
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
303
+ while (1) switch (_context6.prev = _context6.next) {
304
+ case 0:
305
+ data = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
306
+ _context6.prev = 1;
307
+ headers = {
308
+ headers: _objectSpread({}, cloneDeep(_this.params))
309
+ };
310
+ _context6.next = 5;
311
+ return http.patch("".concat(_this.urlPath, "/disconnect"), data, headers);
312
+ case 5:
313
+ response = _context6.sent;
314
+ if (!response.data) {
315
+ _context6.next = 10;
316
+ break;
317
+ }
318
+ return _context6.abrupt("return", response.data);
319
+ case 10:
320
+ throw error(response);
321
+ case 11:
322
+ _context6.next = 16;
323
+ break;
324
+ case 13:
325
+ _context6.prev = 13;
326
+ _context6.t0 = _context6["catch"](1);
327
+ throw error(_context6.t0);
328
+ case 16:
329
+ case "end":
330
+ return _context6.stop();
331
+ }
332
+ }, _callee6, null, [[1, 13]]);
333
+ }));
284
334
  }
@@ -7,7 +7,8 @@ var Region = {
7
7
  EU: 'eu',
8
8
  NA: '',
9
9
  AZURE_NA: 'azure-na',
10
- AZURE_EU: 'azure-eu'
10
+ AZURE_EU: 'azure-eu',
11
+ GCP_NA: 'gcp-na'
11
12
  };
12
13
  exports["default"] = Region;
13
14
  module.exports = exports.default;
@@ -293,4 +293,54 @@ function Hosting(http, data, params) {
293
293
  return new _deployment.Deployment(http, content, _this.params);
294
294
  };
295
295
  }
296
+
297
+ /**
298
+ * @description this disconnects the hosting.
299
+ * @memberof Hosting
300
+ * @func disconnect
301
+ * @returns {disconnect}
302
+ *
303
+ * @example
304
+ * import * as contentstack from '@contentstack/marketplace'
305
+ * const client = contentstack.client({ authtoken: 'TOKEN'})
306
+ * client.marketplace('organization_uid').app('manifest_uid').hosting().disconnect({ 'provider': 'launch' })
307
+ *
308
+ */
309
+ this.disconnect = /*#__PURE__*/(0, _asyncToGenerator3["default"])( /*#__PURE__*/_regenerator2["default"].mark(function _callee6() {
310
+ var data,
311
+ headers,
312
+ response,
313
+ _args6 = arguments;
314
+ return _regenerator2["default"].wrap(function _callee6$(_context6) {
315
+ while (1) switch (_context6.prev = _context6.next) {
316
+ case 0:
317
+ data = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
318
+ _context6.prev = 1;
319
+ headers = {
320
+ headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
321
+ };
322
+ _context6.next = 5;
323
+ return http.patch("".concat(_this.urlPath, "/disconnect"), data, headers);
324
+ case 5:
325
+ response = _context6.sent;
326
+ if (!response.data) {
327
+ _context6.next = 10;
328
+ break;
329
+ }
330
+ return _context6.abrupt("return", response.data);
331
+ case 10:
332
+ throw (0, _contentstackError2["default"])(response);
333
+ case 11:
334
+ _context6.next = 16;
335
+ break;
336
+ case 13:
337
+ _context6.prev = 13;
338
+ _context6.t0 = _context6["catch"](1);
339
+ throw (0, _contentstackError2["default"])(_context6.t0);
340
+ case 16:
341
+ case "end":
342
+ return _context6.stop();
343
+ }
344
+ }, _callee6, null, [[1, 13]]);
345
+ }));
296
346
  }