@contentstack/marketplace-sdk 1.0.2 → 1.1.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 +3 -0
- package/dist/es-modules/marketplace/app/index.js +110 -53
- package/dist/es5/marketplace/app/index.js +110 -53
- 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 +1 -1
- package/types/marketplace/app/index.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [v1.1.0](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.1.0) (2024-06-05)
|
|
4
|
+
- added reinstall app function
|
|
5
|
+
|
|
3
6
|
## [v1.0.2](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.0.2) (2024-01-16)
|
|
4
7
|
- Updated dependencies
|
|
5
8
|
|
|
@@ -182,20 +182,20 @@ export function App(http, data) {
|
|
|
182
182
|
}();
|
|
183
183
|
|
|
184
184
|
/**
|
|
185
|
-
* @description The
|
|
185
|
+
* @description The reinstall call is used to initiate the reinstallation of the app
|
|
186
186
|
* @memberof App
|
|
187
|
-
* @func
|
|
188
|
-
* @param {String} param.targetType - The target on which app needs to be
|
|
189
|
-
* @param {String} param.targetUid - The uid of the target, on which the app will be
|
|
190
|
-
* @returns Promise<
|
|
187
|
+
* @func reinstall
|
|
188
|
+
* @param {String} param.targetType - The target on which app needs to be reinstalled, stack or ogranization.
|
|
189
|
+
* @param {String} param.targetUid - The uid of the target, on which the app will be reinstalled
|
|
190
|
+
* @returns Promise<Reinstallation>
|
|
191
191
|
*
|
|
192
192
|
* @example
|
|
193
193
|
* import * as contentstack from '@contentstack/marketplace'
|
|
194
194
|
* const client = contentstack.client({ authtoken: 'TOKEN'})
|
|
195
|
-
* client.marketplace('organization_uid').app('manifest_uid').
|
|
196
|
-
* .then((
|
|
195
|
+
* client.marketplace('organization_uid').app('manifest_uid').reinstall({ targetUid: 'STACK_API_KEY', targetType: 'stack' })
|
|
196
|
+
* .then((reinstallation) => console.log(installation))
|
|
197
197
|
*/
|
|
198
|
-
this.
|
|
198
|
+
this.reinstall = /*#__PURE__*/function () {
|
|
199
199
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
|
|
200
200
|
var targetUid, targetType, headers, response;
|
|
201
201
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
@@ -237,6 +237,63 @@ export function App(http, data) {
|
|
|
237
237
|
return _ref4.apply(this, arguments);
|
|
238
238
|
};
|
|
239
239
|
}();
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @description The upgrade call is used to upgrade the installation of an app
|
|
243
|
+
* @memberof App
|
|
244
|
+
* @func upgrade
|
|
245
|
+
* @param {String} param.targetType - The target on which app needs to be installed, stack or ogranization.
|
|
246
|
+
* @param {String} param.targetUid - The uid of the target, on which the app will be installed
|
|
247
|
+
* @returns Promise<Installation>
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
* import * as contentstack from '@contentstack/marketplace'
|
|
251
|
+
* const client = contentstack.client({ authtoken: 'TOKEN'})
|
|
252
|
+
* client.marketplace('organization_uid').app('manifest_uid').install({ targetUid: 'STACK_API_KEY', targetType: 'stack' })
|
|
253
|
+
* .then((installation) => console.log(installation))
|
|
254
|
+
*/
|
|
255
|
+
this.upgrade = /*#__PURE__*/function () {
|
|
256
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref5) {
|
|
257
|
+
var targetUid, targetType, headers, response;
|
|
258
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
259
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
260
|
+
case 0:
|
|
261
|
+
targetUid = _ref5.targetUid, targetType = _ref5.targetType;
|
|
262
|
+
_context3.prev = 1;
|
|
263
|
+
headers = {
|
|
264
|
+
headers: _objectSpread({}, cloneDeep(_this.params))
|
|
265
|
+
} || {};
|
|
266
|
+
_context3.next = 5;
|
|
267
|
+
return http.put("".concat(_this.urlPath, "/reinstall"), {
|
|
268
|
+
target_type: targetType,
|
|
269
|
+
target_uid: targetUid
|
|
270
|
+
}, headers);
|
|
271
|
+
case 5:
|
|
272
|
+
response = _context3.sent;
|
|
273
|
+
if (!response.data) {
|
|
274
|
+
_context3.next = 10;
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
return _context3.abrupt("return", new Installation(http, response.data, _this.params) || {});
|
|
278
|
+
case 10:
|
|
279
|
+
throw error(response);
|
|
280
|
+
case 11:
|
|
281
|
+
_context3.next = 16;
|
|
282
|
+
break;
|
|
283
|
+
case 13:
|
|
284
|
+
_context3.prev = 13;
|
|
285
|
+
_context3.t0 = _context3["catch"](1);
|
|
286
|
+
throw error(_context3.t0);
|
|
287
|
+
case 16:
|
|
288
|
+
case "end":
|
|
289
|
+
return _context3.stop();
|
|
290
|
+
}
|
|
291
|
+
}, _callee3, null, [[1, 13]]);
|
|
292
|
+
}));
|
|
293
|
+
return function (_x3) {
|
|
294
|
+
return _ref6.apply(this, arguments);
|
|
295
|
+
};
|
|
296
|
+
}();
|
|
240
297
|
/**
|
|
241
298
|
* @description The GET app requests of an app call is used to retrieve all requests of an app.
|
|
242
299
|
* @returns Promise<Response>
|
|
@@ -251,38 +308,38 @@ export function App(http, data) {
|
|
|
251
308
|
* .then((response) => console.log(response))
|
|
252
309
|
*
|
|
253
310
|
*/
|
|
254
|
-
this.getRequests = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
311
|
+
this.getRequests = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
255
312
|
var headers, response;
|
|
256
|
-
return _regeneratorRuntime.wrap(function
|
|
257
|
-
while (1) switch (
|
|
313
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
314
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
258
315
|
case 0:
|
|
259
|
-
|
|
316
|
+
_context4.prev = 0;
|
|
260
317
|
headers = {
|
|
261
318
|
headers: _objectSpread({}, cloneDeep(_this.params))
|
|
262
319
|
};
|
|
263
|
-
|
|
320
|
+
_context4.next = 4;
|
|
264
321
|
return http.get("".concat(_this.urlPath, "/requests"), headers);
|
|
265
322
|
case 4:
|
|
266
|
-
response =
|
|
323
|
+
response = _context4.sent;
|
|
267
324
|
if (!response.data) {
|
|
268
|
-
|
|
325
|
+
_context4.next = 9;
|
|
269
326
|
break;
|
|
270
327
|
}
|
|
271
|
-
return
|
|
328
|
+
return _context4.abrupt("return", response.data);
|
|
272
329
|
case 9:
|
|
273
330
|
throw error(response);
|
|
274
331
|
case 10:
|
|
275
|
-
|
|
332
|
+
_context4.next = 15;
|
|
276
333
|
break;
|
|
277
334
|
case 12:
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
throw error(
|
|
335
|
+
_context4.prev = 12;
|
|
336
|
+
_context4.t0 = _context4["catch"](0);
|
|
337
|
+
throw error(_context4.t0);
|
|
281
338
|
case 15:
|
|
282
339
|
case "end":
|
|
283
|
-
return
|
|
340
|
+
return _context4.stop();
|
|
284
341
|
}
|
|
285
|
-
},
|
|
342
|
+
}, _callee4, null, [[0, 12]]);
|
|
286
343
|
}));
|
|
287
344
|
/**
|
|
288
345
|
* @description The App authorization allow to authorize app for specific scope.
|
|
@@ -305,13 +362,13 @@ export function App(http, data) {
|
|
|
305
362
|
*
|
|
306
363
|
*/
|
|
307
364
|
this.authorize = /*#__PURE__*/function () {
|
|
308
|
-
var
|
|
365
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref8) {
|
|
309
366
|
var responseType, clientId, redirectUri, scope, state, headers, content, response;
|
|
310
|
-
return _regeneratorRuntime.wrap(function
|
|
311
|
-
while (1) switch (
|
|
367
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
368
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
312
369
|
case 0:
|
|
313
|
-
responseType =
|
|
314
|
-
|
|
370
|
+
responseType = _ref8.responseType, clientId = _ref8.clientId, redirectUri = _ref8.redirectUri, scope = _ref8.scope, state = _ref8.state;
|
|
371
|
+
_context5.prev = 1;
|
|
315
372
|
headers = {
|
|
316
373
|
headers: _objectSpread({}, cloneDeep(_this.params))
|
|
317
374
|
};
|
|
@@ -324,32 +381,32 @@ export function App(http, data) {
|
|
|
324
381
|
if (state) {
|
|
325
382
|
content.state = state;
|
|
326
383
|
}
|
|
327
|
-
|
|
384
|
+
_context5.next = 7;
|
|
328
385
|
return http.post("".concat(_this.urlPath, "/authorize"), content, headers);
|
|
329
386
|
case 7:
|
|
330
|
-
response =
|
|
387
|
+
response = _context5.sent;
|
|
331
388
|
if (!response.data) {
|
|
332
|
-
|
|
389
|
+
_context5.next = 12;
|
|
333
390
|
break;
|
|
334
391
|
}
|
|
335
|
-
return
|
|
392
|
+
return _context5.abrupt("return", response.data);
|
|
336
393
|
case 12:
|
|
337
394
|
throw error(response);
|
|
338
395
|
case 13:
|
|
339
|
-
|
|
396
|
+
_context5.next = 18;
|
|
340
397
|
break;
|
|
341
398
|
case 15:
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
throw error(
|
|
399
|
+
_context5.prev = 15;
|
|
400
|
+
_context5.t0 = _context5["catch"](1);
|
|
401
|
+
throw error(_context5.t0);
|
|
345
402
|
case 18:
|
|
346
403
|
case "end":
|
|
347
|
-
return
|
|
404
|
+
return _context5.stop();
|
|
348
405
|
}
|
|
349
|
-
},
|
|
406
|
+
}, _callee5, null, [[1, 15]]);
|
|
350
407
|
}));
|
|
351
|
-
return function (
|
|
352
|
-
return
|
|
408
|
+
return function (_x4) {
|
|
409
|
+
return _ref9.apply(this, arguments);
|
|
353
410
|
};
|
|
354
411
|
}();
|
|
355
412
|
/**
|
|
@@ -383,38 +440,38 @@ export function App(http, data) {
|
|
|
383
440
|
* .then((collection) => console.log(collection))
|
|
384
441
|
*
|
|
385
442
|
*/
|
|
386
|
-
this.listInstallations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
443
|
+
this.listInstallations = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
387
444
|
var headers, response;
|
|
388
|
-
return _regeneratorRuntime.wrap(function
|
|
389
|
-
while (1) switch (
|
|
445
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
446
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
390
447
|
case 0:
|
|
391
|
-
|
|
448
|
+
_context6.prev = 0;
|
|
392
449
|
headers = {
|
|
393
450
|
headers: _objectSpread(_objectSpread({}, cloneDeep(_this.params)), cloneDeep(_this.headers))
|
|
394
451
|
};
|
|
395
|
-
|
|
452
|
+
_context6.next = 4;
|
|
396
453
|
return http.get("manifests/".concat(_this.uid, "/installations"), headers);
|
|
397
454
|
case 4:
|
|
398
|
-
response =
|
|
455
|
+
response = _context6.sent;
|
|
399
456
|
if (!response.data) {
|
|
400
|
-
|
|
457
|
+
_context6.next = 9;
|
|
401
458
|
break;
|
|
402
459
|
}
|
|
403
|
-
return
|
|
460
|
+
return _context6.abrupt("return", new ContentstackCollection(response, http, _this.stackHeaders, InstallationCollection));
|
|
404
461
|
case 9:
|
|
405
462
|
throw error(response);
|
|
406
463
|
case 10:
|
|
407
|
-
|
|
464
|
+
_context6.next = 15;
|
|
408
465
|
break;
|
|
409
466
|
case 12:
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
throw error(
|
|
467
|
+
_context6.prev = 12;
|
|
468
|
+
_context6.t0 = _context6["catch"](0);
|
|
469
|
+
throw error(_context6.t0);
|
|
413
470
|
case 15:
|
|
414
471
|
case "end":
|
|
415
|
-
return
|
|
472
|
+
return _context6.stop();
|
|
416
473
|
}
|
|
417
|
-
},
|
|
474
|
+
}, _callee6, null, [[0, 12]]);
|
|
418
475
|
}));
|
|
419
476
|
} else {
|
|
420
477
|
/**
|
|
@@ -195,20 +195,20 @@ function App(http, data) {
|
|
|
195
195
|
}();
|
|
196
196
|
|
|
197
197
|
/**
|
|
198
|
-
* @description The
|
|
198
|
+
* @description The reinstall call is used to initiate the reinstallation of the app
|
|
199
199
|
* @memberof App
|
|
200
|
-
* @func
|
|
201
|
-
* @param {String} param.targetType - The target on which app needs to be
|
|
202
|
-
* @param {String} param.targetUid - The uid of the target, on which the app will be
|
|
203
|
-
* @returns Promise<
|
|
200
|
+
* @func reinstall
|
|
201
|
+
* @param {String} param.targetType - The target on which app needs to be reinstalled, stack or ogranization.
|
|
202
|
+
* @param {String} param.targetUid - The uid of the target, on which the app will be reinstalled
|
|
203
|
+
* @returns Promise<Reinstallation>
|
|
204
204
|
*
|
|
205
205
|
* @example
|
|
206
206
|
* import * as contentstack from '@contentstack/marketplace'
|
|
207
207
|
* const client = contentstack.client({ authtoken: 'TOKEN'})
|
|
208
|
-
* client.marketplace('organization_uid').app('manifest_uid').
|
|
209
|
-
* .then((
|
|
208
|
+
* client.marketplace('organization_uid').app('manifest_uid').reinstall({ targetUid: 'STACK_API_KEY', targetType: 'stack' })
|
|
209
|
+
* .then((reinstallation) => console.log(installation))
|
|
210
210
|
*/
|
|
211
|
-
this.
|
|
211
|
+
this.reinstall = /*#__PURE__*/function () {
|
|
212
212
|
var _ref4 = (0, _asyncToGenerator3["default"])( /*#__PURE__*/_regenerator2["default"].mark(function _callee2(_ref3) {
|
|
213
213
|
var targetUid, targetType, headers, response;
|
|
214
214
|
return _regenerator2["default"].wrap(function _callee2$(_context2) {
|
|
@@ -250,6 +250,63 @@ function App(http, data) {
|
|
|
250
250
|
return _ref4.apply(this, arguments);
|
|
251
251
|
};
|
|
252
252
|
}();
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* @description The upgrade call is used to upgrade the installation of an app
|
|
256
|
+
* @memberof App
|
|
257
|
+
* @func upgrade
|
|
258
|
+
* @param {String} param.targetType - The target on which app needs to be installed, stack or ogranization.
|
|
259
|
+
* @param {String} param.targetUid - The uid of the target, on which the app will be installed
|
|
260
|
+
* @returns Promise<Installation>
|
|
261
|
+
*
|
|
262
|
+
* @example
|
|
263
|
+
* import * as contentstack from '@contentstack/marketplace'
|
|
264
|
+
* const client = contentstack.client({ authtoken: 'TOKEN'})
|
|
265
|
+
* client.marketplace('organization_uid').app('manifest_uid').install({ targetUid: 'STACK_API_KEY', targetType: 'stack' })
|
|
266
|
+
* .then((installation) => console.log(installation))
|
|
267
|
+
*/
|
|
268
|
+
this.upgrade = /*#__PURE__*/function () {
|
|
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 _callee3$(_context3) {
|
|
272
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
273
|
+
case 0:
|
|
274
|
+
targetUid = _ref5.targetUid, targetType = _ref5.targetType;
|
|
275
|
+
_context3.prev = 1;
|
|
276
|
+
headers = {
|
|
277
|
+
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
278
|
+
} || {};
|
|
279
|
+
_context3.next = 5;
|
|
280
|
+
return http.put("".concat(_this.urlPath, "/reinstall"), {
|
|
281
|
+
target_type: targetType,
|
|
282
|
+
target_uid: targetUid
|
|
283
|
+
}, headers);
|
|
284
|
+
case 5:
|
|
285
|
+
response = _context3.sent;
|
|
286
|
+
if (!response.data) {
|
|
287
|
+
_context3.next = 10;
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
return _context3.abrupt("return", new _installation.Installation(http, response.data, _this.params) || {});
|
|
291
|
+
case 10:
|
|
292
|
+
throw (0, _contentstackError2["default"])(response);
|
|
293
|
+
case 11:
|
|
294
|
+
_context3.next = 16;
|
|
295
|
+
break;
|
|
296
|
+
case 13:
|
|
297
|
+
_context3.prev = 13;
|
|
298
|
+
_context3.t0 = _context3["catch"](1);
|
|
299
|
+
throw (0, _contentstackError2["default"])(_context3.t0);
|
|
300
|
+
case 16:
|
|
301
|
+
case "end":
|
|
302
|
+
return _context3.stop();
|
|
303
|
+
}
|
|
304
|
+
}, _callee3, null, [[1, 13]]);
|
|
305
|
+
}));
|
|
306
|
+
return function (_x3) {
|
|
307
|
+
return _ref6.apply(this, arguments);
|
|
308
|
+
};
|
|
309
|
+
}();
|
|
253
310
|
/**
|
|
254
311
|
* @description The GET app requests of an app call is used to retrieve all requests of an app.
|
|
255
312
|
* @returns Promise<Response>
|
|
@@ -264,38 +321,38 @@ function App(http, data) {
|
|
|
264
321
|
* .then((response) => console.log(response))
|
|
265
322
|
*
|
|
266
323
|
*/
|
|
267
|
-
this.getRequests = /*#__PURE__*/(0, _asyncToGenerator3["default"])( /*#__PURE__*/_regenerator2["default"].mark(function
|
|
324
|
+
this.getRequests = /*#__PURE__*/(0, _asyncToGenerator3["default"])( /*#__PURE__*/_regenerator2["default"].mark(function _callee4() {
|
|
268
325
|
var headers, response;
|
|
269
|
-
return _regenerator2["default"].wrap(function
|
|
270
|
-
while (1) switch (
|
|
326
|
+
return _regenerator2["default"].wrap(function _callee4$(_context4) {
|
|
327
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
271
328
|
case 0:
|
|
272
|
-
|
|
329
|
+
_context4.prev = 0;
|
|
273
330
|
headers = {
|
|
274
331
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
275
332
|
};
|
|
276
|
-
|
|
333
|
+
_context4.next = 4;
|
|
277
334
|
return http.get("".concat(_this.urlPath, "/requests"), headers);
|
|
278
335
|
case 4:
|
|
279
|
-
response =
|
|
336
|
+
response = _context4.sent;
|
|
280
337
|
if (!response.data) {
|
|
281
|
-
|
|
338
|
+
_context4.next = 9;
|
|
282
339
|
break;
|
|
283
340
|
}
|
|
284
|
-
return
|
|
341
|
+
return _context4.abrupt("return", response.data);
|
|
285
342
|
case 9:
|
|
286
343
|
throw (0, _contentstackError2["default"])(response);
|
|
287
344
|
case 10:
|
|
288
|
-
|
|
345
|
+
_context4.next = 15;
|
|
289
346
|
break;
|
|
290
347
|
case 12:
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
throw (0, _contentstackError2["default"])(
|
|
348
|
+
_context4.prev = 12;
|
|
349
|
+
_context4.t0 = _context4["catch"](0);
|
|
350
|
+
throw (0, _contentstackError2["default"])(_context4.t0);
|
|
294
351
|
case 15:
|
|
295
352
|
case "end":
|
|
296
|
-
return
|
|
353
|
+
return _context4.stop();
|
|
297
354
|
}
|
|
298
|
-
},
|
|
355
|
+
}, _callee4, null, [[0, 12]]);
|
|
299
356
|
}));
|
|
300
357
|
/**
|
|
301
358
|
* @description The App authorization allow to authorize app for specific scope.
|
|
@@ -318,13 +375,13 @@ function App(http, data) {
|
|
|
318
375
|
*
|
|
319
376
|
*/
|
|
320
377
|
this.authorize = /*#__PURE__*/function () {
|
|
321
|
-
var
|
|
378
|
+
var _ref9 = (0, _asyncToGenerator3["default"])( /*#__PURE__*/_regenerator2["default"].mark(function _callee5(_ref8) {
|
|
322
379
|
var responseType, clientId, redirectUri, scope, state, headers, content, response;
|
|
323
|
-
return _regenerator2["default"].wrap(function
|
|
324
|
-
while (1) switch (
|
|
380
|
+
return _regenerator2["default"].wrap(function _callee5$(_context5) {
|
|
381
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
325
382
|
case 0:
|
|
326
|
-
responseType =
|
|
327
|
-
|
|
383
|
+
responseType = _ref8.responseType, clientId = _ref8.clientId, redirectUri = _ref8.redirectUri, scope = _ref8.scope, state = _ref8.state;
|
|
384
|
+
_context5.prev = 1;
|
|
328
385
|
headers = {
|
|
329
386
|
headers: _objectSpread({}, (0, _cloneDeep2["default"])(_this.params))
|
|
330
387
|
};
|
|
@@ -337,32 +394,32 @@ function App(http, data) {
|
|
|
337
394
|
if (state) {
|
|
338
395
|
content.state = state;
|
|
339
396
|
}
|
|
340
|
-
|
|
397
|
+
_context5.next = 7;
|
|
341
398
|
return http.post("".concat(_this.urlPath, "/authorize"), content, headers);
|
|
342
399
|
case 7:
|
|
343
|
-
response =
|
|
400
|
+
response = _context5.sent;
|
|
344
401
|
if (!response.data) {
|
|
345
|
-
|
|
402
|
+
_context5.next = 12;
|
|
346
403
|
break;
|
|
347
404
|
}
|
|
348
|
-
return
|
|
405
|
+
return _context5.abrupt("return", response.data);
|
|
349
406
|
case 12:
|
|
350
407
|
throw (0, _contentstackError2["default"])(response);
|
|
351
408
|
case 13:
|
|
352
|
-
|
|
409
|
+
_context5.next = 18;
|
|
353
410
|
break;
|
|
354
411
|
case 15:
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
throw (0, _contentstackError2["default"])(
|
|
412
|
+
_context5.prev = 15;
|
|
413
|
+
_context5.t0 = _context5["catch"](1);
|
|
414
|
+
throw (0, _contentstackError2["default"])(_context5.t0);
|
|
358
415
|
case 18:
|
|
359
416
|
case "end":
|
|
360
|
-
return
|
|
417
|
+
return _context5.stop();
|
|
361
418
|
}
|
|
362
|
-
},
|
|
419
|
+
}, _callee5, null, [[1, 15]]);
|
|
363
420
|
}));
|
|
364
|
-
return function (
|
|
365
|
-
return
|
|
421
|
+
return function (_x4) {
|
|
422
|
+
return _ref9.apply(this, arguments);
|
|
366
423
|
};
|
|
367
424
|
}();
|
|
368
425
|
/**
|
|
@@ -396,38 +453,38 @@ function App(http, data) {
|
|
|
396
453
|
* .then((collection) => console.log(collection))
|
|
397
454
|
*
|
|
398
455
|
*/
|
|
399
|
-
this.listInstallations = /*#__PURE__*/(0, _asyncToGenerator3["default"])( /*#__PURE__*/_regenerator2["default"].mark(function
|
|
456
|
+
this.listInstallations = /*#__PURE__*/(0, _asyncToGenerator3["default"])( /*#__PURE__*/_regenerator2["default"].mark(function _callee6() {
|
|
400
457
|
var headers, response;
|
|
401
|
-
return _regenerator2["default"].wrap(function
|
|
402
|
-
while (1) switch (
|
|
458
|
+
return _regenerator2["default"].wrap(function _callee6$(_context6) {
|
|
459
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
403
460
|
case 0:
|
|
404
|
-
|
|
461
|
+
_context6.prev = 0;
|
|
405
462
|
headers = {
|
|
406
463
|
headers: _objectSpread(_objectSpread({}, (0, _cloneDeep2["default"])(_this.params)), (0, _cloneDeep2["default"])(_this.headers))
|
|
407
464
|
};
|
|
408
|
-
|
|
465
|
+
_context6.next = 4;
|
|
409
466
|
return http.get("manifests/".concat(_this.uid, "/installations"), headers);
|
|
410
467
|
case 4:
|
|
411
|
-
response =
|
|
468
|
+
response = _context6.sent;
|
|
412
469
|
if (!response.data) {
|
|
413
|
-
|
|
470
|
+
_context6.next = 9;
|
|
414
471
|
break;
|
|
415
472
|
}
|
|
416
|
-
return
|
|
473
|
+
return _context6.abrupt("return", new _contentstackCollection2["default"](response, http, _this.stackHeaders, _installation.InstallationCollection));
|
|
417
474
|
case 9:
|
|
418
475
|
throw (0, _contentstackError2["default"])(response);
|
|
419
476
|
case 10:
|
|
420
|
-
|
|
477
|
+
_context6.next = 15;
|
|
421
478
|
break;
|
|
422
479
|
case 12:
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
throw (0, _contentstackError2["default"])(
|
|
480
|
+
_context6.prev = 12;
|
|
481
|
+
_context6.t0 = _context6["catch"](0);
|
|
482
|
+
throw (0, _contentstackError2["default"])(_context6.t0);
|
|
426
483
|
case 15:
|
|
427
484
|
case "end":
|
|
428
|
-
return
|
|
485
|
+
return _context6.stop();
|
|
429
486
|
}
|
|
430
|
-
},
|
|
487
|
+
}, _callee6, null, [[0, 12]]);
|
|
431
488
|
}));
|
|
432
489
|
} else {
|
|
433
490
|
/**
|