Insight.ts•5.46 kB
/* tslint:disable */
/* eslint-disable */
/**
* Squad API
* API for managing Squad resources
*
* The version of the OpenAPI document: 4.0.0
* Contact: help@meetsquad.ai
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime.js';
/**
* Insight data from a user
* @export
* @interface Insight
*/
export interface Insight {
[key: string]: any | any;
/**
* Unique identifier for the insight
* @type {string}
* @memberof Insight
*/
id: string;
/**
* Type of insight
* @type {string}
* @memberof Insight
*/
type: InsightTypeEnum;
/**
* Title of the insight
* @type {string}
* @memberof Insight
*/
title: string;
/**
* Description of the insight
* @type {string}
* @memberof Insight
*/
description: string;
/**
* Whether the insight has been seen
* @type {boolean}
* @memberof Insight
*/
seen: boolean;
/**
* Whether the insight content should be hidden
* @type {boolean}
* @memberof Insight
*/
hideContent: boolean;
/**
* ID of the insight owner
* @type {string}
* @memberof Insight
*/
ownerId?: string;
/**
* Wilson score + corroboration score (0-1)
* @type {number}
* @memberof Insight
*/
strengthScore?: number;
/**
* Recency and burst detection score
* @type {number}
* @memberof Insight
*/
momentumScore?: number;
/**
* Weighted composite of strength and momentum scores
* @type {number}
* @memberof Insight
*/
combinedScore?: number;
/**
* ISO timestamp of last score calculation
* @type {Date}
* @memberof Insight
*/
lastScoreCalculatedAt?: Date;
/**
* BERT embeddings for topic modeling
* @type {Array<number>}
* @memberof Insight
*/
topicEmbeddings?: Array<number>;
/**
* Creation timestamp
* @type {string}
* @memberof Insight
*/
createdAt: string;
/**
* Last update timestamp
* @type {string}
* @memberof Insight
*/
updatedAt: string;
}
/**
* @export
*/
export const InsightTypeEnum = {
Feedback: 'Feedback',
Bug: 'Bug',
FeatureRequest: 'FeatureRequest'
} as const;
export type InsightTypeEnum = typeof InsightTypeEnum[keyof typeof InsightTypeEnum];
/**
* Check if a given object implements the Insight interface.
*/
export function instanceOfInsight(value: object): value is Insight {
if (!('id' in value) || value['id'] === undefined) return false;
if (!('type' in value) || value['type'] === undefined) return false;
if (!('title' in value) || value['title'] === undefined) return false;
if (!('description' in value) || value['description'] === undefined) return false;
if (!('seen' in value) || value['seen'] === undefined) return false;
if (!('hideContent' in value) || value['hideContent'] === undefined) return false;
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
return true;
}
export function InsightFromJSON(json: any): Insight {
return InsightFromJSONTyped(json, false);
}
export function InsightFromJSONTyped(json: any, ignoreDiscriminator: boolean): Insight {
if (json == null) {
return json;
}
return {
...json,
'id': json['id'],
'type': json['type'],
'title': json['title'],
'description': json['description'],
'seen': json['seen'],
'hideContent': json['hideContent'],
'ownerId': json['ownerId'] == null ? undefined : json['ownerId'],
'strengthScore': json['strengthScore'] == null ? undefined : json['strengthScore'],
'momentumScore': json['momentumScore'] == null ? undefined : json['momentumScore'],
'combinedScore': json['combinedScore'] == null ? undefined : json['combinedScore'],
'lastScoreCalculatedAt': json['lastScoreCalculatedAt'] == null ? undefined : (new Date(json['lastScoreCalculatedAt'])),
'topicEmbeddings': json['topicEmbeddings'] == null ? undefined : json['topicEmbeddings'],
'createdAt': json['createdAt'],
'updatedAt': json['updatedAt'],
};
}
export function InsightToJSON(json: any): Insight {
return InsightToJSONTyped(json, false);
}
export function InsightToJSONTyped(value?: Insight | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
...value,
'id': value['id'],
'type': value['type'],
'title': value['title'],
'description': value['description'],
'seen': value['seen'],
'hideContent': value['hideContent'],
'ownerId': value['ownerId'],
'strengthScore': value['strengthScore'],
'momentumScore': value['momentumScore'],
'combinedScore': value['combinedScore'],
'lastScoreCalculatedAt': value['lastScoreCalculatedAt'] == null ? undefined : ((value['lastScoreCalculatedAt']).toISOString()),
'topicEmbeddings': value['topicEmbeddings'],
'createdAt': value['createdAt'],
'updatedAt': value['updatedAt'],
};
}