vslides 1.0.12 → 1.0.13

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.
Files changed (2) hide show
  1. package/dist/cli.js +8 -2
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -3247,7 +3247,7 @@ async function getGuide() {
3247
3247
  return request("/api/slides/guide");
3248
3248
  }
3249
3249
  async function uploadAsset(slug, token, filename, content) {
3250
- return request("/api/slides/assets", {
3250
+ const response = await fetch(`${BASE_URL}/api/slides/assets`, {
3251
3251
  method: "POST",
3252
3252
  headers: {
3253
3253
  "X-Slug": slug,
@@ -3255,8 +3255,14 @@ async function uploadAsset(slug, token, filename, content) {
3255
3255
  "X-Filename": filename,
3256
3256
  "Content-Type": "application/octet-stream"
3257
3257
  },
3258
- body: content.toString("base64")
3258
+ body: content
3259
3259
  });
3260
+ if (response.status === 401) {
3261
+ clearCLIAuth();
3262
+ throw new AuthExpiredError();
3263
+ }
3264
+ const data = await response.json();
3265
+ return { ok: response.ok, status: response.status, data };
3260
3266
  }
3261
3267
  async function exportSlides(slug, token, format) {
3262
3268
  const response = await fetch(`${BASE_URL}/api/slides/export?format=${format}`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vslides",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "CLI for Vercel Slides API",
5
5
  "license": "MIT",
6
6
  "author": "Vercel",