@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
|
@@ -47,37 +47,37 @@ function Hosting(http, data, params) {
|
|
|
47
47
|
* .then((data) => {})
|
|
48
48
|
*/
|
|
49
49
|
this.isEnable = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee() {
|
|
50
|
-
var headers, response;
|
|
51
|
-
return _regenerator2["default"].wrap(function
|
|
50
|
+
var headers, response, _t;
|
|
51
|
+
return _regenerator2["default"].wrap(function (_context) {
|
|
52
52
|
while (1) switch (_context.prev = _context.next) {
|
|
53
53
|
case 0:
|
|
54
54
|
_context.prev = 0;
|
|
55
55
|
headers = {
|
|
56
56
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
57
57
|
};
|
|
58
|
-
_context.next =
|
|
58
|
+
_context.next = 1;
|
|
59
59
|
return http.get(_this.urlPath, headers);
|
|
60
|
-
case
|
|
60
|
+
case 1:
|
|
61
61
|
response = _context.sent;
|
|
62
62
|
if (!response.data) {
|
|
63
|
-
_context.next =
|
|
63
|
+
_context.next = 2;
|
|
64
64
|
break;
|
|
65
65
|
}
|
|
66
66
|
return _context.abrupt("return", response.data);
|
|
67
|
-
case
|
|
67
|
+
case 2:
|
|
68
68
|
throw (0, _contentstackError2["default"])(response);
|
|
69
|
-
case
|
|
70
|
-
_context.next =
|
|
69
|
+
case 3:
|
|
70
|
+
_context.next = 5;
|
|
71
71
|
break;
|
|
72
|
-
case
|
|
73
|
-
_context.prev =
|
|
74
|
-
|
|
75
|
-
throw (0, _contentstackError2["default"])(
|
|
76
|
-
case
|
|
72
|
+
case 4:
|
|
73
|
+
_context.prev = 4;
|
|
74
|
+
_t = _context["catch"](0);
|
|
75
|
+
throw (0, _contentstackError2["default"])(_t);
|
|
76
|
+
case 5:
|
|
77
77
|
case "end":
|
|
78
78
|
return _context.stop();
|
|
79
79
|
}
|
|
80
|
-
}, _callee, null, [[0,
|
|
80
|
+
}, _callee, null, [[0, 4]]);
|
|
81
81
|
}));
|
|
82
82
|
|
|
83
83
|
/**
|
|
@@ -93,37 +93,37 @@ function Hosting(http, data, params) {
|
|
|
93
93
|
* .then((data) => {})
|
|
94
94
|
*/
|
|
95
95
|
this.enable = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee2() {
|
|
96
|
-
var headers, response;
|
|
97
|
-
return _regenerator2["default"].wrap(function
|
|
96
|
+
var headers, response, _t2;
|
|
97
|
+
return _regenerator2["default"].wrap(function (_context2) {
|
|
98
98
|
while (1) switch (_context2.prev = _context2.next) {
|
|
99
99
|
case 0:
|
|
100
100
|
_context2.prev = 0;
|
|
101
101
|
headers = {
|
|
102
102
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
103
103
|
};
|
|
104
|
-
_context2.next =
|
|
104
|
+
_context2.next = 1;
|
|
105
105
|
return http.patch("".concat(_this.urlPath, "/enable"), {}, headers);
|
|
106
|
-
case
|
|
106
|
+
case 1:
|
|
107
107
|
response = _context2.sent;
|
|
108
108
|
if (!response.data) {
|
|
109
|
-
_context2.next =
|
|
109
|
+
_context2.next = 2;
|
|
110
110
|
break;
|
|
111
111
|
}
|
|
112
112
|
return _context2.abrupt("return", response.data);
|
|
113
|
-
case
|
|
113
|
+
case 2:
|
|
114
114
|
throw (0, _contentstackError2["default"])(response);
|
|
115
|
-
case
|
|
116
|
-
_context2.next =
|
|
115
|
+
case 3:
|
|
116
|
+
_context2.next = 5;
|
|
117
117
|
break;
|
|
118
|
-
case
|
|
119
|
-
_context2.prev =
|
|
120
|
-
|
|
121
|
-
throw (0, _contentstackError2["default"])(
|
|
122
|
-
case
|
|
118
|
+
case 4:
|
|
119
|
+
_context2.prev = 4;
|
|
120
|
+
_t2 = _context2["catch"](0);
|
|
121
|
+
throw (0, _contentstackError2["default"])(_t2);
|
|
122
|
+
case 5:
|
|
123
123
|
case "end":
|
|
124
124
|
return _context2.stop();
|
|
125
125
|
}
|
|
126
|
-
}, _callee2, null, [[0,
|
|
126
|
+
}, _callee2, null, [[0, 4]]);
|
|
127
127
|
}));
|
|
128
128
|
|
|
129
129
|
/**
|
|
@@ -139,37 +139,37 @@ function Hosting(http, data, params) {
|
|
|
139
139
|
* .then((data) => {})
|
|
140
140
|
*/
|
|
141
141
|
this.disable = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee3() {
|
|
142
|
-
var headers, response;
|
|
143
|
-
return _regenerator2["default"].wrap(function
|
|
142
|
+
var headers, response, _t3;
|
|
143
|
+
return _regenerator2["default"].wrap(function (_context3) {
|
|
144
144
|
while (1) switch (_context3.prev = _context3.next) {
|
|
145
145
|
case 0:
|
|
146
146
|
_context3.prev = 0;
|
|
147
147
|
headers = {
|
|
148
148
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
149
149
|
};
|
|
150
|
-
_context3.next =
|
|
150
|
+
_context3.next = 1;
|
|
151
151
|
return http.patch("".concat(_this.urlPath, "/disable"), {}, headers);
|
|
152
|
-
case
|
|
152
|
+
case 1:
|
|
153
153
|
response = _context3.sent;
|
|
154
154
|
if (!response.data) {
|
|
155
|
-
_context3.next =
|
|
155
|
+
_context3.next = 2;
|
|
156
156
|
break;
|
|
157
157
|
}
|
|
158
158
|
return _context3.abrupt("return", response.data);
|
|
159
|
-
case
|
|
159
|
+
case 2:
|
|
160
160
|
throw (0, _contentstackError2["default"])(response);
|
|
161
|
-
case
|
|
162
|
-
_context3.next =
|
|
161
|
+
case 3:
|
|
162
|
+
_context3.next = 5;
|
|
163
163
|
break;
|
|
164
|
-
case
|
|
165
|
-
_context3.prev =
|
|
166
|
-
|
|
167
|
-
throw (0, _contentstackError2["default"])(
|
|
168
|
-
case
|
|
164
|
+
case 4:
|
|
165
|
+
_context3.prev = 4;
|
|
166
|
+
_t3 = _context3["catch"](0);
|
|
167
|
+
throw (0, _contentstackError2["default"])(_t3);
|
|
168
|
+
case 5:
|
|
169
169
|
case "end":
|
|
170
170
|
return _context3.stop();
|
|
171
171
|
}
|
|
172
|
-
}, _callee3, null, [[0,
|
|
172
|
+
}, _callee3, null, [[0, 4]]);
|
|
173
173
|
}));
|
|
174
174
|
|
|
175
175
|
/**
|
|
@@ -185,37 +185,37 @@ function Hosting(http, data, params) {
|
|
|
185
185
|
* .then((data) => {})
|
|
186
186
|
*/
|
|
187
187
|
this.createUploadUrl = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee4() {
|
|
188
|
-
var headers, response;
|
|
189
|
-
return _regenerator2["default"].wrap(function
|
|
188
|
+
var headers, response, _t4;
|
|
189
|
+
return _regenerator2["default"].wrap(function (_context4) {
|
|
190
190
|
while (1) switch (_context4.prev = _context4.next) {
|
|
191
191
|
case 0:
|
|
192
192
|
_context4.prev = 0;
|
|
193
193
|
headers = {
|
|
194
194
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
195
195
|
};
|
|
196
|
-
_context4.next =
|
|
196
|
+
_context4.next = 1;
|
|
197
197
|
return http.post("".concat(_this.urlPath, "/signedUploadUrl"), {}, headers);
|
|
198
|
-
case
|
|
198
|
+
case 1:
|
|
199
199
|
response = _context4.sent;
|
|
200
200
|
if (!response.data) {
|
|
201
|
-
_context4.next =
|
|
201
|
+
_context4.next = 2;
|
|
202
202
|
break;
|
|
203
203
|
}
|
|
204
204
|
return _context4.abrupt("return", response.data);
|
|
205
|
-
case
|
|
205
|
+
case 2:
|
|
206
206
|
throw (0, _contentstackError2["default"])(response);
|
|
207
|
-
case
|
|
208
|
-
_context4.next =
|
|
207
|
+
case 3:
|
|
208
|
+
_context4.next = 5;
|
|
209
209
|
break;
|
|
210
|
-
case
|
|
211
|
-
_context4.prev =
|
|
212
|
-
|
|
213
|
-
throw (0, _contentstackError2["default"])(
|
|
214
|
-
case
|
|
210
|
+
case 4:
|
|
211
|
+
_context4.prev = 4;
|
|
212
|
+
_t4 = _context4["catch"](0);
|
|
213
|
+
throw (0, _contentstackError2["default"])(_t4);
|
|
214
|
+
case 5:
|
|
215
215
|
case "end":
|
|
216
216
|
return _context4.stop();
|
|
217
217
|
}
|
|
218
|
-
}, _callee4, null, [[0,
|
|
218
|
+
}, _callee4, null, [[0, 4]]);
|
|
219
219
|
}));
|
|
220
220
|
|
|
221
221
|
/**
|
|
@@ -231,20 +231,20 @@ function Hosting(http, data, params) {
|
|
|
231
231
|
* .then((data) => {})
|
|
232
232
|
*/
|
|
233
233
|
this.latestLiveDeployment = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee5() {
|
|
234
|
-
var headers, response, content;
|
|
235
|
-
return _regenerator2["default"].wrap(function
|
|
234
|
+
var headers, response, content, _t5;
|
|
235
|
+
return _regenerator2["default"].wrap(function (_context5) {
|
|
236
236
|
while (1) switch (_context5.prev = _context5.next) {
|
|
237
237
|
case 0:
|
|
238
238
|
_context5.prev = 0;
|
|
239
239
|
headers = {
|
|
240
240
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
241
241
|
};
|
|
242
|
-
_context5.next =
|
|
242
|
+
_context5.next = 1;
|
|
243
243
|
return http.get("".concat(_this.urlPath, "/latestLiveDeployment"), headers);
|
|
244
|
-
case
|
|
244
|
+
case 1:
|
|
245
245
|
response = _context5.sent;
|
|
246
246
|
if (!response.data) {
|
|
247
|
-
_context5.next =
|
|
247
|
+
_context5.next = 2;
|
|
248
248
|
break;
|
|
249
249
|
}
|
|
250
250
|
content = response.data.data;
|
|
@@ -252,20 +252,20 @@ function Hosting(http, data, params) {
|
|
|
252
252
|
data: content,
|
|
253
253
|
app_uid: data.app_uid
|
|
254
254
|
}, _this.params));
|
|
255
|
-
case
|
|
255
|
+
case 2:
|
|
256
256
|
throw (0, _contentstackError2["default"])(response);
|
|
257
|
-
case
|
|
258
|
-
_context5.next =
|
|
257
|
+
case 3:
|
|
258
|
+
_context5.next = 5;
|
|
259
259
|
break;
|
|
260
|
-
case
|
|
261
|
-
_context5.prev =
|
|
262
|
-
|
|
263
|
-
throw (0, _contentstackError2["default"])(
|
|
264
|
-
case
|
|
260
|
+
case 4:
|
|
261
|
+
_context5.prev = 4;
|
|
262
|
+
_t5 = _context5["catch"](0);
|
|
263
|
+
throw (0, _contentstackError2["default"])(_t5);
|
|
264
|
+
case 5:
|
|
265
265
|
case "end":
|
|
266
266
|
return _context5.stop();
|
|
267
267
|
}
|
|
268
|
-
}, _callee5, null, [[0,
|
|
268
|
+
}, _callee5, null, [[0, 4]]);
|
|
269
269
|
}));
|
|
270
270
|
|
|
271
271
|
/**
|
|
@@ -310,8 +310,9 @@ function Hosting(http, data, params) {
|
|
|
310
310
|
var data,
|
|
311
311
|
headers,
|
|
312
312
|
response,
|
|
313
|
-
_args6 = arguments
|
|
314
|
-
|
|
313
|
+
_args6 = arguments,
|
|
314
|
+
_t6;
|
|
315
|
+
return _regenerator2["default"].wrap(function (_context6) {
|
|
315
316
|
while (1) switch (_context6.prev = _context6.next) {
|
|
316
317
|
case 0:
|
|
317
318
|
data = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
|
@@ -319,28 +320,28 @@ function Hosting(http, data, params) {
|
|
|
319
320
|
headers = {
|
|
320
321
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
321
322
|
};
|
|
322
|
-
_context6.next =
|
|
323
|
+
_context6.next = 2;
|
|
323
324
|
return http.patch("".concat(_this.urlPath, "/disconnect"), data, headers);
|
|
324
|
-
case
|
|
325
|
+
case 2:
|
|
325
326
|
response = _context6.sent;
|
|
326
327
|
if (!response.data) {
|
|
327
|
-
_context6.next =
|
|
328
|
+
_context6.next = 3;
|
|
328
329
|
break;
|
|
329
330
|
}
|
|
330
331
|
return _context6.abrupt("return", response.data);
|
|
331
|
-
case
|
|
332
|
+
case 3:
|
|
332
333
|
throw (0, _contentstackError2["default"])(response);
|
|
333
|
-
case
|
|
334
|
-
_context6.next =
|
|
334
|
+
case 4:
|
|
335
|
+
_context6.next = 6;
|
|
335
336
|
break;
|
|
336
|
-
case
|
|
337
|
-
_context6.prev =
|
|
338
|
-
|
|
339
|
-
throw (0, _contentstackError2["default"])(
|
|
340
|
-
case
|
|
337
|
+
case 5:
|
|
338
|
+
_context6.prev = 5;
|
|
339
|
+
_t6 = _context6["catch"](1);
|
|
340
|
+
throw (0, _contentstackError2["default"])(_t6);
|
|
341
|
+
case 6:
|
|
341
342
|
case "end":
|
|
342
343
|
return _context6.stop();
|
|
343
344
|
}
|
|
344
|
-
}, _callee6, null, [[1,
|
|
345
|
+
}, _callee6, null, [[1, 5]]);
|
|
345
346
|
}));
|
|
346
347
|
}
|
|
@@ -153,8 +153,8 @@ function App(http, data) {
|
|
|
153
153
|
*/
|
|
154
154
|
this.install = /*#__PURE__*/function () {
|
|
155
155
|
var _ref2 = (0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee(_ref) {
|
|
156
|
-
var targetUid, targetType, headers, response;
|
|
157
|
-
return _regenerator2["default"].wrap(function
|
|
156
|
+
var targetUid, targetType, headers, response, _t;
|
|
157
|
+
return _regenerator2["default"].wrap(function (_context) {
|
|
158
158
|
while (1) switch (_context.prev = _context.next) {
|
|
159
159
|
case 0:
|
|
160
160
|
targetUid = _ref.targetUid, targetType = _ref.targetType;
|
|
@@ -162,32 +162,32 @@ function App(http, data) {
|
|
|
162
162
|
headers = {
|
|
163
163
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
164
164
|
} || {};
|
|
165
|
-
_context.next =
|
|
165
|
+
_context.next = 2;
|
|
166
166
|
return http.post("".concat(_this.urlPath, "/install"), {
|
|
167
167
|
target_type: targetType,
|
|
168
168
|
target_uid: targetUid
|
|
169
169
|
}, headers);
|
|
170
|
-
case
|
|
170
|
+
case 2:
|
|
171
171
|
response = _context.sent;
|
|
172
172
|
if (!response.data) {
|
|
173
|
-
_context.next =
|
|
173
|
+
_context.next = 3;
|
|
174
174
|
break;
|
|
175
175
|
}
|
|
176
176
|
return _context.abrupt("return", new _installation.Installation(http, response.data, _this.params) || {});
|
|
177
|
-
case
|
|
177
|
+
case 3:
|
|
178
178
|
throw (0, _contentstackError2["default"])(response);
|
|
179
|
-
case
|
|
180
|
-
_context.next =
|
|
179
|
+
case 4:
|
|
180
|
+
_context.next = 6;
|
|
181
181
|
break;
|
|
182
|
-
case
|
|
183
|
-
_context.prev =
|
|
184
|
-
|
|
185
|
-
throw (0, _contentstackError2["default"])(
|
|
186
|
-
case
|
|
182
|
+
case 5:
|
|
183
|
+
_context.prev = 5;
|
|
184
|
+
_t = _context["catch"](1);
|
|
185
|
+
throw (0, _contentstackError2["default"])(_t);
|
|
186
|
+
case 6:
|
|
187
187
|
case "end":
|
|
188
188
|
return _context.stop();
|
|
189
189
|
}
|
|
190
|
-
}, _callee, null, [[1,
|
|
190
|
+
}, _callee, null, [[1, 5]]);
|
|
191
191
|
}));
|
|
192
192
|
return function (_x) {
|
|
193
193
|
return _ref2.apply(this, arguments);
|
|
@@ -210,8 +210,8 @@ function App(http, data) {
|
|
|
210
210
|
*/
|
|
211
211
|
this.reinstall = /*#__PURE__*/function () {
|
|
212
212
|
var _ref4 = (0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee2(_ref3) {
|
|
213
|
-
var targetUid, targetType, headers, response;
|
|
214
|
-
return _regenerator2["default"].wrap(function
|
|
213
|
+
var targetUid, targetType, headers, response, _t2;
|
|
214
|
+
return _regenerator2["default"].wrap(function (_context2) {
|
|
215
215
|
while (1) switch (_context2.prev = _context2.next) {
|
|
216
216
|
case 0:
|
|
217
217
|
targetUid = _ref3.targetUid, targetType = _ref3.targetType;
|
|
@@ -219,32 +219,32 @@ function App(http, data) {
|
|
|
219
219
|
headers = {
|
|
220
220
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
221
221
|
} || {};
|
|
222
|
-
_context2.next =
|
|
222
|
+
_context2.next = 2;
|
|
223
223
|
return http.put("".concat(_this.urlPath, "/reinstall"), {
|
|
224
224
|
target_type: targetType,
|
|
225
225
|
target_uid: targetUid
|
|
226
226
|
}, headers);
|
|
227
|
-
case
|
|
227
|
+
case 2:
|
|
228
228
|
response = _context2.sent;
|
|
229
229
|
if (!response.data) {
|
|
230
|
-
_context2.next =
|
|
230
|
+
_context2.next = 3;
|
|
231
231
|
break;
|
|
232
232
|
}
|
|
233
233
|
return _context2.abrupt("return", new _installation.Installation(http, response.data, _this.params) || {});
|
|
234
|
-
case
|
|
234
|
+
case 3:
|
|
235
235
|
throw (0, _contentstackError2["default"])(response);
|
|
236
|
-
case
|
|
237
|
-
_context2.next =
|
|
236
|
+
case 4:
|
|
237
|
+
_context2.next = 6;
|
|
238
238
|
break;
|
|
239
|
-
case
|
|
240
|
-
_context2.prev =
|
|
241
|
-
|
|
242
|
-
throw (0, _contentstackError2["default"])(
|
|
243
|
-
case
|
|
239
|
+
case 5:
|
|
240
|
+
_context2.prev = 5;
|
|
241
|
+
_t2 = _context2["catch"](1);
|
|
242
|
+
throw (0, _contentstackError2["default"])(_t2);
|
|
243
|
+
case 6:
|
|
244
244
|
case "end":
|
|
245
245
|
return _context2.stop();
|
|
246
246
|
}
|
|
247
|
-
}, _callee2, null, [[1,
|
|
247
|
+
}, _callee2, null, [[1, 5]]);
|
|
248
248
|
}));
|
|
249
249
|
return function (_x2) {
|
|
250
250
|
return _ref4.apply(this, arguments);
|
|
@@ -267,8 +267,8 @@ function App(http, data) {
|
|
|
267
267
|
*/
|
|
268
268
|
this.upgrade = /*#__PURE__*/function () {
|
|
269
269
|
var _ref6 = (0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee3(_ref5) {
|
|
270
|
-
var targetUid, targetType, headers, response;
|
|
271
|
-
return _regenerator2["default"].wrap(function
|
|
270
|
+
var targetUid, targetType, headers, response, _t3;
|
|
271
|
+
return _regenerator2["default"].wrap(function (_context3) {
|
|
272
272
|
while (1) switch (_context3.prev = _context3.next) {
|
|
273
273
|
case 0:
|
|
274
274
|
targetUid = _ref5.targetUid, targetType = _ref5.targetType;
|
|
@@ -276,32 +276,32 @@ function App(http, data) {
|
|
|
276
276
|
headers = {
|
|
277
277
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
278
278
|
} || {};
|
|
279
|
-
_context3.next =
|
|
279
|
+
_context3.next = 2;
|
|
280
280
|
return http.put("".concat(_this.urlPath, "/reinstall"), {
|
|
281
281
|
target_type: targetType,
|
|
282
282
|
target_uid: targetUid
|
|
283
283
|
}, headers);
|
|
284
|
-
case
|
|
284
|
+
case 2:
|
|
285
285
|
response = _context3.sent;
|
|
286
286
|
if (!response.data) {
|
|
287
|
-
_context3.next =
|
|
287
|
+
_context3.next = 3;
|
|
288
288
|
break;
|
|
289
289
|
}
|
|
290
290
|
return _context3.abrupt("return", new _installation.Installation(http, response.data, _this.params) || {});
|
|
291
|
-
case
|
|
291
|
+
case 3:
|
|
292
292
|
throw (0, _contentstackError2["default"])(response);
|
|
293
|
-
case
|
|
294
|
-
_context3.next =
|
|
293
|
+
case 4:
|
|
294
|
+
_context3.next = 6;
|
|
295
295
|
break;
|
|
296
|
-
case
|
|
297
|
-
_context3.prev =
|
|
298
|
-
|
|
299
|
-
throw (0, _contentstackError2["default"])(
|
|
300
|
-
case
|
|
296
|
+
case 5:
|
|
297
|
+
_context3.prev = 5;
|
|
298
|
+
_t3 = _context3["catch"](1);
|
|
299
|
+
throw (0, _contentstackError2["default"])(_t3);
|
|
300
|
+
case 6:
|
|
301
301
|
case "end":
|
|
302
302
|
return _context3.stop();
|
|
303
303
|
}
|
|
304
|
-
}, _callee3, null, [[1,
|
|
304
|
+
}, _callee3, null, [[1, 5]]);
|
|
305
305
|
}));
|
|
306
306
|
return function (_x3) {
|
|
307
307
|
return _ref6.apply(this, arguments);
|
|
@@ -322,37 +322,37 @@ function App(http, data) {
|
|
|
322
322
|
*
|
|
323
323
|
*/
|
|
324
324
|
this.getRequests = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee4() {
|
|
325
|
-
var headers, response;
|
|
326
|
-
return _regenerator2["default"].wrap(function
|
|
325
|
+
var headers, response, _t4;
|
|
326
|
+
return _regenerator2["default"].wrap(function (_context4) {
|
|
327
327
|
while (1) switch (_context4.prev = _context4.next) {
|
|
328
328
|
case 0:
|
|
329
329
|
_context4.prev = 0;
|
|
330
330
|
headers = {
|
|
331
331
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
332
332
|
};
|
|
333
|
-
_context4.next =
|
|
333
|
+
_context4.next = 1;
|
|
334
334
|
return http.get("".concat(_this.urlPath, "/requests"), headers);
|
|
335
|
-
case
|
|
335
|
+
case 1:
|
|
336
336
|
response = _context4.sent;
|
|
337
337
|
if (!response.data) {
|
|
338
|
-
_context4.next =
|
|
338
|
+
_context4.next = 2;
|
|
339
339
|
break;
|
|
340
340
|
}
|
|
341
341
|
return _context4.abrupt("return", response.data);
|
|
342
|
-
case
|
|
342
|
+
case 2:
|
|
343
343
|
throw (0, _contentstackError2["default"])(response);
|
|
344
|
-
case
|
|
345
|
-
_context4.next =
|
|
344
|
+
case 3:
|
|
345
|
+
_context4.next = 5;
|
|
346
346
|
break;
|
|
347
|
-
case
|
|
348
|
-
_context4.prev =
|
|
349
|
-
|
|
350
|
-
throw (0, _contentstackError2["default"])(
|
|
351
|
-
case
|
|
347
|
+
case 4:
|
|
348
|
+
_context4.prev = 4;
|
|
349
|
+
_t4 = _context4["catch"](0);
|
|
350
|
+
throw (0, _contentstackError2["default"])(_t4);
|
|
351
|
+
case 5:
|
|
352
352
|
case "end":
|
|
353
353
|
return _context4.stop();
|
|
354
354
|
}
|
|
355
|
-
}, _callee4, null, [[0,
|
|
355
|
+
}, _callee4, null, [[0, 4]]);
|
|
356
356
|
}));
|
|
357
357
|
/**
|
|
358
358
|
* @description The App authorization allow to authorize app for specific scope.
|
|
@@ -376,8 +376,8 @@ function App(http, data) {
|
|
|
376
376
|
*/
|
|
377
377
|
this.authorize = /*#__PURE__*/function () {
|
|
378
378
|
var _ref9 = (0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee5(_ref8) {
|
|
379
|
-
var responseType, clientId, redirectUri, scope, state, headers, content, response;
|
|
380
|
-
return _regenerator2["default"].wrap(function
|
|
379
|
+
var responseType, clientId, redirectUri, scope, state, headers, content, response, _t5;
|
|
380
|
+
return _regenerator2["default"].wrap(function (_context5) {
|
|
381
381
|
while (1) switch (_context5.prev = _context5.next) {
|
|
382
382
|
case 0:
|
|
383
383
|
responseType = _ref8.responseType, clientId = _ref8.clientId, redirectUri = _ref8.redirectUri, scope = _ref8.scope, state = _ref8.state;
|
|
@@ -394,29 +394,29 @@ function App(http, data) {
|
|
|
394
394
|
if (state) {
|
|
395
395
|
content.state = state;
|
|
396
396
|
}
|
|
397
|
-
_context5.next =
|
|
397
|
+
_context5.next = 2;
|
|
398
398
|
return http.post("".concat(_this.urlPath, "/authorize"), content, headers);
|
|
399
|
-
case
|
|
399
|
+
case 2:
|
|
400
400
|
response = _context5.sent;
|
|
401
401
|
if (!response.data) {
|
|
402
|
-
_context5.next =
|
|
402
|
+
_context5.next = 3;
|
|
403
403
|
break;
|
|
404
404
|
}
|
|
405
405
|
return _context5.abrupt("return", response.data);
|
|
406
|
-
case
|
|
406
|
+
case 3:
|
|
407
407
|
throw (0, _contentstackError2["default"])(response);
|
|
408
|
-
case
|
|
409
|
-
_context5.next =
|
|
408
|
+
case 4:
|
|
409
|
+
_context5.next = 6;
|
|
410
410
|
break;
|
|
411
|
-
case
|
|
412
|
-
_context5.prev =
|
|
413
|
-
|
|
414
|
-
throw (0, _contentstackError2["default"])(
|
|
415
|
-
case
|
|
411
|
+
case 5:
|
|
412
|
+
_context5.prev = 5;
|
|
413
|
+
_t5 = _context5["catch"](1);
|
|
414
|
+
throw (0, _contentstackError2["default"])(_t5);
|
|
415
|
+
case 6:
|
|
416
416
|
case "end":
|
|
417
417
|
return _context5.stop();
|
|
418
418
|
}
|
|
419
|
-
}, _callee5, null, [[1,
|
|
419
|
+
}, _callee5, null, [[1, 5]]);
|
|
420
420
|
}));
|
|
421
421
|
return function (_x4) {
|
|
422
422
|
return _ref9.apply(this, arguments);
|
|
@@ -454,37 +454,37 @@ function App(http, data) {
|
|
|
454
454
|
*
|
|
455
455
|
*/
|
|
456
456
|
this.listInstallations = /*#__PURE__*/(0, _asyncToGenerator3["default"])(/*#__PURE__*/_regenerator2["default"].mark(function _callee6() {
|
|
457
|
-
var headers, response;
|
|
458
|
-
return _regenerator2["default"].wrap(function
|
|
457
|
+
var headers, response, _t6;
|
|
458
|
+
return _regenerator2["default"].wrap(function (_context6) {
|
|
459
459
|
while (1) switch (_context6.prev = _context6.next) {
|
|
460
460
|
case 0:
|
|
461
461
|
_context6.prev = 0;
|
|
462
462
|
headers = {
|
|
463
463
|
headers: _objectSpread(_objectSpread({}, (0, _cloneDeep2["default"])(_this.params)), (0, _cloneDeep2["default"])(_this.headers))
|
|
464
464
|
};
|
|
465
|
-
_context6.next =
|
|
465
|
+
_context6.next = 1;
|
|
466
466
|
return http.get("manifests/".concat(_this.uid, "/installations"), headers);
|
|
467
|
-
case
|
|
467
|
+
case 1:
|
|
468
468
|
response = _context6.sent;
|
|
469
469
|
if (!response.data) {
|
|
470
|
-
_context6.next =
|
|
470
|
+
_context6.next = 2;
|
|
471
471
|
break;
|
|
472
472
|
}
|
|
473
473
|
return _context6.abrupt("return", new _contentstackCollection2["default"](response, http, _this.stackHeaders, _installation.InstallationCollection));
|
|
474
|
-
case
|
|
474
|
+
case 2:
|
|
475
475
|
throw (0, _contentstackError2["default"])(response);
|
|
476
|
-
case
|
|
477
|
-
_context6.next =
|
|
476
|
+
case 3:
|
|
477
|
+
_context6.next = 5;
|
|
478
478
|
break;
|
|
479
|
-
case
|
|
480
|
-
_context6.prev =
|
|
481
|
-
|
|
482
|
-
throw (0, _contentstackError2["default"])(
|
|
483
|
-
case
|
|
479
|
+
case 4:
|
|
480
|
+
_context6.prev = 4;
|
|
481
|
+
_t6 = _context6["catch"](0);
|
|
482
|
+
throw (0, _contentstackError2["default"])(_t6);
|
|
483
|
+
case 5:
|
|
484
484
|
case "end":
|
|
485
485
|
return _context6.stop();
|
|
486
486
|
}
|
|
487
|
-
}, _callee6, null, [[0,
|
|
487
|
+
}, _callee6, null, [[0, 4]]);
|
|
488
488
|
}));
|
|
489
489
|
} else {
|
|
490
490
|
/**
|