Skip to content

Commit

Permalink
Rename SupabaseStorageClient to StorageClient (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mircea-Pavel Anton committed Mar 12, 2022
1 parent 4b015f6 commit ee712f2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/SupabaseStorageClient.ts → src/StorageClient.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { StorageBucketApi, StorageFileApi } from './lib'
import { Fetch } from './lib/fetch'

export class SupabaseStorageClient extends StorageBucketApi {
export class StorageClient extends StorageBucketApi {
constructor(url: string, headers: { [key: string]: string } = {}, fetch?: Fetch) {
super(url, headers, fetch)
}
Expand Down
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { SupabaseStorageClient } from './SupabaseStorageClient'

export { SupabaseStorageClient }
export {
StorageClient as StorageClient,
StorageClient as SupabaseStorageClient,
} from './StorageClient'
export * from './lib/types'
4 changes: 2 additions & 2 deletions test/storageFileApi.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { SupabaseStorageClient } from '../src/index'
import { StorageClient } from '../src/index'

// TODO: need to setup storage-api server for this test
const URL = 'http://localhost:8000/storage/v1'
const KEY =
'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJzdXBhYmFzZSIsImlhdCI6MTYwMzk2ODgzNCwiZXhwIjoyNTUwNjUzNjM0LCJhdWQiOiIiLCJzdWIiOiIzMTdlYWRjZS02MzFhLTQ0MjktYTBiYi1mMTlhN2E1MTdiNGEiLCJSb2xlIjoicG9zdGdyZXMifQ.pZobPtp6gDcX0UbzMmG3FHSlg4m4Q-22tKtGWalOrNo'

const storage = new SupabaseStorageClient(URL, { Authorization: `Bearer ${KEY}` })
const storage = new StorageClient(URL, { Authorization: `Bearer ${KEY}` })
const newBucketName = 'my-new-public-bucket'

test('get public URL', async () => {
Expand Down

0 comments on commit ee712f2

Please sign in to comment.