(value: unknown)
| 336 | } |
| 337 | |
| 338 | function actionSourceParam(value: unknown): OpenADEActionEventCreateRequest["source"] { |
| 339 | const source = asRecord(value) |
| 340 | if ( |
| 341 | source.type !== "plan" && |
| 342 | source.type !== "revise" && |
| 343 | source.type !== "run_plan" && |
| 344 | source.type !== "do" && |
| 345 | source.type !== "ask" && |
| 346 | source.type !== "hyperplan" && |
| 347 | source.type !== "review" |
| 348 | ) { |
| 349 | throw new Error("source.type is invalid") |
| 350 | } |
| 351 | if (typeof source.userLabel !== "string" || source.userLabel.length < 1) throw new Error("source.userLabel is invalid") |
| 352 | return source as OpenADEActionEventCreateRequest["source"] |
| 353 | } |
| 354 | |
| 355 | function createActionEventParams(params: unknown): OpenADEActionEventCreateRequest { |
| 356 | const record = asRecord(params) |
no test coverage detected