@contentstack/marketplace-sdk 1.4.1 → 1.4.2

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +10 -7
  2. package/dist/es-modules/contentstack.js +5 -10
  3. package/dist/es-modules/contentstackClient.js +9 -8
  4. package/dist/es-modules/core/Util.js +17 -1
  5. package/dist/es-modules/core/contentstackHTTPClient.js +3 -16
  6. package/dist/es-modules/core/messageHandler.js +126 -0
  7. package/dist/es-modules/entity.js +1 -0
  8. package/dist/es-modules/marketplace/app/hosting/deployment.js +1 -0
  9. package/dist/es-modules/marketplace/app/hosting/index.js +1 -0
  10. package/dist/es-modules/marketplace/app/index.js +15 -14
  11. package/dist/es-modules/marketplace/app/oauth/index.js +7 -6
  12. package/dist/es-modules/marketplace/apprequest/index.js +7 -6
  13. package/dist/es-modules/marketplace/authorization/index.js +7 -6
  14. package/dist/es-modules/marketplace/index.js +5 -4
  15. package/dist/es-modules/marketplace/installation/index.js +14 -13
  16. package/dist/es-modules/marketplace/installation/webhooks/index.js +2 -1
  17. package/dist/es5/contentstack.js +4 -9
  18. package/dist/es5/contentstackClient.js +9 -8
  19. package/dist/es5/core/Util.js +21 -1
  20. package/dist/es5/core/contentstackHTTPClient.js +3 -17
  21. package/dist/es5/core/messageHandler.js +131 -0
  22. package/dist/es5/entity.js +1 -0
  23. package/dist/es5/marketplace/app/hosting/deployment.js +1 -0
  24. package/dist/es5/marketplace/app/hosting/index.js +1 -0
  25. package/dist/es5/marketplace/app/index.js +15 -14
  26. package/dist/es5/marketplace/app/oauth/index.js +7 -6
  27. package/dist/es5/marketplace/apprequest/index.js +7 -6
  28. package/dist/es5/marketplace/authorization/index.js +7 -6
  29. package/dist/es5/marketplace/index.js +5 -4
  30. package/dist/es5/marketplace/installation/index.js +14 -13
  31. package/dist/es5/marketplace/installation/webhooks/index.js +2 -1
  32. package/dist/nativescript/contentstack-marketplace.js +1 -1
  33. package/dist/node/contentstack-marketplace.js +1 -1
  34. package/dist/react-native/contentstack-marketplace.js +1 -1
  35. package/dist/web/contentstack-marketplace.js +1 -1
  36. package/package.json +4 -2
@@ -16,6 +16,7 @@ var _cloneDeep = require("lodash/cloneDeep");
16
16
  var _cloneDeep2 = (0, _interopRequireDefault2["default"])(_cloneDeep);
17
17
  var _contentstackError = require("../../core/contentstackError");
18
18
  var _contentstackError2 = (0, _interopRequireDefault2["default"])(_contentstackError);
19
+ var _messageHandler = require("../../core/messageHandler.js");
19
20
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
20
21
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty3["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
21
22
  /**
@@ -43,8 +44,8 @@ function AppRequest(http, data, param) {
43
44
  * import * as contentstack from '@contentstack/marketplace'
44
45
  * const client = contentstack.client({ authtoken: 'TOKEN'})
45
46
  *
46
- * client.marketplace('organization_uid').appRequests().delete('request_uid`)
47
- * .then((response) => console.log(response))
47
+ * client.marketplace('organization_uid').appRequests().delete('request_uid`)
48
+ * .then((response) => console.log(MESSAGES.APP_REQUEST_RESPONSE))
48
49
  *
49
50
  */
50
51
  this["delete"] = /*#__PURE__*/function () {
@@ -97,8 +98,8 @@ function AppRequest(http, data, param) {
97
98
  * import * as contentstack from '@contentstack/marketplace'
98
99
  * const client = contentstack.client({ authtoken: 'TOKEN'})
99
100
  *
100
- * client.marketplace('organization_uid').appRequests().create({ appUid: 'app_uid', targetUid: 'target_uid' })
101
- * .then((response) => console.log(response))
101
+ * client.marketplace('organization_uid').appRequests().create({ appUid: 'app_uid', targetUid: 'target_uid' })
102
+ * .then((response) => console.log(MESSAGES.APP_REQUEST_RESPONSE))
102
103
  *
103
104
  */
104
105
  this.create = /*#__PURE__*/function () {
@@ -154,8 +155,8 @@ function AppRequest(http, data, param) {
154
155
  * import * as contentstack from '@contentstack/marketplace'
155
156
  * const client = contentstack.client({ authtoken: 'TOKEN'})
156
157
  *
157
- * client.marketplace('organization_uid').appRequests().findAll()
158
- * .then((response) => console.log(response))
158
+ * client.marketplace('organization_uid').appRequests().findAll()
159
+ * .then((response) => console.log(MESSAGES.AUTHORIZATION_RESPONSE))
159
160
  *
160
161
  */
161
162
  this.findAll = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee3() {
@@ -16,6 +16,7 @@ var _cloneDeep = require("lodash/cloneDeep");
16
16
  var _cloneDeep2 = (0, _interopRequireDefault2["default"])(_cloneDeep);
17
17
  var _contentstackError = require("../../core/contentstackError");
18
18
  var _contentstackError2 = (0, _interopRequireDefault2["default"])(_contentstackError);
19
+ var _messageHandler = require("../../core/messageHandler.js");
19
20
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
20
21
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty3["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
21
22
  /**
@@ -44,8 +45,8 @@ function Authorization(http, data, params) {
44
45
  * import * as contentstack from '@contentstack/marketplace'
45
46
  * const client = contentstack.client({ authtoken: 'TOKEN'})
46
47
  *
47
- * client.marketplace('organization_uid').app('manifest_uid').authorization().findAll()
48
- * .then((response) => console.log(response))
48
+ * client.marketplace('organization_uid').app('manifest_uid').authorization().findAll()
49
+ * .then((response) => console.log(MESSAGES.AUTHORIZATION_RESPONSE))
49
50
  */
50
51
  this.findAll = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee() {
51
52
  var param,
@@ -96,8 +97,8 @@ function Authorization(http, data, params) {
96
97
  * import * as contentstack from '@contentstack/marketplace'
97
98
  * const client = contentstack.client({ authtoken: 'TOKEN'})
98
99
  *
99
- * client.marketplace('organization_uid').app('manifest_uid').authorization().revokeAll()
100
- * .then((response) => console.log(response))
100
+ * client.marketplace('organization_uid').app('manifest_uid').authorization().revokeAll()
101
+ * .then((response) => console.log(MESSAGES.AUTHORIZATION_RESPONSE))
101
102
  */
102
103
  this.revokeAll = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee2() {
103
104
  var headers, response, _t2;
@@ -142,8 +143,8 @@ function Authorization(http, data, params) {
142
143
  * import * as contentstack from '@contentstack/marketplace'
143
144
  * const client = contentstack.client({ authtoken: 'TOKEN'})
144
145
  *
145
- * client.marketplace('organization_uid').app('manifest_uid').authorization().revoke('authorization_uid')
146
- * .then((response) => console.log(response))
146
+ * client.marketplace('organization_uid').app('manifest_uid').authorization().revoke('authorization_uid')
147
+ * .then((response) => console.log(MESSAGES.AUTHORIZATION_RESPONSE))
147
148
  */
148
149
  this.revoke = /*#__PURE__*/function () {
149
150
  var _ref3 = (0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee3(authorizationUid) {
@@ -21,6 +21,7 @@ var _contentstackError = require("../core/contentstackError");
21
21
  var _contentstackError2 = (0, _interopRequireDefault2["default"])(_contentstackError);
22
22
  var _entity = require("../entity");
23
23
  var _apprequest = require("./apprequest");
24
+ var _messageHandler = require("../core/messageHandler.js");
24
25
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
25
26
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty3["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
26
27
  /**
@@ -72,13 +73,13 @@ function Marketplace(http, data) {
72
73
  * import * as contentstack from '@contentstack/marketplace'
73
74
  * const client = contentstack.client({ authtoken: 'TOKEN'})
74
75
  * client.organization('organization_uid').app('manifest_uid').installation().findAll()
75
- * .then((installations) => console.log(installations))
76
+ * .then((installations) => console.log('App installation details loaded successfully.'))
76
77
  *
77
78
  * @example
78
79
  * import * as contentstack from '@contentstack/marketplace'
79
80
  * const client = contentstack.client({ authtoken: 'TOKEN'})
80
81
  * client.marketplace('organization_uid').installation('installation_uid').fetch()
81
- * .then((installation) => console.log(installation))
82
+ * .then((installation) => console.log('App installation details loaded successfully.'))
82
83
  */
83
84
  this.installation = function () {
84
85
  var installationUid = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
@@ -119,7 +120,7 @@ function Marketplace(http, data) {
119
120
  * const client = contentstack.client({ authtoken: 'TOKEN'})
120
121
  *
121
122
  * client.marketplace('organization_uid').findAllApps()
122
- * .then((collection) => console.log(collection))
123
+ * .then((collection) => console.log('App collection loaded successfully.'))
123
124
  *
124
125
  */
125
126
  this.urlPath = '/manifests';
@@ -204,7 +205,7 @@ function Marketplace(http, data) {
204
205
  * const client = contentstack.client()
205
206
  *
206
207
  * client.marketplace('organization_uid').findAllAuthorizedApps({ skip: 10 })
207
- * .then((roles) => console.log(roles))
208
+ * .then((roles) => console.log('Marketplace roles loaded successfully.'))
208
209
  *
209
210
  */
210
211
  this.findAllAuthorizedApps = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee2() {
@@ -19,6 +19,7 @@ var _contentstackError = require("../../core/contentstackError");
19
19
  var _contentstackError2 = (0, _interopRequireDefault2["default"])(_contentstackError);
20
20
  var _entity = require("../../entity");
21
21
  var _webhooks = require("./webhooks");
22
+ var _messageHandler = require("../../core/messageHandler.js");
22
23
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
23
24
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty3["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
24
25
  /**
@@ -51,7 +52,7 @@ function Installation(http, data) {
51
52
  * const client = contentstack.client({ authtoken: 'TOKEN'})
52
53
  *
53
54
  * client.marketplace('organization_uid').installation('installation_uid').fetch()
54
- * .then((installation) => console.log(installation))
55
+ * .then((installation) => console.log('App installation details loaded successfully.'))
55
56
  *
56
57
  */
57
58
  this.fetch = (0, _entity.fetch)(http, 'data', this.params);
@@ -75,7 +76,7 @@ function Installation(http, data) {
75
76
  * const installation = client.marketplace('organization_uid').installation('installation_uid')
76
77
  * installation = Object.assign(installation, updateInstallation)
77
78
  * installation.update()
78
- * .then((installation) => console.log(installation))
79
+ * .then((installation) => console.log('App installation details loaded successfully.'))
79
80
  */
80
81
  this.update = (0, _entity.update)(http, 'data', this.params);
81
82
 
@@ -90,7 +91,7 @@ function Installation(http, data) {
90
91
  * const client = contentstack.client({ authtoken: 'TOKEN'})
91
92
  *
92
93
  * client.marketplace('organization_uid').installation('installation_uid').uninstall()
93
- * .then((response) => console.log(response))
94
+ * .then((response) => console.log('Installation response received.'))
94
95
  */
95
96
  this.uninstall = (0, _entity.deleteEntity)(http, false, this.params);
96
97
 
@@ -106,7 +107,7 @@ function Installation(http, data) {
106
107
  * const client = contentstack.client({ authtoken: 'TOKEN'})
107
108
  *
108
109
  * client.marketplace('organization_uid').installation('installation_uid').configuration()
109
- * .then((response) => console.log(response))
110
+ * .then((response) => console.log('Installation response received.'))
110
111
  */
111
112
  this.configuration = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee() {
112
113
  var param,
@@ -160,7 +161,7 @@ function Installation(http, data) {
160
161
  * const client = contentstack.client({ authtoken: 'TOKEN'})
161
162
  *
162
163
  * client.marketplace('organization_uid').installation('installation_uid').setConfiguration({<configuration_details>})
163
- * .then((response) => console.log(response))
164
+ * .then((response) => console.log('Installation response received.'))
164
165
  */
165
166
  this.setConfiguration = /*#__PURE__*/function () {
166
167
  var _ref2 = (0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee2(config) {
@@ -213,7 +214,7 @@ function Installation(http, data) {
213
214
  * const client = contentstack.client({ authtoken: 'TOKEN'})
214
215
  *
215
216
  * client.marketplace('organization_uid').installation('installation_uid').getConfigLocation()
216
- * .then((response) => console.log(response))
217
+ * .then((response) => console.log('Installation response received.'))
217
218
  */
218
219
  this.getConfigLocation = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee3() {
219
220
  var headers, response, _t3;
@@ -261,7 +262,7 @@ function Installation(http, data) {
261
262
  * const client = contentstack.client({ authtoken: 'TOKEN'})
262
263
  *
263
264
  * client.marketplace('organization_uid').installation('installation_uid').serverConfig()
264
- * .then((response) => console.log(response))
265
+ * .then((response) => console.log('Installation response received.'))
265
266
  */
266
267
  this.serverConfig = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee4() {
267
268
  var param,
@@ -315,7 +316,7 @@ function Installation(http, data) {
315
316
  * const client = contentstack.client({ authtoken: 'TOKEN'})
316
317
  *
317
318
  * client.marketplace('organization_uid').installation('installation_uid').setServerConfig({<configuration_details>})
318
- * .then((response) => console.log(response))
319
+ * .then((response) => console.log('Installation response received.'))
319
320
  */
320
321
  this.setServerConfig = /*#__PURE__*/function () {
321
322
  var _ref5 = (0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee5(config) {
@@ -367,7 +368,7 @@ function Installation(http, data) {
367
368
  * const client = contentstack.client({ authtoken: 'TOKEN'})
368
369
  *
369
370
  * client.marketplace('organization_uid').installation('installation_uid').installationData()
370
- * .then((response) => console.log(response))
371
+ * .then((response) => console.log('Installation response received.'))
371
372
  */
372
373
  this.installationData = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee6() {
373
374
  var headers, response, _t6;
@@ -434,7 +435,7 @@ function Installation(http, data) {
434
435
  * const client = contentstack.client({ authtoken: 'TOKEN'})
435
436
  *
436
437
  * client.marketplace('organization_uid').installation().fetchAll()
437
- * .then((collection) => console.log(collection))
438
+ * .then((collection) => console.log('Installation collection loaded successfully.'))
438
439
  *
439
440
  */
440
441
  this.fetchAll = (0, _entity.fetchAll)(http, InstallationCollection, params);
@@ -450,7 +451,7 @@ function Installation(http, data) {
450
451
  * const client = contentstack.client({ authtoken: 'TOKEN'})
451
452
  *
452
453
  * client.marketplace('organization_uid').installation().getInstalledApps()
453
- * .then((collection) => console.log(collection))
454
+ * .then((collection) => console.log('Installation collection loaded successfully.'))
454
455
  *
455
456
  */
456
457
  this.getInstalledApps = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee7() {
@@ -504,7 +505,7 @@ function Installation(http, data) {
504
505
  * const client = contentstack.client({ authtoken: 'TOKEN'})
505
506
  *
506
507
  * client.marketplace('organization_uid').installation().getInstalledUsers()
507
- * .then((collection) => console.log(collection))
508
+ * .then((collection) => console.log('Installation collection loaded successfully.'))
508
509
  *
509
510
  */
510
511
  this.getInstalledUsers = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee8() {
@@ -552,7 +553,7 @@ function Installation(http, data) {
552
553
  * const client = contentstack.client({ authtoken: 'TOKEN'})
553
554
  *
554
555
  * client.marketplace('organization_uid').installation().getInstalledStacks()
555
- * .then((collection) => console.log(collection))
556
+ * .then((collection) => console.log('Installation collection loaded successfully.'))
556
557
  *
557
558
  */
558
559
  this.getInstalledStacks = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee9() {
@@ -16,6 +16,7 @@ var _cloneDeep = require("lodash/cloneDeep");
16
16
  var _cloneDeep2 = (0, _interopRequireDefault2["default"])(_cloneDeep);
17
17
  var _contentstackError = require("../../../core/contentstackError");
18
18
  var _contentstackError2 = (0, _interopRequireDefault2["default"])(_contentstackError);
19
+ var _messageHandler = require("../../../core/messageHandler.js");
19
20
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
20
21
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty3["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
21
22
  /**
@@ -47,7 +48,7 @@ function WebHooks(http, data) {
47
48
  * const client = contentstack.client({ authtoken: 'TOKEN'})
48
49
  *
49
50
  * client.marketplace('organization_uid').installation('installation_uid').webhooks('webhook_uid').listExecutionLogs()
50
- * .then((installation) => console.log(installation))
51
+ * .then((installation) => console.log('Installation webhook details loaded successfully.'))
51
52
  *
52
53
  */
53
54
  this.listExecutionLogs = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee() {