@nextblock-cms/db 0.22.1 → 0.22.2

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 (23) hide show
  1. package/README.md +47 -47
  2. package/package.json +1 -1
  3. package/supabase/migrations/02000_catchup_gen1.sql +5880 -5880
  4. package/supabase/migrations/02001_baseline_schema.sql +2734 -2734
  5. package/supabase/migrations/02002_baseline_constraints_and_indexes.sql +1262 -1262
  6. package/supabase/migrations/02003_baseline_security_and_grants.sql +1577 -1577
  7. package/supabase/migrations/02004_baseline_seed.sql +565 -565
  8. package/supabase/migrations/02005_home_live_demo_promo_cadence_15min.sql +53 -53
  9. package/supabase/migrations/02006_home_marketing_contrast.sql +56 -56
  10. package/supabase/migrations/02007_home_pillar_caption_contrast.sql +44 -44
  11. package/supabase/migrations/02008_home_fr_parity.sql +89 -89
  12. package/supabase/migrations/02009_fr_cortex_posts.sql +67 -67
  13. package/supabase/migrations/02010_shop_hero_redesign.sql +72 -72
  14. package/supabase/migrations/02011_drop_backdrop_blur_on_pages.sql +26 -26
  15. package/supabase/migrations/02012_drop_variant_backdrop_blur.sql +17 -17
  16. package/supabase/migrations/02013_advisor_rls_and_trigger_grants.sql +102 -102
  17. package/supabase/migrations/02014_package_activations_staff_read.sql +18 -18
  18. package/supabase/migrations/02018_install_paths_and_seed_copy_accuracy.sql +1820 -1820
  19. package/supabase/migrations/02019_open_handed_licensing_and_mcp_clients.sql +448 -448
  20. package/supabase/migrations/02020_commerce_product_accuracy.sql +93 -93
  21. package/supabase/migrations/02021_profiles_staff_read_and_role_guard.sql +362 -362
  22. package/supabase/migrations/02022_security_hardening_writer_boundary_and_aal.sql +504 -504
  23. package/supabase/migrations/02024_advisor_trigger_grants_and_pg_net_schema.sql +113 -0
package/README.md CHANGED
@@ -1,47 +1,47 @@
1
- # @nextblock-cms/db
2
-
3
- The database layer of [NextBlock](https://github.com/nextblock-cms/nextblock), the open-core CMS
4
- for Next.js and Supabase: Supabase clients for each trust level, the generated `Database` types,
5
- secret encryption, and the premium-package license check. It also ships the NextBlock database
6
- migrations.
7
-
8
- Projects created with `npm create nextblock@latest` already depend on it. It is built for
9
- NextBlock projects (Next.js 16, React 19, `@supabase/ssr`) rather than as a general-purpose
10
- library.
11
-
12
- ```bash
13
- npm install @nextblock-cms/db
14
- ```
15
-
16
- ## Entry points
17
-
18
- | Import | Use it from | What it holds |
19
- | :-- | :-- | :-- |
20
- | `@nextblock-cms/db` | client | The browser Supabase client (`createClient`), the `Database` types, and client-side profile and language lookups |
21
- | `@nextblock-cms/db/server` | server only | `createClient()` scoped to the request cookies, `getSsgSupabaseClient()` for public reads, `getServiceRoleSupabaseClient()` for admin work only (it bypasses Row Level Security), `verifyPackageOnline()`, secret encryption and config resolution |
22
- | `@nextblock-cms/db/secrets` | server only | Secret encryption (`encryptSecret`, `decryptSecret`) and config resolution, without the Supabase clients |
23
- | `@nextblock-cms/db/types` | types only | The generated `Database` types |
24
-
25
- Pick the server client by trust level. Use the service-role client only in code that has
26
- already checked the caller's role.
27
-
28
- ## Environment
29
-
30
- The clients read `NEXT_PUBLIC_SUPABASE_URL` or `SUPABASE_URL`, the publishable (anon) key under
31
- either its `NEXT_PUBLIC_` or its plain name, and, for the service-role client,
32
- `SUPABASE_SERVICE_ROLE_KEY` or `SUPABASE_SECRET_KEY`. The alternative names are the ones the
33
- Vercel Supabase integration injects.
34
-
35
- ## Migrations
36
-
37
- The package includes `supabase/` with the NextBlock migrations. `npm run update` in a NextBlock
38
- project copies them into the project's `supabase/migrations` and applies the pending ones.
39
-
40
- ## Documentation
41
-
42
- - [Database and auth](https://github.com/nextblock-cms/nextblock/blob/master/docs/04-DATABASE-AND-AUTH.md)
43
- - [Staying up to date](https://github.com/nextblock-cms/nextblock/blob/master/docs/13-STAYING-UP-TO-DATE.md)
44
-
45
- ## License
46
-
47
- AGPL-3.0-or-later.
1
+ # @nextblock-cms/db
2
+
3
+ The database layer of [NextBlock](https://github.com/nextblock-cms/nextblock), the open-core CMS
4
+ for Next.js and Supabase: Supabase clients for each trust level, the generated `Database` types,
5
+ secret encryption, and the premium-package license check. It also ships the NextBlock database
6
+ migrations.
7
+
8
+ Projects created with `npm create nextblock@latest` already depend on it. It is built for
9
+ NextBlock projects (Next.js 16, React 19, `@supabase/ssr`) rather than as a general-purpose
10
+ library.
11
+
12
+ ```bash
13
+ npm install @nextblock-cms/db
14
+ ```
15
+
16
+ ## Entry points
17
+
18
+ | Import | Use it from | What it holds |
19
+ | :-- | :-- | :-- |
20
+ | `@nextblock-cms/db` | client | The browser Supabase client (`createClient`), the `Database` types, and client-side profile and language lookups |
21
+ | `@nextblock-cms/db/server` | server only | `createClient()` scoped to the request cookies, `getSsgSupabaseClient()` for public reads, `getServiceRoleSupabaseClient()` for admin work only (it bypasses Row Level Security), `verifyPackageOnline()`, secret encryption and config resolution |
22
+ | `@nextblock-cms/db/secrets` | server only | Secret encryption (`encryptSecret`, `decryptSecret`) and config resolution, without the Supabase clients |
23
+ | `@nextblock-cms/db/types` | types only | The generated `Database` types |
24
+
25
+ Pick the server client by trust level. Use the service-role client only in code that has
26
+ already checked the caller's role.
27
+
28
+ ## Environment
29
+
30
+ The clients read `NEXT_PUBLIC_SUPABASE_URL` or `SUPABASE_URL`, the publishable (anon) key under
31
+ either its `NEXT_PUBLIC_` or its plain name, and, for the service-role client,
32
+ `SUPABASE_SERVICE_ROLE_KEY` or `SUPABASE_SECRET_KEY`. The alternative names are the ones the
33
+ Vercel Supabase integration injects.
34
+
35
+ ## Migrations
36
+
37
+ The package includes `supabase/` with the NextBlock migrations. `npm run update` in a NextBlock
38
+ project copies them into the project's `supabase/migrations` and applies the pending ones.
39
+
40
+ ## Documentation
41
+
42
+ - [Database and auth](https://github.com/nextblock-cms/nextblock/blob/master/docs/04-DATABASE-AND-AUTH.md)
43
+ - [Staying up to date](https://github.com/nextblock-cms/nextblock/blob/master/docs/13-STAYING-UP-TO-DATE.md)
44
+
45
+ ## License
46
+
47
+ AGPL-3.0-or-later.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nextblock-cms/db",
3
- "version": "0.22.1",
3
+ "version": "0.22.2",
4
4
  "license": "AGPL-3.0-or-later",
5
5
  "repository": {
6
6
  "type": "git",