You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/blob/src/client.browser.test.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -604,7 +604,7 @@ describe('client', () => {
604
604
}),
605
605
).rejects.toThrow(
606
606
newError(
607
-
"Vercel Blob: client/`upload` doesn't allow `addRandomSuffix`, `cacheControlMaxAge`, `allowOverwrite`or `ifMatch`. Configure these options at the server side when generating client tokens.",
607
+
"Vercel Blob: client/`upload` doesn't allow `addRandomSuffix`, `cacheControlMaxAge`, `allowOverwrite`, `ifMatch` or `deleteAfter`. Configure these options at the server side when generating client tokens.",
@@ -19,6 +24,8 @@ import { createUploadPartMethod } from './multipart/upload';
19
24
import{createPutMethod}from'./put';
20
25
importtype{PutBlobResult}from'./put-helpers';
21
26
27
+
exporttype{BlobDeleteAfter}from'./helpers';
28
+
22
29
/**
23
30
* Interface for put, upload and multipart upload operations.
24
31
* This type omits all options that are encoded in the client token.
@@ -82,10 +89,14 @@ function createPutExtraChecks<
82
89
// @ts-expect-error -- Runtime check for DX.
83
90
options.allowOverwrite!==undefined||
84
91
// @ts-expect-error -- Runtime check for DX.
85
-
options.cacheControlMaxAge!==undefined
92
+
options.cacheControlMaxAge!==undefined||
93
+
// @ts-expect-error -- Runtime check for DX.
94
+
options.ifMatch!==undefined||
95
+
// @ts-expect-error -- Runtime check for DX.
96
+
options.deleteAfter!==undefined
86
97
){
87
98
thrownewBlobError(
88
-
`${methodName} doesn't allow \`addRandomSuffix\`, \`cacheControlMaxAge\`or \`allowOverwrite\`. Configure these options at the server side when generating client tokens.`,
99
+
`${methodName} doesn't allow \`addRandomSuffix\`, \`cacheControlMaxAge\`, \`allowOverwrite\`, \`ifMatch\` or \`deleteAfter\`. Configure these options at the server side when generating client tokens.`,
"client/`upload` doesn't allow `addRandomSuffix`, `cacheControlMaxAge`, `allowOverwrite`or `ifMatch`. Configure these options at the server side when generating client tokens.",
308
+
"client/`upload` doesn't allow `addRandomSuffix`, `cacheControlMaxAge`, `allowOverwrite`, `ifMatch` or `deleteAfter`. Configure these options at the server side when generating client tokens.",
* @param fromUrlOrPathname - The blob URL (or pathname) to copy. You can only copy blobs that are in the store, that your 'BLOB_READ_WRITE_TOKEN' has access to.
24
25
* @param toPathname - The pathname to copy the blob to. This includes the filename.
25
-
* @param options - Additional options. The copy method will not preserve any metadata configuration (e.g.: 'cacheControlMaxAge') of the source blob. If you want to copy the metadata, you need to define it here again.
26
+
* @param options - Additional options. The copy method will not preserve any metadata configuration (e.g.: 'cacheControlMaxAge' or 'deleteAfter') of the source blob. If you want to copy the metadata, you need to define it here again.
26
27
*/
27
28
exportasyncfunctioncopy(
28
29
fromUrlOrPathname: string,
@@ -53,30 +54,17 @@ export async function copy(
53
54
}
54
55
}
55
56
56
-
constheaders: Record<string,string>={};
57
-
58
-
// access is always required, so always add it to headers
0 commit comments