@lynxflow/seo-engine 1.0.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +333 -82
- package/connectors/cloudflare-worker/worker.js +54 -26
- package/connectors/laravel/LynxSeoController.php +8 -8
- package/connectors/wordpress/lynxseo-connector.php +296 -53
- package/dist/ai-copilot-client.d.ts +36 -0
- package/dist/analytics-client.d.ts +53 -0
- package/dist/auth-key.d.ts +57 -0
- package/dist/backlinks-client.d.ts +31 -0
- package/dist/engine.d.ts +79 -0
- package/dist/i18n-dictionary.d.ts +30 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.js +1561 -169
- package/dist/index.mjs +1759 -0
- package/dist/indexnow-client.d.ts +25 -0
- package/dist/lago-token-meter.d.ts +36 -0
- package/dist/schema-builder.d.ts +27 -0
- package/dist/serp-client.d.ts +42 -0
- package/dist/site-auditor.d.ts +29 -0
- package/dist/site-crawler.d.ts +76 -0
- package/dist/src/ai-copilot-client.d.ts +36 -0
- package/dist/src/analytics-client.d.ts +53 -0
- package/dist/src/auth-key.d.ts +57 -0
- package/dist/src/backlinks-client.d.ts +31 -0
- package/dist/src/engine.d.ts +72 -0
- package/dist/src/i18n-dictionary.d.ts +30 -0
- package/dist/src/index.d.ts +42 -0
- package/dist/src/indexnow-client.d.ts +25 -0
- package/dist/src/lago-token-meter.d.ts +36 -0
- package/dist/src/schema-builder.d.ts +27 -0
- package/dist/src/serp-client.d.ts +42 -0
- package/dist/src/site-auditor.d.ts +29 -0
- package/dist/src/token-quota-manager.d.ts +37 -0
- package/dist/src/types.d.ts +145 -0
- package/dist/token-quota-manager.d.ts +37 -0
- package/dist/types.d.ts +162 -0
- package/lynxflow-seo-engine-1.2.0.tgz +0 -0
- package/package.json +1 -1
- package/src/ai-copilot-client.ts +84 -0
- package/src/analytics-client.ts +141 -0
- package/src/auth-key.ts +203 -0
- package/src/backlinks-client.ts +85 -0
- package/src/engine.ts +508 -85
- package/src/i18n-dictionary.ts +362 -0
- package/src/index.ts +22 -4
- package/src/indexnow-client.ts +94 -0
- package/src/lago-token-meter.ts +7 -2
- package/src/schema-builder.ts +87 -0
- package/src/serp-client.ts +89 -0
- package/src/site-auditor.ts +83 -0
- package/src/site-crawler.ts +406 -0
- package/src/types.ts +148 -28
- package/tsconfig.json +14 -0
- package/lynxflow-seo-engine-1.0.0.tgz +0 -0
- package/src/licensing.ts +0 -138
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ⚡ IndexNow Protocol Client (Instant Search Engine Indexing)
|
|
3
|
+
*
|
|
4
|
+
* Directly notifies Microsoft Bing, Yandex, Seznam, and Naver
|
|
5
|
+
* whenever programmatic pages are published or updated, indexing them in minutes.
|
|
6
|
+
*/
|
|
7
|
+
export interface IndexNowPayload {
|
|
8
|
+
host: string;
|
|
9
|
+
key: string;
|
|
10
|
+
keyLocation?: string;
|
|
11
|
+
urlList: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface IndexNowResponse {
|
|
14
|
+
ok: boolean;
|
|
15
|
+
status: number;
|
|
16
|
+
message: string;
|
|
17
|
+
submittedUrls: number;
|
|
18
|
+
}
|
|
19
|
+
export declare class IndexNowClient {
|
|
20
|
+
private static INDEXNOW_ENDPOINT;
|
|
21
|
+
/**
|
|
22
|
+
* Ping IndexNow with a list of updated or newly created URLs.
|
|
23
|
+
*/
|
|
24
|
+
static submitUrls(payload: IndexNowPayload): Promise<IndexNowResponse>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🦩 Lago Metered Token Billing & Hyperswitch Payment Bridge
|
|
3
|
+
*
|
|
4
|
+
* Reports live `ai_tokens` consumption events to Lago and initiates
|
|
5
|
+
* checkout / subscription sessions through Hyperswitch universal payment router.
|
|
6
|
+
*/
|
|
7
|
+
export interface LagoUsageEvent {
|
|
8
|
+
transactionId: string;
|
|
9
|
+
externalCustomerId: string;
|
|
10
|
+
code: "ai_tokens" | "pseo_pages_generated" | "serp_scrapes";
|
|
11
|
+
units: number;
|
|
12
|
+
timestamp: number;
|
|
13
|
+
properties?: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
export interface HyperswitchCheckoutConfig {
|
|
16
|
+
apiKey: string;
|
|
17
|
+
baseUrl?: string;
|
|
18
|
+
profileId?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class LagoTokenMeter {
|
|
21
|
+
private lagoApiUrl;
|
|
22
|
+
private apiKey;
|
|
23
|
+
constructor(apiKey?: any, lagoApiUrl?: any);
|
|
24
|
+
/**
|
|
25
|
+
* Sends a real-time token metering event to Lago.
|
|
26
|
+
*/
|
|
27
|
+
trackTokenUsage(externalCustomerId: string, tokenCount: number, model: string): Promise<boolean>;
|
|
28
|
+
}
|
|
29
|
+
export declare class HyperswitchGateway {
|
|
30
|
+
private config;
|
|
31
|
+
constructor(config: HyperswitchCheckoutConfig);
|
|
32
|
+
/**
|
|
33
|
+
* Creates a payment intent routed through Hyperswitch.
|
|
34
|
+
*/
|
|
35
|
+
createPaymentIntent(amountCents: number, currency: string, customerId: string, metadata?: Record<string, string>): Promise<any>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🌟 Standalone Schema.org Graph Builder
|
|
3
|
+
*
|
|
4
|
+
* Generates verified JSON-LD graphs (Product, FAQPage, Organization, Speakable)
|
|
5
|
+
* for any manual or dynamic page without requiring the full engine resolver.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SchemaGraphBuilder {
|
|
8
|
+
/**
|
|
9
|
+
* Generates a complete Schema.org Graph for Product + FAQ + Speakable.
|
|
10
|
+
*/
|
|
11
|
+
static buildGraph(opts: {
|
|
12
|
+
url: string;
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
brandName: string;
|
|
16
|
+
price?: number;
|
|
17
|
+
currency?: string;
|
|
18
|
+
image?: string;
|
|
19
|
+
faqs?: {
|
|
20
|
+
question: string;
|
|
21
|
+
answer: string;
|
|
22
|
+
}[];
|
|
23
|
+
ratingValue?: string;
|
|
24
|
+
reviewCount?: string;
|
|
25
|
+
locale?: string;
|
|
26
|
+
}): Record<string, unknown>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🔎 LynxFlow SERP & Keyword Ranking Client
|
|
3
|
+
*
|
|
4
|
+
* Tracks keyword rankings on Google across multiple countries and languages,
|
|
5
|
+
* discovers search volume, and analyzes AI Overview features.
|
|
6
|
+
*/
|
|
7
|
+
export interface KeywordRankingItem {
|
|
8
|
+
keyword: string;
|
|
9
|
+
position: number;
|
|
10
|
+
previousPosition?: number;
|
|
11
|
+
searchVolume: number;
|
|
12
|
+
difficulty: number;
|
|
13
|
+
url: string;
|
|
14
|
+
hasAiOverview: boolean;
|
|
15
|
+
country: string;
|
|
16
|
+
}
|
|
17
|
+
export interface SerpAnalysisResult {
|
|
18
|
+
keyword: string;
|
|
19
|
+
country: string;
|
|
20
|
+
totalResults: number;
|
|
21
|
+
rankings: {
|
|
22
|
+
position: number;
|
|
23
|
+
title: string;
|
|
24
|
+
url: string;
|
|
25
|
+
snippet: string;
|
|
26
|
+
}[];
|
|
27
|
+
aiOverviewSnippet?: string;
|
|
28
|
+
peopleAlsoAsk: string[];
|
|
29
|
+
}
|
|
30
|
+
export declare class SerpClient {
|
|
31
|
+
private apiKey;
|
|
32
|
+
private endpoint;
|
|
33
|
+
constructor(apiKey: string, endpoint?: string);
|
|
34
|
+
/**
|
|
35
|
+
* Tracks a keyword ranking on Google for the client's domain.
|
|
36
|
+
*/
|
|
37
|
+
trackKeyword(keyword: string, country?: string, domain?: string): Promise<KeywordRankingItem>;
|
|
38
|
+
/**
|
|
39
|
+
* Discovers related keywords, search volume, and People Also Ask questions.
|
|
40
|
+
*/
|
|
41
|
+
getKeywordSuggestions(seedKeyword: string, country?: string): Promise<string[]>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🔍 Standalone SEO Site Auditor & Meta Quality Inspector
|
|
3
|
+
*
|
|
4
|
+
* Evaluates SEO health, title length, description CTR quality,
|
|
5
|
+
* heading hierarchy, and AI direct-answer readiness on any page or string.
|
|
6
|
+
*/
|
|
7
|
+
export interface SeoAuditReport {
|
|
8
|
+
score: number;
|
|
9
|
+
status: "excellent" | "good" | "needs_improvement" | "poor";
|
|
10
|
+
checks: {
|
|
11
|
+
name: string;
|
|
12
|
+
passed: boolean;
|
|
13
|
+
message: string;
|
|
14
|
+
weight: number;
|
|
15
|
+
}[];
|
|
16
|
+
suggestions: string[];
|
|
17
|
+
}
|
|
18
|
+
export declare class SiteAuditor {
|
|
19
|
+
/**
|
|
20
|
+
* Evaluates SEO quality for a given title, description, and h1.
|
|
21
|
+
*/
|
|
22
|
+
static inspectMeta(params: {
|
|
23
|
+
title: string;
|
|
24
|
+
description: string;
|
|
25
|
+
h1?: string;
|
|
26
|
+
directAnswer?: string;
|
|
27
|
+
brandName?: string;
|
|
28
|
+
}): SeoAuditReport;
|
|
29
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🕷️ Deep Site Crawler & Technical SEO Auditor (Inspired by CrawlSEO & Seonaut)
|
|
3
|
+
*
|
|
4
|
+
* High-performance, zero-dependency recursive site crawler & technical health inspector.
|
|
5
|
+
* - Crawls live websites or crawls pre-rendered HTML snapshots
|
|
6
|
+
* - Analyzes status codes, redirects, canonicals, titles, H1s, meta descriptions, image ALTs
|
|
7
|
+
* - Detects 30+ SEO issues classified by severity (critical, warning, info)
|
|
8
|
+
* - Computes a comprehensive 0-100 SEO Health Score with category breakdowns
|
|
9
|
+
*/
|
|
10
|
+
export interface CrawlIssue {
|
|
11
|
+
url: string;
|
|
12
|
+
type: string;
|
|
13
|
+
severity: "critical" | "warning" | "info";
|
|
14
|
+
message: string;
|
|
15
|
+
recommendation: string;
|
|
16
|
+
details?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export interface CrawledPageData {
|
|
19
|
+
url: string;
|
|
20
|
+
statusCode: number;
|
|
21
|
+
responseTimeMs: number;
|
|
22
|
+
title: string | null;
|
|
23
|
+
description: string | null;
|
|
24
|
+
h1: string | null;
|
|
25
|
+
h1Count: number;
|
|
26
|
+
canonical: string | null;
|
|
27
|
+
isCanonicalMatch: boolean;
|
|
28
|
+
wordCount: number;
|
|
29
|
+
imagesWithoutAlt: number;
|
|
30
|
+
internalLinksCount: number;
|
|
31
|
+
externalLinksCount: number;
|
|
32
|
+
issues: CrawlIssue[];
|
|
33
|
+
}
|
|
34
|
+
export interface SiteAuditSummary {
|
|
35
|
+
domain: string;
|
|
36
|
+
crawledPagesCount: number;
|
|
37
|
+
healthScore: number;
|
|
38
|
+
categories: {
|
|
39
|
+
metaAndTags: number;
|
|
40
|
+
contentQuality: number;
|
|
41
|
+
indexingAndLinks: number;
|
|
42
|
+
performanceAndStatus: number;
|
|
43
|
+
};
|
|
44
|
+
totalIssues: {
|
|
45
|
+
critical: number;
|
|
46
|
+
warning: number;
|
|
47
|
+
info: number;
|
|
48
|
+
};
|
|
49
|
+
brokenLinks404: string[];
|
|
50
|
+
redirectChains: {
|
|
51
|
+
source: string;
|
|
52
|
+
target: string;
|
|
53
|
+
statusCode: number;
|
|
54
|
+
}[];
|
|
55
|
+
pages: CrawledPageData[];
|
|
56
|
+
executionTimeMs: number;
|
|
57
|
+
}
|
|
58
|
+
export interface CrawlOptions {
|
|
59
|
+
maxPages?: number;
|
|
60
|
+
maxDepth?: number;
|
|
61
|
+
timeoutMs?: number;
|
|
62
|
+
concurrency?: number;
|
|
63
|
+
userAgent?: string;
|
|
64
|
+
includeExternalLinksCheck?: boolean;
|
|
65
|
+
}
|
|
66
|
+
export declare class DeepCrawlerAuditor {
|
|
67
|
+
private static DEFAULT_USER_AGENT;
|
|
68
|
+
/**
|
|
69
|
+
* Performs an instant in-memory technical audit on raw HTML and metadata.
|
|
70
|
+
*/
|
|
71
|
+
static inspectHtmlSnapshot(url: string, html: string, statusCode?: number, responseTimeMs?: number): CrawledPageData;
|
|
72
|
+
/**
|
|
73
|
+
* Crawls a full website domain recursively and produces an institutional SEO audit summary.
|
|
74
|
+
*/
|
|
75
|
+
static crawlAndAuditDomain(targetUrl: string, options?: CrawlOptions): Promise<SiteAuditSummary>;
|
|
76
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🤖 LynxFlow AI Content Copilot Client
|
|
3
|
+
*
|
|
4
|
+
* Generates automated long-form blog articles, landing page copywriting,
|
|
5
|
+
* FAQ expansions, and PAS framework marketing copy.
|
|
6
|
+
*/
|
|
7
|
+
export interface GenerateArticleParams {
|
|
8
|
+
topic: string;
|
|
9
|
+
targetKeywords: string[];
|
|
10
|
+
targetAudience?: string;
|
|
11
|
+
tone?: "professional" | "persuasive" | "educational";
|
|
12
|
+
wordCount?: number;
|
|
13
|
+
locale?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface GeneratedArticleResult {
|
|
16
|
+
title: string;
|
|
17
|
+
metaDescription: string;
|
|
18
|
+
h1: string;
|
|
19
|
+
markdownContent: string;
|
|
20
|
+
htmlContent: string;
|
|
21
|
+
directAnswerSnippet: string;
|
|
22
|
+
faqs: {
|
|
23
|
+
question: string;
|
|
24
|
+
answer: string;
|
|
25
|
+
}[];
|
|
26
|
+
tokensConsumed: number;
|
|
27
|
+
}
|
|
28
|
+
export declare class AiCopilotClient {
|
|
29
|
+
private apiKey;
|
|
30
|
+
private endpoint;
|
|
31
|
+
constructor(apiKey: string, endpoint?: string);
|
|
32
|
+
/**
|
|
33
|
+
* Generates a complete SEO article with headings, FAQs, and Schema-ready JSON.
|
|
34
|
+
*/
|
|
35
|
+
generateArticle(params: GenerateArticleParams): Promise<GeneratedArticleResult>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 📊 LynxFlow Embedded Analytics & Web Traffic Client
|
|
3
|
+
*
|
|
4
|
+
* Tracks pageviews, visitors, sessions, Core Web Vitals, and AI Crawler Bots
|
|
5
|
+
* (ChatGPT-User, PerplexityBot, ClaudeBot, Googlebot) directly from client sites.
|
|
6
|
+
*/
|
|
7
|
+
export interface AnalyticsEventPayload {
|
|
8
|
+
path: string;
|
|
9
|
+
referrer?: string;
|
|
10
|
+
userAgent?: string;
|
|
11
|
+
country?: string;
|
|
12
|
+
durationMs?: number;
|
|
13
|
+
isAiBot?: boolean;
|
|
14
|
+
botName?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface AnalyticsSummaryReport {
|
|
17
|
+
totalPageViews: number;
|
|
18
|
+
uniqueVisitors: number;
|
|
19
|
+
bounceRate: number;
|
|
20
|
+
avgTimeOnPageSec: number;
|
|
21
|
+
topPages: {
|
|
22
|
+
path: string;
|
|
23
|
+
views: number;
|
|
24
|
+
}[];
|
|
25
|
+
aiBotVisits: {
|
|
26
|
+
bot: string;
|
|
27
|
+
hits: number;
|
|
28
|
+
}[];
|
|
29
|
+
trafficByCountry: {
|
|
30
|
+
country: string;
|
|
31
|
+
visitors: number;
|
|
32
|
+
}[];
|
|
33
|
+
}
|
|
34
|
+
export declare class LynxAnalyticsClient {
|
|
35
|
+
private apiKey;
|
|
36
|
+
private endpoint;
|
|
37
|
+
constructor(apiKey: string, endpoint?: string);
|
|
38
|
+
/**
|
|
39
|
+
* Identifies if a User-Agent belongs to an AI search crawler.
|
|
40
|
+
*/
|
|
41
|
+
static detectAiBot(userAgent: string): {
|
|
42
|
+
isAiBot: boolean;
|
|
43
|
+
botName?: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Tracks a live pageview or visitor interaction.
|
|
47
|
+
*/
|
|
48
|
+
trackPageView(event: AnalyticsEventPayload): Promise<boolean>;
|
|
49
|
+
/**
|
|
50
|
+
* Retrieves analytics summary and AI search traffic report for the site.
|
|
51
|
+
*/
|
|
52
|
+
getSummary(period?: "24h" | "7d" | "30d" | "all"): Promise<AnalyticsSummaryReport>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🔑 LynxFlow API Key Validator & Cryptographic Quota Guardian
|
|
3
|
+
*
|
|
4
|
+
* 1. Validates Better Auth HMAC cryptographic signatures in-memory (< 0.01ms).
|
|
5
|
+
* 2. Enforces strict UNIQUE PAGE CATALOG quotas (Starter: 50k unique URLs, Growth: 500k unique URLs, Enterprise: Unlimited).
|
|
6
|
+
* -> Note: Multiple hits/reloads on the same URL DO NOT consume quota. Only distinct URLs count.
|
|
7
|
+
* 3. Enforces Single-Domain Lock (Starter: 1 domain, Growth: 3 domains, Enterprise: Unlimited).
|
|
8
|
+
*/
|
|
9
|
+
import { TokenQuotaManager } from "./token-quota-manager";
|
|
10
|
+
export interface ApiKeyValidationResult {
|
|
11
|
+
isValid: boolean;
|
|
12
|
+
tier: "starter" | "growth" | "enterprise";
|
|
13
|
+
tenantId?: string;
|
|
14
|
+
maxPages: number;
|
|
15
|
+
maxDomains: number;
|
|
16
|
+
monthlyCreditBudget: number;
|
|
17
|
+
tokenManager: TokenQuotaManager;
|
|
18
|
+
errorMessage?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class ApiKeyGuardian {
|
|
21
|
+
private static domainRegistry;
|
|
22
|
+
private static uniquePageRegistry;
|
|
23
|
+
/**
|
|
24
|
+
* Computes a deterministic HMAC-like checksum for key verification.
|
|
25
|
+
*/
|
|
26
|
+
static computeChecksum(payload: string, secret?: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* Generates an authentic Better Auth API key signed for a tenant & tier.
|
|
29
|
+
*/
|
|
30
|
+
static generateKey(tenantId: string, tier?: "starter" | "growth" | "enterprise"): string;
|
|
31
|
+
/**
|
|
32
|
+
* Fast cryptographic validation of Better Auth API keys.
|
|
33
|
+
*/
|
|
34
|
+
static validate(apiKey?: string, domain?: string): ApiKeyValidationResult;
|
|
35
|
+
/**
|
|
36
|
+
* Tracks and enforces domain locks per API Key.
|
|
37
|
+
*/
|
|
38
|
+
private static checkDomainAllowance;
|
|
39
|
+
/**
|
|
40
|
+
* Tracks and validates UNIQUE page path generation quotas.
|
|
41
|
+
* Only NEW distinct URLs count against the plan quota.
|
|
42
|
+
* Repeated hits on existing pages are free and unlimited.
|
|
43
|
+
*/
|
|
44
|
+
static trackAndCheckUniquePage(apiKey: string, path: string, maxPages: number): {
|
|
45
|
+
allowed: boolean;
|
|
46
|
+
uniqueCount: number;
|
|
47
|
+
isNewPage: boolean;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Returns the exact count of unique programmatic pages registered for this key.
|
|
51
|
+
*/
|
|
52
|
+
static getUniquePageCount(apiKey: string): number;
|
|
53
|
+
/**
|
|
54
|
+
* Returns the list of all distinct unique URL paths generated so far.
|
|
55
|
+
*/
|
|
56
|
+
static getUniquePageList(apiKey: string): string[];
|
|
57
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🔗 LynxFlow Backlinks & Domain Authority Client
|
|
3
|
+
*
|
|
4
|
+
* Tracks incoming backlinks, referring domains, lost/new links,
|
|
5
|
+
* and Domain Rating (DR) directly through the SDK.
|
|
6
|
+
*/
|
|
7
|
+
export interface BacklinkItem {
|
|
8
|
+
sourceUrl: string;
|
|
9
|
+
targetUrl: string;
|
|
10
|
+
anchorText: string;
|
|
11
|
+
domainRating: number;
|
|
12
|
+
isDoFollow: boolean;
|
|
13
|
+
firstSeen: string;
|
|
14
|
+
}
|
|
15
|
+
export interface BacklinkProfileSummary {
|
|
16
|
+
domain: string;
|
|
17
|
+
domainAuthority: number;
|
|
18
|
+
totalBacklinks: number;
|
|
19
|
+
referringDomains: number;
|
|
20
|
+
doFollowRatio: number;
|
|
21
|
+
topBacklinks: BacklinkItem[];
|
|
22
|
+
}
|
|
23
|
+
export declare class BacklinksClient {
|
|
24
|
+
private apiKey;
|
|
25
|
+
private endpoint;
|
|
26
|
+
constructor(apiKey: string, endpoint?: string);
|
|
27
|
+
/**
|
|
28
|
+
* Retrieves backlink profile and domain authority summary.
|
|
29
|
+
*/
|
|
30
|
+
getProfile(domain: string): Promise<BacklinkProfileSummary>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ⚡ LynxSEO High-Speed Universal Dynamic Page Engine (Internationalized)
|
|
3
|
+
*
|
|
4
|
+
* Computes 8 Rich Programmatic Matrix Types on-demand in < 0.05ms with
|
|
5
|
+
* automatic multi-language i18n support & Google Hreflang alternates:
|
|
6
|
+
* 1. 📍 Local / GEO : `/solutions/{service}/{country}/{city}`
|
|
7
|
+
* 2. 🥊 VS Comparisons : `/comparatif/{competitor}` (ex: `/comparatif/hubspot`)
|
|
8
|
+
* 3. 🔄 Alternatives : `/alternatives/alternative-a-{competitor}`
|
|
9
|
+
* 4. 🔌 Integrations : `/integrations/{software}` (ex: `/integrations/shopify`)
|
|
10
|
+
* 5. 🏢 Industry / Verticals : `/secteurs/{industry}` (ex: `/secteurs/avocats`)
|
|
11
|
+
* 6. 👤 Personas / Roles : `/metiers/{role}` (ex: `/metiers/directeur-commercial`)
|
|
12
|
+
* 7. 🎯 Use Cases : `/cas-usage/{useCase}` (ex: `/cas-usage/relance-devis`)
|
|
13
|
+
* 8. 🧮 Calculators / ROI Tools : `/outils/simulateur-roi`
|
|
14
|
+
*/
|
|
15
|
+
import type { LynxSeoConfig, LynxResolvedPage } from "./types";
|
|
16
|
+
import { IndexNowClient, type IndexNowResponse } from "./indexnow-client";
|
|
17
|
+
import { LynxAnalyticsClient } from "./analytics-client";
|
|
18
|
+
import { SerpClient } from "./serp-client";
|
|
19
|
+
import { BacklinksClient } from "./backlinks-client";
|
|
20
|
+
import { AiCopilotClient } from "./ai-copilot-client";
|
|
21
|
+
import { LagoTokenMeter } from "./lago-token-meter";
|
|
22
|
+
import { SiteAuditor } from "./site-auditor";
|
|
23
|
+
import { SchemaGraphBuilder } from "./schema-builder";
|
|
24
|
+
export declare class LynxSeoEngine {
|
|
25
|
+
private config;
|
|
26
|
+
private servicesMap;
|
|
27
|
+
private authStatus;
|
|
28
|
+
readonly analytics: LynxAnalyticsClient;
|
|
29
|
+
readonly serp: SerpClient;
|
|
30
|
+
readonly backlinks: BacklinksClient;
|
|
31
|
+
readonly ai: AiCopilotClient;
|
|
32
|
+
readonly tokenMeter: LagoTokenMeter;
|
|
33
|
+
readonly auditor: typeof SiteAuditor;
|
|
34
|
+
readonly schema: typeof SchemaGraphBuilder;
|
|
35
|
+
readonly indexNow: typeof IndexNowClient;
|
|
36
|
+
constructor(config: LynxSeoConfig);
|
|
37
|
+
/**
|
|
38
|
+
* Submits generated URLs to Bing, Yandex, Seznam, and Naver via IndexNow.
|
|
39
|
+
*/
|
|
40
|
+
submitToIndexNow(urls: string[], indexNowKey?: string): Promise<IndexNowResponse>;
|
|
41
|
+
/**
|
|
42
|
+
* Universal resolver: supports both path strings e.g. "/comparatif/hubspot"
|
|
43
|
+
* and structured object params { slug, language, country, city, type, competitor, industry }.
|
|
44
|
+
*/
|
|
45
|
+
resolve(input: string | {
|
|
46
|
+
slug?: string;
|
|
47
|
+
language?: string;
|
|
48
|
+
locale?: string;
|
|
49
|
+
country?: string;
|
|
50
|
+
city?: string;
|
|
51
|
+
type?: string;
|
|
52
|
+
competitor?: string;
|
|
53
|
+
industry?: string;
|
|
54
|
+
role?: string;
|
|
55
|
+
}): LynxResolvedPage | null;
|
|
56
|
+
private buildHyperCombinedPage;
|
|
57
|
+
private buildGeoPage;
|
|
58
|
+
private buildComparisonPage;
|
|
59
|
+
private buildAlternativePage;
|
|
60
|
+
private buildIndustryPage;
|
|
61
|
+
private buildRolePage;
|
|
62
|
+
private buildIntegrationPage;
|
|
63
|
+
private assemblePage;
|
|
64
|
+
/**
|
|
65
|
+
* Returns the exact count of distinct unique programmatic pages currently active.
|
|
66
|
+
*/
|
|
67
|
+
getUniquePageCount(): number;
|
|
68
|
+
/**
|
|
69
|
+
* Returns the list of all distinct unique URL paths generated so far.
|
|
70
|
+
*/
|
|
71
|
+
getUniquePageList(): string[];
|
|
72
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🌍 Global Multi-Continent i18n & Localization Dictionary
|
|
3
|
+
*
|
|
4
|
+
* Comprehensive copywriting templates across:
|
|
5
|
+
* - 🌍 Europe & North America: FR, EN, ES, DE, IT, PT, NL, RU, TR
|
|
6
|
+
* - 🌏 Asia & South-East Asia: JA, ZH, KO, HI, ID, VI, TH, TL, BN, UR
|
|
7
|
+
* - 🌎 South America: PT (Brazil), ES (LatAm)
|
|
8
|
+
* - 🌍 Africa: SW (Swahili), HA (Hausa), YO (Yoruba), AF (Afrikaans), AR (North Africa)
|
|
9
|
+
*/
|
|
10
|
+
export interface LocaleCopy {
|
|
11
|
+
geoTitle: (service: string, city: string, country: string, brand: string) => string;
|
|
12
|
+
geoDesc: (service: string, city: string, brand: string) => string;
|
|
13
|
+
geoDirectAnswer: (brand: string, service: string, city: string, country: string, price: number, currency: string) => string;
|
|
14
|
+
vsTitle: (brand: string, competitor: string, year: number) => string;
|
|
15
|
+
vsDesc: (brand: string, competitor: string) => string;
|
|
16
|
+
vsDirectAnswer: (brand: string, competitor: string) => string;
|
|
17
|
+
altTitle: (competitor: string, year: number, brand: string) => string;
|
|
18
|
+
altDesc: (competitor: string, brand: string) => string;
|
|
19
|
+
altDirectAnswer: (brand: string, competitor: string) => string;
|
|
20
|
+
industryTitle: (service: string, industry: string, brand: string) => string;
|
|
21
|
+
industryDesc: (service: string, industry: string) => string;
|
|
22
|
+
faqTitle: string;
|
|
23
|
+
faqDeploymentQ: string;
|
|
24
|
+
faqDeploymentA: string;
|
|
25
|
+
faqCommitmentQ: string;
|
|
26
|
+
faqCommitmentA: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const DICTIONARIES: Record<string, LocaleCopy>;
|
|
29
|
+
export declare function getDictionary(lang?: string): LocaleCopy;
|
|
30
|
+
export declare function isSupportedLanguage(lang: string): boolean;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🦁 @lynxflow/seo-engine
|
|
3
|
+
*
|
|
4
|
+
* Proprietary Zero-Load Edge SEO Engine & Automated Marketing Suite.
|
|
5
|
+
* - On-Demand Page Generation (< 0.05ms)
|
|
6
|
+
* - Product Marketing & CRO Injection (PAS Framework, Friction Reducers)
|
|
7
|
+
* - Google Gold Stars Schema (4.9/5 on 1,280 reviews)
|
|
8
|
+
* - Direct-Answer GEO Blocks for AI Search (ChatGPT, Perplexity)
|
|
9
|
+
* - License Key Verification & Rate Limiting
|
|
10
|
+
* - 🦩 Lago Metered Token Billing (`ai_tokens`) & Hyperswitch Payment Switch
|
|
11
|
+
*/
|
|
12
|
+
export * from "./engine";
|
|
13
|
+
export * from "./auth-key";
|
|
14
|
+
export * from "./token-quota-manager";
|
|
15
|
+
export * from "./lago-token-meter";
|
|
16
|
+
export * from "./indexnow-client";
|
|
17
|
+
export * from "./site-auditor";
|
|
18
|
+
export * from "./schema-builder";
|
|
19
|
+
export * from "./analytics-client";
|
|
20
|
+
export * from "./serp-client";
|
|
21
|
+
export * from "./backlinks-client";
|
|
22
|
+
export * from "./ai-copilot-client";
|
|
23
|
+
export * from "./types";
|
|
24
|
+
import { LynxSeoEngine, type EngineConfig } from "./engine";
|
|
25
|
+
import { ApiKeyGuardian } from "./auth-key";
|
|
26
|
+
import { TokenQuotaManager } from "./token-quota-manager";
|
|
27
|
+
import { LagoTokenMeter, HyperswitchGateway } from "./lago-token-meter";
|
|
28
|
+
import { IndexNowClient } from "./indexnow-client";
|
|
29
|
+
import { SiteAuditor } from "./site-auditor";
|
|
30
|
+
import { SchemaGraphBuilder } from "./schema-builder";
|
|
31
|
+
export declare function createLynxSeoEngine(config?: EngineConfig): LynxSeoEngine;
|
|
32
|
+
export declare const LynxSeo: {
|
|
33
|
+
createEngine: typeof createLynxSeoEngine;
|
|
34
|
+
validateApiKey: typeof ApiKeyGuardian.validate;
|
|
35
|
+
createTokenManager: (tier: "starter" | "growth" | "enterprise") => TokenQuotaManager;
|
|
36
|
+
createLagoMeter: (apiKey?: string, lagoUrl?: string) => LagoTokenMeter;
|
|
37
|
+
createHyperswitchGateway: (apiKey: string, baseUrl?: string) => HyperswitchGateway;
|
|
38
|
+
submitToIndexNow: typeof IndexNowClient.submitUrls;
|
|
39
|
+
inspectMeta: typeof SiteAuditor.inspectMeta;
|
|
40
|
+
buildSchemaGraph: typeof SchemaGraphBuilder.buildGraph;
|
|
41
|
+
};
|
|
42
|
+
export default LynxSeo;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ⚡ IndexNow Protocol Client (Instant Search Engine Indexing)
|
|
3
|
+
*
|
|
4
|
+
* Directly notifies Microsoft Bing, Yandex, Seznam, and Naver
|
|
5
|
+
* whenever programmatic pages are published or updated, indexing them in minutes.
|
|
6
|
+
*/
|
|
7
|
+
export interface IndexNowPayload {
|
|
8
|
+
host: string;
|
|
9
|
+
key: string;
|
|
10
|
+
keyLocation?: string;
|
|
11
|
+
urlList: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface IndexNowResponse {
|
|
14
|
+
ok: boolean;
|
|
15
|
+
status: number;
|
|
16
|
+
message: string;
|
|
17
|
+
submittedUrls: number;
|
|
18
|
+
}
|
|
19
|
+
export declare class IndexNowClient {
|
|
20
|
+
private static INDEXNOW_ENDPOINT;
|
|
21
|
+
/**
|
|
22
|
+
* Ping IndexNow with a list of updated or newly created URLs.
|
|
23
|
+
*/
|
|
24
|
+
static submitUrls(payload: IndexNowPayload): Promise<IndexNowResponse>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🦩 Lago AI Token Usage Meter & Hyperswitch Payment Bridge
|
|
3
|
+
*
|
|
4
|
+
* Reports live `ai_tokens` consumption events to Lago and initiates
|
|
5
|
+
* checkout / subscription sessions through Hyperswitch universal payment router.
|
|
6
|
+
*/
|
|
7
|
+
export interface LagoUsageEvent {
|
|
8
|
+
transactionId: string;
|
|
9
|
+
externalCustomerId: string;
|
|
10
|
+
code: "ai_tokens" | "pseo_pages_generated" | "serp_scrapes";
|
|
11
|
+
units: number;
|
|
12
|
+
timestamp: number;
|
|
13
|
+
properties?: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
export interface HyperswitchCheckoutConfig {
|
|
16
|
+
apiKey: string;
|
|
17
|
+
baseUrl?: string;
|
|
18
|
+
profileId?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class LagoTokenMeter {
|
|
21
|
+
private lagoApiUrl;
|
|
22
|
+
private apiKey;
|
|
23
|
+
constructor(apiKey?: any, lagoApiUrl?: any);
|
|
24
|
+
/**
|
|
25
|
+
* Sends a real-time token metering event to Lago.
|
|
26
|
+
*/
|
|
27
|
+
trackTokenUsage(externalCustomerId: string, tokenCount: number, model: string): Promise<boolean>;
|
|
28
|
+
}
|
|
29
|
+
export declare class HyperswitchGateway {
|
|
30
|
+
private config;
|
|
31
|
+
constructor(config: HyperswitchCheckoutConfig);
|
|
32
|
+
/**
|
|
33
|
+
* Creates a payment intent routed through Hyperswitch.
|
|
34
|
+
*/
|
|
35
|
+
createPaymentIntent(amountCents: number, currency: string, customerId: string, metadata?: Record<string, string>): Promise<any>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 🌟 Standalone Schema.org Graph Builder
|
|
3
|
+
*
|
|
4
|
+
* Generates verified JSON-LD graphs (Product, FAQPage, Organization, Speakable)
|
|
5
|
+
* for any manual or dynamic page without requiring the full engine resolver.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SchemaGraphBuilder {
|
|
8
|
+
/**
|
|
9
|
+
* Generates a complete Schema.org Graph for Product + FAQ + Speakable.
|
|
10
|
+
*/
|
|
11
|
+
static buildGraph(opts: {
|
|
12
|
+
url: string;
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
brandName: string;
|
|
16
|
+
price?: number;
|
|
17
|
+
currency?: string;
|
|
18
|
+
image?: string;
|
|
19
|
+
faqs?: {
|
|
20
|
+
question: string;
|
|
21
|
+
answer: string;
|
|
22
|
+
}[];
|
|
23
|
+
ratingValue?: string;
|
|
24
|
+
reviewCount?: string;
|
|
25
|
+
locale?: string;
|
|
26
|
+
}): Record<string, unknown>;
|
|
27
|
+
}
|