@quantcdn/quant-client 2.0.8 → 2.0.10
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/dist/src/client.js +8 -5
- package/package.json +1 -1
package/dist/src/client.js
CHANGED
|
@@ -23,7 +23,7 @@ class HttpClient {
|
|
|
23
23
|
do(options) {
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
25
|
return yield new Promise((resolve, reject) => {
|
|
26
|
-
request(options, (error,
|
|
26
|
+
request(options, (error, response, body) => {
|
|
27
27
|
if (error !== null) {
|
|
28
28
|
reject(error);
|
|
29
29
|
}
|
|
@@ -190,12 +190,13 @@ class QuantClient {
|
|
|
190
190
|
* The response object.
|
|
191
191
|
*/
|
|
192
192
|
publish: (payload) => __awaiter(this, void 0, void 0, function* () {
|
|
193
|
-
|
|
193
|
+
const response = yield this._project.patch(`publish/${payload.revision}`, {}, {
|
|
194
194
|
'Quant-Url': payload.location
|
|
195
195
|
});
|
|
196
|
+
return response.first();
|
|
196
197
|
}),
|
|
197
198
|
/**
|
|
198
|
-
* Unpublish
|
|
199
|
+
* Unpublish the current published revision.
|
|
199
200
|
*
|
|
200
201
|
* @param payload PublishPayload
|
|
201
202
|
* The payload object.
|
|
@@ -204,9 +205,10 @@ class QuantClient {
|
|
|
204
205
|
* The response object.
|
|
205
206
|
*/
|
|
206
207
|
unpublish: (payload) => __awaiter(this, void 0, void 0, function* () {
|
|
207
|
-
|
|
208
|
+
const response = yield this._project.patch('unpublish', {}, {
|
|
208
209
|
'Quant-Url': payload.location
|
|
209
210
|
});
|
|
211
|
+
return response.first();
|
|
210
212
|
}),
|
|
211
213
|
/**
|
|
212
214
|
* Redirect a URL.
|
|
@@ -242,9 +244,10 @@ class QuantClient {
|
|
|
242
244
|
* The repsonse object.
|
|
243
245
|
*/
|
|
244
246
|
delete: (payload) => __awaiter(this, void 0, void 0, function* () {
|
|
245
|
-
|
|
247
|
+
const response = yield this._project.delete('delete/all', {}, {
|
|
246
248
|
'Quant-Url': payload.url
|
|
247
249
|
});
|
|
250
|
+
return yield response.first();
|
|
248
251
|
}),
|
|
249
252
|
/**
|
|
250
253
|
* Get a revision from the API.
|