Reference

The testing kit

Reference for testContext, invoke, checkAgent, assertAgent, runBrain and testChannel from @voicelayer/sdk/testing.

The testing kit runs your handlers, brains and channels as plain functions, with no network and no call.

Import from @voicelayer/sdk/testing. For a walk-through, see Testing agents and channels.

testContext

function · @voicelayer/sdk/testing

testContext(opts?: TestContextOptions): TestContext

Build a test context. It makes no network calls.

Parameters
NameTypeRequiredDescription
optsTestContextOptionsnoThe call, channel, scripted answers and refusals.
Returns

TestContext: A TestContext.

Example
import { testContext } from '@voicelayer/sdk/testing';

const ctx = testContext({ answers: { ask: '[email protected]' } });

TestContextOptions

interface · @voicelayer/sdk/testing

interface TestContextOptions

How to set up a test context: the call, the channel, the captured process data, scripted answers, and which calls to refuse.

Fields

NameTypeRequiredDefaultDescription
callobjectnoFields of ctx.call to override. The defaults are a fixed call id, a placeholder caller, a fixed number and a fixed start time.
call.metadataReadonly<Record<string, unknown>>noThe metadata the call was started with, read only. To keep state across handlers, use ctx.metadata.
call.callIdstringnoThe call's id, the same one the dashboard and the API show.
call.callerIdstringnoThe caller's number (a placeholder like <PII_PHONE_1> unless real values were released to this handler).
call.tostring | nullnoThe number that was called.
call.startedAtDatenoWhen the call started.
languagestringno'en-US'The call's language (ctx.language).
channelobjectnoWhether the conversation is voice (the default) or text, and its display label.
channel.kindChannelKindno'voice'voice or text. One of voice, text.
channel.labelstringno`phone` for voice, `web` for textThe display label.
capabilitiesPartial<WorkerCapabilities>noOverrides for ctx.capabilities.
processobjectnoWhat ctx.process holds: the captured data and whether the process is complete.
process.dataRecord<string, unknown>noThe captured fields.
process.completebooleannofalseWhether the process is complete.
metadataRecord<string, unknown>noThe starting value of ctx.metadata, as the invocation would carry it.
connectorsRecord<string, unknown>noThe value of ctx.connectors.
realValuesbooleannofalseThe value of ctx.realValues.
answersobjectnoScripted answers: ask (a string, or a function of the question), memory (the store memory.get reads) and memoryFacts (what memory.search finds; none by default, as for a version without the memory opt-in).
answers.askstring | ((question: string) => string)noThe answer to ctx.ask: a string, or a function of the question. Without one, ask fails the test.
answers.memoryRecord<string, unknown>noThe starting contents of the store memory.get reads.
answers.memoryFactsAwaited<ReturnType<HandlerContext['memory']['search']>>['facts']noWhat memory.search finds.
refusePartial<Record<RecordedAction['kind'], string>>noMake a call reject as the platform would, by call kind and code, for example { handoff: 'guard_denied' }.
strictChannelLabelbooleannofalseMake reading ctx.channel.label throw, to catch a handler that branches on the label instead of on capabilities.
signalAbortSignalnoThe value of ctx.signal.

TestContext

interface · @voicelayer/sdk/testing

interface TestContext extends HandlerContext

A HandlerContext for tests. Its calls record what the handler asked for and return the scripted answers, so you can assert on said, handoffs and the rest.

Fields

NameTypeRequiredDescription
actionsreadonly RecordedAction[]yesEvery call, in order.
saidreadonly string[]yesThe text passed to say.
respondedreadonly string[]yesThe instructions passed to respond.
handoffsobject[]yesEach handoff, with its destination and options.
handoffs.tostringyesThe destination passed to handoff.
handoffs.optsHandoffOptions | undefinedyesThe options passed to handoff.
endedobject[]yesEach endCall, with its reason.
ended.reasonstringnoThe reason passed to endCall.
eventsreadonly RecordEventInput[]yesEach event passed to recordEvent.
dtmfreadonly string[]yesThe digits passed to sendDtmf.
memoryStoreReadonlyMap<string, unknown>yesWhat memory.set stored.

statePatch

statePatch(): Record<string, unknown> | undefined

Everything the handler changed in ctx.metadata since the context was built, as the merge patch the platform would receive. undefined when nothing changed.

Returns

Record<string, unknown> | undefined

RecordedAction

interface · @voicelayer/sdk/testing

interface RecordedAction

One call a handler made back to the platform, in order.

Fields

NameTypeRequiredDescription
kind'say' | 'respond' | 'ask' | 'handoff' | 'endCall' | 'recordEvent' | 'memory.get' | 'memory.set' | 'memory.search' | 'sendDtmf' | 'watchFormSession' | 'unwatchFormSession'yesWhich call it was: say, respond, ask, handoff, endCall, recordEvent, memory.get, memory.set, memory.search, sendDtmf, watchFormSession or unwatchFormSession.
paramsRecord<string, unknown>yesThe arguments the handler passed.

invoke

function · @voicelayer/sdk/testing

invoke(agent: AgentHandle | BuildResult, handlerId: string, input?: unknown, ctx?: HandlerContext): Promise<unknown>

Run one handler by id as the runner would. input is a tool's arguments or a hook's payload. Arguments are validated as the runner validates them, a blocking handler's value is checked against its result shape, and the handler's own error is rethrown as a HandlerInvocationError.

Parameters
NameTypeRequiredDefaultDescription
agentAgentHandle | BuildResultyesThe agent, or a built manifest.
handlerIdstringyesThe handler to run, such as tool.lookup_order.
inputunknownnoThe tool's arguments or the hook's payload.
ctxHandlerContextnotestContext()The context to run with.
Returns

Promise<unknown>: What the handler returned.

Throws
  • HandlerInvocationError when the handler is not served, the input is invalid, the result has the wrong shape, or the handler throws.
Example
const ctx = testContext();
const result = await invoke(agent, 'tool.lookup_order', { orderId: '42' }, ctx);
expect(result).toMatchObject({ status: 'shipped' });

HandlerInvocationError

class · @voicelayer/sdk/testing

class HandlerInvocationError extends Error

A handler's problem as a test sees it: the error the platform would have replied with. code is not_registered (no such handler), invalid_args (the input does not match), invalid_result (a blocking handler's result is the wrong shape) or handler_error (the handler threw).

new HandlerInvocationError(code: 'not_registered' | 'invalid_args' | 'invalid_result' | 'handler_error', message: string, cause?: unknown)

Fields

NameTypeRequiredDescription
code'not_registered' | 'invalid_args' | 'invalid_result' | 'handler_error'yesWhich problem it was.
causeunknownnoThe error the handler threw, for handler_error.

checkAgent

function · @voicelayer/sdk/testing

checkAgent(agent: AgentHandle | Parameters<typeof buildManifest>[0], opts?: BuildOptions): AgentCheck

Build the manifest and run the upload's own lint offline. ok is false for an unsupported field, a secret or a bad handler declaration: the same findings voicelayer manifest --check and the upload make.

Parameters
NameTypeRequiredDescription
agentAgentHandle | Parameters<typeof buildManifest>[0]yesThe agent, or its config.
optsBuildOptionsnoBuild options.
Returns

AgentCheck: The errors, warnings and build result.

assertAgent

function · @voicelayer/sdk/testing

assertAgent(agent: AgentHandle | Parameters<typeof buildManifest>[0], opts?: BuildOptions): BuildResult

Throw with every finding named when the agent does not build. For a CI test.

Parameters
NameTypeRequiredDescription
agentAgentHandle | Parameters<typeof buildManifest>[0]yesThe agent, or its config.
optsBuildOptionsnoBuild options.
Returns

BuildResult: The build result.

Throws
  • Error listing each error when the agent does not build.
Example
import { assertAgent } from '@voicelayer/sdk/testing';

it('builds', () => {
  assertAgent(agent);
});

AgentCheck

interface · @voicelayer/sdk/testing

interface AgentCheck

The outcome of checkAgent.

Fields

NameTypeRequiredDescription
okbooleanyesTrue when the agent has no errors.
errorsreadonly BuildIssue[]yesFindings that block an upload.
warningsreadonly BuildIssue[]yesFindings that do not block an upload.
resultBuildResultyesThe full build result.

buildManifest

function · @voicelayer/sdk/testing

buildManifest(config: AgentConfig<Record<string, ProcessField>> | Readonly<Record<string, unknown>>, opts?: BuildOptions): BuildResult

Build an agent's manifest, handler table and issues from its config, without running anything. Accepts an AgentConfig or any config object, so a JavaScript author or an older config is checked too.

Parameters
NameTypeRequiredDescription
configAgentConfig<Record<string, ProcessField>> | Readonly<Record<string, unknown>>yesThe agent's config.
optsBuildOptionsnoBuild options.
Returns

BuildResult: The manifest, table, hash and issues.

BuildOptions

interface · @voicelayer/sdk/testing

interface BuildOptions

Options for building a manifest.

Fields

NameTypeRequiredDefaultDescription
textAnsweredBy'direct'noSet to direct when the agent has onMessage: its own process answers text through the API.
buildstringno'local'The deploy identity. A fresh one per deploy makes every deploy a new hash.

BuildResult

interface · @voicelayer/sdk/testing

interface BuildResult

What building an agent produces.

Fields

NameTypeRequiredDescription
manifestAgentManifestInputyesThe manifest that would be uploaded.
tableHandlerTableyesThe handlers the agent serves, by id.
hashstringyesThe manifest's hash, which the platform pins and retires builds by.
issuesreadonly BuildIssue[]yesErrors and warnings. The manifest may be uploaded only when none is an error.
okbooleanyesTrue when there are no errors.

BuildIssue

interface · @voicelayer/sdk/testing

interface BuildIssue

A problem found when building an agent's manifest.

Fields

NameTypeRequiredDescription
severity'error' | 'warning'yeserror blocks an upload; warning does not.
codeManifestIssueCode | BuildOnlyIssueCodeyesA stable code naming the problem.
pathstringyesWhere in the config (or the manifest) the problem is, as a dotted path.
messagestringyesWhat is wrong and how to fix it.

runBrain

function · @voicelayer/sdk/testing

runBrain(agent: AgentHandle | BuildResult, turn: { messages, tools? }, opts?: { tools?, signal? }): Promise<BrainTurnResult>

Run the agent's brain (onQuery or an adapter's handler) for one turn, as the runner would: no network, the turn's history in, the deltas out.

Parameters
NameTypeRequiredDescription
agentAgentHandle | BuildResultyesThe agent, or a built manifest.
turnobjectyesThe conversation so far, and the tools the request carries.
turn.messagesReadonlyArray<{ readonly role: string; readonly content: string }>yesThe conversation so far, oldest first.
turn.toolsReadonlyArray<Record<string, unknown>>noTool definitions the request carries.
optsobjectnotools stands in for VoiceLayer's tools (what an adapter's tool bodies call); signal is the turn's abort, as for a barge-in.
opts.toolsBrainToolCallernoA stand-in for VoiceLayer's tools.
opts.signalAbortSignalnoThe turn's abort signal.
Returns

Promise<BrainTurnResult>: The text, events, finish reason and error.

Throws
  • HandlerInvocationError with code not_registered when the agent serves no brain.
Example
const out = await runBrain(agent, { messages: [{ role: 'user', content: 'what time do you open?' }] });
expect(out.text).toContain('9');

BrainTurnResult

interface · @voicelayer/sdk/testing

interface BrainTurnResult

What a brain produced for one turn.

Fields

NameTypeRequiredDescription
textstringyesEvery text delta, joined.
eventsreadonly BrainTurnEvent[]yesEvery event the brain yielded.
finishReasonstring | undefinedyesThe finish reason of the done event (stop when the handler just ended). undefined after an error.
errorobjectyesThe error the brain reported, if any.
error.codestringyesThe error code.
error.messagestringyesThe error message.

testChannel

function · @voicelayer/sdk/testing

testChannel(channel: ChannelHandle, options?: TestChannelOptions): ChannelTester

Build a tester for a channel, with no network.

Parameters
NameTypeRequiredDescription
channelChannelHandleyesThe channel from defineChannel.
optionsTestChannelOptionsnoThe starting store.
Returns

ChannelTester: The tester.

Example
import { testChannel } from '@voicelayer/sdk/testing';

const t = testChannel(channel);
expect(t.manifest().issues).toEqual([]);
const [r] = await t.parse({ kind: 'message', body: JSON.stringify(update) });
expect(r.outcome).toBe('event');

TestChannelOptions

interface · @voicelayer/sdk/channel

interface TestChannelOptions

Options for testChannel.

Fields

NameTypeRequiredDescription
storeReadonly<Record<string, unknown>>noWhat ctx.store holds when the test starts. It lives for the tester, so a cursor one run keeps is there for the next.

ChannelTester

interface · @voicelayer/sdk/channel

interface ChannelTester

Runs a channel offline: check the manifest, parse events, run actions with a stubbed provider.

Fields

NameTypeRequiredDescription
callsobject[]yesThe provider calls ctx.fetch made, in order.
calls.pathstringyesThe path passed to ctx.fetch.
calls.initChannelFetchInityesThe options passed to ctx.fetch.
storeChannelStore & { readonly entries: ReadonlyMap<string, unknown> }yesThe connection's store for this tester. Read it to check a cursor.

manifest

manifest(connectorId?: string): { readonly manifest: { channels: string[]; id: string; displayName: string; inbound: { verification: { scheme: "slack_v0"; toleranceSec: number; } | { scheme: "meta_hmac_sha256"; } | { scheme: "twilio_hmac_sha1"; } | { scheme: "ed25519"; toleranceSec: number; signatureHeader: string; timestampHeader: string; } | { scheme: "secret_token_header"; header: string; }; events: { kind: string; id: { path: string; from: "json"; } | { name: string; from: "header"; }; items?: string | undefined; lane?: string | undefined; }[]; ack: { type: "fixed"; status: number; body: string; contentType: "text/plain" | "application/json" | "text/xml"; } | { type: "echo_query"; param: string; } | { path: string; type: "echo_json"; as: { format: "text"; } | { format: "json"; key: string; }; } | { path: string; type: "typed"; cases: Record<string, { type: "fixed"; status: number; body: string; contentType: "text/plain" | "application/json" | "text/xml"; }>; fallback: { type: "fixed"; status: number; body: string; contentType: "text/plain" | "application/json" | "text/xml"; }; }; handshakes: { name: string; when: { method: "GET" | "POST"; query?: { param: string; equals?: string | undefined; } | undefined; json?: { path: string; equals: string | number | boolean; } | undefined; }; authentication: { by: "signature"; } | { by: "token"; queryParam: string; }; reply: { type: "fixed"; status: number; body: string; contentType: "text/plain" | "application/json" | "text/xml"; } | { type: "echo_query"; param: string; } | { path: string; type: "echo_json"; as: { format: "text"; } | { format: "json"; key: string; }; } | { path: string; type: "typed"; cases: Record<string, { type: "fixed"; status: number; body: string; contentType: "text/plain" | "application/json" | "text/xml"; }>; fallback: { type: "fixed"; status: number; body: string; contentType: "text/plain" | "application/json" | "text/xml"; }; }; }[]; attribution: { from: "path"; } | { path: string; from: "body"; } | { name: string; from: "header"; }; }; egressHosts: string[]; api?: { host: string; calls: (string | { call: string; query?: string[] | undefined; })[]; } | undefined; sends?: { operations: Partial<Record<"send.text" | "reply.in_window" | "send.media", { path: string; method: "POST" | "PUT" | "PATCH"; recipients: string[]; messageId: string; query?: Record<string, string> | undefined; headers?: Record<string, string> | undefined; body?: { kind: "json"; template: Record<string, unknown>; } | { kind: "form"; fields: Record<string, string>; } | undefined; address?: "peer" | "answered" | undefined; }>>; } | undefined; live?: { events: string[]; protocol: "discord_gateway"; intents: number; } | { protocol: "slack_socket"; } | { protocol: "imap"; mailbox: string; } | undefined; actions?: Record<string, { kind: "send"; sends: number; send: { path: string; method: "POST" | "PUT" | "PATCH"; recipients: string[]; messageId: string; query?: Record<string, string> | undefined; headers?: Record<string, string> | undefined; body?: { kind: "json"; template: Record<string, unknown>; } | { kind: "form"; fields: Record<string, string>; } | undefined; address?: "peer" | "answered" | undefined; }; hasPrepare: boolean; describe: string; forAgent: boolean; input?: Record<string, "string" | "number" | "boolean" | "text" | "url"> | undefined; slots?: Record<string, "digits" | "uuid" | "hex"> | undefined; } | { kind: "code"; describe: string; forAgent: boolean; access: "read" | "write"; input?: Record<string, "string" | "number" | "boolean" | "text" | "url"> | undefined; }> | undefined; schedules?: { name: string; everySeconds: number; }[] | undefined; store?: boolean | undefined; } | undefined; readonly issues: readonly ChannelIssue[]; }

The manifest for ws/test/<name> (or the id you pass), with its issues.

Parameters
NameTypeRequiredDescription
connectorIdstringnoA connector id to build for.
Returns

{ readonly manifest: { channels: string[]; id: string; displayName: string; inbound: { verification: { scheme: "slack_v0"; toleranceSec: number; } | { scheme: "meta_hmac_sha256"; } | { scheme: "twilio_hmac_sha1"; } | { scheme: "ed25519"; toleranceSec: number; signatureHeader: string; timestampHeader: string; } | { scheme: "secret_token_header"; header: string; }; events: { kind: string; id: { path: string; from: "json"; } | { name: string; from: "header"; }; items?: string | undefined; lane?: string | undefined; }[]; ack: { type: "fixed"; status: number; body: string; contentType: "text/plain" | "application/json" | "text/xml"; } | { type: "echo_query"; param: string; } | { path: string; type: "echo_json"; as: { format: "text"; } | { format: "json"; key: string; }; } | { path: string; type: "typed"; cases: Record<string, { type: "fixed"; status: number; body: string; contentType: "text/plain" | "application/json" | "text/xml"; }>; fallback: { type: "fixed"; status: number; body: string; contentType: "text/plain" | "application/json" | "text/xml"; }; }; handshakes: { name: string; when: { method: "GET" | "POST"; query?: { param: string; equals?: string | undefined; } | undefined; json?: { path: string; equals: string | number | boolean; } | undefined; }; authentication: { by: "signature"; } | { by: "token"; queryParam: string; }; reply: { type: "fixed"; status: number; body: string; contentType: "text/plain" | "application/json" | "text/xml"; } | { type: "echo_query"; param: string; } | { path: string; type: "echo_json"; as: { format: "text"; } | { format: "json"; key: string; }; } | { path: string; type: "typed"; cases: Record<string, { type: "fixed"; status: number; body: string; contentType: "text/plain" | "application/json" | "text/xml"; }>; fallback: { type: "fixed"; status: number; body: string; contentType: "text/plain" | "application/json" | "text/xml"; }; }; }[]; attribution: { from: "path"; } | { path: string; from: "body"; } | { name: string; from: "header"; }; }; egressHosts: string[]; api?: { host: string; calls: (string | { call: string; query?: string[] | undefined; })[]; } | undefined; sends?: { operations: Partial<Record<"send.text" | "reply.in_window" | "send.media", { path: string; method: "POST" | "PUT" | "PATCH"; recipients: string[]; messageId: string; query?: Record<string, string> | undefined; headers?: Record<string, string> | undefined; body?: { kind: "json"; template: Record<string, unknown>; } | { kind: "form"; fields: Record<string, string>; } | undefined; address?: "peer" | "answered" | undefined; }>>; } | undefined; live?: { events: string[]; protocol: "discord_gateway"; intents: number; } | { protocol: "slack_socket"; } | { protocol: "imap"; mailbox: string; } | undefined; actions?: Record<string, { kind: "send"; sends: number; send: { path: string; method: "POST" | "PUT" | "PATCH"; recipients: string[]; messageId: string; query?: Record<string, string> | undefined; headers?: Record<string, string> | undefined; body?: { kind: "json"; template: Record<string, unknown>; } | { kind: "form"; fields: Record<string, string>; } | undefined; address?: "peer" | "answered" | undefined; }; hasPrepare: boolean; describe: string; forAgent: boolean; input?: Record<string, "string" | "number" | "boolean" | "text" | "url"> | undefined; slots?: Record<string, "digits" | "uuid" | "hex"> | undefined; } | { kind: "code"; describe: string; forAgent: boolean; access: "read" | "write"; input?: Record<string, "string" | "number" | "boolean" | "text" | "url"> | undefined; }> | undefined; schedules?: { name: string; everySeconds: number; }[] | undefined; store?: boolean | undefined; } | undefined; readonly issues: readonly ChannelIssue[]; }

parse

parse(events?: TestRawEvent[]): Promise<({ eventId: string; outcome: "event"; event: { kind: "message"; from: { kind: AnyIdentifierKind; address: string; displayName?: string | undefined; }; channel: string; providerId: string; conversationKey: string; content: ({ text: string; kind: "text"; } | { kind: "media"; locator: string; format?: string | undefined; })[]; replyTo?: string | undefined; threadKey?: string | undefined; replyContext?: Record<string, unknown> | undefined; providerMetadata?: Record<string, unknown> | undefined; surface?: Record<string, unknown> | undefined; context?: string | undefined; occurredAt?: number | undefined; } | { status: "read" | "sent" | "delivered" | "failed"; kind: "status"; channel: string; providerId: string; at?: number | undefined; errorCode?: string | undefined; error?: string | undefined; metadata?: Record<string, unknown> | undefined; errors?: { code: string; message?: string | undefined; }[] | undefined; correlationTag?: string | undefined; } | { kind: "reaction"; from: { kind: AnyIdentifierKind; address: string; displayName?: string | undefined; }; channel: string; providerId: string; targetProviderId: string; emoji: string; removed: boolean; }; } | { eventId: string; outcome: "mapping_failure"; failure: { reason: string; providerId?: string | undefined; }; } | { eventId: string; outcome: "ignored"; reason: string; })[]>

Run the channel's onEvent on these events. Results are validated strictly, as the platform validates them.

Parameters
NameTypeRequiredDescription
eventsTestRawEvent[]noThe raw events to parse.
Returns

Promise<({ eventId: string; outcome: "event"; event: { kind: "message"; from: { kind: AnyIdentifierKind; address: string; displayName?: string | undefined; }; channel: string; providerId: string; conversationKey: string; content: ({ text: string; kind: "text"; } | { kind: "media"; locator: string; format?: string | undefined; })[]; replyTo?: string | undefined; threadKey?: string | undefined; replyContext?: Record<string, unknown> | undefined; providerMetadata?: Record<string, unknown> | undefined; surface?: Record<string, unknown> | undefined; context?: string | undefined; occurredAt?: number | undefined; } | { status: "read" | "sent" | "delivered" | "failed"; kind: "status"; channel: string; providerId: string; at?: number | undefined; errorCode?: string | undefined; error?: string | undefined; metadata?: Record<string, unknown> | undefined; errors?: { code: string; message?: string | undefined; }[] | undefined; correlationTag?: string | undefined; } | { kind: "reaction"; from: { kind: AnyIdentifierKind; address: string; displayName?: string | undefined; }; channel: string; providerId: string; targetProviderId: string; emoji: string; removed: boolean; }; } | { eventId: string; outcome: "mapping_failure"; failure: { reason: string; providerId?: string | undefined; }; } | { eventId: string; outcome: "ignored"; reason: string; })[]>

action

action(name: string, input?: Record<string, unknown>, opts?: TestActionOptions): Promise<unknown>

Run an action's code and return what it produced: a prepare's slots (a sentence in a digits slot rejects with slot_invalid), a run's or a control's data, or a schedule's { delivered }.

Parameters
NameTypeRequiredDescription
namestringyesThe action's name.
inputRecord<string, unknown>noThe action's input.
optsTestActionOptionsnoThe phase, a stub for ctx.fetch and the settings.
Returns

Promise<unknown>: What the action produced.

Throws
  • ChannelActionError when the action is refused, for example slot_invalid.

TestActionOptions

interface · @voicelayer/sdk/channel

interface TestActionOptions

Options for running a channel action in a test.

Fields

NameTypeRequiredDefaultDescription
phaseChannelActionPhaseno`prepare` for a send action, `run` for a code action for the agent, else `control`Which step to run. One of schedule, prepare, run, control.
fetch(path: string, init: ChannelFetchInit) => unknown | Promise<unknown>noWhat ctx.fetch answers. Without it, a call to ctx.fetch fails the action.
settingsRecord<string, unknown>noThe connection's saved settings.

TestRawEvent

interface · @voicelayer/sdk/channel

interface TestRawEvent

A raw webhook event to feed a channel's onEvent in a test.

Fields

NameTypeRequiredDefaultDescription
bodystring | Record<string, unknown>yesThe event body: a string, or an object that is JSON-encoded.
kindstringnothe first declaredOne of the declaration's event kinds.
eventIdstringnoThe provider's event id.
contentTypeChannelRawEvent['contentType']noThe body's content type.