UNPKG

hud-ai

Version:
85 lines (84 loc) 2.65 kB
/// <reference types="bluebird" /> import * as Promise from 'bluebird'; import { HudAiCreateAttributes, HudAiListAttributes, HudAiUpdateAttributes, Resource } from '../utils/Resource'; import { RequestManager } from '../RequestManager'; import { BasicVideoCompany } from './VideoCompany'; import { BasicVideoPerson } from './VideoPerson'; export interface Video extends BasicVideo { companies?: BasicVideoCompany[]; people?: BasicVideoPerson[]; } export interface BasicVideo { id: string; createdAt: Date; updatedAt: Date; posterUrl: string | null; videoUrl: string; importanceScore: number; sourceId: string; publishedAt: Date; title: string; description: string; transcript: string; } export interface VideoSearchResult extends BasicVideo { companies: BasicVideoCompany[]; people: BasicVideoPerson[]; reactions?: object; } export interface VideoListAttributes extends HudAiListAttributes { personId?: string; companyId?: string; importanceScoreMin?: number; sourceId?: string; publishedAfter?: Date; publishedBefore?: Date; } export interface VideoCreateAttributes extends HudAiCreateAttributes { posterUrl?: string; videoUrl: string; importanceScore: number; publishedAt: Date; title: string; description?: string; transcript?: string; } export interface VideoUpdateAttributes extends HudAiUpdateAttributes { posterUrl?: string; videoUrl?: string; importanceScore?: number; publishedAt?: Date; title?: string; description?: string; transcript?: string; } export interface VideoSearchAttributes { limit?: number; offset?: number; personId?: string | string[]; companyId?: string | string[]; minImportance?: number; maxImportance?: number; text?: string; sourceId?: string; createdAfter?: Date; createdBefore?: Date; publishedAfter?: Date; publishedBefore?: Date; } export declare class VideoResource extends Resource<Video, VideoListAttributes, VideoCreateAttributes, VideoUpdateAttributes> { constructor(requestManager: RequestManager); list(listArgs: VideoListAttributes): Promise<{ count: number; rows: Video[]; }>; search(searchArgs: VideoSearchAttributes): Promise<{ count: number; rows: VideoSearchResult[]; }>; create(createArgs: VideoCreateAttributes): Promise<Video>; get(id: string | number): Promise<Video>; update(id: string | number, updateArgs: VideoUpdateAttributes): Promise<Video>; del(id: string | number): Promise<void>; destroy(id: string | number): Promise<void>; }