@opendesign/api
Advanced tools
Comparing version
@@ -95,7 +95,12 @@ "use strict"; | ||
}, this._getAuthInfo(), Object.assign(Object.assign({ console: this._console }, options), { cancelToken })); | ||
if (res.statusCode !== 200 && res.statusCode !== 202) { | ||
const body = res.body; | ||
const designSummaryOrProcessing = 'status' in body ? body : null; | ||
if (!designSummaryOrProcessing || | ||
designSummaryOrProcessing['status'] === 'failed') { | ||
this._console.error('OpenDesignApi#getDesignSummary()', { designId }, res); | ||
throw new open_design_api_error_1.OpenDesignApiError(res, 'Cannot fetch design'); | ||
} | ||
if (res.statusCode === 202) { | ||
if (res.statusCode === 202 || | ||
designSummaryOrProcessing['status'] !== 'done' || | ||
!('artboards' in designSummaryOrProcessing)) { | ||
yield sleep_1.sleep(1000); | ||
@@ -105,3 +110,3 @@ cancelToken.throwIfCancelled(); | ||
} | ||
return res.body; | ||
return designSummaryOrProcessing; | ||
}); | ||
@@ -108,0 +113,0 @@ } |
@@ -8,3 +8,3 @@ "use strict"; | ||
const paramValue = pathParams[paramName]; | ||
return pathResult.replace(`{${paramName}}`, String(paramValue)); | ||
return pathResult.replace(`{${paramName}}`, encodeURIComponent(String(paramValue))); | ||
}, pathPattern); | ||
@@ -11,0 +11,0 @@ } |
{ | ||
"name": "@opendesign/api", | ||
"version": "0.2.0-rc.1", | ||
"version": "0.2.0-rc.2", | ||
"main": "dist", | ||
@@ -11,3 +11,3 @@ "scripts": { | ||
"devDependencies": { | ||
"@opendesign/octopus-reader": "0.2.0-rc.1", | ||
"@opendesign/octopus-reader": "0.2.0-rc.2", | ||
"open-design-api-types": "0.3.4-rc.1", | ||
@@ -14,0 +14,0 @@ "typescript": "4.1.2", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
281547
0.19%5353
0.09%4
-20%