Commit 091c584
fix: [PR-1680] parse correct API field names for
* fix: correct API field names and resolve is-fullwidth-code-point ESM conflict in images upload
Three bugs fixed in `sf images upload`:
1. `partResponse.data.upload_url` → `.url`: the v2/images/{id}/parts endpoint
returns `url`, not `upload_url` as the schema declared.
2. `sha256_hash` → `sha256`: the v2/images/{id}/complete endpoint expects the
field named `sha256`, not `sha256_hash` as the schema declared. Schema updated
to match both.
3. isFullwidthCodePoint runtime crash: bun's symlink layout caused Node.js (v24)
to resolve `is-fullwidth-code-point` to v5.1.0 (ESM-only) from within
`cli-progress`'s nested `string-width@4.2.3` (CJS). When CJS require()s an
ESM module in Node 24 it gets the module namespace object, not the default
export, so `isFullwidthCodePoint(code)` threw "not a function". Fixed by
pinning `is-fullwidth-code-point` to 3.0.0 via package.json overrides and
a clean bun install.
Also improves the complete-upload error message to use `completeResponse.error`
(already parsed by openapi-fetch) instead of re-reading the consumed response body.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* revert: undo schema.ts field name changes
The v2 API field names (sha256, url) differ from the generated schema
(sha256_hash, upload_url). Rather than modifying the generated schema,
the next commit switches sf images upload to raw fetch with hardcoded
types so it is not coupled to schema.ts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* style: use raw fetch for v2/images upload to decouple from schema types
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Daniel Tao <danieltaox@gmail.com>v2/images (#251)1 parent 4650ad7 commit 091c584
3 files changed
Lines changed: 55 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
79 | 82 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
79 | 84 | | |
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
83 | | - | |
84 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
85 | 92 | | |
86 | 93 | | |
87 | | - | |
88 | | - | |
| 94 | + | |
89 | 95 | | |
90 | | - | |
| 96 | + | |
91 | 97 | | |
92 | 98 | | |
93 | 99 | | |
94 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
95 | 103 | | |
96 | 104 | | |
97 | 105 | | |
| |||
231 | 239 | | |
232 | 240 | | |
233 | 241 | | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
238 | 250 | | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
| 251 | + | |
| 252 | + | |
244 | 253 | | |
245 | 254 | | |
246 | 255 | | |
| |||
250 | 259 | | |
251 | 260 | | |
252 | 261 | | |
253 | | - | |
| 262 | + | |
254 | 263 | | |
255 | 264 | | |
256 | 265 | | |
257 | 266 | | |
258 | 267 | | |
259 | 268 | | |
260 | | - | |
| 269 | + | |
261 | 270 | | |
262 | 271 | | |
263 | 272 | | |
264 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
265 | 276 | | |
266 | 277 | | |
267 | 278 | | |
| |||
353 | 364 | | |
354 | 365 | | |
355 | 366 | | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
360 | 375 | | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
| 376 | + | |
365 | 377 | | |
366 | | - | |
| 378 | + | |
367 | 379 | | |
368 | 380 | | |
369 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
370 | 388 | | |
371 | 389 | | |
372 | 390 | | |
373 | | - | |
| 391 | + | |
374 | 392 | | |
375 | 393 | | |
376 | 394 | | |
| |||
0 commit comments