MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / deserializeSession

Method deserializeSession

server/src/db/si-db.ts:751–781  ·  view source on GitHub ↗
(row: Record<string, unknown>)

Source from the content-addressed store, hash-verified

749 // --------------------------------------------------------------------------
750
751 private deserializeSession(row: Record<string, unknown>): SiSession {
752 return {
753 id: row.id as string,
754 session_id: row.session_id as string,
755 host_type: row.host_type as "addy" | "external",
756 host_identifier: row.host_identifier as string,
757 member_profile_id: row.member_profile_id as string | null,
758 brand_name: row.brand_name as string,
759 user_slack_id: row.user_slack_id as string | null,
760 user_email: row.user_email as string | null,
761 user_name: row.user_name as string | null,
762 user_anonymous_id: row.user_anonymous_id as string | null,
763 identity_consent_granted: row.identity_consent_granted as boolean,
764 status: row.status as SiSession["status"],
765 termination_reason: row.termination_reason as string | null,
766 initial_context: row.initial_context as string | null,
767 campaign_id: row.campaign_id as string | null,
768 offer_id: row.offer_id as string | null,
769 handoff_data: row.handoff_data
770 ? (typeof row.handoff_data === "string"
771 ? JSON.parse(row.handoff_data as string)
772 : row.handoff_data)
773 : null,
774 message_count: row.message_count as number,
775 created_at: new Date(row.created_at as string),
776 last_activity_at: new Date(row.last_activity_at as string),
777 terminated_at: row.terminated_at
778 ? new Date(row.terminated_at as string)
779 : null,
780 };
781 }
782
783 private deserializeMessage(row: Record<string, unknown>): SiSessionMessage {
784 return {

Callers 5

createSessionMethod · 0.95
getSessionMethod · 0.95
updateSessionStatusMethod · 0.95
getActiveSessionsMethod · 0.95
getSessionsByUserMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected