@supacloud/lite 0.29.2 → 0.29.3
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.29.3](https://github.com/vibeunion/supacloud/compare/supacloud-lite-v0.29.2...supacloud-lite-v0.29.3) (2026-10-16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **lite:** preserve single-column table RPC responses ([#1971](https://github.com/vibeunion/supacloud/issues/1971)) ([63edb93](https://github.com/vibeunion/supacloud/commit/63edb937322130796260a1284c09cc895735214e))
|
|
9
|
+
|
|
3
10
|
## [0.29.2](https://github.com/vibeunion/supacloud/compare/supacloud-lite-v0.29.1...supacloud-lite-v0.29.2) (2026-10-15)
|
|
4
11
|
|
|
5
12
|
|
package/dist/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import { dirname as dirname8, join as join10, resolve as resolve6 } from "path";
|
|
|
8
8
|
// package.json
|
|
9
9
|
var package_default = {
|
|
10
10
|
name: "@supacloud/lite",
|
|
11
|
-
version: "0.29.
|
|
11
|
+
version: "0.29.3",
|
|
12
12
|
description: "Bun-native, single-project Supabase-compatible backend powered by PGlite or native PostgreSQL",
|
|
13
13
|
type: "module",
|
|
14
14
|
license: "Apache-2.0",
|
|
@@ -6820,6 +6820,7 @@ class Database {
|
|
|
6820
6820
|
if (cached)
|
|
6821
6821
|
return cached;
|
|
6822
6822
|
const res = await this.engine.query(`select p.proname as name, p.proretset as returns_set,
|
|
6823
|
+
coalesce('t' = any(p.proargmodes), false) as returns_table,
|
|
6823
6824
|
t.typname as return_type, t.typtype as return_typtype,
|
|
6824
6825
|
p.provolatile as volatility,
|
|
6825
6826
|
p.pronargs - p.pronargdefaults as required_arg_count,
|
|
@@ -6841,6 +6842,7 @@ class Database {
|
|
|
6841
6842
|
schema,
|
|
6842
6843
|
name: r.name,
|
|
6843
6844
|
returnsSet: r.returns_set,
|
|
6845
|
+
returnsTable: r.returns_table,
|
|
6844
6846
|
returnType: r.return_type,
|
|
6845
6847
|
returnTypType: r.return_typtype,
|
|
6846
6848
|
volatility: r.volatility,
|
|
@@ -8377,6 +8379,9 @@ function renderFilter(f, alias) {
|
|
|
8377
8379
|
|
|
8378
8380
|
// src/runtime/rest/errors.ts
|
|
8379
8381
|
function statusForSqlState(code, authenticated = true) {
|
|
8382
|
+
if (code.startsWith("PT")) {
|
|
8383
|
+
return /^PT[2-5][0-9]{2}$/.test(code) ? Number(code.slice(2)) : 500;
|
|
8384
|
+
}
|
|
8380
8385
|
switch (code) {
|
|
8381
8386
|
case "42501":
|
|
8382
8387
|
return authenticated ? 403 : 401;
|
|
@@ -8393,10 +8398,52 @@ function statusForSqlState(code, authenticated = true) {
|
|
|
8393
8398
|
return 409;
|
|
8394
8399
|
case "57014":
|
|
8395
8400
|
return 408;
|
|
8401
|
+
case "57P01":
|
|
8402
|
+
return 503;
|
|
8403
|
+
case "53400":
|
|
8404
|
+
return 500;
|
|
8396
8405
|
default:
|
|
8406
|
+
if (code.startsWith("08") || code.startsWith("53"))
|
|
8407
|
+
return 503;
|
|
8397
8408
|
return 400;
|
|
8398
8409
|
}
|
|
8399
8410
|
}
|
|
8411
|
+
function invalidPgrstResponse(part) {
|
|
8412
|
+
return jsonResponse(500, {
|
|
8413
|
+
code: "PGRST121",
|
|
8414
|
+
message: `Could not parse JSON in the "RAISE SQLSTATE 'PGRST'" error`,
|
|
8415
|
+
details: `Invalid JSON value or fields for ${part}`,
|
|
8416
|
+
hint: part === "MESSAGE" ? "MESSAGE must contain string 'code' and 'message'; optional 'details' and 'hint' must be strings or null." : "DETAIL must contain integer 'status' (200-599), string-valued 'headers', and optional string 'status_text'."
|
|
8417
|
+
});
|
|
8418
|
+
}
|
|
8419
|
+
function pgrstErrorToResponse(pg) {
|
|
8420
|
+
let part = "MESSAGE";
|
|
8421
|
+
try {
|
|
8422
|
+
const body = JSON.parse(pg.message);
|
|
8423
|
+
if (!isRecord(body) || typeof body.code !== "string" || typeof body.message !== "string" || body.details != null && typeof body.details !== "string" || body.hint != null && typeof body.hint !== "string") {
|
|
8424
|
+
return invalidPgrstResponse(part);
|
|
8425
|
+
}
|
|
8426
|
+
part = "DETAIL";
|
|
8427
|
+
const detail = JSON.parse(pg.detail ?? "");
|
|
8428
|
+
if (!isRecord(detail) || typeof detail.status !== "number" || !Number.isInteger(detail.status) || detail.status < 200 || detail.status > 599 || !isRecord(detail.headers) || detail.status_text != null && (typeof detail.status_text !== "string" || !/^[\t\x20-\x7e\x80-\xff]*$/.test(detail.status_text))) {
|
|
8429
|
+
return invalidPgrstResponse(part);
|
|
8430
|
+
}
|
|
8431
|
+
const headers = new Headers;
|
|
8432
|
+
for (const [name, value] of Object.entries(detail.headers)) {
|
|
8433
|
+
if (typeof value !== "string")
|
|
8434
|
+
return invalidPgrstResponse(part);
|
|
8435
|
+
headers.set(name, value);
|
|
8436
|
+
}
|
|
8437
|
+
return jsonResponse(detail.status, {
|
|
8438
|
+
code: body.code,
|
|
8439
|
+
message: body.message,
|
|
8440
|
+
details: body.details ?? null,
|
|
8441
|
+
hint: body.hint ?? null
|
|
8442
|
+
}, Object.fromEntries(headers), typeof detail.status_text === "string" ? detail.status_text : undefined);
|
|
8443
|
+
} catch {
|
|
8444
|
+
return invalidPgrstResponse(part);
|
|
8445
|
+
}
|
|
8446
|
+
}
|
|
8400
8447
|
function errorToResponse(e, authenticated = true) {
|
|
8401
8448
|
if (e instanceof ApiError) {
|
|
8402
8449
|
return jsonResponse(e.status, e.body);
|
|
@@ -8406,6 +8453,8 @@ function errorToResponse(e, authenticated = true) {
|
|
|
8406
8453
|
}
|
|
8407
8454
|
const pg = e;
|
|
8408
8455
|
if (pg && typeof pg.code === "string" && /^[0-9A-Z]{5}$/.test(pg.code)) {
|
|
8456
|
+
if (pg.code === "PGRST")
|
|
8457
|
+
return pgrstErrorToResponse(pg);
|
|
8409
8458
|
return jsonResponse(statusForSqlState(pg.code, authenticated), {
|
|
8410
8459
|
code: pg.code,
|
|
8411
8460
|
message: pg.message,
|
|
@@ -8416,9 +8465,11 @@ function errorToResponse(e, authenticated = true) {
|
|
|
8416
8465
|
const message = e instanceof Error ? e.message : String(e);
|
|
8417
8466
|
return jsonResponse(500, { code: "PGRST500", message, details: null, hint: null });
|
|
8418
8467
|
}
|
|
8419
|
-
function jsonResponse(status, body, headers = {}) {
|
|
8420
|
-
|
|
8468
|
+
function jsonResponse(status, body, headers = {}, statusText) {
|
|
8469
|
+
const bodyless = status === 204 || status === 205 || status === 304;
|
|
8470
|
+
return new Response(bodyless ? null : JSON.stringify(body), {
|
|
8421
8471
|
status,
|
|
8472
|
+
...statusText === undefined ? {} : { statusText },
|
|
8422
8473
|
headers: { "content-type": "application/json; charset=utf-8", ...headers }
|
|
8423
8474
|
});
|
|
8424
8475
|
}
|
|
@@ -8753,7 +8804,7 @@ class RestHandler {
|
|
|
8753
8804
|
const value = res.rows[0].result;
|
|
8754
8805
|
return jsonResponse(200, value);
|
|
8755
8806
|
}
|
|
8756
|
-
if (fn.returnsSet && ["b", "d", "e"].includes(fn.returnTypType)) {
|
|
8807
|
+
if (fn.returnsSet && !fn.returnsTable && ["b", "d", "e"].includes(fn.returnTypType)) {
|
|
8757
8808
|
const res = await withRpcContext((query) => query(`select coalesce(json_agg(_v), '[]'::json) as body from ${call} as _t(_v)`, []));
|
|
8758
8809
|
return jsonResponse(200, res.rows[0].body);
|
|
8759
8810
|
}
|
package/dist/index.js
CHANGED
|
@@ -88,7 +88,7 @@ function randomToken(bytes = 32) {
|
|
|
88
88
|
// package.json
|
|
89
89
|
var package_default = {
|
|
90
90
|
name: "@supacloud/lite",
|
|
91
|
-
version: "0.29.
|
|
91
|
+
version: "0.29.3",
|
|
92
92
|
description: "Bun-native, single-project Supabase-compatible backend powered by PGlite or native PostgreSQL",
|
|
93
93
|
type: "module",
|
|
94
94
|
license: "Apache-2.0",
|
|
@@ -6814,6 +6814,7 @@ class Database {
|
|
|
6814
6814
|
if (cached)
|
|
6815
6815
|
return cached;
|
|
6816
6816
|
const res = await this.engine.query(`select p.proname as name, p.proretset as returns_set,
|
|
6817
|
+
coalesce('t' = any(p.proargmodes), false) as returns_table,
|
|
6817
6818
|
t.typname as return_type, t.typtype as return_typtype,
|
|
6818
6819
|
p.provolatile as volatility,
|
|
6819
6820
|
p.pronargs - p.pronargdefaults as required_arg_count,
|
|
@@ -6835,6 +6836,7 @@ class Database {
|
|
|
6835
6836
|
schema,
|
|
6836
6837
|
name: r.name,
|
|
6837
6838
|
returnsSet: r.returns_set,
|
|
6839
|
+
returnsTable: r.returns_table,
|
|
6838
6840
|
returnType: r.return_type,
|
|
6839
6841
|
returnTypType: r.return_typtype,
|
|
6840
6842
|
volatility: r.volatility,
|
|
@@ -8371,6 +8373,9 @@ function renderFilter(f, alias) {
|
|
|
8371
8373
|
|
|
8372
8374
|
// src/runtime/rest/errors.ts
|
|
8373
8375
|
function statusForSqlState(code, authenticated = true) {
|
|
8376
|
+
if (code.startsWith("PT")) {
|
|
8377
|
+
return /^PT[2-5][0-9]{2}$/.test(code) ? Number(code.slice(2)) : 500;
|
|
8378
|
+
}
|
|
8374
8379
|
switch (code) {
|
|
8375
8380
|
case "42501":
|
|
8376
8381
|
return authenticated ? 403 : 401;
|
|
@@ -8387,10 +8392,52 @@ function statusForSqlState(code, authenticated = true) {
|
|
|
8387
8392
|
return 409;
|
|
8388
8393
|
case "57014":
|
|
8389
8394
|
return 408;
|
|
8395
|
+
case "57P01":
|
|
8396
|
+
return 503;
|
|
8397
|
+
case "53400":
|
|
8398
|
+
return 500;
|
|
8390
8399
|
default:
|
|
8400
|
+
if (code.startsWith("08") || code.startsWith("53"))
|
|
8401
|
+
return 503;
|
|
8391
8402
|
return 400;
|
|
8392
8403
|
}
|
|
8393
8404
|
}
|
|
8405
|
+
function invalidPgrstResponse(part) {
|
|
8406
|
+
return jsonResponse(500, {
|
|
8407
|
+
code: "PGRST121",
|
|
8408
|
+
message: `Could not parse JSON in the "RAISE SQLSTATE 'PGRST'" error`,
|
|
8409
|
+
details: `Invalid JSON value or fields for ${part}`,
|
|
8410
|
+
hint: part === "MESSAGE" ? "MESSAGE must contain string 'code' and 'message'; optional 'details' and 'hint' must be strings or null." : "DETAIL must contain integer 'status' (200-599), string-valued 'headers', and optional string 'status_text'."
|
|
8411
|
+
});
|
|
8412
|
+
}
|
|
8413
|
+
function pgrstErrorToResponse(pg) {
|
|
8414
|
+
let part = "MESSAGE";
|
|
8415
|
+
try {
|
|
8416
|
+
const body = JSON.parse(pg.message);
|
|
8417
|
+
if (!isRecord(body) || typeof body.code !== "string" || typeof body.message !== "string" || body.details != null && typeof body.details !== "string" || body.hint != null && typeof body.hint !== "string") {
|
|
8418
|
+
return invalidPgrstResponse(part);
|
|
8419
|
+
}
|
|
8420
|
+
part = "DETAIL";
|
|
8421
|
+
const detail = JSON.parse(pg.detail ?? "");
|
|
8422
|
+
if (!isRecord(detail) || typeof detail.status !== "number" || !Number.isInteger(detail.status) || detail.status < 200 || detail.status > 599 || !isRecord(detail.headers) || detail.status_text != null && (typeof detail.status_text !== "string" || !/^[\t\x20-\x7e\x80-\xff]*$/.test(detail.status_text))) {
|
|
8423
|
+
return invalidPgrstResponse(part);
|
|
8424
|
+
}
|
|
8425
|
+
const headers = new Headers;
|
|
8426
|
+
for (const [name, value] of Object.entries(detail.headers)) {
|
|
8427
|
+
if (typeof value !== "string")
|
|
8428
|
+
return invalidPgrstResponse(part);
|
|
8429
|
+
headers.set(name, value);
|
|
8430
|
+
}
|
|
8431
|
+
return jsonResponse(detail.status, {
|
|
8432
|
+
code: body.code,
|
|
8433
|
+
message: body.message,
|
|
8434
|
+
details: body.details ?? null,
|
|
8435
|
+
hint: body.hint ?? null
|
|
8436
|
+
}, Object.fromEntries(headers), typeof detail.status_text === "string" ? detail.status_text : undefined);
|
|
8437
|
+
} catch {
|
|
8438
|
+
return invalidPgrstResponse(part);
|
|
8439
|
+
}
|
|
8440
|
+
}
|
|
8394
8441
|
function errorToResponse(e, authenticated = true) {
|
|
8395
8442
|
if (e instanceof ApiError) {
|
|
8396
8443
|
return jsonResponse(e.status, e.body);
|
|
@@ -8400,6 +8447,8 @@ function errorToResponse(e, authenticated = true) {
|
|
|
8400
8447
|
}
|
|
8401
8448
|
const pg = e;
|
|
8402
8449
|
if (pg && typeof pg.code === "string" && /^[0-9A-Z]{5}$/.test(pg.code)) {
|
|
8450
|
+
if (pg.code === "PGRST")
|
|
8451
|
+
return pgrstErrorToResponse(pg);
|
|
8403
8452
|
return jsonResponse(statusForSqlState(pg.code, authenticated), {
|
|
8404
8453
|
code: pg.code,
|
|
8405
8454
|
message: pg.message,
|
|
@@ -8410,9 +8459,11 @@ function errorToResponse(e, authenticated = true) {
|
|
|
8410
8459
|
const message = e instanceof Error ? e.message : String(e);
|
|
8411
8460
|
return jsonResponse(500, { code: "PGRST500", message, details: null, hint: null });
|
|
8412
8461
|
}
|
|
8413
|
-
function jsonResponse(status, body, headers = {}) {
|
|
8414
|
-
|
|
8462
|
+
function jsonResponse(status, body, headers = {}, statusText) {
|
|
8463
|
+
const bodyless = status === 204 || status === 205 || status === 304;
|
|
8464
|
+
return new Response(bodyless ? null : JSON.stringify(body), {
|
|
8415
8465
|
status,
|
|
8466
|
+
...statusText === undefined ? {} : { statusText },
|
|
8416
8467
|
headers: { "content-type": "application/json; charset=utf-8", ...headers }
|
|
8417
8468
|
});
|
|
8418
8469
|
}
|
|
@@ -8747,7 +8798,7 @@ class RestHandler {
|
|
|
8747
8798
|
const value = res.rows[0].result;
|
|
8748
8799
|
return jsonResponse(200, value);
|
|
8749
8800
|
}
|
|
8750
|
-
if (fn.returnsSet && ["b", "d", "e"].includes(fn.returnTypType)) {
|
|
8801
|
+
if (fn.returnsSet && !fn.returnsTable && ["b", "d", "e"].includes(fn.returnTypType)) {
|
|
8751
8802
|
const res = await withRpcContext((query) => query(`select coalesce(json_agg(_v), '[]'::json) as body from ${call} as _t(_v)`, []));
|
|
8752
8803
|
return jsonResponse(200, res.rows[0].body);
|
|
8753
8804
|
}
|
|
@@ -43,6 +43,8 @@ export interface FunctionInfo {
|
|
|
43
43
|
schema: string;
|
|
44
44
|
name: string;
|
|
45
45
|
returnsSet: boolean;
|
|
46
|
+
/** Explicit RETURNS TABLE outputs, including a single base/domain/enum column. */
|
|
47
|
+
returnsTable: boolean;
|
|
46
48
|
returnType: string;
|
|
47
49
|
/** pg_type.typtype: b=base, c=composite, p=pseudo, d=domain, e=enum */
|
|
48
50
|
returnTypType: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../../src/runtime/db/database.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAA+B,MAAM,aAAa,CAAA;AAGvF,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEhE,2CAA2C;AAC3C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,OAAO,CAAA;IACnB,UAAU,EAAE,OAAO,CAAA;IACnB,YAAY,EAAE,OAAO,CAAA;CACtB;AAED,mFAAmF;AACnF,MAAM,WAAW,UAAU;IACzB,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB;AAED,uEAAuE;AACvE,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,UAAU,EAAE,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QAAQ,CAAC,MAAM,CAAC,CAAA;KAAE,EAC/D,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAC9B,IAAI;IAeP,sDAAsD;IAChD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,EAAE,CA2BjE;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG/C;AAED,qEAAqE;AACrE,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAElD"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** HTTP status for a Postgres SQLSTATE, following PostgREST's mapping. */
|
|
2
2
|
export declare function statusForSqlState(code: string, authenticated?: boolean): number;
|
|
3
3
|
/**
|
|
4
|
-
* Normalize
|
|
5
|
-
*
|
|
6
|
-
* {@link statusForSqlState}
|
|
4
|
+
* Normalize thrown errors: ApiError/ParseError keep their status, PGRST
|
|
5
|
+
* exceptions supply structured response metadata, and other 5-char SQLSTATEs
|
|
6
|
+
* use {@link statusForSqlState}. Everything else becomes a 500.
|
|
7
7
|
*/
|
|
8
8
|
export declare function errorToResponse(e: unknown, authenticated?: boolean): Response;
|
|
9
|
-
/** JSON Response helper;
|
|
10
|
-
export declare function jsonResponse(status: number, body: unknown, headers?: Record<string, string
|
|
9
|
+
/** JSON Response helper; null-body HTTP statuses never serialize a payload. */
|
|
10
|
+
export declare function jsonResponse(status: number, body: unknown, headers?: Record<string, string>, statusText?: string): Response;
|
|
11
11
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/runtime/rest/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/runtime/rest/errors.ts"],"names":[],"mappings":"AASA,0EAA0E;AAC1E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,UAAO,GAAG,MAAM,CA8B5E;AAuDD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,UAAO,GAAG,QAAQ,CAmB1E;AAED,+EAA+E;AAC/E,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EACb,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EACpC,UAAU,CAAC,EAAE,MAAM,GAClB,QAAQ,CAOV"}
|