MCPcopy Create free account
hub / github.com/apache/maka / decodeTurnResumeQueryInput

Function decodeTurnResumeQueryInput

packages/runtime-host/src/protocol/turn.ts:482–506  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

480}
481
482function decodeTurnResumeQueryInput(value: unknown): TurnResumeQueryInput {
483 const record = requireShapedRecord(
484 value,
485 'turn.resume.query input',
486 ['sessionId'],
487 ['sourceRunId', 'expectedRuntimeEventHighWater'],
488 );
489 if (record.expectedRuntimeEventHighWater !== undefined && record.sourceRunId === undefined) {
490 throw invalidProtocolFrame('Turn resume high-water requires a source Run');
491 }
492 return {
493 sessionId: requireEntityId(record.sessionId, 'sessionId'),
494 ...(record.sourceRunId !== undefined
495 ? { sourceRunId: requireEntityId(record.sourceRunId, 'sourceRunId') }
496 : {}),
497 ...(record.expectedRuntimeEventHighWater !== undefined
498 ? {
499 expectedRuntimeEventHighWater: requirePositiveCount(
500 record.expectedRuntimeEventHighWater,
501 'expectedRuntimeEventHighWater',
502 ),
503 }
504 : {}),
505 };
506}
507
508function decodeTurnResumeStartInput(value: unknown): TurnResumeStartInput {
509 const record = requireExactRecord(value, 'turn.resume.start input', [

Callers

nothing calls this directly

Calls 4

requireShapedRecordFunction · 0.85
invalidProtocolFrameFunction · 0.85
requireEntityIdFunction · 0.85
requirePositiveCountFunction · 0.70

Tested by

no test coverage detected