import assert from "assert"; import { RawEvent, NormalizedEvent } from "../../types"; export default (event: RawEvent): NormalizedEvent<"canny"> => { assert(event, `Canny:Boards null event: ${event}`); assert( event.id, `Canny:Boards event is missing the required field id ${event}` ); assert( event.created, `Canny:Boards event is missing the required field created ${event}` ); return { id: `canny|${event.id}`, ts: Date.parse(event.created), user_info: { source_user_id: null, user_id: null, name: null, email: null, ip: null, avatar: null, nickname: null, phone: null, city: null, continent_code: null, country: null, postal_code: null, region: null, address_line1: null, address_line2: null, timezone: null, country_code: null, user_agent: null, is_employee: null, title: null, birthday: null, company: { name: null, id: null, industry: null, employee_count: null, plan: null }, created_at: null, age: null, gender: null, website: null, custom_attributes: null }, text: `Board ${event.name || null} created`, href: event.url || null, is_bad: false, direction: null, source: "canny", stream: "boards" }; };