@contentstack/marketplace-sdk 1.2.8 → 1.3.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 +11 -2
- 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 +91 -22
- package/dist/es-modules/marketplace/installation/index.js +129 -126
- 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 +91 -22
- package/dist/es5/marketplace/installation/index.js +129 -126
- 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
- package/types/marketplace/index.d.ts +1 -0
|
@@ -35,37 +35,37 @@ export function Hosting(http, data, params) {
|
|
|
35
35
|
* .then((data) => {})
|
|
36
36
|
*/
|
|
37
37
|
this.isEnable = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
38
|
-
var headers, response;
|
|
39
|
-
return _regeneratorRuntime.wrap(function
|
|
38
|
+
var headers, response, _t;
|
|
39
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
40
40
|
while (1) switch (_context.prev = _context.next) {
|
|
41
41
|
case 0:
|
|
42
42
|
_context.prev = 0;
|
|
43
43
|
headers = {
|
|
44
44
|
headers: _objectSpread({}, cloneDeep(_this.params))
|
|
45
45
|
};
|
|
46
|
-
_context.next =
|
|
46
|
+
_context.next = 1;
|
|
47
47
|
return http.get(_this.urlPath, headers);
|
|
48
|
-
case
|
|
48
|
+
case 1:
|
|
49
49
|
response = _context.sent;
|
|
50
50
|
if (!response.data) {
|
|
51
|
-
_context.next =
|
|
51
|
+
_context.next = 2;
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
54
|
return _context.abrupt("return", response.data);
|
|
55
|
-
case
|
|
55
|
+
case 2:
|
|
56
56
|
throw error(response);
|
|
57
|
-
case
|
|
58
|
-
_context.next =
|
|
57
|
+
case 3:
|
|
58
|
+
_context.next = 5;
|
|
59
59
|
break;
|
|
60
|
-
case
|
|
61
|
-
_context.prev =
|
|
62
|
-
|
|
63
|
-
throw error(
|
|
64
|
-
case
|
|
60
|
+
case 4:
|
|
61
|
+
_context.prev = 4;
|
|
62
|
+
_t = _context["catch"](0);
|
|
63
|
+
throw error(_t);
|
|
64
|
+
case 5:
|
|
65
65
|
case "end":
|
|
66
66
|
return _context.stop();
|
|
67
67
|
}
|
|
68
|
-
}, _callee, null, [[0,
|
|
68
|
+
}, _callee, null, [[0, 4]]);
|
|
69
69
|
}));
|
|
70
70
|
|
|
71
71
|
/**
|
|
@@ -81,37 +81,37 @@ export function Hosting(http, data, params) {
|
|
|
81
81
|
* .then((data) => {})
|
|
82
82
|
*/
|
|
83
83
|
this.enable = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
84
|
-
var headers, response;
|
|
85
|
-
return _regeneratorRuntime.wrap(function
|
|
84
|
+
var headers, response, _t2;
|
|
85
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
86
86
|
while (1) switch (_context2.prev = _context2.next) {
|
|
87
87
|
case 0:
|
|
88
88
|
_context2.prev = 0;
|
|
89
89
|
headers = {
|
|
90
90
|
headers: _objectSpread({}, cloneDeep(_this.params))
|
|
91
91
|
};
|
|
92
|
-
_context2.next =
|
|
92
|
+
_context2.next = 1;
|
|
93
93
|
return http.patch("".concat(_this.urlPath, "/enable"), {}, headers);
|
|
94
|
-
case
|
|
94
|
+
case 1:
|
|
95
95
|
response = _context2.sent;
|
|
96
96
|
if (!response.data) {
|
|
97
|
-
_context2.next =
|
|
97
|
+
_context2.next = 2;
|
|
98
98
|
break;
|
|
99
99
|
}
|
|
100
100
|
return _context2.abrupt("return", response.data);
|
|
101
|
-
case
|
|
101
|
+
case 2:
|
|
102
102
|
throw error(response);
|
|
103
|
-
case
|
|
104
|
-
_context2.next =
|
|
103
|
+
case 3:
|
|
104
|
+
_context2.next = 5;
|
|
105
105
|
break;
|
|
106
|
-
case
|
|
107
|
-
_context2.prev =
|
|
108
|
-
|
|
109
|
-
throw error(
|
|
110
|
-
case
|
|
106
|
+
case 4:
|
|
107
|
+
_context2.prev = 4;
|
|
108
|
+
_t2 = _context2["catch"](0);
|
|
109
|
+
throw error(_t2);
|
|
110
|
+
case 5:
|
|
111
111
|
case "end":
|
|
112
112
|
return _context2.stop();
|
|
113
113
|
}
|
|
114
|
-
}, _callee2, null, [[0,
|
|
114
|
+
}, _callee2, null, [[0, 4]]);
|
|
115
115
|
}));
|
|
116
116
|
|
|
117
117
|
/**
|
|
@@ -127,37 +127,37 @@ export function Hosting(http, data, params) {
|
|
|
127
127
|
* .then((data) => {})
|
|
128
128
|
*/
|
|
129
129
|
this.disable = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
130
|
-
var headers, response;
|
|
131
|
-
return _regeneratorRuntime.wrap(function
|
|
130
|
+
var headers, response, _t3;
|
|
131
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
132
132
|
while (1) switch (_context3.prev = _context3.next) {
|
|
133
133
|
case 0:
|
|
134
134
|
_context3.prev = 0;
|
|
135
135
|
headers = {
|
|
136
136
|
headers: _objectSpread({}, cloneDeep(_this.params))
|
|
137
137
|
};
|
|
138
|
-
_context3.next =
|
|
138
|
+
_context3.next = 1;
|
|
139
139
|
return http.patch("".concat(_this.urlPath, "/disable"), {}, headers);
|
|
140
|
-
case
|
|
140
|
+
case 1:
|
|
141
141
|
response = _context3.sent;
|
|
142
142
|
if (!response.data) {
|
|
143
|
-
_context3.next =
|
|
143
|
+
_context3.next = 2;
|
|
144
144
|
break;
|
|
145
145
|
}
|
|
146
146
|
return _context3.abrupt("return", response.data);
|
|
147
|
-
case
|
|
147
|
+
case 2:
|
|
148
148
|
throw error(response);
|
|
149
|
-
case
|
|
150
|
-
_context3.next =
|
|
149
|
+
case 3:
|
|
150
|
+
_context3.next = 5;
|
|
151
151
|
break;
|
|
152
|
-
case
|
|
153
|
-
_context3.prev =
|
|
154
|
-
|
|
155
|
-
throw error(
|
|
156
|
-
case
|
|
152
|
+
case 4:
|
|
153
|
+
_context3.prev = 4;
|
|
154
|
+
_t3 = _context3["catch"](0);
|
|
155
|
+
throw error(_t3);
|
|
156
|
+
case 5:
|
|
157
157
|
case "end":
|
|
158
158
|
return _context3.stop();
|
|
159
159
|
}
|
|
160
|
-
}, _callee3, null, [[0,
|
|
160
|
+
}, _callee3, null, [[0, 4]]);
|
|
161
161
|
}));
|
|
162
162
|
|
|
163
163
|
/**
|
|
@@ -173,37 +173,37 @@ export function Hosting(http, data, params) {
|
|
|
173
173
|
* .then((data) => {})
|
|
174
174
|
*/
|
|
175
175
|
this.createUploadUrl = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
176
|
-
var headers, response;
|
|
177
|
-
return _regeneratorRuntime.wrap(function
|
|
176
|
+
var headers, response, _t4;
|
|
177
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
178
178
|
while (1) switch (_context4.prev = _context4.next) {
|
|
179
179
|
case 0:
|
|
180
180
|
_context4.prev = 0;
|
|
181
181
|
headers = {
|
|
182
182
|
headers: _objectSpread({}, cloneDeep(_this.params))
|
|
183
183
|
};
|
|
184
|
-
_context4.next =
|
|
184
|
+
_context4.next = 1;
|
|
185
185
|
return http.post("".concat(_this.urlPath, "/signedUploadUrl"), {}, headers);
|
|
186
|
-
case
|
|
186
|
+
case 1:
|
|
187
187
|
response = _context4.sent;
|
|
188
188
|
if (!response.data) {
|
|
189
|
-
_context4.next =
|
|
189
|
+
_context4.next = 2;
|
|
190
190
|
break;
|
|
191
191
|
}
|
|
192
192
|
return _context4.abrupt("return", response.data);
|
|
193
|
-
case
|
|
193
|
+
case 2:
|
|
194
194
|
throw error(response);
|
|
195
|
-
case
|
|
196
|
-
_context4.next =
|
|
195
|
+
case 3:
|
|
196
|
+
_context4.next = 5;
|
|
197
197
|
break;
|
|
198
|
-
case
|
|
199
|
-
_context4.prev =
|
|
200
|
-
|
|
201
|
-
throw error(
|
|
202
|
-
case
|
|
198
|
+
case 4:
|
|
199
|
+
_context4.prev = 4;
|
|
200
|
+
_t4 = _context4["catch"](0);
|
|
201
|
+
throw error(_t4);
|
|
202
|
+
case 5:
|
|
203
203
|
case "end":
|
|
204
204
|
return _context4.stop();
|
|
205
205
|
}
|
|
206
|
-
}, _callee4, null, [[0,
|
|
206
|
+
}, _callee4, null, [[0, 4]]);
|
|
207
207
|
}));
|
|
208
208
|
|
|
209
209
|
/**
|
|
@@ -219,20 +219,20 @@ export function Hosting(http, data, params) {
|
|
|
219
219
|
* .then((data) => {})
|
|
220
220
|
*/
|
|
221
221
|
this.latestLiveDeployment = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
|
|
222
|
-
var headers, response, content;
|
|
223
|
-
return _regeneratorRuntime.wrap(function
|
|
222
|
+
var headers, response, content, _t5;
|
|
223
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
224
224
|
while (1) switch (_context5.prev = _context5.next) {
|
|
225
225
|
case 0:
|
|
226
226
|
_context5.prev = 0;
|
|
227
227
|
headers = {
|
|
228
228
|
headers: _objectSpread({}, cloneDeep(_this.params))
|
|
229
229
|
};
|
|
230
|
-
_context5.next =
|
|
230
|
+
_context5.next = 1;
|
|
231
231
|
return http.get("".concat(_this.urlPath, "/latestLiveDeployment"), headers);
|
|
232
|
-
case
|
|
232
|
+
case 1:
|
|
233
233
|
response = _context5.sent;
|
|
234
234
|
if (!response.data) {
|
|
235
|
-
_context5.next =
|
|
235
|
+
_context5.next = 2;
|
|
236
236
|
break;
|
|
237
237
|
}
|
|
238
238
|
content = response.data.data;
|
|
@@ -240,20 +240,20 @@ export function Hosting(http, data, params) {
|
|
|
240
240
|
data: content,
|
|
241
241
|
app_uid: data.app_uid
|
|
242
242
|
}, _this.params));
|
|
243
|
-
case
|
|
243
|
+
case 2:
|
|
244
244
|
throw error(response);
|
|
245
|
-
case
|
|
246
|
-
_context5.next =
|
|
245
|
+
case 3:
|
|
246
|
+
_context5.next = 5;
|
|
247
247
|
break;
|
|
248
|
-
case
|
|
249
|
-
_context5.prev =
|
|
250
|
-
|
|
251
|
-
throw error(
|
|
252
|
-
case
|
|
248
|
+
case 4:
|
|
249
|
+
_context5.prev = 4;
|
|
250
|
+
_t5 = _context5["catch"](0);
|
|
251
|
+
throw error(_t5);
|
|
252
|
+
case 5:
|
|
253
253
|
case "end":
|
|
254
254
|
return _context5.stop();
|
|
255
255
|
}
|
|
256
|
-
}, _callee5, null, [[0,
|
|
256
|
+
}, _callee5, null, [[0, 4]]);
|
|
257
257
|
}));
|
|
258
258
|
|
|
259
259
|
/**
|
|
@@ -298,8 +298,9 @@ export function Hosting(http, data, params) {
|
|
|
298
298
|
var data,
|
|
299
299
|
headers,
|
|
300
300
|
response,
|
|
301
|
-
_args6 = arguments
|
|
302
|
-
|
|
301
|
+
_args6 = arguments,
|
|
302
|
+
_t6;
|
|
303
|
+
return _regeneratorRuntime.wrap(function (_context6) {
|
|
303
304
|
while (1) switch (_context6.prev = _context6.next) {
|
|
304
305
|
case 0:
|
|
305
306
|
data = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {};
|
|
@@ -307,28 +308,28 @@ export function Hosting(http, data, params) {
|
|
|
307
308
|
headers = {
|
|
308
309
|
headers: _objectSpread({}, cloneDeep(_this.params))
|
|
309
310
|
};
|
|
310
|
-
_context6.next =
|
|
311
|
+
_context6.next = 2;
|
|
311
312
|
return http.patch("".concat(_this.urlPath, "/disconnect"), data, headers);
|
|
312
|
-
case
|
|
313
|
+
case 2:
|
|
313
314
|
response = _context6.sent;
|
|
314
315
|
if (!response.data) {
|
|
315
|
-
_context6.next =
|
|
316
|
+
_context6.next = 3;
|
|
316
317
|
break;
|
|
317
318
|
}
|
|
318
319
|
return _context6.abrupt("return", response.data);
|
|
319
|
-
case
|
|
320
|
+
case 3:
|
|
320
321
|
throw error(response);
|
|
321
|
-
case
|
|
322
|
-
_context6.next =
|
|
322
|
+
case 4:
|
|
323
|
+
_context6.next = 6;
|
|
323
324
|
break;
|
|
324
|
-
case
|
|
325
|
-
_context6.prev =
|
|
326
|
-
|
|
327
|
-
throw error(
|
|
328
|
-
case
|
|
325
|
+
case 5:
|
|
326
|
+
_context6.prev = 5;
|
|
327
|
+
_t6 = _context6["catch"](1);
|
|
328
|
+
throw error(_t6);
|
|
329
|
+
case 6:
|
|
329
330
|
case "end":
|
|
330
331
|
return _context6.stop();
|
|
331
332
|
}
|
|
332
|
-
}, _callee6, null, [[1,
|
|
333
|
+
}, _callee6, null, [[1, 5]]);
|
|
333
334
|
}));
|
|
334
335
|
}
|
|
@@ -140,8 +140,8 @@ export function App(http, data) {
|
|
|
140
140
|
*/
|
|
141
141
|
this.install = /*#__PURE__*/function () {
|
|
142
142
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
143
|
-
var targetUid, targetType, headers, response;
|
|
144
|
-
return _regeneratorRuntime.wrap(function
|
|
143
|
+
var targetUid, targetType, headers, response, _t;
|
|
144
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
145
145
|
while (1) switch (_context.prev = _context.next) {
|
|
146
146
|
case 0:
|
|
147
147
|
targetUid = _ref.targetUid, targetType = _ref.targetType;
|
|
@@ -149,32 +149,32 @@ export function App(http, data) {
|
|
|
149
149
|
headers = {
|
|
150
150
|
headers: _objectSpread({}, cloneDeep(_this.params))
|
|
151
151
|
} || {};
|
|
152
|
-
_context.next =
|
|
152
|
+
_context.next = 2;
|
|
153
153
|
return http.post("".concat(_this.urlPath, "/install"), {
|
|
154
154
|
target_type: targetType,
|
|
155
155
|
target_uid: targetUid
|
|
156
156
|
}, headers);
|
|
157
|
-
case
|
|
157
|
+
case 2:
|
|
158
158
|
response = _context.sent;
|
|
159
159
|
if (!response.data) {
|
|
160
|
-
_context.next =
|
|
160
|
+
_context.next = 3;
|
|
161
161
|
break;
|
|
162
162
|
}
|
|
163
163
|
return _context.abrupt("return", new Installation(http, response.data, _this.params) || {});
|
|
164
|
-
case
|
|
164
|
+
case 3:
|
|
165
165
|
throw error(response);
|
|
166
|
-
case
|
|
167
|
-
_context.next =
|
|
166
|
+
case 4:
|
|
167
|
+
_context.next = 6;
|
|
168
168
|
break;
|
|
169
|
-
case
|
|
170
|
-
_context.prev =
|
|
171
|
-
|
|
172
|
-
throw error(
|
|
173
|
-
case
|
|
169
|
+
case 5:
|
|
170
|
+
_context.prev = 5;
|
|
171
|
+
_t = _context["catch"](1);
|
|
172
|
+
throw error(_t);
|
|
173
|
+
case 6:
|
|
174
174
|
case "end":
|
|
175
175
|
return _context.stop();
|
|
176
176
|
}
|
|
177
|
-
}, _callee, null, [[1,
|
|
177
|
+
}, _callee, null, [[1, 5]]);
|
|
178
178
|
}));
|
|
179
179
|
return function (_x) {
|
|
180
180
|
return _ref2.apply(this, arguments);
|
|
@@ -197,8 +197,8 @@ export function App(http, data) {
|
|
|
197
197
|
*/
|
|
198
198
|
this.reinstall = /*#__PURE__*/function () {
|
|
199
199
|
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
|
|
200
|
-
var targetUid, targetType, headers, response;
|
|
201
|
-
return _regeneratorRuntime.wrap(function
|
|
200
|
+
var targetUid, targetType, headers, response, _t2;
|
|
201
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
202
202
|
while (1) switch (_context2.prev = _context2.next) {
|
|
203
203
|
case 0:
|
|
204
204
|
targetUid = _ref3.targetUid, targetType = _ref3.targetType;
|
|
@@ -206,32 +206,32 @@ export function App(http, data) {
|
|
|
206
206
|
headers = {
|
|
207
207
|
headers: _objectSpread({}, cloneDeep(_this.params))
|
|
208
208
|
} || {};
|
|
209
|
-
_context2.next =
|
|
209
|
+
_context2.next = 2;
|
|
210
210
|
return http.put("".concat(_this.urlPath, "/reinstall"), {
|
|
211
211
|
target_type: targetType,
|
|
212
212
|
target_uid: targetUid
|
|
213
213
|
}, headers);
|
|
214
|
-
case
|
|
214
|
+
case 2:
|
|
215
215
|
response = _context2.sent;
|
|
216
216
|
if (!response.data) {
|
|
217
|
-
_context2.next =
|
|
217
|
+
_context2.next = 3;
|
|
218
218
|
break;
|
|
219
219
|
}
|
|
220
220
|
return _context2.abrupt("return", new Installation(http, response.data, _this.params) || {});
|
|
221
|
-
case
|
|
221
|
+
case 3:
|
|
222
222
|
throw error(response);
|
|
223
|
-
case
|
|
224
|
-
_context2.next =
|
|
223
|
+
case 4:
|
|
224
|
+
_context2.next = 6;
|
|
225
225
|
break;
|
|
226
|
-
case
|
|
227
|
-
_context2.prev =
|
|
228
|
-
|
|
229
|
-
throw error(
|
|
230
|
-
case
|
|
226
|
+
case 5:
|
|
227
|
+
_context2.prev = 5;
|
|
228
|
+
_t2 = _context2["catch"](1);
|
|
229
|
+
throw error(_t2);
|
|
230
|
+
case 6:
|
|
231
231
|
case "end":
|
|
232
232
|
return _context2.stop();
|
|
233
233
|
}
|
|
234
|
-
}, _callee2, null, [[1,
|
|
234
|
+
}, _callee2, null, [[1, 5]]);
|
|
235
235
|
}));
|
|
236
236
|
return function (_x2) {
|
|
237
237
|
return _ref4.apply(this, arguments);
|
|
@@ -254,8 +254,8 @@ export function App(http, data) {
|
|
|
254
254
|
*/
|
|
255
255
|
this.upgrade = /*#__PURE__*/function () {
|
|
256
256
|
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref5) {
|
|
257
|
-
var targetUid, targetType, headers, response;
|
|
258
|
-
return _regeneratorRuntime.wrap(function
|
|
257
|
+
var targetUid, targetType, headers, response, _t3;
|
|
258
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
259
259
|
while (1) switch (_context3.prev = _context3.next) {
|
|
260
260
|
case 0:
|
|
261
261
|
targetUid = _ref5.targetUid, targetType = _ref5.targetType;
|
|
@@ -263,32 +263,32 @@ export function App(http, data) {
|
|
|
263
263
|
headers = {
|
|
264
264
|
headers: _objectSpread({}, cloneDeep(_this.params))
|
|
265
265
|
} || {};
|
|
266
|
-
_context3.next =
|
|
266
|
+
_context3.next = 2;
|
|
267
267
|
return http.put("".concat(_this.urlPath, "/reinstall"), {
|
|
268
268
|
target_type: targetType,
|
|
269
269
|
target_uid: targetUid
|
|
270
270
|
}, headers);
|
|
271
|
-
case
|
|
271
|
+
case 2:
|
|
272
272
|
response = _context3.sent;
|
|
273
273
|
if (!response.data) {
|
|
274
|
-
_context3.next =
|
|
274
|
+
_context3.next = 3;
|
|
275
275
|
break;
|
|
276
276
|
}
|
|
277
277
|
return _context3.abrupt("return", new Installation(http, response.data, _this.params) || {});
|
|
278
|
-
case
|
|
278
|
+
case 3:
|
|
279
279
|
throw error(response);
|
|
280
|
-
case
|
|
281
|
-
_context3.next =
|
|
280
|
+
case 4:
|
|
281
|
+
_context3.next = 6;
|
|
282
282
|
break;
|
|
283
|
-
case
|
|
284
|
-
_context3.prev =
|
|
285
|
-
|
|
286
|
-
throw error(
|
|
287
|
-
case
|
|
283
|
+
case 5:
|
|
284
|
+
_context3.prev = 5;
|
|
285
|
+
_t3 = _context3["catch"](1);
|
|
286
|
+
throw error(_t3);
|
|
287
|
+
case 6:
|
|
288
288
|
case "end":
|
|
289
289
|
return _context3.stop();
|
|
290
290
|
}
|
|
291
|
-
}, _callee3, null, [[1,
|
|
291
|
+
}, _callee3, null, [[1, 5]]);
|
|
292
292
|
}));
|
|
293
293
|
return function (_x3) {
|
|
294
294
|
return _ref6.apply(this, arguments);
|
|
@@ -309,37 +309,37 @@ export function App(http, data) {
|
|
|
309
309
|
*
|
|
310
310
|
*/
|
|
311
311
|
this.getRequests = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
312
|
-
var headers, response;
|
|
313
|
-
return _regeneratorRuntime.wrap(function
|
|
312
|
+
var headers, response, _t4;
|
|
313
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
314
314
|
while (1) switch (_context4.prev = _context4.next) {
|
|
315
315
|
case 0:
|
|
316
316
|
_context4.prev = 0;
|
|
317
317
|
headers = {
|
|
318
318
|
headers: _objectSpread({}, cloneDeep(_this.params))
|
|
319
319
|
};
|
|
320
|
-
_context4.next =
|
|
320
|
+
_context4.next = 1;
|
|
321
321
|
return http.get("".concat(_this.urlPath, "/requests"), headers);
|
|
322
|
-
case
|
|
322
|
+
case 1:
|
|
323
323
|
response = _context4.sent;
|
|
324
324
|
if (!response.data) {
|
|
325
|
-
_context4.next =
|
|
325
|
+
_context4.next = 2;
|
|
326
326
|
break;
|
|
327
327
|
}
|
|
328
328
|
return _context4.abrupt("return", response.data);
|
|
329
|
-
case
|
|
329
|
+
case 2:
|
|
330
330
|
throw error(response);
|
|
331
|
-
case
|
|
332
|
-
_context4.next =
|
|
331
|
+
case 3:
|
|
332
|
+
_context4.next = 5;
|
|
333
333
|
break;
|
|
334
|
-
case
|
|
335
|
-
_context4.prev =
|
|
336
|
-
|
|
337
|
-
throw error(
|
|
338
|
-
case
|
|
334
|
+
case 4:
|
|
335
|
+
_context4.prev = 4;
|
|
336
|
+
_t4 = _context4["catch"](0);
|
|
337
|
+
throw error(_t4);
|
|
338
|
+
case 5:
|
|
339
339
|
case "end":
|
|
340
340
|
return _context4.stop();
|
|
341
341
|
}
|
|
342
|
-
}, _callee4, null, [[0,
|
|
342
|
+
}, _callee4, null, [[0, 4]]);
|
|
343
343
|
}));
|
|
344
344
|
/**
|
|
345
345
|
* @description The App authorization allow to authorize app for specific scope.
|
|
@@ -363,8 +363,8 @@ export function App(http, data) {
|
|
|
363
363
|
*/
|
|
364
364
|
this.authorize = /*#__PURE__*/function () {
|
|
365
365
|
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref8) {
|
|
366
|
-
var responseType, clientId, redirectUri, scope, state, headers, content, response;
|
|
367
|
-
return _regeneratorRuntime.wrap(function
|
|
366
|
+
var responseType, clientId, redirectUri, scope, state, headers, content, response, _t5;
|
|
367
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
368
368
|
while (1) switch (_context5.prev = _context5.next) {
|
|
369
369
|
case 0:
|
|
370
370
|
responseType = _ref8.responseType, clientId = _ref8.clientId, redirectUri = _ref8.redirectUri, scope = _ref8.scope, state = _ref8.state;
|
|
@@ -381,29 +381,29 @@ export function App(http, data) {
|
|
|
381
381
|
if (state) {
|
|
382
382
|
content.state = state;
|
|
383
383
|
}
|
|
384
|
-
_context5.next =
|
|
384
|
+
_context5.next = 2;
|
|
385
385
|
return http.post("".concat(_this.urlPath, "/authorize"), content, headers);
|
|
386
|
-
case
|
|
386
|
+
case 2:
|
|
387
387
|
response = _context5.sent;
|
|
388
388
|
if (!response.data) {
|
|
389
|
-
_context5.next =
|
|
389
|
+
_context5.next = 3;
|
|
390
390
|
break;
|
|
391
391
|
}
|
|
392
392
|
return _context5.abrupt("return", response.data);
|
|
393
|
-
case
|
|
393
|
+
case 3:
|
|
394
394
|
throw error(response);
|
|
395
|
-
case
|
|
396
|
-
_context5.next =
|
|
395
|
+
case 4:
|
|
396
|
+
_context5.next = 6;
|
|
397
397
|
break;
|
|
398
|
-
case
|
|
399
|
-
_context5.prev =
|
|
400
|
-
|
|
401
|
-
throw error(
|
|
402
|
-
case
|
|
398
|
+
case 5:
|
|
399
|
+
_context5.prev = 5;
|
|
400
|
+
_t5 = _context5["catch"](1);
|
|
401
|
+
throw error(_t5);
|
|
402
|
+
case 6:
|
|
403
403
|
case "end":
|
|
404
404
|
return _context5.stop();
|
|
405
405
|
}
|
|
406
|
-
}, _callee5, null, [[1,
|
|
406
|
+
}, _callee5, null, [[1, 5]]);
|
|
407
407
|
}));
|
|
408
408
|
return function (_x4) {
|
|
409
409
|
return _ref9.apply(this, arguments);
|
|
@@ -441,37 +441,37 @@ export function App(http, data) {
|
|
|
441
441
|
*
|
|
442
442
|
*/
|
|
443
443
|
this.listInstallations = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
444
|
-
var headers, response;
|
|
445
|
-
return _regeneratorRuntime.wrap(function
|
|
444
|
+
var headers, response, _t6;
|
|
445
|
+
return _regeneratorRuntime.wrap(function (_context6) {
|
|
446
446
|
while (1) switch (_context6.prev = _context6.next) {
|
|
447
447
|
case 0:
|
|
448
448
|
_context6.prev = 0;
|
|
449
449
|
headers = {
|
|
450
450
|
headers: _objectSpread(_objectSpread({}, cloneDeep(_this.params)), cloneDeep(_this.headers))
|
|
451
451
|
};
|
|
452
|
-
_context6.next =
|
|
452
|
+
_context6.next = 1;
|
|
453
453
|
return http.get("manifests/".concat(_this.uid, "/installations"), headers);
|
|
454
|
-
case
|
|
454
|
+
case 1:
|
|
455
455
|
response = _context6.sent;
|
|
456
456
|
if (!response.data) {
|
|
457
|
-
_context6.next =
|
|
457
|
+
_context6.next = 2;
|
|
458
458
|
break;
|
|
459
459
|
}
|
|
460
460
|
return _context6.abrupt("return", new ContentstackCollection(response, http, _this.stackHeaders, InstallationCollection));
|
|
461
|
-
case
|
|
461
|
+
case 2:
|
|
462
462
|
throw error(response);
|
|
463
|
-
case
|
|
464
|
-
_context6.next =
|
|
463
|
+
case 3:
|
|
464
|
+
_context6.next = 5;
|
|
465
465
|
break;
|
|
466
|
-
case
|
|
467
|
-
_context6.prev =
|
|
468
|
-
|
|
469
|
-
throw error(
|
|
470
|
-
case
|
|
466
|
+
case 4:
|
|
467
|
+
_context6.prev = 4;
|
|
468
|
+
_t6 = _context6["catch"](0);
|
|
469
|
+
throw error(_t6);
|
|
470
|
+
case 5:
|
|
471
471
|
case "end":
|
|
472
472
|
return _context6.stop();
|
|
473
473
|
}
|
|
474
|
-
}, _callee6, null, [[0,
|
|
474
|
+
}, _callee6, null, [[0, 4]]);
|
|
475
475
|
}));
|
|
476
476
|
} else {
|
|
477
477
|
/**
|