12 lines
439 B
TypeScript
12 lines
439 B
TypeScript
|
|
import type { RudderContext } from '../core/context.js';
|
||
|
|
import { api } from '../generated/api.js';
|
||
|
|
import type { CallModuleFunctionClientResponse } from '../generated/modules.js';
|
||
|
|
|
||
|
|
export class ModulesDomain {
|
||
|
|
constructor(private readonly ctx: RudderContext) {}
|
||
|
|
|
||
|
|
call(module: string, fn: string, args?: unknown): Promise<CallModuleFunctionClientResponse> {
|
||
|
|
return api.callModuleFunction(this.ctx, { module, fn }, { args });
|
||
|
|
}
|
||
|
|
}
|