Skip to content

Commit 54b8f28

Browse files
committed
refactor(orm): move ExtResultFieldDef to internal client-impl
The type was exported from plugin.ts but never used in public typings. Move it as a simple non-generic type into client-impl.ts where it's actually consumed.
1 parent 36d5575 commit 54b8f28

2 files changed

Lines changed: 6 additions & 16 deletions

File tree

packages/orm/src/client/client-impl.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ import { ZenStackQueryExecutor } from './executor/zenstack-query-executor';
3737
import * as BuiltinFunctions from './functions';
3838
import { SchemaDbPusher } from './helpers/schema-db-pusher';
3939
import type { ClientOptions, ProceduresOptions } from './options';
40-
import type { AnyPlugin, ExtResultFieldDef } from './plugin';
40+
import type { AnyPlugin } from './plugin';
41+
42+
type ExtResultFieldDef = {
43+
needs: Record<string, true>;
44+
compute: (data: Record<string, any>) => unknown;
45+
};
4146
import { getField } from './query-utils';
4247
import { createZenStackPromise, type ZenStackPromise } from './promise';
4348
import { ResultProcessor } from './result-processor';

packages/orm/src/client/plugin.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,6 @@ export type ExtQueryArgsBase = {
2020
*/
2121
export type ExtClientMembersBase = Record<string, unknown>;
2222

23-
/**
24-
* Definition for a single extended result field.
25-
* When used without type parameters, accepts any field names and untyped compute.
26-
*/
27-
export type ExtResultFieldDef<Needs extends Record<string, true> = Record<string, true>> = {
28-
/**
29-
* Fields required to compute this result field.
30-
*/
31-
needs: Needs;
32-
/**
33-
* Computes the result field value from the query result row.
34-
*/
35-
compute: (data: { [K in keyof Needs]: any }) => unknown;
36-
};
37-
3823
/**
3924
* Base shape of plugin-extended result fields.
4025
* Keyed by model name, each value maps field names to their definitions.

0 commit comments

Comments
 (0)