vslides 1.0.14 → 1.0.16
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/cli.js +10 -33
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3247,39 +3247,16 @@ async function getGuide() {
|
|
|
3247
3247
|
return request("/api/slides/guide");
|
|
3248
3248
|
}
|
|
3249
3249
|
async function uploadAsset(slug, token, filename, content) {
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
body: new Uint8Array(content)
|
|
3261
|
-
});
|
|
3262
|
-
if (response.status === 503) {
|
|
3263
|
-
console.log("Sandbox waking up...");
|
|
3264
|
-
await sleep(RETRY_DELAY);
|
|
3265
|
-
continue;
|
|
3266
|
-
}
|
|
3267
|
-
if (response.status === 401) {
|
|
3268
|
-
clearCLIAuth();
|
|
3269
|
-
throw new AuthExpiredError();
|
|
3270
|
-
}
|
|
3271
|
-
const data = await response.json();
|
|
3272
|
-
return { ok: response.ok, status: response.status, data };
|
|
3273
|
-
} catch (err) {
|
|
3274
|
-
if (i < MAX_RETRIES - 1) {
|
|
3275
|
-
console.log(`Upload failed, retrying... (${i + 1}/${MAX_RETRIES})`);
|
|
3276
|
-
await sleep(RETRY_DELAY);
|
|
3277
|
-
continue;
|
|
3278
|
-
}
|
|
3279
|
-
throw err;
|
|
3280
|
-
}
|
|
3281
|
-
}
|
|
3282
|
-
throw new Error("Upload failed after max retries");
|
|
3250
|
+
return request("/api/slides/assets", {
|
|
3251
|
+
method: "POST",
|
|
3252
|
+
headers: {
|
|
3253
|
+
"X-Slug": slug,
|
|
3254
|
+
"X-Session-Token": token,
|
|
3255
|
+
"X-Filename": filename,
|
|
3256
|
+
"Content-Type": "application/octet-stream"
|
|
3257
|
+
},
|
|
3258
|
+
body: content
|
|
3259
|
+
});
|
|
3283
3260
|
}
|
|
3284
3261
|
async function exportSlides(slug, token, format) {
|
|
3285
3262
|
const response = await fetch(`${BASE_URL}/api/slides/export?format=${format}`, {
|