@supacloud/lite 0.34.0 → 0.35.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.
- package/CHANGELOG.md +15 -0
- package/README.md +50 -0
- package/dist/cli.js +4600 -216
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4601 -216
- package/dist/project-runtime.d.ts +6 -0
- package/dist/project-runtime.d.ts.map +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/rest/handler.d.ts.map +1 -1
- package/dist/runtime/storage/handler.d.ts +20 -0
- package/dist/runtime/storage/handler.d.ts.map +1 -1
- package/dist/runtime/storage/s3.d.ts +69 -0
- package/dist/runtime/storage/s3.d.ts.map +1 -0
- package/dist/runtime/types.d.ts +11 -0
- package/dist/runtime/types.d.ts.map +1 -1
- package/package.json +9 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.35.1](https://github.com/vibeunion/supacloud/compare/supacloud-lite-v0.35.0...supacloud-lite-v0.35.1) (2026-10-30)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **upstream:** sync Supabase SDK, CLI, Realtime and Storage metadata ([#2290](https://github.com/vibeunion/supacloud/issues/2290)) ([fa15832](https://github.com/vibeunion/supacloud/commit/fa1583267a6535f7f45cb0c2a93c62a1c7643643))
|
|
9
|
+
|
|
10
|
+
## [0.35.0](https://github.com/vibeunion/supacloud/compare/supacloud-lite-v0.34.0...supacloud-lite-v0.35.0) (2026-10-26)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **lite:** add PostgREST count strategies and rollback preference ([#2253](https://github.com/vibeunion/supacloud/issues/2253)) ([b87ef01](https://github.com/vibeunion/supacloud/commit/b87ef01f320cb1ed5b94cd16ea0412cf798fe5c9))
|
|
16
|
+
* **lite:** add S3-compatible storage endpoint ([#2252](https://github.com/vibeunion/supacloud/issues/2252)) ([37a37b3](https://github.com/vibeunion/supacloud/commit/37a37b3e193cd328a5ef5e852d927b594ad1856f))
|
|
17
|
+
|
|
3
18
|
## [0.34.0](https://github.com/vibeunion/supacloud/compare/supacloud-lite-v0.33.2...supacloud-lite-v0.34.0) (2026-10-26)
|
|
4
19
|
|
|
5
20
|
|
package/README.md
CHANGED
|
@@ -253,6 +253,9 @@ supacloud-lite auth create-user --project-dir ./my-project \
|
|
|
253
253
|
- `SUPACLOUD_LITE_STORAGE_DIR`
|
|
254
254
|
- `SUPACLOUD_LITE_STORAGE_BACKEND`:`fs`(默认)、`memory` 或 `s3`
|
|
255
255
|
- `SUPACLOUD_LITE_S3_PREFIX`:S3 对象 key 前缀,可被 `--s3-prefix` 覆盖
|
|
256
|
+
- `SUPACLOUD_LITE_S3_ENDPOINT_ACCESS_KEY_ID` / `SUPACLOUD_LITE_S3_ENDPOINT_SECRET_ACCESS_KEY`:启用入站 `/storage/v1/s3` 的 SigV4 凭据,必须成对设置
|
|
257
|
+
- `SUPACLOUD_LITE_S3_ENDPOINT_REGION`:入站 S3 期望的 SigV4 region,默认 `us-east-1`
|
|
258
|
+
- `SUPACLOUD_LITE_S3_ENDPOINT_BUCKETS`:逗号分隔的入站 S3 bucket allowlist;为空表示项目内全部 bucket
|
|
256
259
|
- `SUPACLOUD_LITE_POSTGRES_MIRROR`:native 引擎下载 PostgreSQL 发布包时使用的 HTTPS 镜像前缀,例如 `https://ghproxy.net/`
|
|
257
260
|
- `SUPACLOUD_LITE_ENGINE`:`pglite`(默认)或 `native`
|
|
258
261
|
- `SUPACLOUD_LITE_REPLICATION_PROFILE`:仅支持显式值 `powersync`,且仅用于 native 引擎
|
|
@@ -366,6 +369,26 @@ S3 模式的快照只包含数据库中的 Storage 元数据和密钥,不复
|
|
|
366
369
|
|
|
367
370
|
内存数据库没有可持久化的数据,因此 `snapshot` 和 `upgrade` 会拒绝 `--memory`。
|
|
368
371
|
|
|
372
|
+
### S3 兼容入口
|
|
373
|
+
|
|
374
|
+
设置 `SUPACLOUD_LITE_S3_ENDPOINT_ACCESS_KEY_ID` 和 `SUPACLOUD_LITE_S3_ENDPOINT_SECRET_ACCESS_KEY` 后,Lite 会在 `/storage/v1/s3` 挂载 SigV4 + XML 的 S3 协议入口。AWS SDK 使用 path-style endpoint:
|
|
375
|
+
|
|
376
|
+
```ts
|
|
377
|
+
const s3 = new S3Client({
|
|
378
|
+
endpoint: 'https://example.com/storage/v1/s3',
|
|
379
|
+
region: 'us-east-1',
|
|
380
|
+
forcePathStyle: true,
|
|
381
|
+
credentials: { accessKeyId, secretAccessKey },
|
|
382
|
+
})
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
支持 `ListBuckets`、Bucket 创建/HEAD/删除、`PutObject`、`GetObject`/Range、`HeadObject`、`DeleteObject`、`DeleteObjects`、`ListObjectsV2`、`CopyObject`、Presigned GET,以及最多 10000 个 part 的 multipart 上传。Multipart part 会先写入 StorageDriver 的临时 key,完成时按顺序合并;因此它适合单机 Lite,不是大规模并行对象组装服务。
|
|
386
|
+
|
|
387
|
+
S3 对象和 multipart 完成后的总大小上限为 64 MiB,同时遵守 bucket 的大小、MIME 类型限制及项目默认大小限制。Multipart 完成请求必须明确列出升序且不重复的 part;XML 请求体上限为 2 MiB。
|
|
388
|
+
项目最多保留 128 个活跃 multipart 上传、10000 个临时 part 和 256 MiB 临时数据。上传 24 小时后过期,启动和后续 multipart 请求会清理过期数据;删除 bucket 时也会清理其临时分片。
|
|
389
|
+
|
|
390
|
+
第一版明确限制:只支持 path-style,不支持 virtual-hosted-style、S3 ACL/Bucket Policy、Versioning、Object Lock、Replication、S3 Select 和 `STREAMING-*` SigV4 payload。S3 凭据是服务级凭据,默认绕过 RLS;需要隔离时用 `SUPACLOUD_LITE_S3_ENDPOINT_BUCKETS` 限定 bucket。S3 写入仍使用与普通 Storage API 相同的 bucket/object 元数据和 StorageDriver。
|
|
391
|
+
|
|
369
392
|
### 兼容范围
|
|
370
393
|
|
|
371
394
|
| 能力 | V1 状态 | 说明 |
|
|
@@ -389,6 +412,8 @@ S3 模式的快照只包含数据库中的 Storage 元数据和密钥,不复
|
|
|
389
412
|
|
|
390
413
|
RLS 表的 Realtime DELETE 无法在行删除后安全重放 SELECT policy,因此 V1 只向 `service_role` 订阅者发送这类 DELETE 事件。普通用户仍可收到通过逐行 RLS 校验的 INSERT/UPDATE 事件。
|
|
391
414
|
|
|
415
|
+
PostgREST 的边缘语义补充:表和 view 的 `Prefer: count=planned` 和 `count=estimated` 都在当前角色与 JWT claims 的只读事务中读取最外层 `count(*)` 输入节点的 `Plan Rows`(该计数聚合节点本身恒为 1),保留过滤条件、RLS、inner embed、view 和查询本身的 GROUP BY 聚合。Lite 不直接读取全表 `pg_class.reltuples`;`estimated` 是保守的 planner 兼容实现,不实现 PostgREST 按阈值切换精确计数的行为,估算值仍可能不准确。两者都只用于 GET/HEAD,结果仍写入 `Content-Range`。`Prefer: tx=rollback` 可包裹成功的 POST/PATCH/DELETE,返回与实际提交相同的状态和 representation,但事务最终回滚且不触发 CDC/webhook。其他 `Prefer` 值(`return`、`resolution`、`missing`)行为不变。
|
|
416
|
+
|
|
392
417
|
Realtime 也支持服务端 HTTP 广播:
|
|
393
418
|
|
|
394
419
|
```http
|
|
@@ -741,6 +766,9 @@ Environment variables:
|
|
|
741
766
|
- `SUPACLOUD_LITE_STORAGE_DIR`
|
|
742
767
|
- `SUPACLOUD_LITE_STORAGE_BACKEND`: `fs` (default), `memory`, or `s3`
|
|
743
768
|
- `SUPACLOUD_LITE_S3_PREFIX`: S3 object key prefix, can be overridden by `--s3-prefix`
|
|
769
|
+
- `SUPACLOUD_LITE_S3_ENDPOINT_ACCESS_KEY_ID` / `SUPACLOUD_LITE_S3_ENDPOINT_SECRET_ACCESS_KEY`: SigV4 credentials enabling the inbound `/storage/v1/s3` endpoint; set both together
|
|
770
|
+
- `SUPACLOUD_LITE_S3_ENDPOINT_REGION`: SigV4 region expected by the inbound S3 endpoint, default `us-east-1`
|
|
771
|
+
- `SUPACLOUD_LITE_S3_ENDPOINT_BUCKETS`: comma-separated bucket allowlist for the inbound endpoint; empty means every project bucket
|
|
744
772
|
- `SUPACLOUD_LITE_POSTGRES_MIRROR`: HTTPS prefix used to proxy native-engine PostgreSQL release downloads, for example `https://ghproxy.net/`
|
|
745
773
|
- `SUPACLOUD_LITE_ENGINE`: `pglite` (default) or `native`
|
|
746
774
|
- `SUPACLOUD_LITE_REPLICATION_PROFILE`: explicit `powersync` opt-in for the native engine only
|
|
@@ -915,6 +943,26 @@ See repository document `docs/lite-runtime-compatibility.md` for configuration
|
|
|
915
943
|
and acceptance boundaries. Run `bun run benchmark` (or add `--native`) in the
|
|
916
944
|
source package for a synthetic baseline, not a production performance claim.
|
|
917
945
|
|
|
946
|
+
### S3-compatible endpoint
|
|
947
|
+
|
|
948
|
+
When `SUPACLOUD_LITE_S3_ENDPOINT_ACCESS_KEY_ID` and `SUPACLOUD_LITE_S3_ENDPOINT_SECRET_ACCESS_KEY` are set, Lite mounts a SigV4 + XML S3 endpoint at `/storage/v1/s3`. Configure AWS SDKs with a path-style endpoint:
|
|
949
|
+
|
|
950
|
+
```ts
|
|
951
|
+
const s3 = new S3Client({
|
|
952
|
+
endpoint: 'https://example.com/storage/v1/s3',
|
|
953
|
+
region: 'us-east-1',
|
|
954
|
+
forcePathStyle: true,
|
|
955
|
+
credentials: { accessKeyId, secretAccessKey },
|
|
956
|
+
})
|
|
957
|
+
```
|
|
958
|
+
|
|
959
|
+
It supports `ListBuckets`, bucket create/HEAD/delete, `PutObject`, `GetObject`/Range, `HeadObject`, `DeleteObject`, `DeleteObjects`, `ListObjectsV2`, `CopyObject`, presigned GET, and multipart uploads with up to 10000 parts. Multipart parts are staged in the StorageDriver and concatenated on completion; this is suitable for single-node Lite, not a distributed object-assembly service.
|
|
960
|
+
|
|
961
|
+
S3 objects, including completed multipart uploads, are limited to 64 MiB and also honor bucket size/MIME restrictions and the project default size limit. Completion requests must explicitly list unique parts in ascending order. XML request bodies are limited to 2 MiB.
|
|
962
|
+
Each project allows at most 128 active uploads, 10000 staged parts and 256 MiB of staged bytes. Uploads expire after 24 hours and are reclaimed at startup and on subsequent multipart requests. Bucket deletion also removes its staged multipart data.
|
|
963
|
+
|
|
964
|
+
The first version deliberately excludes virtual-hosted-style addressing, S3 ACL/Bucket Policy, Versioning, Object Lock, Replication, S3 Select, and `STREAMING-*` SigV4 payloads. S3 credentials are service-level and bypass RLS by default; use `SUPACLOUD_LITE_S3_ENDPOINT_BUCKETS` to restrict buckets. S3 writes use the same bucket/object metadata and StorageDriver as the normal Storage API.
|
|
965
|
+
|
|
918
966
|
### Compatibility Scope
|
|
919
967
|
|
|
920
968
|
| Capability | V1 Status | Notes |
|
|
@@ -938,6 +986,8 @@ source package for a synthetic baseline, not a production performance claim.
|
|
|
938
986
|
|
|
939
987
|
Realtime DELETE on RLS tables cannot safely replay SELECT policies after a row is deleted, so V1 only sends such DELETE events to `service_role` subscribers. Regular users can still receive INSERT/UPDATE events that pass row-by-row RLS validation.
|
|
940
988
|
|
|
989
|
+
PostgREST edge semantics: for tables and views, `Prefer: count=planned` and `count=estimated` both read the `Plan Rows` of the outermost `count(*)` input inside the current role and JWT-claims read-only transaction (that counting aggregate itself always produces one row). This preserves filters, RLS, inner embeds, views, and the query's own GROUP BY aggregates. Lite does not read relation-wide `pg_class.reltuples` directly; `estimated` is a conservative planner-based compatibility implementation, not PostgREST's threshold-based switch to exact counting, and estimates may still be inaccurate. Both are only evaluated for GET/HEAD and still populate `Content-Range`. `Prefer: tx=rollback` wraps a successful POST/PATCH/DELETE, returns the same status and representation as a commit, then rolls the transaction back without firing CDC/webhooks. Other `Prefer` values (`return`, `resolution`, `missing`) keep their existing behavior.
|
|
990
|
+
|
|
941
991
|
Realtime also exposes server-side HTTP broadcast:
|
|
942
992
|
|
|
943
993
|
```http
|