Skip to content

Commit 34fd976

Browse files
committed
fix(plugin-auth): 测试层的冗余 object 键跟进 DriverQuery,台账不抬 (#6075)
check:type-check-debt 的全仓 re-measure 报 plugin-auth 从 131 涨到 132 (+1)。plugin-auth 的 tsconfig 把 **/*.test.ts 排除在外,所以 per-package `pnpm typecheck` 看不见它,只有把排除掀掉的全仓 re-measure 量得到。 定位到的就是一处: src/auth-where-operator-coverage.test.ts(383,7): error TS2353: Object literal may only specify known properties, and 'object' does not exist in type 'DriverQuery'. `driver.find('sys_user', { object: 'sys_user', fields: ['id'] } satisfies QueryAST)` —— 删掉的值与第一个实参逐字相同,属重拼类。承载类型按第三类 处置改为 `satisfies DriverQuery`:该处上方注释明确写了「这里不能用 as any, 否则会被 check:query-options-erasure (#4674/#4918) 记一笔」,所以保留 satisfies、只换目标类型,正是它原本的意图。 ⛔ 未抬台账数字:门禁原话「the ledger is a ratchet and may only shrink」 (#5278),本单是自己引入的 +1,属可约。改完复测回到 131,与台账记录一致。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WyvqvKMG6asi9aXjKE6xtx
1 parent ae9fe54 commit 34fd976

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/plugins/plugin-auth/src/auth-where-operator-coverage.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ import { assertEngineDeleteDispatch } from '@objectstack/objectql';
7373
import { whereOperators } from '@better-auth/core/db/adapter';
7474
import { FILTER_OPERATORS } from '@objectstack/spec/data';
7575
import type { QueryAST } from '@objectstack/spec/data';
76+
import type { DriverQuery } from '@objectstack/spec/contracts';
7677
import type { IDataEngine } from '@objectstack/core';
7778
import {
7879
createObjectQLAdapterFactory,
@@ -380,9 +381,8 @@ describe('[#5813] the predicates really filter on a real backend', () => {
380381
// would be counted by `check:query-options-erasure` (#4674/#4918), and
381382
// nothing about this read is off-contract.
382383
const left = await driver.find('sys_user', {
383-
object: 'sys_user',
384384
fields: ['id'],
385-
} satisfies QueryAST);
385+
} satisfies DriverQuery);
386386
expect(left.map((r: any) => r.id).sort()).toEqual(['u_abc1', 'u_abcz', 'u_xabc']);
387387
});
388388
});

0 commit comments

Comments
 (0)