rust-store-node 2.5.0 → 2.7.0
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/index.d.ts
CHANGED
|
@@ -61,8 +61,24 @@ export declare class Registry {
|
|
|
61
61
|
mergeOwnerCondition(model: string, ctx?: any | undefined | null, condition?: any | undefined | null): any
|
|
62
62
|
readableFields(model: string, ctx?: any | undefined | null): any
|
|
63
63
|
readableRelations(model: string, ctx?: any | undefined | null): any
|
|
64
|
+
/** 可读计算列(read 白名单判决与 fields/relations 同构;`ctx=None` → None 不裁剪) */
|
|
65
|
+
readableComputes(model: string, ctx?: any | undefined | null): any
|
|
64
66
|
writableFields(model: string, ctx?: any | undefined | null): any
|
|
65
67
|
filterWritableData(model: string, ctx: any | undefined | null, data: any): any
|
|
68
|
+
/**
|
|
69
|
+
* RBAC 动作判决:`action ∈ {read, insert, update, remove}`。
|
|
70
|
+
* 策略未注入 / RBAC 不介入 → true(与 plan 链路的实际拦截结果一致)。
|
|
71
|
+
*/
|
|
72
|
+
rbacCan(model: string, action: string, ctx?: any | undefined | null): boolean
|
|
73
|
+
/** RBAC 叠加后的可读字段集(静态 ∩ readFields);`ctx=null` → null 不裁剪 */
|
|
74
|
+
rbacReadableFields(model: string, ctx?: any | undefined | null): any
|
|
75
|
+
/** RBAC 叠加后的可写字段集(静态 ∩ writeFields);`ctx=null` → null 不裁剪 */
|
|
76
|
+
rbacWritableFields(model: string, ctx?: any | undefined | null): any
|
|
77
|
+
/**
|
|
78
|
+
* RBAC 行级条件(ownerOnly / condition 的 OR 合并体);null = 无行级收紧。
|
|
79
|
+
* `action ∈ {read, update, remove}`(insert 无行级语义)。
|
|
80
|
+
*/
|
|
81
|
+
rbacRowCondition(model: string, action: string, ctx?: any | undefined | null): any
|
|
66
82
|
/**
|
|
67
83
|
* 生成插入命令;`now` / `newId` 由 Host 提供(core 无时钟与随机源)
|
|
68
84
|
*
|
|
@@ -127,6 +143,8 @@ export declare class Registry {
|
|
|
127
143
|
register(defn: any): void
|
|
128
144
|
has(name: string): boolean
|
|
129
145
|
list(): Array<string>
|
|
146
|
+
/** 清空 schema 注册表(测试隔离 / 动态重建;不动 requireContext / profile 配置开关) */
|
|
147
|
+
clearSchemas(): void
|
|
130
148
|
/** 注册同步计算列回调(schema 里 `fn: true` 的 `fnRef`,缺省为计算列名) */
|
|
131
149
|
setFn(fnRef: string, callback: (arg: any) => any): void
|
|
132
150
|
clearFns(): void
|
|
@@ -145,4 +163,11 @@ export declare class Registry {
|
|
|
145
163
|
setProfile(profile: string): void
|
|
146
164
|
/** 当前查询档位字符串(`"standard"` / `"text2query"`) */
|
|
147
165
|
profile(): string
|
|
166
|
+
/**
|
|
167
|
+
* 注入/清除 RBAC 动态策略(object 或 null);解析失败抛错(fail-fast)。
|
|
168
|
+
* 判决唯一在 core:宿主仅透传配置与查询面,plan 链路拦截自动生效。
|
|
169
|
+
*/
|
|
170
|
+
setRbac(policy?: any | undefined | null): void
|
|
171
|
+
/** RBAC 策略是否已注入 */
|
|
172
|
+
rbacEnabled(): boolean
|
|
148
173
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rust-store-node",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "Node.js binding (napi-rs) for the rust-store multi-backend data engine: GQL parsing, permissions, computed columns and SQL dialect translation for MongoDB, MySQL, SQLite and PostgreSQL",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"build:debug": "napi build --platform",
|
|
33
33
|
"artifacts": "napi artifacts",
|
|
34
34
|
"prepublishOnly": "napi prepublish -t npm --skip-gh-release",
|
|
35
|
-
"test": "node --test test/parity.test.js test/dialect.smoke.test.js test/t2q.skill.test.js"
|
|
35
|
+
"test": "node --test test/parity.test.js test/dialect.smoke.test.js test/t2q.skill.test.js test/perm.bindings.test.js test/registry.bindings.test.js"
|
|
36
36
|
},
|
|
37
37
|
"keywords": [
|
|
38
38
|
"rust-store",
|
|
@@ -68,10 +68,10 @@
|
|
|
68
68
|
"sql.js": "^1.8.0"
|
|
69
69
|
},
|
|
70
70
|
"optionalDependencies": {
|
|
71
|
-
"rust-store-node-win32-x64-msvc": "2.
|
|
72
|
-
"rust-store-node-linux-x64-gnu": "2.
|
|
73
|
-
"rust-store-node-linux-arm64-gnu": "2.
|
|
74
|
-
"rust-store-node-darwin-x64": "2.
|
|
75
|
-
"rust-store-node-darwin-arm64": "2.
|
|
71
|
+
"rust-store-node-win32-x64-msvc": "2.7.0",
|
|
72
|
+
"rust-store-node-linux-x64-gnu": "2.7.0",
|
|
73
|
+
"rust-store-node-linux-arm64-gnu": "2.7.0",
|
|
74
|
+
"rust-store-node-darwin-x64": "2.7.0",
|
|
75
|
+
"rust-store-node-darwin-arm64": "2.7.0"
|
|
76
76
|
}
|
|
77
77
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|