@plutocms/supabase 0.8.0 → 0.8.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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.8.1](https://github.com/plutocms/supabase/compare/v0.8.0...v0.8.1) (2026-09-13)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **content:** widen the adapter's client cast through unknown ([#62](https://github.com/plutocms/supabase/issues/62)) ([f539958](https://github.com/plutocms/supabase/commit/f539958ac062ebd3d295731e419801d5ade6861c))
9
+
3
10
  ## [0.8.0](https://github.com/plutocms/supabase/compare/v0.7.2...v0.8.0) (2026-09-13)
4
11
 
5
12
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@plutocms/supabase",
3
3
  "type": "module",
4
- "version": "0.8.0",
4
+ "version": "0.8.1",
5
5
  "trustedDependencies": [
6
6
  "@parcel/watcher",
7
7
  "@plutocms/pluto",
@@ -15,9 +15,23 @@ import { requireCapability } from './capability-guard'
15
15
  * is the one, deliberate place this file loses compile-time table/column
16
16
  * safety. See `.claude/skills/content-adapter/SKILL.md` for the full
17
17
  * write-up.
18
+ *
19
+ * Goes through `unknown` first: `serverSupabaseClient`'s inferred
20
+ * `Database` type is whichever layer's own generated types are in scope
21
+ * at the *call site* — this repo's own `shared/types/supabase.ts` when
22
+ * typechecked standalone, but a different consumer's own generated types
23
+ * when this file is typechecked as part of a deeper extends chain (a
24
+ * layer that extends this one, extending it in turn). A direct `as
25
+ * SupabaseClient` cast is only valid when the two concrete
26
+ * instantiations "sufficiently overlap"; a client typed against some
27
+ * other, unrelated `Database` shape does not, and TypeScript correctly
28
+ * refuses the direct assertion in that case. Routing through `unknown`
29
+ * is the standard, correct way to widen past that check on purpose —
30
+ * this cast has always been meant to discard the specific `Database`
31
+ * type, not to assert against one.
18
32
  */
19
33
  async function getClient(event: H3Event): Promise<SupabaseClient> {
20
- return (await serverSupabaseClient(event)) as SupabaseClient
34
+ return (await serverSupabaseClient(event)) as unknown as SupabaseClient
21
35
  }
22
36
 
23
37
  /**