fix(PendingRequestMap): resolve type name conflict between env.ts interface and call.ts class

- Remove PendingRequestMap interface from env.ts (had reduced signature missing deadline, identity typed as unknown)
- Add CallMap interface in env.ts with full call() signature matching the class
- Update EnvOptions.callMap to use CallMap type
- Export PendingRequestMap class directly (remove PendingRequestMapClass alias)
- Export CallMap type from index.ts instead of old PendingRequestMap interface
This commit is contained in:
2026-05-11 01:54:04 +00:00
parent b6c2b2c186
commit 9f4d2fb5f7
3 changed files with 60 additions and 6 deletions

View File

@@ -1,19 +1,19 @@
import { OperationType } from "./types.js";
import type { OperationContext, OperationEnv } from "./types.js";
import type { OperationContext, OperationEnv, Identity } from "./types.js";
import type { OperationRegistry } from "./registry.js";
import { getLogger } from "@logtape/logtape";
const logger = getLogger("operations:env");
export interface PendingRequestMap {
call(operationId: string, input: unknown, options?: { parentRequestId?: string; identity?: unknown }): Promise<unknown>;
export interface CallMap {
call(operationId: string, input: unknown, options?: { parentRequestId?: string; deadline?: number; identity?: Identity }): Promise<unknown>;
}
export interface EnvOptions {
registry: OperationRegistry;
context: OperationContext;
allowedNamespaces?: string[];
callMap?: PendingRequestMap;
callMap?: CallMap;
}
export function buildEnv(options: EnvOptions): OperationEnv {