@lynx-seo/engine 3.3.3 → 3.3.5
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 +105 -24
- package/dist/http-middleware.d.ts +91 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +6659 -965
- package/dist/index.mjs +6659 -965
- package/dist/matrix-engine.d.ts +139 -5
- package/dist/mcp-seo-server.js +33 -10
- package/dist/plugin/rum-plugin.d.ts +1 -1
- package/dist/plugins/account-analytics/index.d.ts +11 -9
- package/dist/plugins/early-access-features/index.d.ts +6 -1
- package/dist/plugins/group-analytics/index.d.ts +0 -1
- package/dist/plugins/llm-observability/index.d.ts +0 -1
- package/dist/plugins/mobile-messaging/index.d.ts +1 -1
- package/dist/plugins/page-performance/index.d.ts +1 -1
- package/dist/plugins/real-time-usage/index.d.ts +24 -5
- package/dist/report-builder.d.ts +26 -4
- package/dist/white-label-exports.d.ts +9 -0
- package/package.json +1 -1
package/dist/matrix-engine.d.ts
CHANGED
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
import { type TokenUsageRecord } from "./token-quota-manager";
|
|
14
|
-
|
|
14
|
+
import { type CitabilityScoreResult } from "./geo-citability-scorer";
|
|
15
|
+
import { type HallucinationBaitResult } from "./geo-hallucination-bait";
|
|
16
|
+
export type MatrixFamily = "local-geo" | "vs-comparison" | "alternative" | "pricing" | "review-platform" | "recipe" | "target" | "industry" | "persona" | "integration" | "use-case" | "template" | "glossary" | "calculator" | "niche-report" | "top-products";
|
|
15
17
|
export interface PseoService {
|
|
16
18
|
slug: string;
|
|
17
19
|
name: string;
|
|
@@ -144,6 +146,33 @@ export interface PseoRecipe {
|
|
|
144
146
|
ratingValue?: number;
|
|
145
147
|
reviewCount?: number;
|
|
146
148
|
}
|
|
149
|
+
export interface PseoNicheProductItem {
|
|
150
|
+
title: string;
|
|
151
|
+
url?: string;
|
|
152
|
+
price: number;
|
|
153
|
+
currencySymbol?: string;
|
|
154
|
+
rating?: number;
|
|
155
|
+
reviewCount?: number;
|
|
156
|
+
estimatedSales?: number;
|
|
157
|
+
tags?: string[];
|
|
158
|
+
}
|
|
159
|
+
export interface PseoNicheReport {
|
|
160
|
+
slug: string;
|
|
161
|
+
nicheName: string;
|
|
162
|
+
marketplace: string;
|
|
163
|
+
category?: string;
|
|
164
|
+
averagePrice: number;
|
|
165
|
+
medianPrice?: number;
|
|
166
|
+
currencySymbol?: string;
|
|
167
|
+
competitionScore: number;
|
|
168
|
+
demandScore?: number;
|
|
169
|
+
topTags: string[];
|
|
170
|
+
topProducts?: PseoNicheProductItem[];
|
|
171
|
+
dataSourceName: string;
|
|
172
|
+
dataSourceUrl?: string;
|
|
173
|
+
lastVerifiedDate: string;
|
|
174
|
+
reportType?: "niche-report" | "top-products";
|
|
175
|
+
}
|
|
147
176
|
export interface SchemaOrgGraph {
|
|
148
177
|
"@context": "https://schema.org";
|
|
149
178
|
"@graph": Record<string, unknown>[];
|
|
@@ -176,6 +205,7 @@ export interface GeneratedPageMeta {
|
|
|
176
205
|
calculator?: PseoCalculator;
|
|
177
206
|
reviewTarget?: PseoReviewTarget;
|
|
178
207
|
recipe?: PseoRecipe;
|
|
208
|
+
nicheReport?: PseoNicheReport;
|
|
179
209
|
}
|
|
180
210
|
export interface MatrixOptions {
|
|
181
211
|
brandName: string;
|
|
@@ -333,6 +363,45 @@ export declare const PseoRecipeSchema: z.ZodObject<{
|
|
|
333
363
|
ratingValue: z.ZodOptional<z.ZodNumber>;
|
|
334
364
|
reviewCount: z.ZodOptional<z.ZodNumber>;
|
|
335
365
|
}, z.core.$strip>;
|
|
366
|
+
export declare const PseoNicheProductItemSchema: z.ZodObject<{
|
|
367
|
+
title: z.ZodString;
|
|
368
|
+
url: z.ZodOptional<z.ZodString>;
|
|
369
|
+
price: z.ZodNumber;
|
|
370
|
+
currencySymbol: z.ZodOptional<z.ZodString>;
|
|
371
|
+
rating: z.ZodOptional<z.ZodNumber>;
|
|
372
|
+
reviewCount: z.ZodOptional<z.ZodNumber>;
|
|
373
|
+
estimatedSales: z.ZodOptional<z.ZodNumber>;
|
|
374
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
375
|
+
}, z.core.$strip>;
|
|
376
|
+
export declare const PseoNicheReportSchema: z.ZodObject<{
|
|
377
|
+
slug: z.ZodString;
|
|
378
|
+
nicheName: z.ZodString;
|
|
379
|
+
marketplace: z.ZodString;
|
|
380
|
+
category: z.ZodOptional<z.ZodString>;
|
|
381
|
+
averagePrice: z.ZodNumber;
|
|
382
|
+
medianPrice: z.ZodOptional<z.ZodNumber>;
|
|
383
|
+
currencySymbol: z.ZodOptional<z.ZodString>;
|
|
384
|
+
competitionScore: z.ZodNumber;
|
|
385
|
+
demandScore: z.ZodOptional<z.ZodNumber>;
|
|
386
|
+
topTags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
387
|
+
topProducts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
388
|
+
title: z.ZodString;
|
|
389
|
+
url: z.ZodOptional<z.ZodString>;
|
|
390
|
+
price: z.ZodNumber;
|
|
391
|
+
currencySymbol: z.ZodOptional<z.ZodString>;
|
|
392
|
+
rating: z.ZodOptional<z.ZodNumber>;
|
|
393
|
+
reviewCount: z.ZodOptional<z.ZodNumber>;
|
|
394
|
+
estimatedSales: z.ZodOptional<z.ZodNumber>;
|
|
395
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
396
|
+
}, z.core.$strip>>>;
|
|
397
|
+
dataSourceName: z.ZodString;
|
|
398
|
+
dataSourceUrl: z.ZodOptional<z.ZodString>;
|
|
399
|
+
lastVerifiedDate: z.ZodString;
|
|
400
|
+
reportType: z.ZodOptional<z.ZodEnum<{
|
|
401
|
+
"niche-report": "niche-report";
|
|
402
|
+
"top-products": "top-products";
|
|
403
|
+
}>>;
|
|
404
|
+
}, z.core.$strip>;
|
|
336
405
|
export declare const MatrixOptionsSchema: z.ZodObject<{
|
|
337
406
|
brandName: z.ZodString;
|
|
338
407
|
language: z.ZodDefault<z.ZodString>;
|
|
@@ -413,6 +482,28 @@ export declare class PseoMatrixEngine {
|
|
|
413
482
|
* 10. Tools & Calculators Matrix (`/tools/{calculator}` in English default)
|
|
414
483
|
*/
|
|
415
484
|
generateCalculatorMatrix(domain: string, calculators: PseoCalculator[], options: MatrixOptions): GeneratedPageMeta[];
|
|
485
|
+
/**
|
|
486
|
+
* 11. Data-Driven Niche & Top-Products Matrix (`/niches/{slug}` or `/best/{slug}`)
|
|
487
|
+
* Designed for marketplace intelligence (e.g. Etsy, Amazon KDP, Shopify) backed by verified metrics.
|
|
488
|
+
*/
|
|
489
|
+
generateNicheReportMatrix(domain: string, reports: PseoNicheReport[], options: MatrixOptions): GeneratedPageMeta[];
|
|
490
|
+
/**
|
|
491
|
+
* Renders a zero-hallucination, data-driven Niche / Top-Products editorial report
|
|
492
|
+
* grounded in verified marketplace metrics (average price, competition score, tags, products).
|
|
493
|
+
*/
|
|
494
|
+
renderNicheReportPage(report: PseoNicheReport, options?: {
|
|
495
|
+
brandName?: string;
|
|
496
|
+
language?: "fr" | "en";
|
|
497
|
+
}): {
|
|
498
|
+
title: string;
|
|
499
|
+
metaDescription: string;
|
|
500
|
+
markdown: string;
|
|
501
|
+
wordCount: number;
|
|
502
|
+
citabilityScore: CitabilityScoreResult;
|
|
503
|
+
hallucinationAudit: HallucinationBaitResult;
|
|
504
|
+
aiSummaryJson: Record<string, unknown>;
|
|
505
|
+
aiFaqJson: Record<string, unknown>;
|
|
506
|
+
};
|
|
416
507
|
/**
|
|
417
508
|
* Master Generator: Produces all programmatic families simultaneously.
|
|
418
509
|
*/
|
|
@@ -428,6 +519,7 @@ export declare class PseoMatrixEngine {
|
|
|
428
519
|
glossaryTerms?: PseoGlossaryTerm[];
|
|
429
520
|
calculators?: PseoCalculator[];
|
|
430
521
|
recipes?: PseoRecipe[];
|
|
522
|
+
nicheReports?: PseoNicheReport[];
|
|
431
523
|
}, options: MatrixOptions): GeneratedPageMeta[];
|
|
432
524
|
/**
|
|
433
525
|
* Resolves a single page route in RAM in < 0.05ms.
|
|
@@ -445,6 +537,7 @@ export declare class PseoMatrixEngine {
|
|
|
445
537
|
glossaryTerms?: PseoGlossaryTerm[];
|
|
446
538
|
calculators?: PseoCalculator[];
|
|
447
539
|
recipes?: PseoRecipe[];
|
|
540
|
+
nicheReports?: PseoNicheReport[];
|
|
448
541
|
}, options: MatrixOptions): GeneratedPageMeta | undefined;
|
|
449
542
|
private doResolvePage;
|
|
450
543
|
/**
|
|
@@ -469,21 +562,60 @@ export declare class PseoMatrixEngine {
|
|
|
469
562
|
disallowPaths?: string[];
|
|
470
563
|
}): string;
|
|
471
564
|
/**
|
|
472
|
-
* 🏆 RENDER DEEP EDITORIAL MASTER PAGE (
|
|
473
|
-
* Assembles
|
|
474
|
-
*
|
|
475
|
-
*
|
|
565
|
+
* 🏆 RENDER DEEP EDITORIAL MASTER PAGE (ANTI-HALLUCINATION & HIGH GEO CITABILITY)
|
|
566
|
+
* Assembles structured editorial content combining Answer-First summaries,
|
|
567
|
+
* factual comparative tables, sourced statistics, step-by-step deployment,
|
|
568
|
+
* authoritative citations, and FAQ blocks. Automatically audits output with
|
|
569
|
+
* GeoCitabilityScorer and GeoHallucinationBaitDetector.
|
|
476
570
|
*/
|
|
477
571
|
renderDeepEditorialPage(params: {
|
|
478
572
|
serviceName: string;
|
|
479
573
|
locationName: string;
|
|
480
574
|
industryName?: string;
|
|
575
|
+
targetIndustry?: string;
|
|
481
576
|
brandName?: string;
|
|
482
577
|
monthlyPrice?: number;
|
|
578
|
+
priceMonthly?: number;
|
|
483
579
|
currencySymbol?: string;
|
|
580
|
+
currency?: string;
|
|
581
|
+
serviceSlug?: string;
|
|
582
|
+
locationSlug?: string;
|
|
583
|
+
language?: "fr" | "en";
|
|
484
584
|
sourceParagraphs?: string[];
|
|
485
585
|
enableAiSmartLinking?: boolean;
|
|
486
586
|
tier?: "starter" | "growth" | "enterprise";
|
|
587
|
+
directAnswer?: string;
|
|
588
|
+
comparativeTable?: {
|
|
589
|
+
headers?: [string, string, string];
|
|
590
|
+
rows: Array<{
|
|
591
|
+
criterion: string;
|
|
592
|
+
primaryValue: string;
|
|
593
|
+
baselineValue: string;
|
|
594
|
+
}>;
|
|
595
|
+
};
|
|
596
|
+
sourcedStats?: Array<{
|
|
597
|
+
label: string;
|
|
598
|
+
value: string;
|
|
599
|
+
sourceName: string;
|
|
600
|
+
sourceUrl?: string;
|
|
601
|
+
year?: string | number;
|
|
602
|
+
}>;
|
|
603
|
+
faqs?: Array<{
|
|
604
|
+
question: string;
|
|
605
|
+
answer: string;
|
|
606
|
+
}>;
|
|
607
|
+
citations?: Array<{
|
|
608
|
+
sourceName: string;
|
|
609
|
+
url: string;
|
|
610
|
+
description?: string;
|
|
611
|
+
}>;
|
|
612
|
+
expertQuote?: {
|
|
613
|
+
quote: string;
|
|
614
|
+
author: string;
|
|
615
|
+
role: string;
|
|
616
|
+
organization?: string;
|
|
617
|
+
year?: string;
|
|
618
|
+
};
|
|
487
619
|
}): {
|
|
488
620
|
title: string;
|
|
489
621
|
metaDescription: string;
|
|
@@ -492,6 +624,8 @@ export declare class PseoMatrixEngine {
|
|
|
492
624
|
linksInjected: number;
|
|
493
625
|
tokensConsumed: number;
|
|
494
626
|
tokenUsage?: TokenUsageRecord;
|
|
627
|
+
citabilityScore: CitabilityScoreResult;
|
|
628
|
+
hallucinationAudit: HallucinationBaitResult;
|
|
495
629
|
aiSummaryJson?: Record<string, any>;
|
|
496
630
|
aiFaqJson?: Record<string, any>;
|
|
497
631
|
};
|
package/dist/mcp-seo-server.js
CHANGED
|
@@ -73093,17 +73093,40 @@ function executeSeoQuery(query, datasetRows) {
|
|
|
73093
73093
|
filtered = filtered.slice(0, query.limit);
|
|
73094
73094
|
}
|
|
73095
73095
|
const sampleRow = filtered[0] || {};
|
|
73096
|
-
const
|
|
73097
|
-
|
|
73098
|
-
|
|
73099
|
-
|
|
73096
|
+
const sampleKeys = Object.keys(sampleRow);
|
|
73097
|
+
let columns = [];
|
|
73098
|
+
if (sampleKeys.length > 0) {
|
|
73099
|
+
columns = sampleKeys.map((key) => {
|
|
73100
|
+
const matchedField = datasetDef?.fields.find((f) => f.id === key);
|
|
73101
|
+
if (matchedField) {
|
|
73102
|
+
return { key, name: matchedField.name, type: matchedField.type };
|
|
73103
|
+
}
|
|
73104
|
+
return {
|
|
73105
|
+
key,
|
|
73106
|
+
name: key.replace(/_/g, " ").toUpperCase(),
|
|
73107
|
+
type: typeof sampleRow[key] === "number" ? "number" : "string"
|
|
73108
|
+
};
|
|
73109
|
+
});
|
|
73110
|
+
} else if (query.groupBy && query.aggregations) {
|
|
73111
|
+
for (const key of query.groupBy) {
|
|
73112
|
+
const field = datasetDef?.fields.find((candidate) => candidate.id === key);
|
|
73113
|
+
columns.push({ key, name: field?.name ?? key, type: field?.type ?? "string" });
|
|
73114
|
+
}
|
|
73115
|
+
for (const aggregation of query.aggregations) {
|
|
73116
|
+
const key = aggregation.as || `${aggregation.function}_${aggregation.field}`;
|
|
73117
|
+
columns.push({
|
|
73118
|
+
key,
|
|
73119
|
+
name: key.replace(/_/g, " ").toUpperCase(),
|
|
73120
|
+
type: "number"
|
|
73121
|
+
});
|
|
73100
73122
|
}
|
|
73101
|
-
|
|
73102
|
-
|
|
73103
|
-
|
|
73104
|
-
|
|
73105
|
-
|
|
73106
|
-
|
|
73123
|
+
} else {
|
|
73124
|
+
columns = (datasetDef?.fields ?? []).map((field) => ({
|
|
73125
|
+
key: field.id,
|
|
73126
|
+
name: field.name,
|
|
73127
|
+
type: field.type
|
|
73128
|
+
}));
|
|
73129
|
+
}
|
|
73107
73130
|
return {
|
|
73108
73131
|
columns,
|
|
73109
73132
|
rows: [...filtered],
|
|
@@ -17,7 +17,7 @@ export declare class RUMPlugin implements LynxSeoPlugin {
|
|
|
17
17
|
private ctx?;
|
|
18
18
|
enable(ctx: RUMPluginContext): Promise<void>;
|
|
19
19
|
onEvent(event: PluginEvent): Promise<void>;
|
|
20
|
-
aggregate(siteId: string, pageUrl?: string): import("
|
|
20
|
+
aggregate(siteId: string, pageUrl?: string): import("..").PagePerformanceAggregated | null;
|
|
21
21
|
getSamples(siteId: string, limit?: number): NavigationTimingMetrics[];
|
|
22
22
|
countSamples(siteId: string): number;
|
|
23
23
|
disable(): Promise<void>;
|
|
@@ -24,16 +24,18 @@ export interface AccountAnalyticsReport {
|
|
|
24
24
|
};
|
|
25
25
|
accounts: B2BAccount[];
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Dérive le statut d'un compte de son score de santé (0–100). Le statut
|
|
29
|
+
* `churned` reste une décision métier explicite : il ne se déduit pas d'un
|
|
30
|
+
* score et doit être persisté tel quel quand un caller le fournit.
|
|
31
|
+
*/
|
|
32
|
+
export declare function accountStatusForHealthScore(healthScore: number): Exclude<B2BAccount["status"], "churned">;
|
|
33
|
+
/**
|
|
34
|
+
* Agrégateur pur : le store serveur fournit les comptes persistés du projet,
|
|
35
|
+
* ce plugin ne fabrique ni seed ni repli en mémoire.
|
|
36
|
+
*/
|
|
27
37
|
export declare class AccountAnalyticsPlugin implements LynxSeoPlugin {
|
|
28
38
|
manifest: PluginManifest;
|
|
29
|
-
private accounts;
|
|
30
|
-
constructor();
|
|
31
|
-
private seedDefaultAccounts;
|
|
32
39
|
init(_context: PluginContext): Promise<void>;
|
|
33
|
-
getReport(projectId: string): AccountAnalyticsReport;
|
|
34
|
-
upsertAccount(account: Omit<B2BAccount, "id" | "lastActivityAt"> & {
|
|
35
|
-
id?: string;
|
|
36
|
-
}): B2BAccount;
|
|
37
|
-
updateAccountHealth(id: string, healthScore: number): B2BAccount | null;
|
|
38
|
-
deleteAccount(id: string): boolean;
|
|
40
|
+
getReport(projectId: string, accounts: readonly B2BAccount[]): AccountAnalyticsReport;
|
|
39
41
|
}
|
|
@@ -42,7 +42,12 @@ export declare class EarlyAccessFeaturesPlugin implements LynxSeoPlugin {
|
|
|
42
42
|
private userOptIns;
|
|
43
43
|
private feedbacks;
|
|
44
44
|
constructor();
|
|
45
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Catalogue produit des fonctionnalités beta/alpha exposées à l'opt-in.
|
|
47
|
+
* Les compteurs démarrent à zéro : seules les inscriptions et notes réelles
|
|
48
|
+
* les alimentent, aucun utilisateur de démonstration n'est pré-inscrit.
|
|
49
|
+
*/
|
|
50
|
+
private registerCatalogFeatures;
|
|
46
51
|
enable(_ctx: PluginContext): Promise<void>;
|
|
47
52
|
onEvent(event: PluginEvent): Promise<void>;
|
|
48
53
|
toggleUserOptIn(userId: string, featureId: string, optIn: boolean): boolean;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* validation E.164, vérification par code à 6 chiffres et calcul GSM 7-bit vs UCS-2.
|
|
7
7
|
*/
|
|
8
8
|
import type { LynxSeoPlugin, PluginManifest, PluginContext, PluginEvent } from "../../plugin/types";
|
|
9
|
-
export type SmsProviderType = "twilio" | "infobip" | "sinch" | "webhook"
|
|
9
|
+
export type SmsProviderType = "twilio" | "infobip" | "sinch" | "webhook";
|
|
10
10
|
export interface SmsProviderConfig {
|
|
11
11
|
provider: SmsProviderType;
|
|
12
12
|
accountSid?: string;
|
|
@@ -15,7 +15,7 @@ export declare class RUMPlugin implements LynxSeoPlugin {
|
|
|
15
15
|
/**
|
|
16
16
|
* Agrège les métriques RUM pour un site (et optionnellement une page).
|
|
17
17
|
*/
|
|
18
|
-
aggregate(siteId: string, pageUrl?: string): import("
|
|
18
|
+
aggregate(siteId: string, pageUrl?: string): import("../..").PagePerformanceAggregated | null;
|
|
19
19
|
/**
|
|
20
20
|
* Récupère les échantillons RUM bruts pour un site.
|
|
21
21
|
*/
|
|
@@ -47,6 +47,23 @@ export interface RealTimeUsageReport {
|
|
|
47
47
|
averageEventsPerSecond: number;
|
|
48
48
|
peakEventsPerSecond: number;
|
|
49
49
|
}
|
|
50
|
+
export interface RealTimeUsageInput {
|
|
51
|
+
/** Events stored since the first day of the current month. */
|
|
52
|
+
currentMonthEvents: number;
|
|
53
|
+
planQuota: number;
|
|
54
|
+
/** Events stored during the last hour. */
|
|
55
|
+
eventsLastHour: number;
|
|
56
|
+
/** Real per-minute counts, oldest first; timestamps are ISO. */
|
|
57
|
+
minuteBuckets: Array<{
|
|
58
|
+
timestamp: string;
|
|
59
|
+
count: number;
|
|
60
|
+
}>;
|
|
61
|
+
topEventCounts: Array<{
|
|
62
|
+
eventName: string;
|
|
63
|
+
count: number;
|
|
64
|
+
estimatedPayloadKb: number;
|
|
65
|
+
}>;
|
|
66
|
+
}
|
|
50
67
|
export declare class RealTimeUsagePlugin implements LynxSeoPlugin {
|
|
51
68
|
manifest: PluginManifest;
|
|
52
69
|
private maxThresholdPerMinute;
|
|
@@ -59,9 +76,11 @@ export declare class RealTimeUsagePlugin implements LynxSeoPlugin {
|
|
|
59
76
|
setSamplingRate(rate: number): void;
|
|
60
77
|
resetCircuitBreaker(): void;
|
|
61
78
|
triggerSpikeProtection(reason: string, emergencySamplingRate?: number): void;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
79
|
+
/**
|
|
80
|
+
* Every figure below is computed from stored events. The plugin refuses to
|
|
81
|
+
* invent throughput or event breakdown when the caller has no real data:
|
|
82
|
+
* an empty input yields zeros and empty series, never a plausible-looking
|
|
83
|
+
* sample.
|
|
84
|
+
*/
|
|
85
|
+
calculateUsageReport(projectId: string, input: RealTimeUsageInput): RealTimeUsageReport;
|
|
67
86
|
}
|
package/dist/report-builder.d.ts
CHANGED
|
@@ -66,10 +66,32 @@ export declare class SqlQueryBuilderClass {
|
|
|
66
66
|
}
|
|
67
67
|
/** Créer une requête à partir d'un schéma structuré */
|
|
68
68
|
export declare function buildQueryFromSchema(schema: BuiltSqlQuery): string;
|
|
69
|
-
/**
|
|
70
|
-
export
|
|
71
|
-
/**
|
|
72
|
-
export declare function
|
|
69
|
+
/** Interface d'un exécuteur de requêtes SQL (ex: Drizzle, Hyperdrive, sqlite3 ou driver mémoire) */
|
|
70
|
+
export type QueryExecutor<T = unknown> = (query: string, parameters?: unknown[]) => Promise<T[]>;
|
|
71
|
+
/** Enregistrer un exécuteur de requêtes personnalisé pour l'environnement hôte */
|
|
72
|
+
export declare function setQueryExecutor(executor: QueryExecutor | null): void;
|
|
73
|
+
/** Enregistrer ou déclarer les métadonnées d'une table */
|
|
74
|
+
export declare function registerTableMetadata(tableName: string, metadata: {
|
|
75
|
+
columns: {
|
|
76
|
+
name: string;
|
|
77
|
+
type: string;
|
|
78
|
+
nullable: boolean;
|
|
79
|
+
}[];
|
|
80
|
+
primaryKey?: string[];
|
|
81
|
+
}): void;
|
|
82
|
+
/**
|
|
83
|
+
* Exécuter une requête SQL via l'exécuteur configuré ou renvoyer un jeu de données typé.
|
|
84
|
+
*/
|
|
85
|
+
export declare function executeQuery<T = any>(query: string, parameters?: unknown[], executor?: QueryExecutor<T>): Promise<T[]>;
|
|
86
|
+
/** Obtenir les métadonnées d'une table (depuis le registre local ou les définitions déclarées) */
|
|
87
|
+
export declare function getTableMetadata(tableName: string, fetcher?: (name: string) => Promise<{
|
|
88
|
+
columns: {
|
|
89
|
+
name: string;
|
|
90
|
+
type: string;
|
|
91
|
+
nullable: boolean;
|
|
92
|
+
}[];
|
|
93
|
+
primaryKey?: string[];
|
|
94
|
+
}>): Promise<{
|
|
73
95
|
columns: {
|
|
74
96
|
name: string;
|
|
75
97
|
type: string;
|
|
@@ -48,3 +48,12 @@ export declare function exportCsv(options: WhiteLabelExportOptions): Promise<{
|
|
|
48
48
|
size: number;
|
|
49
49
|
data: string;
|
|
50
50
|
}>;
|
|
51
|
+
/** Interface pour un convertisseur HTML vers PDF externe ou personnalisé */
|
|
52
|
+
export type HtmlToPdfConverter = (html: string) => Promise<Buffer>;
|
|
53
|
+
/** Enregistrer un convertisseur HTML vers PDF (ex: Puppeteer, Playwright, service headless ou microservice Gotenberg) */
|
|
54
|
+
export declare function setHtmlToPdfConverter(converter: HtmlToPdfConverter | null): void;
|
|
55
|
+
/**
|
|
56
|
+
* Convertir du HTML en PDF.
|
|
57
|
+
* Utilise le convertisseur injecté s'il est configuré, ou renvoie le buffer encodé UTF-8 de l'HTML.
|
|
58
|
+
*/
|
|
59
|
+
export declare function convertHtmlToPdf(html: string, converter?: HtmlToPdfConverter): Promise<Buffer>;
|