initialised repo
This commit is contained in:
194
lib/types.ts
Normal file
194
lib/types.ts
Normal file
@@ -0,0 +1,194 @@
|
||||
// Enhanced Types for Deep Analysis
|
||||
|
||||
export type PlatformId = 'reddit' | 'twitter' | 'hackernews' | 'indiehackers' | 'quora' | 'stackoverflow' | 'linkedin'
|
||||
|
||||
export type SearchStrategy =
|
||||
| 'direct-keywords'
|
||||
| 'problem-pain'
|
||||
| 'competitor-alternative'
|
||||
| 'how-to'
|
||||
| 'emotional-frustrated'
|
||||
| 'comparison'
|
||||
| 'recommendation'
|
||||
|
||||
export interface PlatformConfig {
|
||||
id: PlatformId
|
||||
name: string
|
||||
icon: string
|
||||
enabled: boolean
|
||||
searchTemplate: string
|
||||
rateLimit: number
|
||||
}
|
||||
|
||||
export interface SearchConfig {
|
||||
platforms: PlatformConfig[]
|
||||
strategies: SearchStrategy[]
|
||||
intensity: 'broad' | 'balanced' | 'targeted'
|
||||
maxResults: number
|
||||
timeFilter?: 'past-day' | 'past-week' | 'past-month' | 'past-year' | 'all'
|
||||
}
|
||||
|
||||
export interface GeneratedQuery {
|
||||
query: string
|
||||
platform: PlatformId
|
||||
strategy: SearchStrategy
|
||||
priority: number
|
||||
expectedIntent: string
|
||||
}
|
||||
|
||||
export interface Opportunity {
|
||||
id: string
|
||||
title: string
|
||||
url: string
|
||||
snippet: string
|
||||
platform: string
|
||||
source: string
|
||||
|
||||
relevanceScore: number
|
||||
emotionalIntensity: 'low' | 'medium' | 'high'
|
||||
intent: 'frustrated' | 'looking' | 'comparing' | 'learning' | 'recommending'
|
||||
|
||||
matchedKeywords: string[]
|
||||
matchedProblems: string[]
|
||||
matchedPersona?: string
|
||||
|
||||
engagement?: {
|
||||
upvotes?: number
|
||||
comments?: number
|
||||
views?: number
|
||||
}
|
||||
postedAt?: string
|
||||
|
||||
status: 'new' | 'viewed' | 'contacted' | 'responded' | 'converted' | 'ignored'
|
||||
notes?: string
|
||||
tags?: string[]
|
||||
|
||||
suggestedApproach: string
|
||||
replyTemplate?: string
|
||||
softPitch: boolean
|
||||
|
||||
scoringBreakdown?: {
|
||||
keywordMatches: number
|
||||
problemMatches: number
|
||||
emotionalIntensity: number
|
||||
competitorMention: number
|
||||
recency: number
|
||||
engagement: number
|
||||
}
|
||||
}
|
||||
|
||||
export interface Feature {
|
||||
name: string
|
||||
description: string
|
||||
benefits: string[]
|
||||
useCases: string[]
|
||||
}
|
||||
|
||||
export interface Problem {
|
||||
problem: string
|
||||
severity: 'high' | 'medium' | 'low'
|
||||
currentWorkarounds: string[]
|
||||
emotionalImpact: string
|
||||
searchTerms: string[]
|
||||
}
|
||||
|
||||
export interface Persona {
|
||||
name: string
|
||||
role: string
|
||||
companySize: string
|
||||
industry: string
|
||||
painPoints: string[]
|
||||
goals: string[]
|
||||
techSavvy: 'low' | 'medium' | 'high'
|
||||
objections: string[]
|
||||
searchBehavior: string[]
|
||||
}
|
||||
|
||||
export interface Keyword {
|
||||
term: string
|
||||
type: 'product' | 'problem' | 'solution' | 'competitor' | 'feature' | 'longtail' | 'differentiator'
|
||||
searchVolume: 'high' | 'medium' | 'low'
|
||||
intent: 'informational' | 'navigational' | 'transactional'
|
||||
funnel: 'awareness' | 'consideration' | 'decision'
|
||||
emotionalIntensity: 'frustrated' | 'curious' | 'ready'
|
||||
}
|
||||
|
||||
export interface UseCase {
|
||||
scenario: string
|
||||
trigger: string
|
||||
emotionalState: string
|
||||
currentWorkflow: string[]
|
||||
desiredOutcome: string
|
||||
alternativeProducts: string[]
|
||||
whyThisProduct: string
|
||||
churnRisk: string[]
|
||||
}
|
||||
|
||||
export interface Competitor {
|
||||
name: string
|
||||
differentiator: string
|
||||
theirStrength: string
|
||||
switchTrigger: string
|
||||
theirWeakness: string
|
||||
}
|
||||
|
||||
export interface DorkQuery {
|
||||
query: string
|
||||
platform: 'reddit' | 'hackernews' | 'indiehackers' | 'twitter' | 'quora' | 'stackoverflow'
|
||||
intent: 'looking-for' | 'frustrated' | 'alternative' | 'comparison' | 'problem-solving' | 'tutorial'
|
||||
priority: 'high' | 'medium' | 'low'
|
||||
}
|
||||
|
||||
export interface EnhancedProductAnalysis {
|
||||
productName: string
|
||||
tagline: string
|
||||
description: string
|
||||
category: string
|
||||
positioning: string
|
||||
|
||||
features: Feature[]
|
||||
problemsSolved: Problem[]
|
||||
personas: Persona[]
|
||||
keywords: Keyword[]
|
||||
useCases: UseCase[]
|
||||
competitors: Competitor[]
|
||||
dorkQueries: DorkQuery[]
|
||||
|
||||
scrapedAt: string
|
||||
analysisVersion: string
|
||||
}
|
||||
|
||||
// Legacy types for backwards compatibility
|
||||
export interface ProductAnalysis {
|
||||
productName: string
|
||||
tagline: string
|
||||
description: string
|
||||
features: string[]
|
||||
problemsSolved: string[]
|
||||
targetAudience: string[]
|
||||
valuePropositions: string[]
|
||||
keywords: string[]
|
||||
scrapedAt: string
|
||||
}
|
||||
|
||||
export interface ScrapedContent {
|
||||
url: string
|
||||
title: string
|
||||
metaDescription: string
|
||||
headings: string[]
|
||||
paragraphs: string[]
|
||||
featureList: string[]
|
||||
links: string[]
|
||||
rawText: string
|
||||
}
|
||||
|
||||
export interface SearchResults {
|
||||
productAnalysis: EnhancedProductAnalysis
|
||||
totalFound: number
|
||||
opportunities: Opportunity[]
|
||||
searchStats: {
|
||||
queriesUsed: number
|
||||
platformsSearched: string[]
|
||||
averageRelevance: number
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user