Skip to content

Commit 532c96d

Browse files
committed
test(runtime): the pins' handler plugin reads the engine slot through its contract type
Claude-Session: https://claude.ai/code/session_016GiHYRmLSNWTfbX9gVQkpz Co-authored-by: Claude <noreply@anthropic.com>
1 parent edf0df4 commit 532c96d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎packages/runtime/src/stored-metadata-reader-contexts.pin.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646

4747
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
4848
import { ObjectKernel } from '@objectstack/core';
49+
import type { Plugin, PluginContext } from '@objectstack/core';
4950
import { ObjectQLPlugin } from '@objectstack/objectql';
51+
import type { ObjectQL } from '@objectstack/objectql';
5052
import { HonoServerPlugin } from '@objectstack/plugin-hono-server';
5153
import { createRestApiPlugin } from '@objectstack/rest';
5254
import { AuthPlugin } from '@objectstack/plugin-auth';
@@ -141,12 +143,12 @@ const PIN_APP: any = {
141143
};
142144

143145
/** ② / ③ — host code registering action handlers, the way a plugin does. */
144-
const PIN_HANDLER_PLUGIN: any = {
146+
const PIN_HANDLER_PLUGIN: Plugin = {
145147
name: 'pin.reader21454.handler',
146148
version: '0.0.0',
147149
init: async () => {},
148-
start: async (ctx: any) => {
149-
const ql: any = ctx.getService('objectql');
150+
start: async (ctx: PluginContext) => {
151+
const ql = ctx.getService<ObjectQL>('objectql');
150152
const where = { type: 'datasource', name: DS_NAME };
151153
for (const [action, object] of [
152154
['handler_engine_reads_family', 'sys_metadata'],

0 commit comments

Comments
 (0)