@unrdf/hooks 26.4.2 → 26.4.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/examples/hook-chains/node_modules/.bin/jiti +21 -0
- package/examples/hook-chains/node_modules/.bin/msw +21 -0
- package/examples/hook-chains/node_modules/.bin/terser +21 -0
- package/examples/hook-chains/node_modules/.bin/tsc +21 -0
- package/examples/hook-chains/node_modules/.bin/tsserver +21 -0
- package/examples/hook-chains/node_modules/.bin/tsx +21 -0
- package/examples/hook-chains/node_modules/.bin/validate-hooks +0 -0
- package/examples/hook-chains/node_modules/.bin/vite +21 -0
- package/examples/hook-chains/node_modules/.bin/vitest +2 -2
- package/examples/hook-chains/node_modules/.bin/yaml +21 -0
- package/examples/hook-chains/package.json +2 -2
- package/examples/hook-chains/unrdf-hooks-example-chains-5.0.0.tgz +0 -0
- package/examples/policy-hooks/node_modules/.bin/jiti +21 -0
- package/examples/policy-hooks/node_modules/.bin/msw +21 -0
- package/examples/policy-hooks/node_modules/.bin/terser +21 -0
- package/examples/policy-hooks/node_modules/.bin/tsc +21 -0
- package/examples/policy-hooks/node_modules/.bin/tsserver +21 -0
- package/examples/policy-hooks/node_modules/.bin/tsx +21 -0
- package/examples/policy-hooks/node_modules/.bin/validate-hooks +0 -0
- package/examples/policy-hooks/node_modules/.bin/vite +21 -0
- package/examples/policy-hooks/node_modules/.bin/vitest +2 -2
- package/examples/policy-hooks/node_modules/.bin/yaml +21 -0
- package/examples/policy-hooks/package.json +2 -2
- package/examples/policy-hooks/unrdf-hooks-example-policy-5.0.0.tgz +0 -0
- package/package.json +23 -23
- package/src/hooks/define-hook.mjs +6 -4
- package/src/hooks/policy-pack.mjs +7 -1
- package/src/hooks/query-optimizer.mjs +1 -5
- package/src/hooks/schemas.mjs +8 -2
- package/src/policy-compiler.mjs +11 -11
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/node_modules:/Users/sac/unrdf/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/node_modules:/Users/sac/unrdf/node_modules/.pnpm/jiti@2.6.1/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/node_modules:/Users/sac/unrdf/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/node_modules:/Users/sac/unrdf/node_modules/.pnpm/jiti@2.6.1/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti-cli.mjs" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../../../node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti-cli.mjs" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/msw@2.12.14_@types+node@25.5.0_typescript@5.9.3/node_modules/msw/cli/node_modules:/Users/sac/unrdf/node_modules/.pnpm/msw@2.12.14_@types+node@25.5.0_typescript@5.9.3/node_modules/msw/node_modules:/Users/sac/unrdf/node_modules/.pnpm/msw@2.12.14_@types+node@25.5.0_typescript@5.9.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/msw@2.12.14_@types+node@25.5.0_typescript@5.9.3/node_modules/msw/cli/node_modules:/Users/sac/unrdf/node_modules/.pnpm/msw@2.12.14_@types+node@25.5.0_typescript@5.9.3/node_modules/msw/node_modules:/Users/sac/unrdf/node_modules/.pnpm/msw@2.12.14_@types+node@25.5.0_typescript@5.9.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/msw@2.12.14_@types+node@25.5.0_typescript@5.9.3/node_modules/msw/cli/index.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../../../node_modules/.pnpm/msw@2.12.14_@types+node@25.5.0_typescript@5.9.3/node_modules/msw/cli/index.js" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/terser@5.46.1/node_modules/terser/bin/node_modules:/Users/sac/unrdf/node_modules/.pnpm/terser@5.46.1/node_modules/terser/node_modules:/Users/sac/unrdf/node_modules/.pnpm/terser@5.46.1/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/terser@5.46.1/node_modules/terser/bin/node_modules:/Users/sac/unrdf/node_modules/.pnpm/terser@5.46.1/node_modules/terser/node_modules:/Users/sac/unrdf/node_modules/.pnpm/terser@5.46.1/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/terser@5.46.1/node_modules/terser/bin/terser" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../../../node_modules/.pnpm/terser@5.46.1/node_modules/terser/bin/terser" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/tsc" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/tsc" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/tsserver" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/tsserver" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/node_modules:/Users/sac/unrdf/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/node_modules:/Users/sac/unrdf/node_modules/.pnpm/tsx@4.21.0/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/node_modules:/Users/sac/unrdf/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/node_modules:/Users/sac/unrdf/node_modules/.pnpm/tsx@4.21.0/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" "$@"
|
|
21
|
+
fi
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.21.0_yaml@2.8.3/node_modules/vite/bin/node_modules:/Users/sac/unrdf/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.21.0_yaml@2.8.3/node_modules/vite/node_modules:/Users/sac/unrdf/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.21.0_yaml@2.8.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.21.0_yaml@2.8.3/node_modules/vite/bin/node_modules:/Users/sac/unrdf/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.21.0_yaml@2.8.3/node_modules/vite/node_modules:/Users/sac/unrdf/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.21.0_yaml@2.8.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.21.0_yaml@2.8.3/node_modules/vite/bin/vite.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../../../node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.21.0_yaml@2.8.3/node_modules/vite/bin/vite.js" "$@"
|
|
21
|
+
fi
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/vitest@4.
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/vitest@4.1.2_@opentelemetry+api@1.9.1_@types+node@25.5.0_@vitest+ui@4.1.2_happy-dom@20._43a84fb45b8a6c418aa4e6591a004ea7/node_modules/vitest/node_modules:/Users/sac/unrdf/node_modules/.pnpm/vitest@4.1.2_@opentelemetry+api@1.9.1_@types+node@25.5.0_@vitest+ui@4.1.2_happy-dom@20._43a84fb45b8a6c418aa4e6591a004ea7/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/vitest@4.
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/vitest@4.1.2_@opentelemetry+api@1.9.1_@types+node@25.5.0_@vitest+ui@4.1.2_happy-dom@20._43a84fb45b8a6c418aa4e6591a004ea7/node_modules/vitest/node_modules:/Users/sac/unrdf/node_modules/.pnpm/vitest@4.1.2_@opentelemetry+api@1.9.1_@types+node@25.5.0_@vitest+ui@4.1.2_happy-dom@20._43a84fb45b8a6c418aa4e6591a004ea7/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../vitest/vitest.mjs" "$@"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/node_modules:/Users/sac/unrdf/node_modules/.pnpm/yaml@2.8.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/node_modules:/Users/sac/unrdf/node_modules/.pnpm/yaml@2.8.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/bin.mjs" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/bin.mjs" "$@"
|
|
21
|
+
fi
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/node_modules:/Users/sac/unrdf/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/node_modules:/Users/sac/unrdf/node_modules/.pnpm/jiti@2.6.1/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/node_modules:/Users/sac/unrdf/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/node_modules:/Users/sac/unrdf/node_modules/.pnpm/jiti@2.6.1/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti-cli.mjs" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../../../node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti-cli.mjs" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/msw@2.12.14_@types+node@25.5.0_typescript@5.9.3/node_modules/msw/cli/node_modules:/Users/sac/unrdf/node_modules/.pnpm/msw@2.12.14_@types+node@25.5.0_typescript@5.9.3/node_modules/msw/node_modules:/Users/sac/unrdf/node_modules/.pnpm/msw@2.12.14_@types+node@25.5.0_typescript@5.9.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/msw@2.12.14_@types+node@25.5.0_typescript@5.9.3/node_modules/msw/cli/node_modules:/Users/sac/unrdf/node_modules/.pnpm/msw@2.12.14_@types+node@25.5.0_typescript@5.9.3/node_modules/msw/node_modules:/Users/sac/unrdf/node_modules/.pnpm/msw@2.12.14_@types+node@25.5.0_typescript@5.9.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/msw@2.12.14_@types+node@25.5.0_typescript@5.9.3/node_modules/msw/cli/index.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../../../node_modules/.pnpm/msw@2.12.14_@types+node@25.5.0_typescript@5.9.3/node_modules/msw/cli/index.js" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/terser@5.46.1/node_modules/terser/bin/node_modules:/Users/sac/unrdf/node_modules/.pnpm/terser@5.46.1/node_modules/terser/node_modules:/Users/sac/unrdf/node_modules/.pnpm/terser@5.46.1/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/terser@5.46.1/node_modules/terser/bin/node_modules:/Users/sac/unrdf/node_modules/.pnpm/terser@5.46.1/node_modules/terser/node_modules:/Users/sac/unrdf/node_modules/.pnpm/terser@5.46.1/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/terser@5.46.1/node_modules/terser/bin/terser" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../../../node_modules/.pnpm/terser@5.46.1/node_modules/terser/bin/terser" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/tsc" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/tsc" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/sac/unrdf/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/tsserver" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/tsserver" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/node_modules:/Users/sac/unrdf/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/node_modules:/Users/sac/unrdf/node_modules/.pnpm/tsx@4.21.0/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/node_modules:/Users/sac/unrdf/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/node_modules:/Users/sac/unrdf/node_modules/.pnpm/tsx@4.21.0/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../../../node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/cli.mjs" "$@"
|
|
21
|
+
fi
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.21.0_yaml@2.8.3/node_modules/vite/bin/node_modules:/Users/sac/unrdf/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.21.0_yaml@2.8.3/node_modules/vite/node_modules:/Users/sac/unrdf/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.21.0_yaml@2.8.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.21.0_yaml@2.8.3/node_modules/vite/bin/node_modules:/Users/sac/unrdf/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.21.0_yaml@2.8.3/node_modules/vite/node_modules:/Users/sac/unrdf/node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.21.0_yaml@2.8.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.21.0_yaml@2.8.3/node_modules/vite/bin/vite.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../../../node_modules/.pnpm/vite@7.3.1_@types+node@25.5.0_jiti@2.6.1_lightningcss@1.32.0_terser@5.46.1_tsx@4.21.0_yaml@2.8.3/node_modules/vite/bin/vite.js" "$@"
|
|
21
|
+
fi
|
|
@@ -10,9 +10,9 @@ case `uname` in
|
|
|
10
10
|
esac
|
|
11
11
|
|
|
12
12
|
if [ -z "$NODE_PATH" ]; then
|
|
13
|
-
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/vitest@4.
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/vitest@4.1.2_@opentelemetry+api@1.9.1_@types+node@25.5.0_@vitest+ui@4.1.2_happy-dom@20._43a84fb45b8a6c418aa4e6591a004ea7/node_modules/vitest/node_modules:/Users/sac/unrdf/node_modules/.pnpm/vitest@4.1.2_@opentelemetry+api@1.9.1_@types+node@25.5.0_@vitest+ui@4.1.2_happy-dom@20._43a84fb45b8a6c418aa4e6591a004ea7/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
14
|
else
|
|
15
|
-
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/vitest@4.
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/vitest@4.1.2_@opentelemetry+api@1.9.1_@types+node@25.5.0_@vitest+ui@4.1.2_happy-dom@20._43a84fb45b8a6c418aa4e6591a004ea7/node_modules/vitest/node_modules:/Users/sac/unrdf/node_modules/.pnpm/vitest@4.1.2_@opentelemetry+api@1.9.1_@types+node@25.5.0_@vitest+ui@4.1.2_happy-dom@20._43a84fb45b8a6c418aa4e6591a004ea7/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
16
|
fi
|
|
17
17
|
if [ -x "$basedir/node" ]; then
|
|
18
18
|
exec "$basedir/node" "$basedir/../vitest/vitest.mjs" "$@"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/node_modules:/Users/sac/unrdf/node_modules/.pnpm/yaml@2.8.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/sac/unrdf/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/node_modules:/Users/sac/unrdf/node_modules/.pnpm/yaml@2.8.3/node_modules:/Users/sac/unrdf/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/bin.mjs" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/bin.mjs" "$@"
|
|
21
|
+
fi
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unrdf/hooks",
|
|
3
|
-
"version": "26.4.
|
|
3
|
+
"version": "26.4.3",
|
|
4
4
|
"description": "UNRDF Knowledge Hooks - Policy Definition and Execution Framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -20,25 +20,6 @@
|
|
|
20
20
|
"README.md",
|
|
21
21
|
"LICENSE"
|
|
22
22
|
],
|
|
23
|
-
"scripts": {
|
|
24
|
-
"test": "vitest run --coverage",
|
|
25
|
-
"test:fast": "vitest run --coverage",
|
|
26
|
-
"test:watch": "vitest --coverage",
|
|
27
|
-
"test:browser": "vitest --config vitest.browser.config.mjs",
|
|
28
|
-
"test:browser:chromium": "vitest --config vitest.browser.config.mjs --browser.name=chromium",
|
|
29
|
-
"test:browser:firefox": "vitest --config vitest.browser.config.mjs --browser.name=firefox",
|
|
30
|
-
"test:browser:webkit": "vitest --config vitest.browser.config.mjs --browser.name=webkit",
|
|
31
|
-
"test:browser:all": "vitest --workspace=vitest.browser.workspace.mjs",
|
|
32
|
-
"benchmark": "vitest run --coverage test/benchmarks/",
|
|
33
|
-
"benchmark:browser": "vitest run --config vitest.browser.config.mjs",
|
|
34
|
-
"build": "unbuild || true",
|
|
35
|
-
"lint": "eslint src/ test/ --max-warnings=0",
|
|
36
|
-
"lint:fix": "eslint src/ test/ --fix",
|
|
37
|
-
"format": "prettier --write src/",
|
|
38
|
-
"format:check": "prettier --check src/",
|
|
39
|
-
"clean": "rm -rf dist/ .nyc_output/ coverage/",
|
|
40
|
-
"dev": "echo 'Development mode for @unrdf/hooks'"
|
|
41
|
-
},
|
|
42
23
|
"keywords": [
|
|
43
24
|
"rdf",
|
|
44
25
|
"knowledge-graph",
|
|
@@ -47,8 +28,8 @@
|
|
|
47
28
|
"validation"
|
|
48
29
|
],
|
|
49
30
|
"dependencies": {
|
|
50
|
-
"@unrdf/core": "
|
|
51
|
-
"@unrdf/oxigraph": "
|
|
31
|
+
"@unrdf/core": "26.4.3",
|
|
32
|
+
"@unrdf/oxigraph": "26.4.3",
|
|
52
33
|
"citty": "^0.1.6",
|
|
53
34
|
"zod": "^4.1.13"
|
|
54
35
|
},
|
|
@@ -71,5 +52,24 @@
|
|
|
71
52
|
"license": "MIT",
|
|
72
53
|
"publishConfig": {
|
|
73
54
|
"access": "public"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"test": "vitest run --coverage",
|
|
58
|
+
"test:fast": "vitest run --coverage",
|
|
59
|
+
"test:watch": "vitest --coverage",
|
|
60
|
+
"test:browser": "vitest --config vitest.browser.config.mjs",
|
|
61
|
+
"test:browser:chromium": "vitest --config vitest.browser.config.mjs --browser.name=chromium",
|
|
62
|
+
"test:browser:firefox": "vitest --config vitest.browser.config.mjs --browser.name=firefox",
|
|
63
|
+
"test:browser:webkit": "vitest --config vitest.browser.config.mjs --browser.name=webkit",
|
|
64
|
+
"test:browser:all": "vitest --workspace=vitest.browser.workspace.mjs",
|
|
65
|
+
"benchmark": "vitest run --coverage test/benchmarks/",
|
|
66
|
+
"benchmark:browser": "vitest run --config vitest.browser.config.mjs",
|
|
67
|
+
"build": "unbuild || true",
|
|
68
|
+
"lint": "eslint src/ test/ --max-warnings=0",
|
|
69
|
+
"lint:fix": "eslint src/ test/ --fix",
|
|
70
|
+
"format": "prettier --write src/",
|
|
71
|
+
"format:check": "prettier --check src/",
|
|
72
|
+
"clean": "rm -rf dist/ .nyc_output/ coverage/",
|
|
73
|
+
"dev": "echo 'Development mode for @unrdf/hooks'"
|
|
74
74
|
}
|
|
75
|
-
}
|
|
75
|
+
}
|
|
@@ -102,10 +102,12 @@ export const HookConfigSchema = z.object({
|
|
|
102
102
|
transform: z.function().optional(),
|
|
103
103
|
metadata: z.record(z.string(), z.any()).optional(),
|
|
104
104
|
// Old format compatibility
|
|
105
|
-
meta: z
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
meta: z
|
|
106
|
+
.object({
|
|
107
|
+
name: z.string(),
|
|
108
|
+
description: z.string().optional(),
|
|
109
|
+
})
|
|
110
|
+
.optional(),
|
|
109
111
|
pattern: z.string().optional(),
|
|
110
112
|
run: z.function().optional(),
|
|
111
113
|
});
|
|
@@ -7,7 +7,13 @@
|
|
|
7
7
|
* governance units that can be activated/deactivated as cohesive sets.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
readFileSync,
|
|
12
|
+
writeFileSync as _writeFileSync,
|
|
13
|
+
existsSync,
|
|
14
|
+
mkdirSync as _mkdirSync,
|
|
15
|
+
readdirSync,
|
|
16
|
+
} from 'fs';
|
|
11
17
|
import { join, dirname, basename as _basename, extname as _extname } from 'path';
|
|
12
18
|
import { createKnowledgeHook as _createKnowledgeHook, validateKnowledgeHook } from './schemas.mjs';
|
|
13
19
|
import { z } from 'zod';
|
|
@@ -16,11 +16,7 @@
|
|
|
16
16
|
* @returns {object} Query optimizer instance
|
|
17
17
|
*/
|
|
18
18
|
export function createQueryOptimizer(options = {}) {
|
|
19
|
-
const {
|
|
20
|
-
enableIndexing = true,
|
|
21
|
-
enableCaching = true,
|
|
22
|
-
cacheMaxSize = 1000,
|
|
23
|
-
} = options;
|
|
19
|
+
const { enableIndexing = true, enableCaching = true, cacheMaxSize = 1000 } = options;
|
|
24
20
|
|
|
25
21
|
const queryCache = new Map();
|
|
26
22
|
const indexes = new Map();
|
package/src/hooks/schemas.mjs
CHANGED
|
@@ -25,7 +25,10 @@ export const HookMetaSchema = z.object({
|
|
|
25
25
|
*/
|
|
26
26
|
export const HookConditionRefSchema = z.object({
|
|
27
27
|
uri: z.string().min(1),
|
|
28
|
-
sha256: z
|
|
28
|
+
sha256: z
|
|
29
|
+
.string()
|
|
30
|
+
.regex(/^[a-f0-9]{64}$/, 'SHA-256 hash must be 64 hex characters')
|
|
31
|
+
.optional(),
|
|
29
32
|
mediaType: z.string().optional(),
|
|
30
33
|
});
|
|
31
34
|
|
|
@@ -45,7 +48,10 @@ export const HookConditionSchema = z.object({
|
|
|
45
48
|
*/
|
|
46
49
|
export const HookEffectRefSchema = z.object({
|
|
47
50
|
uri: z.string().min(1),
|
|
48
|
-
sha256: z
|
|
51
|
+
sha256: z
|
|
52
|
+
.string()
|
|
53
|
+
.regex(/^[a-f0-9]{64}$/, 'SHA-256 hash must be 64 hex characters')
|
|
54
|
+
.optional(),
|
|
49
55
|
mediaType: z.string().optional(),
|
|
50
56
|
});
|
|
51
57
|
|
package/src/policy-compiler.mjs
CHANGED
|
@@ -110,11 +110,11 @@ export function compilePolicy(policy) {
|
|
|
110
110
|
case PolicyPatterns.SUBJECT_PATTERN: {
|
|
111
111
|
const pattern = policy.config?.pattern;
|
|
112
112
|
if (pattern instanceof RegExp) {
|
|
113
|
-
compiledFn =
|
|
113
|
+
compiledFn = quad => pattern.test(quad.subject?.value || '');
|
|
114
114
|
} else if (typeof pattern === 'string') {
|
|
115
115
|
// Compile string to regex for performance
|
|
116
116
|
const regex = new RegExp(pattern);
|
|
117
|
-
compiledFn =
|
|
117
|
+
compiledFn = quad => regex.test(quad.subject?.value || '');
|
|
118
118
|
} else {
|
|
119
119
|
compiledFn = () => true;
|
|
120
120
|
}
|
|
@@ -124,10 +124,10 @@ export function compilePolicy(policy) {
|
|
|
124
124
|
case PolicyPatterns.PREDICATE_PATTERN: {
|
|
125
125
|
const pattern = policy.config?.pattern;
|
|
126
126
|
if (pattern instanceof RegExp) {
|
|
127
|
-
compiledFn =
|
|
127
|
+
compiledFn = quad => pattern.test(quad.predicate?.value || '');
|
|
128
128
|
} else if (typeof pattern === 'string') {
|
|
129
129
|
const regex = new RegExp(pattern);
|
|
130
|
-
compiledFn =
|
|
130
|
+
compiledFn = quad => regex.test(quad.predicate?.value || '');
|
|
131
131
|
} else {
|
|
132
132
|
compiledFn = () => true;
|
|
133
133
|
}
|
|
@@ -137,10 +137,10 @@ export function compilePolicy(policy) {
|
|
|
137
137
|
case PolicyPatterns.OBJECT_PATTERN: {
|
|
138
138
|
const pattern = policy.config?.pattern;
|
|
139
139
|
if (pattern instanceof RegExp) {
|
|
140
|
-
compiledFn =
|
|
140
|
+
compiledFn = quad => pattern.test(quad.object?.value || '');
|
|
141
141
|
} else if (typeof pattern === 'string') {
|
|
142
142
|
const regex = new RegExp(pattern);
|
|
143
|
-
compiledFn =
|
|
143
|
+
compiledFn = quad => regex.test(quad.object?.value || '');
|
|
144
144
|
} else {
|
|
145
145
|
compiledFn = () => true;
|
|
146
146
|
}
|
|
@@ -151,7 +151,7 @@ export function compilePolicy(policy) {
|
|
|
151
151
|
const namespace = policy.config?.namespace;
|
|
152
152
|
if (namespace) {
|
|
153
153
|
// Optimized prefix check
|
|
154
|
-
compiledFn =
|
|
154
|
+
compiledFn = quad => {
|
|
155
155
|
const s = quad.subject?.value || '';
|
|
156
156
|
const p = quad.predicate?.value || '';
|
|
157
157
|
return s.startsWith(namespace) || p.startsWith(namespace);
|
|
@@ -310,7 +310,6 @@ export function executeCompiledHook(hook, quad) {
|
|
|
310
310
|
if (compiledHook.transform && result.valid) {
|
|
311
311
|
result.quad = compiledHook.transform(quad);
|
|
312
312
|
}
|
|
313
|
-
|
|
314
313
|
} catch (error) {
|
|
315
314
|
result.valid = false;
|
|
316
315
|
result.error = error.message;
|
|
@@ -336,7 +335,7 @@ export function executeCompiledChain(hooks, quad) {
|
|
|
336
335
|
let chainError;
|
|
337
336
|
|
|
338
337
|
// Compile all hooks upfront
|
|
339
|
-
const compiledHooks = hooks.map(h => h._compiled ? h : compileHook(h));
|
|
338
|
+
const compiledHooks = hooks.map(h => (h._compiled ? h : compileHook(h)));
|
|
340
339
|
|
|
341
340
|
for (const hook of compiledHooks) {
|
|
342
341
|
const result = executeCompiledHook(hook, currentQuad);
|
|
@@ -368,7 +367,7 @@ export function executeCompiledChain(hooks, quad) {
|
|
|
368
367
|
*/
|
|
369
368
|
export function batchValidateCompiled(hooks, quads) {
|
|
370
369
|
// Ensure all hooks are compiled
|
|
371
|
-
const compiledHooks = hooks.map(h => h._compiled ? h : compileHook(h));
|
|
370
|
+
const compiledHooks = hooks.map(h => (h._compiled ? h : compileHook(h)));
|
|
372
371
|
|
|
373
372
|
// Filter to validation hooks only
|
|
374
373
|
const validationHooks = compiledHooks.filter(h => h.validate);
|
|
@@ -467,7 +466,8 @@ export function getCompilerStats() {
|
|
|
467
466
|
patternCacheSize: patternCache.size,
|
|
468
467
|
avgCompileTimeMs: compilerStats.totalCompileTimeMs / compilerStats.compiled || 0,
|
|
469
468
|
avgEvalTimeUs: (compilerStats.totalEvalTimeMs / compilerStats.evaluations) * 1000 || 0,
|
|
470
|
-
cacheHitRate:
|
|
469
|
+
cacheHitRate:
|
|
470
|
+
compilerStats.cacheHits / (compilerStats.cacheHits + compilerStats.cacheMisses) || 0,
|
|
471
471
|
};
|
|
472
472
|
}
|
|
473
473
|
|