@vercel/blob
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -1,1 +0,1 @@ | ||
import{fetch as r}from"undici";async function c(e,o,t){if(!e)throw new Error("vercelBlob.put: pathname is required");if(!o)throw new Error("vercelBlob.put: body is required");if(!t||t.access!=="public")throw new Error('vercelBlob.put: access must be "public"');return(await r(`${n()}/${e}`,{method:"PUT",body:o,headers:{authorization:`Bearer ${s(t)}`},duplex:"half"})).json()}async function d(e,o){let t=new URL(n());t.searchParams.set("url",e),await r(t,{method:"DELETE",headers:{authorization:`Bearer ${s(o)}`}})}async function u(e,o){let t=new URL(n());t.searchParams.set("url",e);let i=await(await r(t,{method:"GET",headers:{authorization:`Bearer ${s(o)}`}})).json();return{...i,uploadedAt:new Date(i.uploadedAt)}}function n(){return process.env.BLOB_STORE_API_URL||"https://blob.vercel-storage.com"}function s(e){if(e!=null&&e.token)return e.token;if(!process.env.BLOB_STORE_WRITE_TOKEN)throw new Error("BLOB_STORE_WRITE_TOKEN environment variable is not set. Please set it to your write token.");return process.env.BLOB_STORE_WRITE_TOKEN}export{d as del,u as head,c as put}; | ||
import{fetch as r}from"undici";async function c(e,o,t){if(!e)throw new Error("vercelBlob.put: pathname is required");if(!o)throw new Error("vercelBlob.put: body is required");if(!t||t.access!=="public")throw new Error('vercelBlob.put: access must be "public"');return(await r(`${n()}/${e}`,{method:"PUT",body:o,headers:{authorization:`Bearer ${s(t)}`},duplex:"half"})).json()}async function d(e,o){let t=new URL(n());t.searchParams.set("url",e),await r(t,{method:"DELETE",headers:{authorization:`Bearer ${s(o)}`}})}async function u(e,o){let t=new URL(n());t.searchParams.set("url",e);let i=await(await r(t,{method:"GET",headers:{authorization:`Bearer ${s(o)}`}})).json();return{...i,uploadedAt:new Date(i.uploadedAt)}}function n(){return process.env.VERCEL_BLOB_API_URL||"https://blob.vercel-storage.com"}function s(e){if(e!=null&&e.token)return e.token;if(!process.env.BLOB_STORE_WRITE_TOKEN)throw new Error("BLOB_STORE_WRITE_TOKEN environment variable is not set. Please set it to your write token.");return process.env.BLOB_STORE_WRITE_TOKEN}export{d as del,u as head,c as put}; |
{ | ||
"name": "@vercel/blob", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "The Vercel Blob JavaScript API client", | ||
@@ -57,3 +57,3 @@ "homepage": "https://vercel.com/blob", | ||
"@types/jest": "29.5.1", | ||
"@types/node": "18.15.11", | ||
"@types/node": "18.15.12", | ||
"@vercel/style-guide": "4.0.2", | ||
@@ -60,0 +60,0 @@ "axios": "1.3.6", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
12908