@contentstack/marketplace-sdk 1.2.7 → 1.2.9
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/.husky/pre-commit +69 -0
- package/CHANGELOG.md +8 -1
- package/dist/es-modules/entity.js +78 -74
- package/dist/es-modules/marketplace/app/hosting/deployment.js +71 -70
- package/dist/es-modules/marketplace/app/hosting/index.js +85 -84
- package/dist/es-modules/marketplace/app/index.js +84 -84
- package/dist/es-modules/marketplace/app/oauth/index.js +43 -42
- package/dist/es-modules/marketplace/apprequest/index.js +43 -42
- package/dist/es-modules/marketplace/authorization/index.js +43 -42
- package/dist/es-modules/marketplace/index.js +16 -15
- package/dist/es-modules/marketplace/installation/index.js +137 -129
- package/dist/es-modules/marketplace/installation/webhooks/index.js +42 -42
- package/dist/es5/entity.js +78 -74
- package/dist/es5/marketplace/app/hosting/deployment.js +71 -70
- package/dist/es5/marketplace/app/hosting/index.js +85 -84
- package/dist/es5/marketplace/app/index.js +84 -84
- package/dist/es5/marketplace/app/oauth/index.js +43 -42
- package/dist/es5/marketplace/apprequest/index.js +43 -42
- package/dist/es5/marketplace/authorization/index.js +43 -42
- package/dist/es5/marketplace/index.js +16 -15
- package/dist/es5/marketplace/installation/index.js +137 -129
- package/dist/es5/marketplace/installation/webhooks/index.js +42 -42
- package/dist/nativescript/contentstack-marketplace.js +1 -1
- package/dist/node/contentstack-marketplace.js +1 -1
- package/dist/react-native/contentstack-marketplace.js +1 -1
- package/dist/web/contentstack-marketplace.js +1 -1
- package/package.json +14 -13
|
@@ -52,8 +52,9 @@ function Oauth(http, data, params) {
|
|
|
52
52
|
var param,
|
|
53
53
|
headers,
|
|
54
54
|
response,
|
|
55
|
-
_args = arguments
|
|
56
|
-
|
|
55
|
+
_args = arguments,
|
|
56
|
+
_t;
|
|
57
|
+
return _regenerator2["default"].wrap(function (_context) {
|
|
57
58
|
while (1) switch (_context.prev = _context.next) {
|
|
58
59
|
case 0:
|
|
59
60
|
param = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
@@ -62,29 +63,29 @@ function Oauth(http, data, params) {
|
|
|
62
63
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params)),
|
|
63
64
|
params: _objectSpread({}, (0, _cloneDeep2["default"])(param))
|
|
64
65
|
} || {};
|
|
65
|
-
_context.next =
|
|
66
|
+
_context.next = 2;
|
|
66
67
|
return http.get(_this.urlPath, headers);
|
|
67
|
-
case
|
|
68
|
+
case 2:
|
|
68
69
|
response = _context.sent;
|
|
69
70
|
if (!response.data) {
|
|
70
|
-
_context.next =
|
|
71
|
+
_context.next = 3;
|
|
71
72
|
break;
|
|
72
73
|
}
|
|
73
74
|
return _context.abrupt("return", response.data.data || {});
|
|
74
|
-
case
|
|
75
|
+
case 3:
|
|
75
76
|
throw (0, _contentstackError2["default"])(response);
|
|
76
|
-
case
|
|
77
|
-
_context.next =
|
|
77
|
+
case 4:
|
|
78
|
+
_context.next = 6;
|
|
78
79
|
break;
|
|
79
|
-
case
|
|
80
|
-
_context.prev =
|
|
81
|
-
|
|
82
|
-
throw (0, _contentstackError2["default"])(
|
|
83
|
-
case
|
|
80
|
+
case 5:
|
|
81
|
+
_context.prev = 5;
|
|
82
|
+
_t = _context["catch"](1);
|
|
83
|
+
throw (0, _contentstackError2["default"])(_t);
|
|
84
|
+
case 6:
|
|
84
85
|
case "end":
|
|
85
86
|
return _context.stop();
|
|
86
87
|
}
|
|
87
|
-
}, _callee, null, [[1,
|
|
88
|
+
}, _callee, null, [[1, 5]]);
|
|
88
89
|
}));
|
|
89
90
|
|
|
90
91
|
/**
|
|
@@ -112,8 +113,8 @@ function Oauth(http, data, params) {
|
|
|
112
113
|
*/
|
|
113
114
|
this.update = /*#__PURE__*/function () {
|
|
114
115
|
var _ref3 = (0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee2(_ref2) {
|
|
115
|
-
var config, _ref2$param, param, headers, response;
|
|
116
|
-
return _regenerator2["default"].wrap(function
|
|
116
|
+
var config, _ref2$param, param, headers, response, _t2;
|
|
117
|
+
return _regenerator2["default"].wrap(function (_context2) {
|
|
117
118
|
while (1) switch (_context2.prev = _context2.next) {
|
|
118
119
|
case 0:
|
|
119
120
|
config = _ref2.config, _ref2$param = _ref2.param, param = _ref2$param === void 0 ? {} : _ref2$param;
|
|
@@ -122,29 +123,29 @@ function Oauth(http, data, params) {
|
|
|
122
123
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params)),
|
|
123
124
|
params: _objectSpread({}, (0, _cloneDeep2["default"])(param))
|
|
124
125
|
} || {};
|
|
125
|
-
_context2.next =
|
|
126
|
+
_context2.next = 2;
|
|
126
127
|
return http.put(_this.urlPath, config, headers);
|
|
127
|
-
case
|
|
128
|
+
case 2:
|
|
128
129
|
response = _context2.sent;
|
|
129
130
|
if (!response.data) {
|
|
130
|
-
_context2.next =
|
|
131
|
+
_context2.next = 3;
|
|
131
132
|
break;
|
|
132
133
|
}
|
|
133
134
|
return _context2.abrupt("return", response.data.data || {});
|
|
134
|
-
case
|
|
135
|
+
case 3:
|
|
135
136
|
throw (0, _contentstackError2["default"])(response);
|
|
136
|
-
case
|
|
137
|
-
_context2.next =
|
|
137
|
+
case 4:
|
|
138
|
+
_context2.next = 6;
|
|
138
139
|
break;
|
|
139
|
-
case
|
|
140
|
-
_context2.prev =
|
|
141
|
-
|
|
142
|
-
throw (0, _contentstackError2["default"])(
|
|
143
|
-
case
|
|
140
|
+
case 5:
|
|
141
|
+
_context2.prev = 5;
|
|
142
|
+
_t2 = _context2["catch"](1);
|
|
143
|
+
throw (0, _contentstackError2["default"])(_t2);
|
|
144
|
+
case 6:
|
|
144
145
|
case "end":
|
|
145
146
|
return _context2.stop();
|
|
146
147
|
}
|
|
147
|
-
}, _callee2, null, [[1,
|
|
148
|
+
}, _callee2, null, [[1, 5]]);
|
|
148
149
|
}));
|
|
149
150
|
return function (_x) {
|
|
150
151
|
return _ref3.apply(this, arguments);
|
|
@@ -165,37 +166,37 @@ function Oauth(http, data, params) {
|
|
|
165
166
|
* .then((scopes) => console.log(scopes))
|
|
166
167
|
*/
|
|
167
168
|
this.getScopes = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee3() {
|
|
168
|
-
var headers, response;
|
|
169
|
-
return _regenerator2["default"].wrap(function
|
|
169
|
+
var headers, response, _t3;
|
|
170
|
+
return _regenerator2["default"].wrap(function (_context3) {
|
|
170
171
|
while (1) switch (_context3.prev = _context3.next) {
|
|
171
172
|
case 0:
|
|
172
173
|
_context3.prev = 0;
|
|
173
174
|
headers = {
|
|
174
175
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
175
176
|
} || {};
|
|
176
|
-
_context3.next =
|
|
177
|
+
_context3.next = 1;
|
|
177
178
|
return http.get('/manifests/oauth/scopes', headers);
|
|
178
|
-
case
|
|
179
|
+
case 1:
|
|
179
180
|
response = _context3.sent;
|
|
180
181
|
if (!response.data) {
|
|
181
|
-
_context3.next =
|
|
182
|
+
_context3.next = 2;
|
|
182
183
|
break;
|
|
183
184
|
}
|
|
184
185
|
return _context3.abrupt("return", response.data.data || {});
|
|
185
|
-
case
|
|
186
|
+
case 2:
|
|
186
187
|
throw (0, _contentstackError2["default"])(response);
|
|
187
|
-
case
|
|
188
|
-
_context3.next =
|
|
188
|
+
case 3:
|
|
189
|
+
_context3.next = 5;
|
|
189
190
|
break;
|
|
190
|
-
case
|
|
191
|
-
_context3.prev =
|
|
192
|
-
|
|
193
|
-
throw (0, _contentstackError2["default"])(
|
|
194
|
-
case
|
|
191
|
+
case 4:
|
|
192
|
+
_context3.prev = 4;
|
|
193
|
+
_t3 = _context3["catch"](0);
|
|
194
|
+
throw (0, _contentstackError2["default"])(_t3);
|
|
195
|
+
case 5:
|
|
195
196
|
case "end":
|
|
196
197
|
return _context3.stop();
|
|
197
198
|
}
|
|
198
|
-
}, _callee3, null, [[0,
|
|
199
|
+
}, _callee3, null, [[0, 4]]);
|
|
199
200
|
}));
|
|
200
201
|
}
|
|
201
202
|
}
|
|
@@ -49,37 +49,37 @@ function AppRequest(http, data, param) {
|
|
|
49
49
|
*/
|
|
50
50
|
this["delete"] = /*#__PURE__*/function () {
|
|
51
51
|
var _ref = (0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee(requestUid) {
|
|
52
|
-
var headers, response;
|
|
53
|
-
return _regenerator2["default"].wrap(function
|
|
52
|
+
var headers, response, _t;
|
|
53
|
+
return _regenerator2["default"].wrap(function (_context) {
|
|
54
54
|
while (1) switch (_context.prev = _context.next) {
|
|
55
55
|
case 0:
|
|
56
56
|
_context.prev = 0;
|
|
57
57
|
headers = {
|
|
58
58
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
59
59
|
};
|
|
60
|
-
_context.next =
|
|
60
|
+
_context.next = 1;
|
|
61
61
|
return http["delete"]("/requests/".concat(requestUid), headers);
|
|
62
|
-
case
|
|
62
|
+
case 1:
|
|
63
63
|
response = _context.sent;
|
|
64
64
|
if (!response.data) {
|
|
65
|
-
_context.next =
|
|
65
|
+
_context.next = 2;
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
return _context.abrupt("return", response.data);
|
|
69
|
-
case
|
|
69
|
+
case 2:
|
|
70
70
|
throw (0, _contentstackError2["default"])(response);
|
|
71
|
-
case
|
|
72
|
-
_context.next =
|
|
71
|
+
case 3:
|
|
72
|
+
_context.next = 5;
|
|
73
73
|
break;
|
|
74
|
-
case
|
|
75
|
-
_context.prev =
|
|
76
|
-
|
|
77
|
-
throw (0, _contentstackError2["default"])(
|
|
78
|
-
case
|
|
74
|
+
case 4:
|
|
75
|
+
_context.prev = 4;
|
|
76
|
+
_t = _context["catch"](0);
|
|
77
|
+
throw (0, _contentstackError2["default"])(_t);
|
|
78
|
+
case 5:
|
|
79
79
|
case "end":
|
|
80
80
|
return _context.stop();
|
|
81
81
|
}
|
|
82
|
-
}, _callee, null, [[0,
|
|
82
|
+
}, _callee, null, [[0, 4]]);
|
|
83
83
|
}));
|
|
84
84
|
return function (_x) {
|
|
85
85
|
return _ref.apply(this, arguments);
|
|
@@ -103,8 +103,8 @@ function AppRequest(http, data, param) {
|
|
|
103
103
|
*/
|
|
104
104
|
this.create = /*#__PURE__*/function () {
|
|
105
105
|
var _ref3 = (0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee2(_ref2) {
|
|
106
|
-
var appUid, targetUid, headers, response;
|
|
107
|
-
return _regenerator2["default"].wrap(function
|
|
106
|
+
var appUid, targetUid, headers, response, _t2;
|
|
107
|
+
return _regenerator2["default"].wrap(function (_context2) {
|
|
108
108
|
while (1) switch (_context2.prev = _context2.next) {
|
|
109
109
|
case 0:
|
|
110
110
|
appUid = _ref2.appUid, targetUid = _ref2.targetUid;
|
|
@@ -112,32 +112,32 @@ function AppRequest(http, data, param) {
|
|
|
112
112
|
headers = {
|
|
113
113
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
114
114
|
};
|
|
115
|
-
_context2.next =
|
|
115
|
+
_context2.next = 2;
|
|
116
116
|
return http.post("/requests", {
|
|
117
117
|
app_uid: appUid,
|
|
118
118
|
target_uid: targetUid
|
|
119
119
|
}, headers);
|
|
120
|
-
case
|
|
120
|
+
case 2:
|
|
121
121
|
response = _context2.sent;
|
|
122
122
|
if (!response.data) {
|
|
123
|
-
_context2.next =
|
|
123
|
+
_context2.next = 3;
|
|
124
124
|
break;
|
|
125
125
|
}
|
|
126
126
|
return _context2.abrupt("return", response.data);
|
|
127
|
-
case
|
|
127
|
+
case 3:
|
|
128
128
|
throw (0, _contentstackError2["default"])(response);
|
|
129
|
-
case
|
|
130
|
-
_context2.next =
|
|
129
|
+
case 4:
|
|
130
|
+
_context2.next = 6;
|
|
131
131
|
break;
|
|
132
|
-
case
|
|
133
|
-
_context2.prev =
|
|
134
|
-
|
|
135
|
-
throw (0, _contentstackError2["default"])(
|
|
136
|
-
case
|
|
132
|
+
case 5:
|
|
133
|
+
_context2.prev = 5;
|
|
134
|
+
_t2 = _context2["catch"](1);
|
|
135
|
+
throw (0, _contentstackError2["default"])(_t2);
|
|
136
|
+
case 6:
|
|
137
137
|
case "end":
|
|
138
138
|
return _context2.stop();
|
|
139
139
|
}
|
|
140
|
-
}, _callee2, null, [[1,
|
|
140
|
+
}, _callee2, null, [[1, 5]]);
|
|
141
141
|
}));
|
|
142
142
|
return function (_x2) {
|
|
143
143
|
return _ref3.apply(this, arguments);
|
|
@@ -162,8 +162,9 @@ function AppRequest(http, data, param) {
|
|
|
162
162
|
var param,
|
|
163
163
|
headers,
|
|
164
164
|
response,
|
|
165
|
-
_args3 = arguments
|
|
166
|
-
|
|
165
|
+
_args3 = arguments,
|
|
166
|
+
_t3;
|
|
167
|
+
return _regenerator2["default"].wrap(function (_context3) {
|
|
167
168
|
while (1) switch (_context3.prev = _context3.next) {
|
|
168
169
|
case 0:
|
|
169
170
|
param = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
|
@@ -172,29 +173,29 @@ function AppRequest(http, data, param) {
|
|
|
172
173
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params)),
|
|
173
174
|
params: _objectSpread({}, param)
|
|
174
175
|
};
|
|
175
|
-
_context3.next =
|
|
176
|
+
_context3.next = 2;
|
|
176
177
|
return http.get("/requests", headers);
|
|
177
|
-
case
|
|
178
|
+
case 2:
|
|
178
179
|
response = _context3.sent;
|
|
179
180
|
if (!response.data) {
|
|
180
|
-
_context3.next =
|
|
181
|
+
_context3.next = 3;
|
|
181
182
|
break;
|
|
182
183
|
}
|
|
183
184
|
return _context3.abrupt("return", response.data);
|
|
184
|
-
case
|
|
185
|
+
case 3:
|
|
185
186
|
throw (0, _contentstackError2["default"])(response);
|
|
186
|
-
case
|
|
187
|
-
_context3.next =
|
|
187
|
+
case 4:
|
|
188
|
+
_context3.next = 6;
|
|
188
189
|
break;
|
|
189
|
-
case
|
|
190
|
-
_context3.prev =
|
|
191
|
-
|
|
192
|
-
throw (0, _contentstackError2["default"])(
|
|
193
|
-
case
|
|
190
|
+
case 5:
|
|
191
|
+
_context3.prev = 5;
|
|
192
|
+
_t3 = _context3["catch"](1);
|
|
193
|
+
throw (0, _contentstackError2["default"])(_t3);
|
|
194
|
+
case 6:
|
|
194
195
|
case "end":
|
|
195
196
|
return _context3.stop();
|
|
196
197
|
}
|
|
197
|
-
}, _callee3, null, [[1,
|
|
198
|
+
}, _callee3, null, [[1, 5]]);
|
|
198
199
|
}));
|
|
199
200
|
}
|
|
200
201
|
}
|
|
@@ -51,8 +51,9 @@ function Authorization(http, data, params) {
|
|
|
51
51
|
var param,
|
|
52
52
|
headers,
|
|
53
53
|
response,
|
|
54
|
-
_args = arguments
|
|
55
|
-
|
|
54
|
+
_args = arguments,
|
|
55
|
+
_t;
|
|
56
|
+
return _regenerator2["default"].wrap(function (_context) {
|
|
56
57
|
while (1) switch (_context.prev = _context.next) {
|
|
57
58
|
case 0:
|
|
58
59
|
param = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
@@ -61,29 +62,29 @@ function Authorization(http, data, params) {
|
|
|
61
62
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params)),
|
|
62
63
|
params: _objectSpread({}, (0, _cloneDeep2["default"])(param))
|
|
63
64
|
};
|
|
64
|
-
_context.next =
|
|
65
|
+
_context.next = 2;
|
|
65
66
|
return http.get(_this.urlPath, headers);
|
|
66
|
-
case
|
|
67
|
+
case 2:
|
|
67
68
|
response = _context.sent;
|
|
68
69
|
if (!response.data) {
|
|
69
|
-
_context.next =
|
|
70
|
+
_context.next = 3;
|
|
70
71
|
break;
|
|
71
72
|
}
|
|
72
73
|
return _context.abrupt("return", response.data);
|
|
73
|
-
case
|
|
74
|
+
case 3:
|
|
74
75
|
throw (0, _contentstackError2["default"])(response);
|
|
75
|
-
case
|
|
76
|
-
_context.next =
|
|
76
|
+
case 4:
|
|
77
|
+
_context.next = 6;
|
|
77
78
|
break;
|
|
78
|
-
case
|
|
79
|
-
_context.prev =
|
|
80
|
-
|
|
81
|
-
throw (0, _contentstackError2["default"])(
|
|
82
|
-
case
|
|
79
|
+
case 5:
|
|
80
|
+
_context.prev = 5;
|
|
81
|
+
_t = _context["catch"](1);
|
|
82
|
+
throw (0, _contentstackError2["default"])(_t);
|
|
83
|
+
case 6:
|
|
83
84
|
case "end":
|
|
84
85
|
return _context.stop();
|
|
85
86
|
}
|
|
86
|
-
}, _callee, null, [[1,
|
|
87
|
+
}, _callee, null, [[1, 5]]);
|
|
87
88
|
}));
|
|
88
89
|
/**
|
|
89
90
|
* @description Revoke all users tokens issued to an authorized app for the particular organization
|
|
@@ -99,37 +100,37 @@ function Authorization(http, data, params) {
|
|
|
99
100
|
* .then((response) => console.log(response))
|
|
100
101
|
*/
|
|
101
102
|
this.revokeAll = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee2() {
|
|
102
|
-
var headers, response;
|
|
103
|
-
return _regenerator2["default"].wrap(function
|
|
103
|
+
var headers, response, _t2;
|
|
104
|
+
return _regenerator2["default"].wrap(function (_context2) {
|
|
104
105
|
while (1) switch (_context2.prev = _context2.next) {
|
|
105
106
|
case 0:
|
|
106
107
|
_context2.prev = 0;
|
|
107
108
|
headers = {
|
|
108
109
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
109
110
|
};
|
|
110
|
-
_context2.next =
|
|
111
|
+
_context2.next = 1;
|
|
111
112
|
return http["delete"](_this.urlPath, headers);
|
|
112
|
-
case
|
|
113
|
+
case 1:
|
|
113
114
|
response = _context2.sent;
|
|
114
115
|
if (!response.data) {
|
|
115
|
-
_context2.next =
|
|
116
|
+
_context2.next = 2;
|
|
116
117
|
break;
|
|
117
118
|
}
|
|
118
119
|
return _context2.abrupt("return", response.data);
|
|
119
|
-
case
|
|
120
|
+
case 2:
|
|
120
121
|
throw (0, _contentstackError2["default"])(response);
|
|
121
|
-
case
|
|
122
|
-
_context2.next =
|
|
122
|
+
case 3:
|
|
123
|
+
_context2.next = 5;
|
|
123
124
|
break;
|
|
124
|
-
case
|
|
125
|
-
_context2.prev =
|
|
126
|
-
|
|
127
|
-
throw (0, _contentstackError2["default"])(
|
|
128
|
-
case
|
|
125
|
+
case 4:
|
|
126
|
+
_context2.prev = 4;
|
|
127
|
+
_t2 = _context2["catch"](0);
|
|
128
|
+
throw (0, _contentstackError2["default"])(_t2);
|
|
129
|
+
case 5:
|
|
129
130
|
case "end":
|
|
130
131
|
return _context2.stop();
|
|
131
132
|
}
|
|
132
|
-
}, _callee2, null, [[0,
|
|
133
|
+
}, _callee2, null, [[0, 4]]);
|
|
133
134
|
}));
|
|
134
135
|
/**
|
|
135
136
|
* @description Revoke user token issued to an authorized app for the particular organization
|
|
@@ -146,37 +147,37 @@ function Authorization(http, data, params) {
|
|
|
146
147
|
*/
|
|
147
148
|
this.revoke = /*#__PURE__*/function () {
|
|
148
149
|
var _ref3 = (0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee3(authorizationUid) {
|
|
149
|
-
var headers, response;
|
|
150
|
-
return _regenerator2["default"].wrap(function
|
|
150
|
+
var headers, response, _t3;
|
|
151
|
+
return _regenerator2["default"].wrap(function (_context3) {
|
|
151
152
|
while (1) switch (_context3.prev = _context3.next) {
|
|
152
153
|
case 0:
|
|
153
154
|
_context3.prev = 0;
|
|
154
155
|
headers = {
|
|
155
156
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
156
157
|
};
|
|
157
|
-
_context3.next =
|
|
158
|
+
_context3.next = 1;
|
|
158
159
|
return http["delete"]("".concat(_this.urlPath, "/").concat(authorizationUid), headers);
|
|
159
|
-
case
|
|
160
|
+
case 1:
|
|
160
161
|
response = _context3.sent;
|
|
161
162
|
if (!response.data) {
|
|
162
|
-
_context3.next =
|
|
163
|
+
_context3.next = 2;
|
|
163
164
|
break;
|
|
164
165
|
}
|
|
165
166
|
return _context3.abrupt("return", response.data);
|
|
166
|
-
case
|
|
167
|
+
case 2:
|
|
167
168
|
throw (0, _contentstackError2["default"])(response);
|
|
168
|
-
case
|
|
169
|
-
_context3.next =
|
|
169
|
+
case 3:
|
|
170
|
+
_context3.next = 5;
|
|
170
171
|
break;
|
|
171
|
-
case
|
|
172
|
-
_context3.prev =
|
|
173
|
-
|
|
174
|
-
throw (0, _contentstackError2["default"])(
|
|
175
|
-
case
|
|
172
|
+
case 4:
|
|
173
|
+
_context3.prev = 4;
|
|
174
|
+
_t3 = _context3["catch"](0);
|
|
175
|
+
throw (0, _contentstackError2["default"])(_t3);
|
|
176
|
+
case 5:
|
|
176
177
|
case "end":
|
|
177
178
|
return _context3.stop();
|
|
178
179
|
}
|
|
179
|
-
}, _callee3, null, [[0,
|
|
180
|
+
}, _callee3, null, [[0, 4]]);
|
|
180
181
|
}));
|
|
181
182
|
return function (_x) {
|
|
182
183
|
return _ref3.apply(this, arguments);
|
|
@@ -143,8 +143,9 @@ function Marketplace(http, data) {
|
|
|
143
143
|
var param,
|
|
144
144
|
headers,
|
|
145
145
|
response,
|
|
146
|
-
_args = arguments
|
|
147
|
-
|
|
146
|
+
_args = arguments,
|
|
147
|
+
_t;
|
|
148
|
+
return _regenerator2["default"].wrap(function (_context) {
|
|
148
149
|
while (1) switch (_context.prev = _context.next) {
|
|
149
150
|
case 0:
|
|
150
151
|
param = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
@@ -152,30 +153,30 @@ function Marketplace(http, data) {
|
|
|
152
153
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
153
154
|
};
|
|
154
155
|
headers.params = _objectSpread({}, param);
|
|
155
|
-
_context.prev =
|
|
156
|
-
_context.next =
|
|
156
|
+
_context.prev = 1;
|
|
157
|
+
_context.next = 2;
|
|
157
158
|
return http.get("/authorized-apps", headers);
|
|
158
|
-
case
|
|
159
|
+
case 2:
|
|
159
160
|
response = _context.sent;
|
|
160
161
|
if (!response.data) {
|
|
161
|
-
_context.next =
|
|
162
|
+
_context.next = 3;
|
|
162
163
|
break;
|
|
163
164
|
}
|
|
164
165
|
return _context.abrupt("return", response.data);
|
|
165
|
-
case
|
|
166
|
+
case 3:
|
|
166
167
|
return _context.abrupt("return", (0, _contentstackError2["default"])(response));
|
|
167
|
-
case
|
|
168
|
-
_context.next =
|
|
168
|
+
case 4:
|
|
169
|
+
_context.next = 6;
|
|
169
170
|
break;
|
|
170
|
-
case
|
|
171
|
-
_context.prev =
|
|
172
|
-
|
|
173
|
-
return _context.abrupt("return", (0, _contentstackError2["default"])(
|
|
174
|
-
case
|
|
171
|
+
case 5:
|
|
172
|
+
_context.prev = 5;
|
|
173
|
+
_t = _context["catch"](1);
|
|
174
|
+
return _context.abrupt("return", (0, _contentstackError2["default"])(_t));
|
|
175
|
+
case 6:
|
|
175
176
|
case "end":
|
|
176
177
|
return _context.stop();
|
|
177
178
|
}
|
|
178
|
-
}, _callee, null, [[
|
|
179
|
+
}, _callee, null, [[1, 5]]);
|
|
179
180
|
}));
|
|
180
181
|
}
|
|
181
182
|
return this;
|