Skip to content

Conversation

dshukertjr
Copy link
Member

@dshukertjr dshukertjr commented Jan 2, 2021

What kind of change does this PR introduce?

In order to get the User type, I had to do a import like this

import { User } from '@supabase/gotrue-js/dist/main/lib/types'

so I thought it would be better to export User from supabase-js

What is the current behavior?

User is not exported within supabase-js

What is the new behavior?

User is exported as AuthUser. Developers should be able to import the AuthUser type like this:

import { AuthUser } from "supabase-js";

@kiwicopple
Copy link
Member

Good idea @dshukertjr , but perhaps we should export this one as AuthUser? With GoTrue it isn't really necessary, but this library has a long way to go, so hopefully this will prevent conflicts in the future.

@dshukertjr
Copy link
Member Author

dshukertjr commented Jan 2, 2021

@kiwicopple Sounds good! Let me update the code right now.

@kiwicopple
Copy link
Member

Legend, thanks @dshukertjr !

@kiwicopple kiwicopple merged commit 20498ca into supabase:master Jan 3, 2021
@kiwicopple
Copy link
Member

🎉 This PR is included in version 1.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

mandarini pushed a commit that referenced this pull request Oct 2, 2025
* feat: improve function return types (#60)

* feat: improve types

* chore: better error handling

* feat: custom storage api error

* chore: use custom error type

* chore: update custom error type

* chore: replace instanceof with isStorageError

* chore: move isStorageError to a non-static method

* Improve `uploadOrUpdate` returned data. (#63)

* fix: typo in updateBucket jsdoc

* fix: import cross-fetch conditionally

* fix: es2020

* Also return the clean path for the uploaded file.

* Update readme.

* Add bucket id in returned data.

* Update readme

* Fix return type for `upload` and `update`.

* Fix typo in code snippet comment.

* Rename `downloadPath` to `path`

* Update return types

Co-authored-by: Jonathan Picques <jonathan.picques@gmail.com>
Co-authored-by: Bobbie Soedirgo <bobbie@soedirgo.dev>
Co-authored-by: Mircea-Pavel Anton <mircea.anton99@yahoo.com>

* Improve `getPublicUrl` (#62)

* Improve `getPublicUrl`

* Make return types consistent across all functions.

* Undo return type change

* Change the `getPublicUrl` method to return only the url as string.

* Remove redundant method.

* Update tests.

Co-authored-by: Mircea-Pavel Anton <mircea.anton99@yahoo.com>

* upload, update: don't return bucketId

as a return parameter and in the path. Just returning the path without the bucket id makes it easier to pass the value in to other storage-js functions. Also not calling it Key -- was uppercase and not as clear as just calling it path.

* add docs folder to .gitignore

* Merge branch 'master' into chore/merge-master-04-08-22 (#82)

* fix: remove release config from package.json (#83)

* chore: merge main into next (#85)

* fix: typo in updateBucket jsdoc

* fix: import cross-fetch conditionally

* fix: es2020

* chore: add search param to SearchOptions jsdoc on list function (#59)

* build(release-next): sets up the next branch as an npm prerelease (#80)

* fix: rename main release branch (#84)

Co-authored-by: Jonathan Picques <jonathan.picques@gmail.com>
Co-authored-by: Bobbie Soedirgo <bobbie@soedirgo.dev>

* fix: encode all urls

fixes #78

this should ideally be done in the api server, but doing this breaking change at the client library first, so when we do it at the backend, only folks who are using the api directly will need to upgrade.

* return values is always wrapped by data

signedURL used to return a url directly and inside the data object. This is inconsistent. Now we always return values inside a data object only.

* fix: pass through all values returned by backend

instead of cherry picking only name - we still do this in the types though.

also ensures data is always an object.

Fixes #6

* fix tests

* fix metadata type

Previously accessing metada.contentType would throw a type error since we set the type to an empty object.

* only export StorageClient

supabase/storage-js#46

removing the change we added for backward compatibility

* update ci to node 16

* upgrade typedoc to latest version

* fix: move bucket and file api to package folder

docs look better when we do this and add the packages to the entrypoint to the typedoc command

* modify publicurl to always return data

all methods return data and an error

* dont return error for getPublicUrl

* fix: signed url is returned as signedUrl

matches the method name createSignedUrl

* downgrade typedoc to 0.22.16

our doc generation pipeline only works with 0.22.16 for now

* exclude protected properties from typedoc

* fix: typedocs

* chore: merge main into next (#99)

* fix: typo in updateBucket jsdoc

* fix: import cross-fetch conditionally

* fix: es2020

* chore: add search param to SearchOptions jsdoc on list function (#59)

* build(release-next): sets up the next branch as an npm prerelease (#80)

* fix: rename main release branch (#84)

* build(release-rc): sets up the rc branch as an npm prerelease (#98)

Co-authored-by: Jonathan Picques <jonathan.picques@gmail.com>
Co-authored-by: Bobbie Soedirgo <bobbie@soedirgo.dev>

* feat: Release V2 RC

BREAKING CHANGE: Release V2

* update docs (#102)

* Fix docs typo (#104)

* chore: increased test coverage (#106)

* fix: consistent return types for copy (#110)

* feat: download file via url (#112)

* fix: merge main into rc (#113)

* fix: typo in updateBucket jsdoc

* fix: import cross-fetch conditionally

* fix: es2020

* chore: add search param to SearchOptions jsdoc on list function (#59)

* build(release-next): sets up the next branch as an npm prerelease (#80)

* fix: rename main release branch (#84)

* build(release-rc): sets up the rc branch as an npm prerelease (#98)

* Adds v1 docs (#107)

* docs: ci

Co-authored-by: Jonathan Picques <jonathan.picques@gmail.com>
Co-authored-by: Bobbie Soedirgo <bobbie@soedirgo.dev>
Co-authored-by: Copple <10214025+kiwicopple@users.noreply.github.com>

Co-authored-by: Mircea-Pavel Anton <contact@mirceanton.com>
Co-authored-by: Jonathan Picques <jonathan.picques@gmail.com>
Co-authored-by: Bobbie Soedirgo <bobbie@soedirgo.dev>
Co-authored-by: Mircea-Pavel Anton <mircea.anton99@yahoo.com>
Co-authored-by: Inian <inian1234@gmail.com>
Co-authored-by: Fabrizio <fabri.feno@gmail.com>
Co-authored-by: Copple <10214025+kiwicopple@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants