@contentstack/marketplace-sdk 1.2.8 → 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/CHANGELOG.md +7 -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 +16 -15
- 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 +16 -15
- 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/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
-
## [v1.2.8](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.2.
|
|
2
|
+
## [v1.2.8](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.2.9) (2024-08-04)
|
|
3
|
+
- Fix: Fixed the Linting issues
|
|
4
|
+
- Updated all the dependency to the latest version
|
|
5
|
+
- Added Pre-commit hook to run the snyk and talismand scans
|
|
6
|
+
|
|
7
|
+
## [v1.2.8](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.2.8) (2024-05-26)
|
|
3
8
|
- Fix: Added params support to getInstalledApps method for enhanced flexibility
|
|
4
9
|
|
|
5
|
-
## [v1.2.7](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.2.
|
|
10
|
+
## [v1.2.7](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.2.7) (2024-05-15)
|
|
6
11
|
- Fixed base URL path logic in contentstackClient to handle when region and host not provided
|
|
7
12
|
|
|
8
13
|
## [v1.2.6](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.2.6) (2024-03-03)
|
|
@@ -11,8 +11,8 @@ export var create = function create(_ref) {
|
|
|
11
11
|
params = _ref.params;
|
|
12
12
|
return /*#__PURE__*/function () {
|
|
13
13
|
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(data, param) {
|
|
14
|
-
var headers, response;
|
|
15
|
-
return _regeneratorRuntime.wrap(function
|
|
14
|
+
var headers, response, _t;
|
|
15
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
16
16
|
while (1) switch (_context.prev = _context.next) {
|
|
17
17
|
case 0:
|
|
18
18
|
headers = {
|
|
@@ -20,29 +20,29 @@ export var create = function create(_ref) {
|
|
|
20
20
|
params: _objectSpread({}, cloneDeep(param))
|
|
21
21
|
} || {};
|
|
22
22
|
_context.prev = 1;
|
|
23
|
-
_context.next =
|
|
23
|
+
_context.next = 2;
|
|
24
24
|
return http.post(this.urlPath, data, headers);
|
|
25
|
-
case
|
|
25
|
+
case 2:
|
|
26
26
|
response = _context.sent;
|
|
27
27
|
if (!response.data) {
|
|
28
|
-
_context.next =
|
|
28
|
+
_context.next = 3;
|
|
29
29
|
break;
|
|
30
30
|
}
|
|
31
31
|
return _context.abrupt("return", new this.constructor(http, parseData(response, this.stackHeaders, this.content_type_uid)));
|
|
32
|
-
case
|
|
32
|
+
case 3:
|
|
33
33
|
throw error(response);
|
|
34
|
-
case
|
|
35
|
-
_context.next =
|
|
34
|
+
case 4:
|
|
35
|
+
_context.next = 6;
|
|
36
36
|
break;
|
|
37
|
-
case
|
|
38
|
-
_context.prev =
|
|
39
|
-
|
|
40
|
-
throw error(
|
|
41
|
-
case
|
|
37
|
+
case 5:
|
|
38
|
+
_context.prev = 5;
|
|
39
|
+
_t = _context["catch"](1);
|
|
40
|
+
throw error(_t);
|
|
41
|
+
case 6:
|
|
42
42
|
case "end":
|
|
43
43
|
return _context.stop();
|
|
44
44
|
}
|
|
45
|
-
}, _callee, this, [[1,
|
|
45
|
+
}, _callee, this, [[1, 5]]);
|
|
46
46
|
}));
|
|
47
47
|
return function (_x, _x2) {
|
|
48
48
|
return _ref2.apply(this, arguments);
|
|
@@ -56,8 +56,9 @@ export var update = function update(http, type) {
|
|
|
56
56
|
updateData,
|
|
57
57
|
json,
|
|
58
58
|
response,
|
|
59
|
-
_args2 = arguments
|
|
60
|
-
|
|
59
|
+
_args2 = arguments,
|
|
60
|
+
_t2;
|
|
61
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
61
62
|
while (1) switch (_context2.prev = _context2.next) {
|
|
62
63
|
case 0:
|
|
63
64
|
param = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {};
|
|
@@ -79,33 +80,33 @@ export var update = function update(http, type) {
|
|
|
79
80
|
} else {
|
|
80
81
|
updateData = json;
|
|
81
82
|
}
|
|
82
|
-
_context2.prev =
|
|
83
|
-
_context2.next =
|
|
83
|
+
_context2.prev = 1;
|
|
84
|
+
_context2.next = 2;
|
|
84
85
|
return http.put(this.urlPath, updateData, {
|
|
85
86
|
headers: _objectSpread(_objectSpread({}, cloneDeep(this.stackHeaders)), cloneDeep(params)),
|
|
86
87
|
params: _objectSpread({}, cloneDeep(param))
|
|
87
88
|
});
|
|
88
|
-
case
|
|
89
|
+
case 2:
|
|
89
90
|
response = _context2.sent;
|
|
90
91
|
if (!response.data) {
|
|
91
|
-
_context2.next =
|
|
92
|
+
_context2.next = 3;
|
|
92
93
|
break;
|
|
93
94
|
}
|
|
94
95
|
return _context2.abrupt("return", new this.constructor(http, parseData(response, this.stackHeaders, this.content_type_uid)));
|
|
95
|
-
case
|
|
96
|
+
case 3:
|
|
96
97
|
throw error(response);
|
|
97
|
-
case
|
|
98
|
-
_context2.next =
|
|
98
|
+
case 4:
|
|
99
|
+
_context2.next = 6;
|
|
99
100
|
break;
|
|
100
|
-
case
|
|
101
|
-
_context2.prev =
|
|
102
|
-
|
|
103
|
-
throw error(
|
|
104
|
-
case
|
|
101
|
+
case 5:
|
|
102
|
+
_context2.prev = 5;
|
|
103
|
+
_t2 = _context2["catch"](1);
|
|
104
|
+
throw error(_t2);
|
|
105
|
+
case 6:
|
|
105
106
|
case "end":
|
|
106
107
|
return _context2.stop();
|
|
107
108
|
}
|
|
108
|
-
}, _callee2, this, [[
|
|
109
|
+
}, _callee2, this, [[1, 5]]);
|
|
109
110
|
}));
|
|
110
111
|
};
|
|
111
112
|
export var deleteEntity = function deleteEntity(http) {
|
|
@@ -115,8 +116,9 @@ export var deleteEntity = function deleteEntity(http) {
|
|
|
115
116
|
var param,
|
|
116
117
|
headers,
|
|
117
118
|
response,
|
|
118
|
-
_args3 = arguments
|
|
119
|
-
|
|
119
|
+
_args3 = arguments,
|
|
120
|
+
_t3;
|
|
121
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
120
122
|
while (1) switch (_context3.prev = _context3.next) {
|
|
121
123
|
case 0:
|
|
122
124
|
param = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
|
@@ -128,38 +130,38 @@ export var deleteEntity = function deleteEntity(http) {
|
|
|
128
130
|
if (force === true) {
|
|
129
131
|
headers.params.force = true;
|
|
130
132
|
}
|
|
131
|
-
_context3.next =
|
|
133
|
+
_context3.next = 2;
|
|
132
134
|
return http["delete"](this.urlPath, headers);
|
|
133
|
-
case
|
|
135
|
+
case 2:
|
|
134
136
|
response = _context3.sent;
|
|
135
137
|
if (!response.data) {
|
|
136
|
-
_context3.next =
|
|
138
|
+
_context3.next = 3;
|
|
137
139
|
break;
|
|
138
140
|
}
|
|
139
141
|
return _context3.abrupt("return", response.data);
|
|
140
|
-
case
|
|
142
|
+
case 3:
|
|
141
143
|
if (!(response.status >= 200 && response.status < 300)) {
|
|
142
|
-
_context3.next =
|
|
144
|
+
_context3.next = 4;
|
|
143
145
|
break;
|
|
144
146
|
}
|
|
145
147
|
return _context3.abrupt("return", {
|
|
146
148
|
status: response.status,
|
|
147
149
|
statusText: response.statusText
|
|
148
150
|
});
|
|
149
|
-
case
|
|
151
|
+
case 4:
|
|
150
152
|
throw error(response);
|
|
151
|
-
case
|
|
152
|
-
_context3.next =
|
|
153
|
+
case 5:
|
|
154
|
+
_context3.next = 7;
|
|
153
155
|
break;
|
|
154
|
-
case
|
|
155
|
-
_context3.prev =
|
|
156
|
-
|
|
157
|
-
throw error(
|
|
158
|
-
case
|
|
156
|
+
case 6:
|
|
157
|
+
_context3.prev = 6;
|
|
158
|
+
_t3 = _context3["catch"](1);
|
|
159
|
+
throw error(_t3);
|
|
160
|
+
case 7:
|
|
159
161
|
case "end":
|
|
160
162
|
return _context3.stop();
|
|
161
163
|
}
|
|
162
|
-
}, _callee3, this, [[1,
|
|
164
|
+
}, _callee3, this, [[1, 6]]);
|
|
163
165
|
}));
|
|
164
166
|
};
|
|
165
167
|
export var fetch = function fetch(http, type) {
|
|
@@ -168,8 +170,9 @@ export var fetch = function fetch(http, type) {
|
|
|
168
170
|
var param,
|
|
169
171
|
headers,
|
|
170
172
|
response,
|
|
171
|
-
_args4 = arguments
|
|
172
|
-
|
|
173
|
+
_args4 = arguments,
|
|
174
|
+
_t4;
|
|
175
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
173
176
|
while (1) switch (_context4.prev = _context4.next) {
|
|
174
177
|
case 0:
|
|
175
178
|
param = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
|
@@ -181,12 +184,12 @@ export var fetch = function fetch(http, type) {
|
|
|
181
184
|
if (this.organization_uid) {
|
|
182
185
|
headers.headers.organization_uid = this.organization_uid;
|
|
183
186
|
}
|
|
184
|
-
_context4.next =
|
|
187
|
+
_context4.next = 2;
|
|
185
188
|
return http.get(this.urlPath, headers);
|
|
186
|
-
case
|
|
189
|
+
case 2:
|
|
187
190
|
response = _context4.sent;
|
|
188
191
|
if (!response.data) {
|
|
189
|
-
_context4.next =
|
|
192
|
+
_context4.next = 3;
|
|
190
193
|
break;
|
|
191
194
|
}
|
|
192
195
|
if (type === 'entry') {
|
|
@@ -194,20 +197,20 @@ export var fetch = function fetch(http, type) {
|
|
|
194
197
|
response.data[type]['schema'] = response.data['schema'];
|
|
195
198
|
}
|
|
196
199
|
return _context4.abrupt("return", new this.constructor(http, parseData(response, this.stackHeaders, this.content_type_uid)));
|
|
197
|
-
case
|
|
200
|
+
case 3:
|
|
198
201
|
throw error(response);
|
|
199
|
-
case
|
|
200
|
-
_context4.next =
|
|
202
|
+
case 4:
|
|
203
|
+
_context4.next = 6;
|
|
201
204
|
break;
|
|
202
|
-
case
|
|
203
|
-
_context4.prev =
|
|
204
|
-
|
|
205
|
-
throw error(
|
|
206
|
-
case
|
|
205
|
+
case 5:
|
|
206
|
+
_context4.prev = 5;
|
|
207
|
+
_t4 = _context4["catch"](1);
|
|
208
|
+
throw error(_t4);
|
|
209
|
+
case 6:
|
|
207
210
|
case "end":
|
|
208
211
|
return _context4.stop();
|
|
209
212
|
}
|
|
210
|
-
}, _callee4, this, [[1,
|
|
213
|
+
}, _callee4, this, [[1, 5]]);
|
|
211
214
|
}));
|
|
212
215
|
};
|
|
213
216
|
export var fetchAll = function fetchAll(http, wrapperCollection) {
|
|
@@ -216,8 +219,9 @@ export var fetchAll = function fetchAll(http, wrapperCollection) {
|
|
|
216
219
|
var param,
|
|
217
220
|
headers,
|
|
218
221
|
response,
|
|
219
|
-
_args5 = arguments
|
|
220
|
-
|
|
222
|
+
_args5 = arguments,
|
|
223
|
+
_t5;
|
|
224
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
221
225
|
while (1) switch (_context5.prev = _context5.next) {
|
|
222
226
|
case 0:
|
|
223
227
|
param = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
|
@@ -225,30 +229,30 @@ export var fetchAll = function fetchAll(http, wrapperCollection) {
|
|
|
225
229
|
headers: _objectSpread(_objectSpread({}, cloneDeep(this.stackHeaders)), cloneDeep(params)),
|
|
226
230
|
params: _objectSpread({}, cloneDeep(param))
|
|
227
231
|
} || {};
|
|
228
|
-
_context5.prev =
|
|
229
|
-
_context5.next =
|
|
232
|
+
_context5.prev = 1;
|
|
233
|
+
_context5.next = 2;
|
|
230
234
|
return http.get(this.urlPath, headers);
|
|
231
|
-
case
|
|
235
|
+
case 2:
|
|
232
236
|
response = _context5.sent;
|
|
233
237
|
if (!response.data) {
|
|
234
|
-
_context5.next =
|
|
238
|
+
_context5.next = 3;
|
|
235
239
|
break;
|
|
236
240
|
}
|
|
237
241
|
return _context5.abrupt("return", new ContentstackCollection(response, http, this.stackHeaders, wrapperCollection));
|
|
238
|
-
case
|
|
242
|
+
case 3:
|
|
239
243
|
throw error(response);
|
|
240
|
-
case
|
|
241
|
-
_context5.next =
|
|
244
|
+
case 4:
|
|
245
|
+
_context5.next = 6;
|
|
242
246
|
break;
|
|
243
|
-
case
|
|
244
|
-
_context5.prev =
|
|
245
|
-
|
|
246
|
-
throw error(
|
|
247
|
-
case
|
|
247
|
+
case 5:
|
|
248
|
+
_context5.prev = 5;
|
|
249
|
+
_t5 = _context5["catch"](1);
|
|
250
|
+
throw error(_t5);
|
|
251
|
+
case 6:
|
|
248
252
|
case "end":
|
|
249
253
|
return _context5.stop();
|
|
250
254
|
}
|
|
251
|
-
}, _callee5, this, [[
|
|
255
|
+
}, _callee5, this, [[1, 5]]);
|
|
252
256
|
}));
|
|
253
257
|
};
|
|
254
258
|
export function parseData(response, stackHeaders, contentTypeUID) {
|
|
@@ -45,20 +45,20 @@ export function Deployment(http, data, params) {
|
|
|
45
45
|
* .then((data) => {})
|
|
46
46
|
*/
|
|
47
47
|
this.fetch = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
48
|
-
var headers, response, content;
|
|
49
|
-
return _regeneratorRuntime.wrap(function
|
|
48
|
+
var headers, response, content, _t;
|
|
49
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
50
50
|
while (1) switch (_context.prev = _context.next) {
|
|
51
51
|
case 0:
|
|
52
52
|
_context.prev = 0;
|
|
53
53
|
headers = {
|
|
54
54
|
headers: _objectSpread({}, cloneDeep(_this.params))
|
|
55
55
|
};
|
|
56
|
-
_context.next =
|
|
56
|
+
_context.next = 1;
|
|
57
57
|
return http.get("".concat(_this.urlPath), headers);
|
|
58
|
-
case
|
|
58
|
+
case 1:
|
|
59
59
|
response = _context.sent;
|
|
60
60
|
if (!response.data) {
|
|
61
|
-
_context.next =
|
|
61
|
+
_context.next = 2;
|
|
62
62
|
break;
|
|
63
63
|
}
|
|
64
64
|
content = response.data.data;
|
|
@@ -66,20 +66,20 @@ export function Deployment(http, data, params) {
|
|
|
66
66
|
data: content,
|
|
67
67
|
app_uid: data.app_uid
|
|
68
68
|
}, _this.params));
|
|
69
|
-
case
|
|
69
|
+
case 2:
|
|
70
70
|
throw error(response);
|
|
71
|
-
case
|
|
72
|
-
_context.next =
|
|
71
|
+
case 3:
|
|
72
|
+
_context.next = 5;
|
|
73
73
|
break;
|
|
74
|
-
case
|
|
75
|
-
_context.prev =
|
|
76
|
-
|
|
77
|
-
throw error(
|
|
78
|
-
case
|
|
74
|
+
case 4:
|
|
75
|
+
_context.prev = 4;
|
|
76
|
+
_t = _context["catch"](0);
|
|
77
|
+
throw error(_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
|
|
|
85
85
|
/**
|
|
@@ -95,37 +95,37 @@ export function Deployment(http, data, params) {
|
|
|
95
95
|
* .then((data) => {})
|
|
96
96
|
*/
|
|
97
97
|
this.logs = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
98
|
-
var headers, response;
|
|
99
|
-
return _regeneratorRuntime.wrap(function
|
|
98
|
+
var headers, response, _t2;
|
|
99
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
100
100
|
while (1) switch (_context2.prev = _context2.next) {
|
|
101
101
|
case 0:
|
|
102
102
|
_context2.prev = 0;
|
|
103
103
|
headers = {
|
|
104
104
|
headers: _objectSpread({}, cloneDeep(_this.params))
|
|
105
105
|
};
|
|
106
|
-
_context2.next =
|
|
106
|
+
_context2.next = 1;
|
|
107
107
|
return http.get("".concat(_this.urlPath, "/logs"), headers);
|
|
108
|
-
case
|
|
108
|
+
case 1:
|
|
109
109
|
response = _context2.sent;
|
|
110
110
|
if (!response.data) {
|
|
111
|
-
_context2.next =
|
|
111
|
+
_context2.next = 2;
|
|
112
112
|
break;
|
|
113
113
|
}
|
|
114
114
|
return _context2.abrupt("return", response.data.data);
|
|
115
|
-
case
|
|
115
|
+
case 2:
|
|
116
116
|
throw error(response);
|
|
117
|
-
case
|
|
118
|
-
_context2.next =
|
|
117
|
+
case 3:
|
|
118
|
+
_context2.next = 5;
|
|
119
119
|
break;
|
|
120
|
-
case
|
|
121
|
-
_context2.prev =
|
|
122
|
-
|
|
123
|
-
throw error(
|
|
124
|
-
case
|
|
120
|
+
case 4:
|
|
121
|
+
_context2.prev = 4;
|
|
122
|
+
_t2 = _context2["catch"](0);
|
|
123
|
+
throw error(_t2);
|
|
124
|
+
case 5:
|
|
125
125
|
case "end":
|
|
126
126
|
return _context2.stop();
|
|
127
127
|
}
|
|
128
|
-
}, _callee2, null, [[0,
|
|
128
|
+
}, _callee2, null, [[0, 4]]);
|
|
129
129
|
}));
|
|
130
130
|
|
|
131
131
|
/**
|
|
@@ -141,37 +141,37 @@ export function Deployment(http, data, params) {
|
|
|
141
141
|
* .then((data) => {})
|
|
142
142
|
*/
|
|
143
143
|
this.signedDownloadUrl = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
|
144
|
-
var headers, response;
|
|
145
|
-
return _regeneratorRuntime.wrap(function
|
|
144
|
+
var headers, response, _t3;
|
|
145
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
146
146
|
while (1) switch (_context3.prev = _context3.next) {
|
|
147
147
|
case 0:
|
|
148
148
|
_context3.prev = 0;
|
|
149
149
|
headers = {
|
|
150
150
|
headers: _objectSpread({}, cloneDeep(_this.params))
|
|
151
151
|
};
|
|
152
|
-
_context3.next =
|
|
152
|
+
_context3.next = 1;
|
|
153
153
|
return http.post("".concat(_this.urlPath, "/signedDownloadUrl"), {}, headers);
|
|
154
|
-
case
|
|
154
|
+
case 1:
|
|
155
155
|
response = _context3.sent;
|
|
156
156
|
if (!response.data) {
|
|
157
|
-
_context3.next =
|
|
157
|
+
_context3.next = 2;
|
|
158
158
|
break;
|
|
159
159
|
}
|
|
160
160
|
return _context3.abrupt("return", response.data.data);
|
|
161
|
-
case
|
|
161
|
+
case 2:
|
|
162
162
|
throw error(response);
|
|
163
|
-
case
|
|
164
|
-
_context3.next =
|
|
163
|
+
case 3:
|
|
164
|
+
_context3.next = 5;
|
|
165
165
|
break;
|
|
166
|
-
case
|
|
167
|
-
_context3.prev =
|
|
168
|
-
|
|
169
|
-
throw error(
|
|
170
|
-
case
|
|
166
|
+
case 4:
|
|
167
|
+
_context3.prev = 4;
|
|
168
|
+
_t3 = _context3["catch"](0);
|
|
169
|
+
throw error(_t3);
|
|
170
|
+
case 5:
|
|
171
171
|
case "end":
|
|
172
172
|
return _context3.stop();
|
|
173
173
|
}
|
|
174
|
-
}, _callee3, null, [[0,
|
|
174
|
+
}, _callee3, null, [[0, 4]]);
|
|
175
175
|
}));
|
|
176
176
|
} else {
|
|
177
177
|
/**
|
|
@@ -188,8 +188,8 @@ export function Deployment(http, data, params) {
|
|
|
188
188
|
*/
|
|
189
189
|
this.create = /*#__PURE__*/function () {
|
|
190
190
|
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
|
191
|
-
var uploadUid, fileType, withAdvancedOptions, headers, response, content;
|
|
192
|
-
return _regeneratorRuntime.wrap(function
|
|
191
|
+
var uploadUid, fileType, withAdvancedOptions, headers, response, content, _t4;
|
|
192
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
193
193
|
while (1) switch (_context4.prev = _context4.next) {
|
|
194
194
|
case 0:
|
|
195
195
|
uploadUid = _ref4.uploadUid, fileType = _ref4.fileType, withAdvancedOptions = _ref4.withAdvancedOptions;
|
|
@@ -202,15 +202,15 @@ export function Deployment(http, data, params) {
|
|
|
202
202
|
with_advanced_options: withAdvancedOptions
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
|
-
_context4.next =
|
|
205
|
+
_context4.next = 2;
|
|
206
206
|
return http.post("".concat(_this.urlPath), {
|
|
207
207
|
upload_uid: uploadUid,
|
|
208
208
|
file_type: fileType
|
|
209
209
|
}, headers);
|
|
210
|
-
case
|
|
210
|
+
case 2:
|
|
211
211
|
response = _context4.sent;
|
|
212
212
|
if (!response.data) {
|
|
213
|
-
_context4.next =
|
|
213
|
+
_context4.next = 3;
|
|
214
214
|
break;
|
|
215
215
|
}
|
|
216
216
|
content = response.data.data;
|
|
@@ -218,20 +218,20 @@ export function Deployment(http, data, params) {
|
|
|
218
218
|
data: content,
|
|
219
219
|
app_uid: data.app_uid
|
|
220
220
|
}, _this.params));
|
|
221
|
-
case
|
|
221
|
+
case 3:
|
|
222
222
|
throw error(response);
|
|
223
|
-
case
|
|
224
|
-
_context4.next =
|
|
223
|
+
case 4:
|
|
224
|
+
_context4.next = 6;
|
|
225
225
|
break;
|
|
226
|
-
case
|
|
227
|
-
_context4.prev =
|
|
228
|
-
|
|
229
|
-
throw error(
|
|
230
|
-
case
|
|
226
|
+
case 5:
|
|
227
|
+
_context4.prev = 5;
|
|
228
|
+
_t4 = _context4["catch"](1);
|
|
229
|
+
throw error(_t4);
|
|
230
|
+
case 6:
|
|
231
231
|
case "end":
|
|
232
232
|
return _context4.stop();
|
|
233
233
|
}
|
|
234
|
-
}, _callee4, null, [[1,
|
|
234
|
+
}, _callee4, null, [[1, 5]]);
|
|
235
235
|
}));
|
|
236
236
|
return function (_x) {
|
|
237
237
|
return _ref5.apply(this, arguments);
|
|
@@ -256,8 +256,9 @@ export function Deployment(http, data, params) {
|
|
|
256
256
|
response,
|
|
257
257
|
content,
|
|
258
258
|
collection,
|
|
259
|
-
_args5 = arguments
|
|
260
|
-
|
|
259
|
+
_args5 = arguments,
|
|
260
|
+
_t5;
|
|
261
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
261
262
|
while (1) switch (_context5.prev = _context5.next) {
|
|
262
263
|
case 0:
|
|
263
264
|
param = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {};
|
|
@@ -266,32 +267,32 @@ export function Deployment(http, data, params) {
|
|
|
266
267
|
headers: _objectSpread({}, cloneDeep(_this.params)),
|
|
267
268
|
params: _objectSpread({}, cloneDeep(param))
|
|
268
269
|
};
|
|
269
|
-
_context5.next =
|
|
270
|
+
_context5.next = 2;
|
|
270
271
|
return http.get("".concat(_this.urlPath), headers);
|
|
271
|
-
case
|
|
272
|
+
case 2:
|
|
272
273
|
response = _context5.sent;
|
|
273
274
|
if (!response.data) {
|
|
274
|
-
_context5.next =
|
|
275
|
+
_context5.next = 3;
|
|
275
276
|
break;
|
|
276
277
|
}
|
|
277
278
|
content = response.data;
|
|
278
279
|
collection = new ContentstackCollection(response, http);
|
|
279
280
|
collection.items = DeploymentCollection(http, content, data.app_uid, _this.params);
|
|
280
281
|
return _context5.abrupt("return", collection);
|
|
281
|
-
case
|
|
282
|
+
case 3:
|
|
282
283
|
throw error(response);
|
|
283
|
-
case
|
|
284
|
-
_context5.next =
|
|
284
|
+
case 4:
|
|
285
|
+
_context5.next = 6;
|
|
285
286
|
break;
|
|
286
|
-
case
|
|
287
|
-
_context5.prev =
|
|
288
|
-
|
|
289
|
-
throw error(
|
|
290
|
-
case
|
|
287
|
+
case 5:
|
|
288
|
+
_context5.prev = 5;
|
|
289
|
+
_t5 = _context5["catch"](1);
|
|
290
|
+
throw error(_t5);
|
|
291
|
+
case 6:
|
|
291
292
|
case "end":
|
|
292
293
|
return _context5.stop();
|
|
293
294
|
}
|
|
294
|
-
}, _callee5, null, [[1,
|
|
295
|
+
}, _callee5, null, [[1, 5]]);
|
|
295
296
|
}));
|
|
296
297
|
}
|
|
297
298
|
}
|