@supabase/gotrue-js 2.78.0 → 2.78.1-canary.1

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.
Files changed (36) hide show
  1. package/README.md +9 -0
  2. package/dist/main/GoTrueClient.d.ts +11 -0
  3. package/dist/main/GoTrueClient.d.ts.map +1 -1
  4. package/dist/main/GoTrueClient.js +145 -112
  5. package/dist/main/GoTrueClient.js.map +1 -1
  6. package/dist/main/lib/helpers.d.ts.map +1 -1
  7. package/dist/main/lib/helpers.js +2 -42
  8. package/dist/main/lib/helpers.js.map +1 -1
  9. package/dist/main/lib/types.d.ts +5 -0
  10. package/dist/main/lib/types.d.ts.map +1 -1
  11. package/dist/main/lib/types.js.map +1 -1
  12. package/dist/main/lib/version.d.ts +1 -1
  13. package/dist/main/lib/version.d.ts.map +1 -1
  14. package/dist/main/lib/version.js +1 -1
  15. package/dist/main/lib/version.js.map +1 -1
  16. package/dist/module/GoTrueClient.d.ts +11 -0
  17. package/dist/module/GoTrueClient.d.ts.map +1 -1
  18. package/dist/module/GoTrueClient.js +145 -112
  19. package/dist/module/GoTrueClient.js.map +1 -1
  20. package/dist/module/lib/helpers.d.ts.map +1 -1
  21. package/dist/module/lib/helpers.js +2 -9
  22. package/dist/module/lib/helpers.js.map +1 -1
  23. package/dist/module/lib/types.d.ts +5 -0
  24. package/dist/module/lib/types.d.ts.map +1 -1
  25. package/dist/module/lib/types.js.map +1 -1
  26. package/dist/module/lib/version.d.ts +1 -1
  27. package/dist/module/lib/version.d.ts.map +1 -1
  28. package/dist/module/lib/version.js +1 -1
  29. package/dist/module/lib/version.js.map +1 -1
  30. package/dist/tsconfig.module.tsbuildinfo +1 -1
  31. package/dist/tsconfig.tsbuildinfo +1 -1
  32. package/package.json +4 -3
  33. package/src/GoTrueClient.ts +149 -112
  34. package/src/lib/helpers.ts +2 -8
  35. package/src/lib/types.ts +5 -0
  36. package/src/lib/version.ts +1 -1
@@ -94,16 +94,10 @@ export function parseParametersFromURL(href: string) {
94
94
  type Fetch = typeof fetch
95
95
 
96
96
  export const resolveFetch = (customFetch?: Fetch): Fetch => {
97
- let _fetch: Fetch
98
97
  if (customFetch) {
99
- _fetch = customFetch
100
- } else if (typeof fetch === 'undefined') {
101
- _fetch = (...args) =>
102
- import('@supabase/node-fetch' as any).then(({ default: fetch }) => fetch(...args))
103
- } else {
104
- _fetch = fetch
98
+ return (...args) => customFetch(...args)
105
99
  }
106
- return (...args) => _fetch(...args)
100
+ return (...args) => fetch(...args)
107
101
  }
108
102
 
109
103
  export const looksLikeFetchResponse = (maybeResponse: unknown): maybeResponse is Response => {
package/src/lib/types.ts CHANGED
@@ -107,6 +107,11 @@ export type GoTrueClientOptions = {
107
107
  * @experimental
108
108
  */
109
109
  hasCustomAuthorizationHeader?: boolean
110
+ /**
111
+ * If there is an error with the query, throwOnError will reject the promise by
112
+ * throwing the error instead of returning it as part of a successful response.
113
+ */
114
+ throwOnError?: boolean
110
115
  }
111
116
 
112
117
  const WeakPasswordReasons = ['length', 'characters', 'pwned'] as const
@@ -4,4 +4,4 @@
4
4
  // - Debugging and support (identifying which version is running)
5
5
  // - Telemetry and logging (version reporting in errors/analytics)
6
6
  // - Ensuring build artifacts match the published package version
7
- export const version = '2.78.0'
7
+ export const version = '2.78.1-canary.1'