Skip to content

Commit d912c27

Browse files
Version Packages (#930)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent e2de71a commit d912c27

5 files changed

Lines changed: 74 additions & 66 deletions

File tree

.changeset/happy-cups-brake.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/blob/CHANGELOG.md

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @vercel/blob
22

3+
## 2.0.1
4+
5+
### Patch Changes
6+
7+
- e2de71a: Upgrade undici to fix security issue warning
8+
39
## 2.0.0
410

511
### Major Changes
@@ -38,7 +44,7 @@
3844
body,
3945
request,
4046
onBeforeGenerateToken: async (pathname) => {
41-
return { callbackUrl: 'https://example.com' }; // the path to call will be automatically computed
47+
return { callbackUrl: "https://example.com" }; // the path to call will be automatically computed
4248
},
4349
onUploadCompleted: async ({ blob, tokenPayload }) => {
4450
/* code */
@@ -102,11 +108,11 @@
102108
- Overwriting blobs now requires to use `allowOverwrite: true`. Example:
103109

104110
```js
105-
await put('file.png', file, { access: 'public' });
111+
await put("file.png", file, { access: "public" });
106112

107-
await put('file.png', file, { access: 'public' }); // This will throw
113+
await put("file.png", file, { access: "public" }); // This will throw
108114

109-
put('file.png', file, { access: 'public', allowOverwrite: true }); // This will work
115+
put("file.png", file, { access: "public", allowOverwrite: true }); // This will work
110116
```
111117

112118
How to upgrade:
@@ -240,12 +246,12 @@
240246
const abortController = new AbortController();
241247

242248
vercelBlob
243-
.put('canceled.txt', 'test', {
244-
access: 'public',
249+
.put("canceled.txt", "test", {
250+
access: "public",
245251
abortSignal: abortController.signal,
246252
})
247253
.then((blob) => {
248-
console.log('Blob created:', blob);
254+
console.log("Blob created:", blob);
249255
});
250256

251257
setTimeout(function () {
@@ -296,19 +302,19 @@
296302

297303
```ts
298304
const { key, uploadId } = await vercelBlob.createMultipartUpload(
299-
'big-file.txt',
300-
{ access: 'public' },
305+
"big-file.txt",
306+
{ access: "public" }
301307
);
302308

303-
const part1 = await vercelBlob.uploadPart(fullPath, 'first part', {
304-
access: 'public',
309+
const part1 = await vercelBlob.uploadPart(fullPath, "first part", {
310+
access: "public",
305311
key,
306312
uploadId,
307313
partNumber: 1,
308314
});
309315

310-
const part2 = await vercelBlob.uploadPart(fullPath, 'second part', {
311-
access: 'public',
316+
const part2 = await vercelBlob.uploadPart(fullPath, "second part", {
317+
access: "public",
312318
key,
313319
uploadId,
314320
partNumber: 2,
@@ -318,10 +324,10 @@
318324
fullPath,
319325
[part1, part2],
320326
{
321-
access: 'public',
327+
access: "public",
322328
key,
323329
uploadId,
324-
},
330+
}
325331
);
326332
```
327333

@@ -330,8 +336,8 @@
330336
For multipart methods, since some of the data remains consistent (uploadId, key), you can make use of the `createMultipartUploader`. This function stores certain data internally, making it possible to offer convinient `put` and `complete` functions.
331337

332338
```ts
333-
const uploader = await vercelBlob.createMultipartUploader('big-file.txt', {
334-
access: 'public',
339+
const uploader = await vercelBlob.createMultipartUploader("big-file.txt", {
340+
access: "public",
335341
});
336342

337343
const part1 = await uploader.uploadPart(1, createReadStream(fullPath));
@@ -397,15 +403,15 @@
397403
Usage:
398404

399405
```ts
400-
const blob = await put('file.png', file, {
401-
access: 'public',
406+
const blob = await put("file.png", file, {
407+
access: "public",
402408
multipart: true, // `false` by default
403409
});
404410

405411
// and:
406-
const blob = await upload('file.png', file, {
407-
access: 'public',
408-
handleUploadUrl: '/api/upload',
412+
const blob = await upload("file.png", file, {
413+
access: "public",
414+
handleUploadUrl: "/api/upload",
409415
multipart: true,
410416
});
411417
```
@@ -415,26 +421,26 @@
415421
More examples:
416422

417423
```ts
418-
import { createReadStream } from 'node:fs';
424+
import { createReadStream } from "node:fs";
419425

420426
const blob = await vercelBlob.put(
421-
'elon.mp4',
427+
"elon.mp4",
422428
// this works 👍, it will gradually read the file from the system and upload it
423-
createReadStream('/users/Elon/me.mp4'),
424-
{ access: 'public', multipart: true },
429+
createReadStream("/users/Elon/me.mp4"),
430+
{ access: "public", multipart: true }
425431
);
426432
```
427433

428434
```ts
429435
const response = await fetch(
430-
'https://example-files.online-convert.com/video/mp4/example_big.mp4',
436+
"https://example-files.online-convert.com/video/mp4/example_big.mp4"
431437
);
432438

433439
const blob = await vercelBlob.put(
434-
'example_big.mp4',
440+
"example_big.mp4",
435441
// this works too 👍, it will gradually read the file from internet and upload it
436442
response.body,
437-
{ access: 'public', multipart: true },
443+
{ access: "public", multipart: true }
438444
);
439445
```
440446

@@ -446,8 +452,8 @@
446452
Now the the SDK validates if the operation is a folder creation by checking if the pathname ends with a trailling slash.
447453

448454
```ts
449-
const blob = await vercelBlob.put('folder/', {
450-
access: 'public',
455+
const blob = await vercelBlob.put("folder/", {
456+
access: "public",
451457
addRandomSuffix: false,
452458
});
453459
```
@@ -552,7 +558,7 @@
552558
upload,
553559
handleUpload,
554560
generateClientTokenFromReadWriteToken,
555-
} from '@vercel/blob/client';
561+
} from "@vercel/blob/client";
556562
```
557563

558564
Here are the new features:

packages/blob/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vercel/blob",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "The Vercel Blob JavaScript API client",
55
"homepage": "https://vercel.com/storage/blob",
66
"repository": {

test/next/CHANGELOG.md

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# vercel-storage-integration-test-suite
22

3+
## 0.3.14
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [e2de71a]
8+
- @vercel/blob@2.0.1
9+
310
## 0.3.13
411

512
### Patch Changes
@@ -237,12 +244,12 @@
237244
const abortController = new AbortController();
238245

239246
vercelBlob
240-
.put('canceled.txt', 'test', {
241-
access: 'public',
247+
.put("canceled.txt", "test", {
248+
access: "public",
242249
abortSignal: abortController.signal,
243250
})
244251
.then((blob) => {
245-
console.log('Blob created:', blob);
252+
console.log("Blob created:", blob);
246253
});
247254

248255
setTimeout(function () {
@@ -331,19 +338,19 @@
331338

332339
```ts
333340
const { key, uploadId } = await vercelBlob.createMultipartUpload(
334-
'big-file.txt',
335-
{ access: 'public' },
341+
"big-file.txt",
342+
{ access: "public" }
336343
);
337344

338-
const part1 = await vercelBlob.uploadPart(fullPath, 'first part', {
339-
access: 'public',
345+
const part1 = await vercelBlob.uploadPart(fullPath, "first part", {
346+
access: "public",
340347
key,
341348
uploadId,
342349
partNumber: 1,
343350
});
344351

345-
const part2 = await vercelBlob.uploadPart(fullPath, 'second part', {
346-
access: 'public',
352+
const part2 = await vercelBlob.uploadPart(fullPath, "second part", {
353+
access: "public",
347354
key,
348355
uploadId,
349356
partNumber: 2,
@@ -353,10 +360,10 @@
353360
fullPath,
354361
[part1, part2],
355362
{
356-
access: 'public',
363+
access: "public",
357364
key,
358365
uploadId,
359-
},
366+
}
360367
);
361368
```
362369

@@ -365,8 +372,8 @@
365372
For multipart methods, since some of the data remains consistent (uploadId, key), you can make use of the `createMultipartUploader`. This function stores certain data internally, making it possible to offer convinient `put` and `complete` functions.
366373

367374
```ts
368-
const uploader = await vercelBlob.createMultipartUploader('big-file.txt', {
369-
access: 'public',
375+
const uploader = await vercelBlob.createMultipartUploader("big-file.txt", {
376+
access: "public",
370377
});
371378

372379
const part1 = await uploader.uploadPart(1, createReadStream(fullPath));
@@ -447,8 +454,8 @@
447454
Now the the SDK validates if the operation is a folder creation by checking if the pathname ends with a trailling slash.
448455

449456
```ts
450-
const blob = await vercelBlob.put('folder/', {
451-
access: 'public',
457+
const blob = await vercelBlob.put("folder/", {
458+
access: "public",
452459
addRandomSuffix: false,
453460
});
454461
```
@@ -464,15 +471,15 @@
464471
Usage:
465472

466473
```ts
467-
const blob = await put('file.png', file, {
468-
access: 'public',
474+
const blob = await put("file.png", file, {
475+
access: "public",
469476
multipart: true, // `false` by default
470477
});
471478

472479
// and:
473-
const blob = await upload('file.png', file, {
474-
access: 'public',
475-
handleUploadUrl: '/api/upload',
480+
const blob = await upload("file.png", file, {
481+
access: "public",
482+
handleUploadUrl: "/api/upload",
476483
multipart: true,
477484
});
478485
```
@@ -482,26 +489,26 @@
482489
More examples:
483490

484491
```ts
485-
import { createReadStream } from 'node:fs';
492+
import { createReadStream } from "node:fs";
486493

487494
const blob = await vercelBlob.put(
488-
'elon.mp4',
495+
"elon.mp4",
489496
// this works 👍, it will gradually read the file from the system and upload it
490-
createReadStream('/users/Elon/me.mp4'),
491-
{ access: 'public', multipart: true },
497+
createReadStream("/users/Elon/me.mp4"),
498+
{ access: "public", multipart: true }
492499
);
493500
```
494501

495502
```ts
496503
const response = await fetch(
497-
'https://example-files.online-convert.com/video/mp4/example_big.mp4',
504+
"https://example-files.online-convert.com/video/mp4/example_big.mp4"
498505
);
499506

500507
const blob = await vercelBlob.put(
501-
'example_big.mp4',
508+
"example_big.mp4",
502509
// this works too 👍, it will gradually read the file from internet and upload it
503510
response.body,
504-
{ access: 'public', multipart: true },
511+
{ access: "public", multipart: true }
505512
);
506513
```
507514

test/next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vercel-storage-integration-test-suite",
3-
"version": "0.3.13",
3+
"version": "0.3.14",
44
"private": true,
55
"scripts": {
66
"build": "next build",

0 commit comments

Comments
 (0)