Skip to content

Commit ac040af

Browse files
MichaelGHSegclaude
andauthored
Align e2e-cli types with sdk-e2e-tests definitions (#294)
Add missing field extraction: messageId, timestamp, category, context, integrations. Fields are parsed from input JSON for type consistency; the Kotlin SDK API doesn't accept these as direct parameters (they're set at the event pipeline level). Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a2636de commit ac040af

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

e2e-cli/src/main/kotlin/cli/Main.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,17 @@ fun sendEvent(analytics: Analytics, event: JsonObject) {
104104
?: throw IllegalArgumentException("Event missing 'type' field")
105105
val userId = event["userId"]?.jsonPrimitive?.content ?: ""
106106
val anonymousId = event["anonymousId"]?.jsonPrimitive?.content ?: ""
107+
val messageId = event["messageId"]?.jsonPrimitive?.content
108+
val timestamp = event["timestamp"]?.jsonPrimitive?.content
107109
val traits = event["traits"]?.jsonObject ?: emptyJsonObject
108110
val properties = event["properties"]?.jsonObject ?: emptyJsonObject
109111
val eventName = event["event"]?.jsonPrimitive?.content
110112
val name = event["name"]?.jsonPrimitive?.content
113+
val category = event["category"]?.jsonPrimitive?.content
111114
val groupId = event["groupId"]?.jsonPrimitive?.content
112115
val previousId = event["previousId"]?.jsonPrimitive?.content
116+
val context = event["context"]?.jsonObject
117+
val integrations = event["integrations"]?.jsonObject
113118

114119
when (type) {
115120
"identify" -> analytics.identify(userId, traits)

0 commit comments

Comments
 (0)