MCPcopy
hub / github.com/directus/directus / write

Method write

packages/storage-driver-supabase/src/index.ts:150–161  ·  view source on GitHub ↗
(filepath: string, content: Readable, type?: string)

Source from the content-addressed store, hash-verified

148 }
149
150 async write(filepath: string, content: Readable, type?: string): Promise<void> {
151 const { error } = await this.bucket.upload(this.fullPath(filepath), content, {
152 contentType: type ?? '',
153 cacheControl: '3600',
154 upsert: true,
155 duplex: 'half',
156 });
157
158 if (error) {
159 throw new Error(`Error uploading file "${filepath}"`, { cause: error });
160 }
161 }
162
163 async delete(filepath: string): Promise<void> {
164 await this.bucket.remove([this.fullPath(filepath)]);

Callers 1

index.test.tsFile · 0.45

Calls 1

fullPathMethod · 0.95

Tested by

no test coverage detected