@oktis-works/cms 0.15.0 → 0.15.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.
@@ -3,12 +3,12 @@
3
3
  // by `bun run build`. Used as the offline fallback for `okcms init` ranges
4
4
  // when the npm registry cannot be reached.
5
5
  export const APP_VERSIONS = {
6
- '@oktis-works/api': '0.17.5',
6
+ '@oktis-works/api': '0.17.6',
7
7
  '@oktis-works/admin': '0.25.1',
8
- '@oktis-works/web': '0.13.5',
9
- '@oktis-works/worker': '0.8.15',
10
- '@oktis-works/core': '0.16.5',
8
+ '@oktis-works/web': '0.14.0',
9
+ '@oktis-works/worker': '0.8.16',
10
+ '@oktis-works/core': '0.17.0',
11
11
  '@oktis-works/plugin-runtime': '0.8.0',
12
- '@oktis-works/cms': '0.15.0',
12
+ '@oktis-works/cms': '0.15.1',
13
13
  };
14
14
  //# sourceMappingURL=app-versions.js.map
@@ -2593,7 +2593,7 @@ export const DEFAULT_THEME_FILES = {
2593
2593
  "type": "theme",
2594
2594
  "author": "Oktis Works",
2595
2595
  "compatibility": {
2596
- "okcms": "^0.38.0"
2596
+ "okcms": "^0.39.0"
2597
2597
  },
2598
2598
  "screenshots": [
2599
2599
  "screenshot.png"
@@ -5,7 +5,7 @@
5
5
  "type": "theme",
6
6
  "author": "Oktis Works",
7
7
  "compatibility": {
8
- "okcms": "^0.38.0"
8
+ "okcms": "^0.39.0"
9
9
  },
10
10
  "screenshots": [
11
11
  "screenshot.png"
@@ -0,0 +1,18 @@
1
+ -- @okcms domain=core_schema provider=postgres
2
+ -- Adds current_user_id() function for per-user Row Level Security
3
+ -- This enables plugins to create policies like: USING (user_id = current_user_id())
4
+
5
+ -- Function to get current user ID from session setting
6
+ -- Returns NULL if not set (anonymous users)
7
+ CREATE OR REPLACE FUNCTION current_user_id() RETURNS uuid
8
+ LANGUAGE sql STABLE AS $$
9
+ SELECT NULLIF(current_setting('app.current_user_id', true), '')::uuid;
10
+ $$;
11
+
12
+ COMMENT ON FUNCTION current_user_id() IS 'Returns the current user ID from app.current_user_id setting, or NULL for anonymous. Used in RLS policies for per-user data isolation.';
13
+
14
+ -- Note: The setting 'app.current_user_id' is set by the web auth middleware
15
+ -- when a user is authenticated. It should be set via:
16
+ -- SELECT set_config('app.current_user_id', $userId, false);
17
+ -- And cleared with:
18
+ -- RESET app.current_user_id;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oktis-works/cms",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -22,10 +22,10 @@
22
22
  "wp:validate": "node --loader ts-node/esm src/wp-migrate/index.ts validate"
23
23
  },
24
24
  "dependencies": {
25
- "@oktis-works/auth": "^0.8.5",
25
+ "@oktis-works/auth": "^0.8.6",
26
26
  "@oktis-works/config": "^0.6.6",
27
- "@oktis-works/core": "^0.16.5",
28
- "@oktis-works/database": "^0.15.5",
27
+ "@oktis-works/core": "^0.17.0",
28
+ "@oktis-works/database": "^0.16.0",
29
29
  "@oktis-works/theme-runtime": "^0.12.0",
30
30
  "@oktis-works/validation": "^0.8.2",
31
31
  "mysql2": "^3.14.1"