@supabase/postgrest-js 2.107.0-beta.0 → 2.107.0-canary.0
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.cjs +13 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +13 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/PostgrestBuilder.ts +14 -6
- package/src/version.ts +1 -1
package/package.json
CHANGED
package/src/PostgrestBuilder.ts
CHANGED
|
@@ -69,11 +69,9 @@ export default abstract class PostgrestBuilder<
|
|
|
69
69
|
ClientOptions extends ClientServerOptions,
|
|
70
70
|
Result,
|
|
71
71
|
ThrowOnError extends boolean = false,
|
|
72
|
-
> implements
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
>
|
|
76
|
-
{
|
|
72
|
+
> implements PromiseLike<
|
|
73
|
+
ThrowOnError extends true ? PostgrestResponseSuccess<Result> : PostgrestSingleResponse<Result>
|
|
74
|
+
> {
|
|
77
75
|
protected method: 'GET' | 'HEAD' | 'POST' | 'PATCH' | 'DELETE'
|
|
78
76
|
protected url: URL
|
|
79
77
|
protected headers: Headers
|
|
@@ -476,7 +474,17 @@ export default abstract class PostgrestBuilder<
|
|
|
476
474
|
) {
|
|
477
475
|
data = body
|
|
478
476
|
} else {
|
|
479
|
-
|
|
477
|
+
try {
|
|
478
|
+
data = JSON.parse(body)
|
|
479
|
+
} catch {
|
|
480
|
+
// A 2xx status doesn't guarantee a JSON body; mirror the non-2xx fallback below.
|
|
481
|
+
error = { message: body }
|
|
482
|
+
data = null
|
|
483
|
+
|
|
484
|
+
if (this.shouldThrowOnError) {
|
|
485
|
+
throw new PostgrestError({ message: body, details: '', hint: '', code: '' })
|
|
486
|
+
}
|
|
487
|
+
}
|
|
480
488
|
}
|
|
481
489
|
}
|
|
482
490
|
|
package/src/version.ts
CHANGED
|
@@ -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.107.0-
|
|
7
|
+
export const version = '2.107.0-canary.0'
|