rust-store-node 1.0.0 → 2.0.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/index.d.ts CHANGED
@@ -61,28 +61,25 @@ export declare class Registry {
61
61
  readableRelations(model: string, ctx?: any | undefined | null): any
62
62
  writableFields(model: string, ctx?: any | undefined | null): any
63
63
  filterWritableData(model: string, ctx: any | undefined | null, data: any): any
64
- /** 解析 GQL 并构建 pipeline / projection,返回 `{tokens, ast, pipeline, projection}` */
65
- buildPipeline(gql: string, params: any, ctx?: any | undefined | null): any
66
- planQuery(gql: string, params: any, ctx?: any | undefined | null, routeOverride?: any | undefined | null): any
67
- /** queryOne 计划:未显式 `$limit` 时强制下推 `$limit(1)`(`$pipeline` 全权模式不注入) */
68
- planQueryOne(gql: string, params: any, ctx?: any | undefined | null, routeOverride?: any | undefined | null): any
69
- /** 列表 + total;`total` 由 Host 执行 `countCommand` 后回喂,用于算 `hasMore` */
70
- planQueryWithCount(gql: string, params: any, ctx?: any | undefined | null, total?: number | undefined | null, routeOverride?: any | undefined | null): any
71
- resolvePage(gql: string, params: any): any
72
- /** 两阶段查询后按阶段一 `_id` 顺序重排,返回 `{items}` */
73
- restoreSortOrder(items: Array<any>, ids: Array<any>, sort?: any | undefined | null): any
74
- /** 生成插入命令;`now` / `newId` 由 Host 提供(core 无时钟与随机源) */
64
+ /**
65
+ * 生成插入命令;`now` / `newId` 由 Host 提供(core 无时钟与随机源)
66
+ *
67
+ * 参数与 JS store API 一一对应(跨语言 parity 优先于参数个数),保持位置参数。
68
+ */
75
69
  planInsert(model: string, data: any, now: number, newId: string, ctx?: any | undefined | null, routeOverride?: any | undefined | null): any
76
- planExists(model: string, condition: any, routeOverride?: any | undefined | null): any
77
- planCount(model: string, filter?: any | undefined | null, routeOverride?: any | undefined | null): any
78
- planAggregate(model: string, pipeline: Array<any>, routeOverride?: any | undefined | null): any
79
- /** 批量插入命令;`newIds` 按需消费(仅无 `_id` 的文档取用) */
70
+ /**
71
+ * 批量插入命令;`newIds` 按需消费(仅无 `_id` 的文档取用)
72
+ *
73
+ * 参数与 JS store API 一一对应(跨语言 parity 优先于参数个数),保持位置参数。
74
+ */
80
75
  planInsertMany(model: string, docs: Array<any>, now: number, newIds: Array<string>, ctx?: any | undefined | null, routeOverride?: any | undefined | null): any
81
76
  /**
82
77
  * 更新一条(findOneAndUpdate + returnDocument AFTER)。
83
78
  *
84
79
  * creator 写权限需探针时返回 `{"needsProbe": cmd}`;Host 执行探针后携
85
80
  * `probeFound`(true/false)与 `probeDoc` 重入即得 `{"command": cmd}`。
81
+ *
82
+ * 参数与 JS store API 一一对应(跨语言 parity 优先于参数个数),保持位置参数。
86
83
  */
87
84
  planUpdate(model: string, condition: any, data: any, options: any | undefined | null, now: number, ctx?: any | undefined | null, probeFound?: boolean | undefined | null, probeDoc?: any | undefined | null, routeOverride?: any | undefined | null): any
88
85
  /** 批量更新(guest / 无写授权直接拒绝,不走 creator 探针) */
@@ -94,7 +91,11 @@ export declare class Registry {
94
91
  planRemove(model: string, condition: any, ctx?: any | undefined | null, probeFound?: boolean | undefined | null, probeDoc?: any | undefined | null, routeOverride?: any | undefined | null): any
95
92
  /** 归档文档命令:源文档补 `deletedAt` 后批量写入 `<collection>_deleted` */
96
93
  planArchiveDocs(model: string, docs: Array<any>, now: number, routeOverride?: any | undefined | null): any
97
- /** 显式条件 upsert;`newId` 仅在需生成 `_id` 时被使用 */
94
+ /**
95
+ * 显式条件 upsert;`newId` 仅在需生成 `_id` 时被使用
96
+ *
97
+ * 参数与 JS store API 一一对应(跨语言 parity 优先于参数个数),保持位置参数。
98
+ */
98
99
  planUpsert(model: string, condition: any, data: any, options: any | undefined | null, now: number, newId: string, ctx?: any | undefined | null, routeOverride?: any | undefined | null): any
99
100
  /**
100
101
  * mutation 规划:展开为有序步骤序列 `{steps: [{model, command}]}`,
@@ -106,6 +107,18 @@ export declare class Registry {
106
107
  * (对齐 JS `applyDefaultsAndComputes(result, s)`)
107
108
  */
108
109
  applyWriteDefaults(model: string, doc: any): any
110
+ /** 解析 GQL 并构建 pipeline / projection,返回 `{tokens, ast, pipeline, projection}` */
111
+ buildPipeline(gql: string, params: any, ctx?: any | undefined | null): any
112
+ planQuery(gql: string, params: any, ctx?: any | undefined | null, routeOverride?: any | undefined | null): any
113
+ /** queryOne 计划:未显式 `$limit` 时强制下推 `$limit(1)` */
114
+ planQueryOne(gql: string, params: any, ctx?: any | undefined | null, routeOverride?: any | undefined | null): any
115
+ /** 列表 + total;`total` 由 Host 执行 `countCommand` 后回喂,用于算 `hasMore` */
116
+ planQueryWithCount(gql: string, params: any, ctx?: any | undefined | null, total?: number | undefined | null, routeOverride?: any | undefined | null): any
117
+ resolvePage(gql: string, params: any): any
118
+ /** 两阶段查询后按阶段一 `_id` 顺序重排,返回 `{items}` */
119
+ restoreSortOrder(items: Array<any>, ids: Array<any>, sort?: any | undefined | null): any
120
+ planExists(model: string, condition: any, routeOverride?: any | undefined | null): any
121
+ planCount(model: string, filter?: any | undefined | null, ctx?: any | undefined | null, routeOverride?: any | undefined | null): any
109
122
  sortsByRelation(sort?: any | undefined | null): boolean
110
123
  constructor()
111
124
  /** 注册 schema(自动派生 `<Name>Deleted` 归档表;`timestamps !== false` 时补时间戳字段) */
@@ -115,8 +128,6 @@ export declare class Registry {
115
128
  /** 注册同步计算列回调(schema 里 `fn: true` 的 `fnRef`,缺省为计算列名) */
116
129
  setFn(fnRef: string, callback: (arg: any) => any): void
117
130
  clearFns(): void
118
- /** 开关用户 $pipeline 直通(默认允许;AI 查询宿主建议关闭作纵深防御) */
119
- setAllowUserPipeline(allow: boolean): void
120
131
  /**
121
132
  * 开关「上下文强制」(默认关闭 = fail-open,保持 JS parity)。
122
133
  * 开启后:plan 入口遇 `ctx` 缺失抛 `ERR_NO_CONTEXT`(fail-secure),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rust-store-node",
3
- "version": "1.0.0",
4
- "description": "rust-store 的 Node 绑定(napi-rs):把 core 的 Command 契约暴露给 JS Host",
3
+ "version": "2.0.1",
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",
7
7
  "files": [
@@ -32,14 +32,24 @@
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/**/*.test.js\""
35
+ "test": "node --test test/parity.test.js test/dialect.smoke.test.js test/t2q.skill.test.js"
36
36
  },
37
37
  "keywords": [
38
38
  "rust-store",
39
39
  "napi-rs",
40
+ "napi",
40
41
  "binding",
41
42
  "gql",
42
- "data-layer"
43
+ "data-layer",
44
+ "multi-backend",
45
+ "mongodb",
46
+ "mysql",
47
+ "sqlite",
48
+ "postgresql",
49
+ "sql-dialect",
50
+ "query-planner",
51
+ "orm-alternative",
52
+ "rust"
43
53
  ],
44
54
  "author": "leo <coen_ddt@qq.com>",
45
55
  "license": "MIT",
@@ -56,10 +66,10 @@
56
66
  "sql.js": "^1.8.0"
57
67
  },
58
68
  "optionalDependencies": {
59
- "rust-store-node-win32-x64-msvc": "1.0.0",
60
- "rust-store-node-linux-x64-gnu": "1.0.0",
61
- "rust-store-node-linux-arm64-gnu": "1.0.0",
62
- "rust-store-node-darwin-x64": "1.0.0",
63
- "rust-store-node-darwin-arm64": "1.0.0"
69
+ "rust-store-node-win32-x64-msvc": "2.0.1",
70
+ "rust-store-node-linux-x64-gnu": "2.0.1",
71
+ "rust-store-node-linux-arm64-gnu": "2.0.1",
72
+ "rust-store-node-darwin-x64": "2.0.1",
73
+ "rust-store-node-darwin-arm64": "2.0.1"
64
74
  }
65
75
  }
Binary file
Binary file