vslides 1.0.11 → 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 +11 -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}`, {
@@ -4069,6 +4075,7 @@ async function push(options = {}) {
4069
4075
  info(`Server has version ${conflict.currentVersion}, you expected version ${cfg.version}.`);
4070
4076
  info("Server content saved to: upstream.md");
4071
4077
  writeUpstream(conflict.currentMarkdown);
4078
+ updateConfig({ version: conflict.currentVersion });
4072
4079
  instructions([
4073
4080
  "Compare slides.md (your changes) with upstream.md (server version)",
4074
4081
  "Merge both sets of changes into slides.md",
@@ -4123,6 +4130,7 @@ async function sync() {
4123
4130
  const serverMarkdown = getResult.data.markdown;
4124
4131
  if (localVersion !== void 0 && serverVersion > localVersion) {
4125
4132
  writeUpstream(serverMarkdown);
4133
+ updateConfig({ version: serverVersion });
4126
4134
  info(`SERVER_UPDATED: Version ${serverVersion} available`);
4127
4135
  info("Server content saved to: upstream.md");
4128
4136
  instructions([
@@ -4162,6 +4170,7 @@ async function sync() {
4162
4170
  info(`Server has version ${conflict.currentVersion}, you expected version ${serverVersion}.`);
4163
4171
  info("Server content saved to: upstream.md");
4164
4172
  writeUpstream(conflict.currentMarkdown);
4173
+ updateConfig({ version: conflict.currentVersion });
4165
4174
  instructions([
4166
4175
  "Compare slides.md (your changes) with upstream.md (server version)",
4167
4176
  "Merge both sets of changes into slides.md",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vslides",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "CLI for Vercel Slides API",
5
5
  "license": "MIT",
6
6
  "author": "Vercel",