@alepha/bucket-vercel 0.10.3 → 0.10.4

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.
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var VercelBlobApi = class {
14
14
 
15
15
  //#endregion
16
16
  //#region src/providers/VercelFileStorageProvider.ts
17
- const envSchema = t.object({ BLOB_READ_WRITE_TOKEN: t.string({ size: "long" }) });
17
+ const envSchema = t.object({ BLOB_READ_WRITE_TOKEN: t.text({ size: "long" }) });
18
18
  /**
19
19
  * Vercel Blob Storage implementation of File Storage Provider.
20
20
  */
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/providers/VercelBlobProvider.ts","../src/providers/VercelFileStorageProvider.ts","../src/index.ts"],"sourcesContent":["import { del, head, put } from \"@vercel/blob\";\n\nexport class VercelBlobApi {\n\tput: typeof put = put;\n\thead: typeof head = head;\n\tdel: typeof del = del;\n}\n","import type { Readable } from \"node:stream\";\nimport {\n\t$bucket,\n\tFileNotFoundError,\n\ttype FileStorageProvider,\n} from \"@alepha/bucket\";\nimport {\n\t$env,\n\t$hook,\n\t$inject,\n\tAlepha,\n\tAlephaError,\n\ttype FileLike,\n\ttype Static,\n\tt,\n} from \"@alepha/core\";\nimport { DateTimeProvider } from \"@alepha/datetime\";\nimport { createFile } from \"@alepha/file\";\nimport { $logger } from \"@alepha/logger\";\nimport { VercelBlobApi } from \"./VercelBlobProvider.ts\";\n\nconst envSchema = t.object({\n\tBLOB_READ_WRITE_TOKEN: t.string({\n\t\tsize: \"long\",\n\t}),\n});\n\ndeclare module \"@alepha/core\" {\n\tinterface Env extends Partial<Static<typeof envSchema>> {}\n}\n\n/**\n * Vercel Blob Storage implementation of File Storage Provider.\n */\nexport class VercelFileStorageProvider implements FileStorageProvider {\n\tprotected readonly log = $logger();\n\tprotected readonly env = $env(envSchema);\n\tprotected readonly alepha = $inject(Alepha);\n\tprotected readonly time = $inject(DateTimeProvider);\n\tprotected readonly stores: Set<string> = new Set();\n\tprotected readonly vercelBlobApi = $inject(VercelBlobApi);\n\n\tprotected readonly onStart = $hook({\n\t\ton: \"start\",\n\t\thandler: async () => {\n\t\t\tfor (const bucket of this.alepha.descriptors($bucket)) {\n\t\t\t\tif (bucket.provider !== this) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst storeName = this.convertName(bucket.name);\n\n\t\t\t\tthis.log.debug(`Prepare store '${storeName}' ...`);\n\n\t\t\t\t// Vercel Blob doesn't require explicit store/container creation\n\t\t\t\t// We just track the store names for reference\n\t\t\t\tthis.stores.add(storeName);\n\n\t\t\t\tthis.log.info(`Store '${bucket.name}' OK`);\n\t\t\t}\n\t\t},\n\t});\n\n\tpublic convertName(name: string): string {\n\t\t// Convert to a valid path-like name for Vercel Blob\n\t\treturn name.replaceAll(\"/\", \"-\").toLowerCase();\n\t}\n\n\tpublic async upload(\n\t\tbucketName: string,\n\t\tfile: FileLike,\n\t\tfileId?: string,\n\t): Promise<string> {\n\t\t// force file id as filename for Vercel because we can't store filename as metadata\n\t\t// it's bad, but we have no choice for now\n\t\tfileId = file.name;\n\n\t\tthis.log.trace(\n\t\t\t`Uploading file '${file.name}' to bucket '${bucketName}' with id '${fileId}'...`,\n\t\t);\n\n\t\tconst storeName = this.convertName(bucketName);\n\t\tconst pathname = `${storeName}/${fileId}`;\n\n\t\ttry {\n\t\t\tconst result = await this.vercelBlobApi.put(\n\t\t\t\tpathname,\n\t\t\t\tfile.stream() as Readable,\n\t\t\t\t{\n\t\t\t\t\taccess: \"public\",\n\t\t\t\t\tcontentType: file.type,\n\t\t\t\t\ttoken: this.env.BLOB_READ_WRITE_TOKEN,\n\t\t\t\t\tallowOverwrite: true,\n\t\t\t\t},\n\t\t\t);\n\n\t\t\tthis.log.trace(`File uploaded successfully: ${result.url}`);\n\t\t\treturn fileId;\n\t\t} catch (error) {\n\t\t\tthis.log.error(`Failed to upload file: ${error}`);\n\t\t\tif (error instanceof Error) {\n\t\t\t\tthrow new AlephaError(`Upload failed: ${error.message}`, {\n\t\t\t\t\tcause: error,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tpublic async download(bucketName: string, fileId: string): Promise<FileLike> {\n\t\tthis.log.trace(\n\t\t\t`Downloading file '${fileId}' from bucket '${bucketName}'...`,\n\t\t);\n\n\t\tconst storeName = this.convertName(bucketName);\n\t\tconst pathname = `${storeName}/${fileId}`;\n\n\t\ttry {\n\t\t\t// check if the file exists and get metadata\n\t\t\tconst headResult = await this.vercelBlobApi.head(pathname, {\n\t\t\t\ttoken: this.env.BLOB_READ_WRITE_TOKEN,\n\t\t\t});\n\n\t\t\tif (!headResult) {\n\t\t\t\tthrow new FileNotFoundError(\n\t\t\t\t\t`File '${fileId}' not found in bucket '${bucketName}'`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// fetch the actual file content\n\t\t\tconst response = await fetch(headResult.url);\n\n\t\t\tif (!response.ok) {\n\t\t\t\tthrow new FileNotFoundError(\n\t\t\t\t\t`Failed to fetch file: ${response.statusText}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst stream = response.body;\n\t\t\tif (!stream) {\n\t\t\t\tthrow new FileNotFoundError(\"File not found - empty response body\");\n\t\t\t}\n\n\t\t\tconst originalType =\n\t\t\t\tresponse.headers.get(\"Content-Type\") || \"application/octet-stream\";\n\n\t\t\treturn createFile(stream, {\n\t\t\t\tname: fileId,\n\t\t\t\ttype: originalType,\n\t\t\t\tsize: headResult.size,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (error instanceof FileNotFoundError) {\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\tthis.log.error(`Failed to download file: ${error}`);\n\t\t\tif (error instanceof Error) {\n\t\t\t\tthrow new FileNotFoundError(\"Error downloading file\", { cause: error });\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tpublic async exists(bucketName: string, fileId: string): Promise<boolean> {\n\t\tthis.log.trace(\n\t\t\t`Checking existence of file '${fileId}' in bucket '${bucketName}'...`,\n\t\t);\n\n\t\tconst storeName = this.convertName(bucketName);\n\t\tconst pathname = `${storeName}/${fileId}`;\n\n\t\ttry {\n\t\t\tconst result = await this.vercelBlobApi.head(pathname, {\n\t\t\t\ttoken: this.env.BLOB_READ_WRITE_TOKEN,\n\t\t\t});\n\t\t\treturn result !== null;\n\t\t} catch (error) {\n\t\t\t// Vercel Blob head() throws for non-existent files\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tpublic async delete(bucketName: string, fileId: string): Promise<void> {\n\t\tthis.log.trace(`Deleting file '${fileId}' from bucket '${bucketName}'...`);\n\n\t\tconst storeName = this.convertName(bucketName);\n\t\tconst pathname = `${storeName}/${fileId}`;\n\n\t\ttry {\n\t\t\tawait this.vercelBlobApi.del(pathname, {\n\t\t\t\ttoken: this.env.BLOB_READ_WRITE_TOKEN,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tthis.log.error(`Failed to delete file: ${error}`);\n\t\t\tif (error instanceof Error) {\n\t\t\t\tthrow new FileNotFoundError(\"Error deleting file\", { cause: error });\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n","import { AlephaBucket, FileStorageProvider } from \"@alepha/bucket\";\nimport { $module } from \"@alepha/core\";\nimport { VercelFileStorageProvider } from \"./providers/VercelFileStorageProvider.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./providers/VercelFileStorageProvider.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * Plugin for Alepha Bucket that provides Vercel Blob Storage capabilities.\n *\n * @see {@link VercelFileStorageProvider}\n * @module alepha.bucket.vercel\n */\nexport const AlephaBucketVercel = $module({\n\tname: \"alepha.bucket.vercel\",\n\tservices: [VercelFileStorageProvider],\n\tregister: (alepha) =>\n\t\talepha\n\t\t\t.with({\n\t\t\t\toptional: true,\n\t\t\t\tpr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,MAAM,kBAAkB,OAAO,iBAAiB,WAAW;EAEpE,MAAM,YAAY,KAAK,YAAY;EACnC,MAAM,WAAW,GAAG,UAAU,GAAG;AAEjC,MAAI;AACH,SAAM,KAAK,cAAc,IAAI,UAAU,EACtC,OAAO,KAAK,IAAI,uBAChB;EACD,SAAQ,OAAO;AACf,QAAK,IAAI,MAAM,0BAA0B;AACzC,OAAI,iBAAiB,MACpB,OAAM,IAAI,kBAAkB,uBAAuB,EAAE,OAAO,OAAO;AAEpE,SAAM;EACN;CACD;AACD;;;;;;;;;;AC3LD,MAAa,qBAAqB,QAAQ;CACzC,MAAM;CACN,UAAU,CAAC,0BAA0B;CACrC,WAAW,WACV,OACE,KAAK;EACL,UAAU;EACV,SAAS;EACT,KAAK;EACL,EACA,KAAK;CACR"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/providers/VercelBlobProvider.ts","../src/providers/VercelFileStorageProvider.ts","../src/index.ts"],"sourcesContent":["import { del, head, put } from \"@vercel/blob\";\n\nexport class VercelBlobApi {\n\tput: typeof put = put;\n\thead: typeof head = head;\n\tdel: typeof del = del;\n}\n","import type { Readable } from \"node:stream\";\nimport {\n\t$bucket,\n\tFileNotFoundError,\n\ttype FileStorageProvider,\n} from \"@alepha/bucket\";\nimport {\n\t$env,\n\t$hook,\n\t$inject,\n\tAlepha,\n\tAlephaError,\n\ttype FileLike,\n\ttype Static,\n\tt,\n} from \"@alepha/core\";\nimport { DateTimeProvider } from \"@alepha/datetime\";\nimport { createFile } from \"@alepha/file\";\nimport { $logger } from \"@alepha/logger\";\nimport { VercelBlobApi } from \"./VercelBlobProvider.ts\";\n\nconst envSchema = t.object({\n\tBLOB_READ_WRITE_TOKEN: t.text({\n\t\tsize: \"long\",\n\t}),\n});\n\ndeclare module \"@alepha/core\" {\n\tinterface Env extends Partial<Static<typeof envSchema>> {}\n}\n\n/**\n * Vercel Blob Storage implementation of File Storage Provider.\n */\nexport class VercelFileStorageProvider implements FileStorageProvider {\n\tprotected readonly log = $logger();\n\tprotected readonly env = $env(envSchema);\n\tprotected readonly alepha = $inject(Alepha);\n\tprotected readonly time = $inject(DateTimeProvider);\n\tprotected readonly stores: Set<string> = new Set();\n\tprotected readonly vercelBlobApi = $inject(VercelBlobApi);\n\n\tprotected readonly onStart = $hook({\n\t\ton: \"start\",\n\t\thandler: async () => {\n\t\t\tfor (const bucket of this.alepha.descriptors($bucket)) {\n\t\t\t\tif (bucket.provider !== this) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst storeName = this.convertName(bucket.name);\n\n\t\t\t\tthis.log.debug(`Prepare store '${storeName}' ...`);\n\n\t\t\t\t// Vercel Blob doesn't require explicit store/container creation\n\t\t\t\t// We just track the store names for reference\n\t\t\t\tthis.stores.add(storeName);\n\n\t\t\t\tthis.log.info(`Store '${bucket.name}' OK`);\n\t\t\t}\n\t\t},\n\t});\n\n\tpublic convertName(name: string): string {\n\t\t// Convert to a valid path-like name for Vercel Blob\n\t\treturn name.replaceAll(\"/\", \"-\").toLowerCase();\n\t}\n\n\tpublic async upload(\n\t\tbucketName: string,\n\t\tfile: FileLike,\n\t\tfileId?: string,\n\t): Promise<string> {\n\t\t// force file id as filename for Vercel because we can't store filename as metadata\n\t\t// it's bad, but we have no choice for now\n\t\tfileId = file.name;\n\n\t\tthis.log.trace(\n\t\t\t`Uploading file '${file.name}' to bucket '${bucketName}' with id '${fileId}'...`,\n\t\t);\n\n\t\tconst storeName = this.convertName(bucketName);\n\t\tconst pathname = `${storeName}/${fileId}`;\n\n\t\ttry {\n\t\t\tconst result = await this.vercelBlobApi.put(\n\t\t\t\tpathname,\n\t\t\t\tfile.stream() as Readable,\n\t\t\t\t{\n\t\t\t\t\taccess: \"public\",\n\t\t\t\t\tcontentType: file.type,\n\t\t\t\t\ttoken: this.env.BLOB_READ_WRITE_TOKEN,\n\t\t\t\t\tallowOverwrite: true,\n\t\t\t\t},\n\t\t\t);\n\n\t\t\tthis.log.trace(`File uploaded successfully: ${result.url}`);\n\t\t\treturn fileId;\n\t\t} catch (error) {\n\t\t\tthis.log.error(`Failed to upload file: ${error}`);\n\t\t\tif (error instanceof Error) {\n\t\t\t\tthrow new AlephaError(`Upload failed: ${error.message}`, {\n\t\t\t\t\tcause: error,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tpublic async download(bucketName: string, fileId: string): Promise<FileLike> {\n\t\tthis.log.trace(\n\t\t\t`Downloading file '${fileId}' from bucket '${bucketName}'...`,\n\t\t);\n\n\t\tconst storeName = this.convertName(bucketName);\n\t\tconst pathname = `${storeName}/${fileId}`;\n\n\t\ttry {\n\t\t\t// check if the file exists and get metadata\n\t\t\tconst headResult = await this.vercelBlobApi.head(pathname, {\n\t\t\t\ttoken: this.env.BLOB_READ_WRITE_TOKEN,\n\t\t\t});\n\n\t\t\tif (!headResult) {\n\t\t\t\tthrow new FileNotFoundError(\n\t\t\t\t\t`File '${fileId}' not found in bucket '${bucketName}'`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// fetch the actual file content\n\t\t\tconst response = await fetch(headResult.url);\n\n\t\t\tif (!response.ok) {\n\t\t\t\tthrow new FileNotFoundError(\n\t\t\t\t\t`Failed to fetch file: ${response.statusText}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst stream = response.body;\n\t\t\tif (!stream) {\n\t\t\t\tthrow new FileNotFoundError(\"File not found - empty response body\");\n\t\t\t}\n\n\t\t\tconst originalType =\n\t\t\t\tresponse.headers.get(\"Content-Type\") || \"application/octet-stream\";\n\n\t\t\treturn createFile(stream, {\n\t\t\t\tname: fileId,\n\t\t\t\ttype: originalType,\n\t\t\t\tsize: headResult.size,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (error instanceof FileNotFoundError) {\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\tthis.log.error(`Failed to download file: ${error}`);\n\t\t\tif (error instanceof Error) {\n\t\t\t\tthrow new FileNotFoundError(\"Error downloading file\", { cause: error });\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tpublic async exists(bucketName: string, fileId: string): Promise<boolean> {\n\t\tthis.log.trace(\n\t\t\t`Checking existence of file '${fileId}' in bucket '${bucketName}'...`,\n\t\t);\n\n\t\tconst storeName = this.convertName(bucketName);\n\t\tconst pathname = `${storeName}/${fileId}`;\n\n\t\ttry {\n\t\t\tconst result = await this.vercelBlobApi.head(pathname, {\n\t\t\t\ttoken: this.env.BLOB_READ_WRITE_TOKEN,\n\t\t\t});\n\t\t\treturn result !== null;\n\t\t} catch (error) {\n\t\t\t// Vercel Blob head() throws for non-existent files\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tpublic async delete(bucketName: string, fileId: string): Promise<void> {\n\t\tthis.log.trace(`Deleting file '${fileId}' from bucket '${bucketName}'...`);\n\n\t\tconst storeName = this.convertName(bucketName);\n\t\tconst pathname = `${storeName}/${fileId}`;\n\n\t\ttry {\n\t\t\tawait this.vercelBlobApi.del(pathname, {\n\t\t\t\ttoken: this.env.BLOB_READ_WRITE_TOKEN,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tthis.log.error(`Failed to delete file: ${error}`);\n\t\t\tif (error instanceof Error) {\n\t\t\t\tthrow new FileNotFoundError(\"Error deleting file\", { cause: error });\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n}\n","import { AlephaBucket, FileStorageProvider } from \"@alepha/bucket\";\nimport { $module } from \"@alepha/core\";\nimport { VercelFileStorageProvider } from \"./providers/VercelFileStorageProvider.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./providers/VercelFileStorageProvider.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * Plugin for Alepha Bucket that provides Vercel Blob Storage capabilities.\n *\n * @see {@link VercelFileStorageProvider}\n * @module alepha.bucket.vercel\n */\nexport const AlephaBucketVercel = $module({\n\tname: \"alepha.bucket.vercel\",\n\tservices: [VercelFileStorageProvider],\n\tregister: (alepha) =>\n\t\talepha\n\t\t\t.with({\n\t\t\t\toptional: true,\n\t\t\t\tprovide: FileStorageProvider,\n\t\t\t\tuse: VercelFileStorageProvider,\n\t\t\t})\n\t\t\t.with(AlephaBucket),\n});\n"],"mappings":";;;;;;;;AAEA,IAAa,gBAAb,MAA2B;CAC1B,MAAkB;CAClB,OAAoB;CACpB,MAAkB;AAClB;;;;ACeD,MAAM,YAAY,EAAE,OAAO,EAC1B,uBAAuB,EAAE,KAAK,EAC7B,MAAM,QACN,GACD;;;;AASD,IAAa,4BAAb,MAAsE;CACrE,AAAmB,MAAM;CACzB,AAAmB,MAAM,KAAK;CAC9B,AAAmB,SAAS,QAAQ;CACpC,AAAmB,OAAO,QAAQ;CAClC,AAAmB,yBAAsB,IAAI;CAC7C,AAAmB,gBAAgB,QAAQ;CAE3C,AAAmB,UAAU,MAAM;EAClC,IAAI;EACJ,SAAS,YAAY;AACpB,QAAK,MAAM,UAAU,KAAK,OAAO,YAAY,UAAU;AACtD,QAAI,OAAO,aAAa,KACvB;IAGD,MAAM,YAAY,KAAK,YAAY,OAAO;AAE1C,SAAK,IAAI,MAAM,kBAAkB,UAAU;AAI3C,SAAK,OAAO,IAAI;AAEhB,SAAK,IAAI,KAAK,UAAU,OAAO,KAAK;GACpC;EACD;EACD;CAED,AAAO,YAAY,MAAsB;AAExC,SAAO,KAAK,WAAW,KAAK,KAAK;CACjC;CAED,MAAa,OACZ,YACA,MACA,QACkB;AAGlB,WAAS,KAAK;AAEd,OAAK,IAAI,MACR,mBAAmB,KAAK,KAAK,eAAe,WAAW,aAAa,OAAO;EAG5E,MAAM,YAAY,KAAK,YAAY;EACnC,MAAM,WAAW,GAAG,UAAU,GAAG;AAEjC,MAAI;GACH,MAAM,SAAS,MAAM,KAAK,cAAc,IACvC,UACA,KAAK,UACL;IACC,QAAQ;IACR,aAAa,KAAK;IAClB,OAAO,KAAK,IAAI;IAChB,gBAAgB;IAChB;AAGF,QAAK,IAAI,MAAM,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O;AAEf,UAAO;EACP;CACD;CAED,MAAa,OAAO,YAAoB,QAA+B;AACtE,OAAK,IAAI,MAAM,kBAAkB,OAAO,iBAAiB,WAAW;EAEpE,MAAM,YAAY,KAAK,YAAY;EACnC,MAAM,WAAW,GAAG,UAAU,GAAG;AAEjC,MAAI;AACH,SAAM,KAAK,cAAc,IAAI,UAAU,EACtC,OAAO,KAAK,IAAI,uBAChB;EACD,SAAQ,OAAO;AACf,QAAK,IAAI,MAAM,0BAA0B;AACzC,OAAI,iBAAiB,MACpB,OAAM,IAAI,kBAAkB,uBAAuB,EAAE,OAAO,OAAO;AAEpE,SAAM;EACN;CACD;AACD;;;;;;;;;;AC3LD,MAAa,qBAAqB,QAAQ;CACzC,MAAM;CACN,UAAU,CAAC,0BAA0B;CACrC,WAAW,WACV,OACE,KAAK;EACL,UAAU;EACV,SAAS;EACT,KAAK;EACL,EACA,KAAK;CACR"}
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "blob"
11
11
  ],
12
12
  "author": "Feunard",
13
- "version": "0.10.3",
13
+ "version": "0.10.4",
14
14
  "type": "module",
15
15
  "engines": {
16
16
  "node": ">=22.0.0"
@@ -23,16 +23,16 @@
23
23
  "src"
24
24
  ],
25
25
  "dependencies": {
26
- "@alepha/bucket": "0.10.3",
27
- "@alepha/core": "0.10.3",
28
- "@alepha/datetime": "0.10.3",
29
- "@alepha/file": "0.10.3",
30
- "@alepha/logger": "0.10.3",
26
+ "@alepha/bucket": "0.10.4",
27
+ "@alepha/core": "0.10.4",
28
+ "@alepha/datetime": "0.10.4",
29
+ "@alepha/file": "0.10.4",
30
+ "@alepha/logger": "0.10.4",
31
31
  "@vercel/blob": "^2.0.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@biomejs/biome": "^2.2.5",
35
- "@types/node": "^24.6.2",
35
+ "@types/node": "^24.7.1",
36
36
  "tsdown": "^0.15.6",
37
37
  "typescript": "^5.9.3",
38
38
  "vitest": "^3.2.4"
@@ -20,7 +20,7 @@ import { $logger } from "@alepha/logger";
20
20
  import { VercelBlobApi } from "./VercelBlobProvider.ts";
21
21
 
22
22
  const envSchema = t.object({
23
- BLOB_READ_WRITE_TOKEN: t.string({
23
+ BLOB_READ_WRITE_TOKEN: t.text({
24
24
  size: "long",
25
25
  }),
26
26
  });