@overscore/cli 0.13.22 → 0.13.23
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/index.js +7 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3396,18 +3396,17 @@ async function probeDashboard(deviceToken, projectSlug, dashboardSlug) {
|
|
|
3396
3396
|
if (!apiKey)
|
|
3397
3397
|
return { state: "error", apiKey };
|
|
3398
3398
|
try {
|
|
3399
|
-
const
|
|
3399
|
+
const sRes = await fetch(`${HUB_URL}/api/dashboards/${dashboardSlug}/source`, {
|
|
3400
|
+
method: "HEAD",
|
|
3400
3401
|
headers: { Authorization: `Bearer ${apiKey}` },
|
|
3401
3402
|
});
|
|
3402
|
-
if (
|
|
3403
|
+
if (sRes.status === 401 || sRes.status === 403)
|
|
3403
3404
|
return { state: "unauthorized", apiKey };
|
|
3404
|
-
if (
|
|
3405
|
+
if (sRes.status === 404)
|
|
3405
3406
|
return { state: "new", apiKey };
|
|
3406
|
-
if (
|
|
3407
|
-
return { state: "
|
|
3408
|
-
|
|
3409
|
-
const deployed = Array.isArray(data.versions) && data.versions.length > 0;
|
|
3410
|
-
return { state: deployed ? "deployed" : "new", apiKey };
|
|
3407
|
+
if (sRes.ok)
|
|
3408
|
+
return { state: "deployed", apiKey };
|
|
3409
|
+
return { state: "error", apiKey };
|
|
3411
3410
|
}
|
|
3412
3411
|
catch {
|
|
3413
3412
|
return { state: "error", apiKey };
|