({ }, op: string)
| 225 | |
| 226 | @param('op', Types.String) |
| 227 | async prepare({ }, op: string) { |
| 228 | if (op === 'rpc') { |
| 229 | this.isRpc = true; |
| 230 | return; |
| 231 | } |
| 232 | if (!APIS[op]) throw new BadRequestError(`Invalid API operation: ${op}`); |
| 233 | if (APIS[op].type !== 'Subscription') { |
| 234 | throw new BadRequestError('Only subscription operations are supported'); |
| 235 | } |
| 236 | handleArguments(this.args); |
| 237 | // @ts-ignore |
| 238 | await this.ctx.parallel('handler/api/before', this); |
| 239 | // @ts-ignore |
| 240 | await this.ctx.parallel(`handler/api/before/${op}`, this); |
| 241 | this.dispose = await this.ctx.api.execute( |
| 242 | this, op, { domainId: this.args.domainId, ...this.args, ...(this.args.args || {}) }, |
| 243 | (m, args) => (this.ctx.parallel as any)(m, args), this.args.projection, (p) => this.send(p), |
| 244 | ); |
| 245 | } |
| 246 | |
| 247 | async message(message) { |
| 248 | if (!this.isRpc) throw new BadRequestError('Only RPC operations are supported'); |
nothing calls this directly
no test coverage detected