Skip to content

Commit 0fad163

Browse files
committed
test(runtime): type the engine option bags in the suite-move overlay pins
Claude-Session: https://claude.ai/code/session_01ADHkmR2hWY1vfpcDK2q19Q Co-authored-by: Claude <noreply@anthropic.com>
1 parent a59426e commit 0fad163

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎packages/runtime/src/domains/meta-overlay-follows-suite.test.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import { ObjectQL } from '@objectstack/objectql';
3535
import { SqlDriver } from '@objectstack/driver-sql';
3636
import { ObjectStackProtocolImplementation } from '@objectstack/metadata-protocol';
3737
import { appOf, installedManifestsOf } from '@objectstack/metadata-core';
38+
import type { DataEngineInsertOptions, EngineQueryOptions } from '@objectstack/spec/data';
3839
import { SysMetadata, SysMetadataHistoryObject, SysMetadataAuditObject } from '@objectstack/platform-objects/metadata';
3940
// The protocol's doors reach `import('@objectstack/metadata')`; pay that load
4041
// during collection, never inside a clocked case (check:test-source-alias).
@@ -127,14 +128,14 @@ async function boot(file: string, version: Version, { partner = false } = {}) {
127128
const served = async (owner: string) => ({
128129
bare: await label(), owner: await label(owner), list: await listed(), layered: await layered(),
129130
});
130-
const rows = async () => ((await engine.find('sys_metadata', {
131-
where: { type: 'view', name: VIEW }, context: { isSystem: true },
132-
} as any)) as any[]).map((r) => [r.package_id ?? null, r.state]);
131+
const systemRead: EngineQueryOptions = { where: { type: 'view', name: VIEW }, context: { isSystem: true } };
132+
const rows = async () => (await engine.find('sys_metadata', systemRead)).map((r) => [r.package_id ?? null, r.state]);
133+
const systemWrite: DataEngineInsertOptions = { context: { isSystem: true } };
133134
/** A row laid down through the engine, as an earlier release or a pre-gate write stored it. */
134135
const layRow = async (type: string, name: string, packageId: string, body: Record<string, unknown>) => engine.insert('sys_metadata', {
135136
type, name, namespace: 'default', package_id: packageId, scope: 'platform', strategy: 'merge', state: 'active', version: 1,
136137
metadata: JSON.stringify(body),
137-
}, { context: { isSystem: true } } as any);
138+
}, systemWrite);
138139
return { engine, protocol, label, served, rows, layRow, installed: installedManifestsOf(engine.registry as any) };
139140
}
140141
type Session = Awaited<ReturnType<typeof boot>>;

0 commit comments

Comments
 (0)