aiseo-audit 1.0.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.
@@ -0,0 +1,442 @@
1
+ import { z } from 'zod';
2
+ import { CheerioAPI } from 'cheerio';
3
+
4
+ declare const CategoryWeightSchema: z.ZodDefault<z.ZodObject<{
5
+ contentExtractability: z.ZodDefault<z.ZodNumber>;
6
+ contentStructure: z.ZodDefault<z.ZodNumber>;
7
+ answerability: z.ZodDefault<z.ZodNumber>;
8
+ entityClarity: z.ZodDefault<z.ZodNumber>;
9
+ groundingSignals: z.ZodDefault<z.ZodNumber>;
10
+ authorityContext: z.ZodDefault<z.ZodNumber>;
11
+ readabilityForCompression: z.ZodDefault<z.ZodNumber>;
12
+ }, z.core.$strip>>;
13
+ declare const AiseoConfigSchema: z.ZodDefault<z.ZodObject<{
14
+ timeout: z.ZodDefault<z.ZodNumber>;
15
+ userAgent: z.ZodDefault<z.ZodString>;
16
+ format: z.ZodDefault<z.ZodEnum<{
17
+ pretty: "pretty";
18
+ json: "json";
19
+ md: "md";
20
+ html: "html";
21
+ }>>;
22
+ failUnder: z.ZodOptional<z.ZodNumber>;
23
+ weights: z.ZodDefault<z.ZodObject<{
24
+ contentExtractability: z.ZodDefault<z.ZodNumber>;
25
+ contentStructure: z.ZodDefault<z.ZodNumber>;
26
+ answerability: z.ZodDefault<z.ZodNumber>;
27
+ entityClarity: z.ZodDefault<z.ZodNumber>;
28
+ groundingSignals: z.ZodDefault<z.ZodNumber>;
29
+ authorityContext: z.ZodDefault<z.ZodNumber>;
30
+ readabilityForCompression: z.ZodDefault<z.ZodNumber>;
31
+ }, z.core.$strip>>;
32
+ }, z.core.$strip>>;
33
+ type CategoryWeightType = z.infer<typeof CategoryWeightSchema>;
34
+ type AiseoConfigType = z.infer<typeof AiseoConfigSchema>;
35
+
36
+ declare const AnalyzerOptionsSchema: z.ZodObject<{
37
+ url: z.ZodString;
38
+ timeout: z.ZodDefault<z.ZodNumber>;
39
+ userAgent: z.ZodDefault<z.ZodString>;
40
+ }, z.core.$strip>;
41
+ declare const AnalyzerResultSchema: z.ZodObject<{
42
+ url: z.ZodString;
43
+ analyzedAt: z.ZodString;
44
+ overallScore: z.ZodNumber;
45
+ grade: z.ZodString;
46
+ totalPoints: z.ZodNumber;
47
+ maxPoints: z.ZodNumber;
48
+ categories: z.ZodRecord<z.ZodString, z.ZodObject<{
49
+ name: z.ZodString;
50
+ key: z.ZodEnum<{
51
+ contentExtractability: "contentExtractability";
52
+ contentStructure: "contentStructure";
53
+ answerability: "answerability";
54
+ entityClarity: "entityClarity";
55
+ groundingSignals: "groundingSignals";
56
+ authorityContext: "authorityContext";
57
+ readabilityForCompression: "readabilityForCompression";
58
+ }>;
59
+ score: z.ZodNumber;
60
+ maxScore: z.ZodNumber;
61
+ factors: z.ZodArray<z.ZodObject<{
62
+ name: z.ZodString;
63
+ score: z.ZodNumber;
64
+ maxScore: z.ZodNumber;
65
+ value: z.ZodString;
66
+ status: z.ZodEnum<{
67
+ good: "good";
68
+ needs_improvement: "needs_improvement";
69
+ critical: "critical";
70
+ neutral: "neutral";
71
+ }>;
72
+ }, z.core.$strip>>;
73
+ }, z.core.$strip>>;
74
+ recommendations: z.ZodArray<z.ZodObject<{
75
+ category: z.ZodString;
76
+ factor: z.ZodString;
77
+ currentValue: z.ZodString;
78
+ priority: z.ZodEnum<{
79
+ high: "high";
80
+ medium: "medium";
81
+ low: "low";
82
+ }>;
83
+ recommendation: z.ZodString;
84
+ }, z.core.$strip>>;
85
+ rawData: z.ZodObject<{
86
+ title: z.ZodString;
87
+ metaDescription: z.ZodString;
88
+ wordCount: z.ZodNumber;
89
+ crawlerAccess: z.ZodOptional<z.ZodObject<{
90
+ allowed: z.ZodArray<z.ZodString>;
91
+ blocked: z.ZodArray<z.ZodString>;
92
+ unknown: z.ZodArray<z.ZodString>;
93
+ }, z.core.$strip>>;
94
+ sectionLengths: z.ZodOptional<z.ZodObject<{
95
+ sectionCount: z.ZodNumber;
96
+ avgWordsPerSection: z.ZodNumber;
97
+ sections: z.ZodArray<z.ZodNumber>;
98
+ }, z.core.$strip>>;
99
+ answerCapsules: z.ZodOptional<z.ZodObject<{
100
+ total: z.ZodNumber;
101
+ withCapsule: z.ZodNumber;
102
+ }, z.core.$strip>>;
103
+ entities: z.ZodOptional<z.ZodObject<{
104
+ people: z.ZodArray<z.ZodString>;
105
+ organizations: z.ZodArray<z.ZodString>;
106
+ places: z.ZodArray<z.ZodString>;
107
+ topics: z.ZodArray<z.ZodString>;
108
+ }, z.core.$strip>>;
109
+ externalLinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
110
+ url: z.ZodString;
111
+ text: z.ZodString;
112
+ }, z.core.$strip>>>;
113
+ structuredDataTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
114
+ freshness: z.ZodOptional<z.ZodObject<{
115
+ publishDate: z.ZodNullable<z.ZodString>;
116
+ modifiedDate: z.ZodNullable<z.ZodString>;
117
+ ageInMonths: z.ZodNullable<z.ZodNumber>;
118
+ hasModifiedDate: z.ZodBoolean;
119
+ }, z.core.$strip>>;
120
+ questionsFound: z.ZodOptional<z.ZodArray<z.ZodString>>;
121
+ avgSentenceLength: z.ZodOptional<z.ZodNumber>;
122
+ readabilityScore: z.ZodOptional<z.ZodNumber>;
123
+ imageAccessibility: z.ZodOptional<z.ZodObject<{
124
+ imageCount: z.ZodNumber;
125
+ imagesWithAlt: z.ZodNumber;
126
+ figcaptionCount: z.ZodNumber;
127
+ }, z.core.$strip>>;
128
+ schemaCompleteness: z.ZodOptional<z.ZodObject<{
129
+ totalTypes: z.ZodNumber;
130
+ avgCompleteness: z.ZodNumber;
131
+ details: z.ZodArray<z.ZodObject<{
132
+ type: z.ZodString;
133
+ present: z.ZodArray<z.ZodString>;
134
+ missing: z.ZodArray<z.ZodString>;
135
+ }, z.core.$strip>>;
136
+ }, z.core.$strip>>;
137
+ entityConsistency: z.ZodOptional<z.ZodObject<{
138
+ entityName: z.ZodNullable<z.ZodString>;
139
+ surfacesFound: z.ZodNumber;
140
+ surfacesChecked: z.ZodNumber;
141
+ }, z.core.$strip>>;
142
+ }, z.core.$strip>;
143
+ meta: z.ZodObject<{
144
+ version: z.ZodString;
145
+ analysisDurationMs: z.ZodNumber;
146
+ }, z.core.$strip>;
147
+ }, z.core.$strip>;
148
+ type AnalyzerOptionsType = z.infer<typeof AnalyzerOptionsSchema>;
149
+ type AnalyzerResultType = z.infer<typeof AnalyzerResultSchema>;
150
+
151
+ declare function analyzeUrl(options: AnalyzerOptionsType, config: AiseoConfigType): Promise<AnalyzerResultType>;
152
+
153
+ declare function loadConfig(configPath?: string): Promise<AiseoConfigType>;
154
+
155
+ declare const ReportFormatSchema: z.ZodEnum<{
156
+ pretty: "pretty";
157
+ json: "json";
158
+ md: "md";
159
+ html: "html";
160
+ }>;
161
+ declare const RenderOptionsSchema: z.ZodObject<{
162
+ format: z.ZodDefault<z.ZodEnum<{
163
+ pretty: "pretty";
164
+ json: "json";
165
+ md: "md";
166
+ html: "html";
167
+ }>>;
168
+ }, z.core.$strip>;
169
+ type ReportFormatType = z.infer<typeof ReportFormatSchema>;
170
+ type RenderOptionsType = z.infer<typeof RenderOptionsSchema>;
171
+
172
+ declare function renderReport(result: AnalyzerResultType, options: RenderOptionsType): string;
173
+
174
+ declare const CategoryNameSchema: z.ZodEnum<{
175
+ contentExtractability: "contentExtractability";
176
+ contentStructure: "contentStructure";
177
+ answerability: "answerability";
178
+ entityClarity: "entityClarity";
179
+ groundingSignals: "groundingSignals";
180
+ authorityContext: "authorityContext";
181
+ readabilityForCompression: "readabilityForCompression";
182
+ }>;
183
+ declare const DomainSignalsSchema: z.ZodObject<{
184
+ robotsTxt: z.ZodNullable<z.ZodString>;
185
+ llmsTxtExists: z.ZodBoolean;
186
+ llmsFullTxtExists: z.ZodBoolean;
187
+ }, z.core.$strip>;
188
+ declare const FactorResultSchema: z.ZodObject<{
189
+ name: z.ZodString;
190
+ score: z.ZodNumber;
191
+ maxScore: z.ZodNumber;
192
+ value: z.ZodString;
193
+ status: z.ZodEnum<{
194
+ good: "good";
195
+ needs_improvement: "needs_improvement";
196
+ critical: "critical";
197
+ neutral: "neutral";
198
+ }>;
199
+ }, z.core.$strip>;
200
+ declare const CategoryResultSchema: z.ZodObject<{
201
+ name: z.ZodString;
202
+ key: z.ZodEnum<{
203
+ contentExtractability: "contentExtractability";
204
+ contentStructure: "contentStructure";
205
+ answerability: "answerability";
206
+ entityClarity: "entityClarity";
207
+ groundingSignals: "groundingSignals";
208
+ authorityContext: "authorityContext";
209
+ readabilityForCompression: "readabilityForCompression";
210
+ }>;
211
+ score: z.ZodNumber;
212
+ maxScore: z.ZodNumber;
213
+ factors: z.ZodArray<z.ZodObject<{
214
+ name: z.ZodString;
215
+ score: z.ZodNumber;
216
+ maxScore: z.ZodNumber;
217
+ value: z.ZodString;
218
+ status: z.ZodEnum<{
219
+ good: "good";
220
+ needs_improvement: "needs_improvement";
221
+ critical: "critical";
222
+ neutral: "neutral";
223
+ }>;
224
+ }, z.core.$strip>>;
225
+ }, z.core.$strip>;
226
+ declare const AuditResultSchema: z.ZodObject<{
227
+ categories: z.ZodRecord<z.ZodEnum<{
228
+ contentExtractability: "contentExtractability";
229
+ contentStructure: "contentStructure";
230
+ answerability: "answerability";
231
+ entityClarity: "entityClarity";
232
+ groundingSignals: "groundingSignals";
233
+ authorityContext: "authorityContext";
234
+ readabilityForCompression: "readabilityForCompression";
235
+ }>, z.ZodObject<{
236
+ name: z.ZodString;
237
+ key: z.ZodEnum<{
238
+ contentExtractability: "contentExtractability";
239
+ contentStructure: "contentStructure";
240
+ answerability: "answerability";
241
+ entityClarity: "entityClarity";
242
+ groundingSignals: "groundingSignals";
243
+ authorityContext: "authorityContext";
244
+ readabilityForCompression: "readabilityForCompression";
245
+ }>;
246
+ score: z.ZodNumber;
247
+ maxScore: z.ZodNumber;
248
+ factors: z.ZodArray<z.ZodObject<{
249
+ name: z.ZodString;
250
+ score: z.ZodNumber;
251
+ maxScore: z.ZodNumber;
252
+ value: z.ZodString;
253
+ status: z.ZodEnum<{
254
+ good: "good";
255
+ needs_improvement: "needs_improvement";
256
+ critical: "critical";
257
+ neutral: "neutral";
258
+ }>;
259
+ }, z.core.$strip>>;
260
+ }, z.core.$strip>>;
261
+ rawData: z.ZodObject<{
262
+ title: z.ZodString;
263
+ metaDescription: z.ZodString;
264
+ wordCount: z.ZodNumber;
265
+ crawlerAccess: z.ZodOptional<z.ZodObject<{
266
+ allowed: z.ZodArray<z.ZodString>;
267
+ blocked: z.ZodArray<z.ZodString>;
268
+ unknown: z.ZodArray<z.ZodString>;
269
+ }, z.core.$strip>>;
270
+ sectionLengths: z.ZodOptional<z.ZodObject<{
271
+ sectionCount: z.ZodNumber;
272
+ avgWordsPerSection: z.ZodNumber;
273
+ sections: z.ZodArray<z.ZodNumber>;
274
+ }, z.core.$strip>>;
275
+ answerCapsules: z.ZodOptional<z.ZodObject<{
276
+ total: z.ZodNumber;
277
+ withCapsule: z.ZodNumber;
278
+ }, z.core.$strip>>;
279
+ entities: z.ZodOptional<z.ZodObject<{
280
+ people: z.ZodArray<z.ZodString>;
281
+ organizations: z.ZodArray<z.ZodString>;
282
+ places: z.ZodArray<z.ZodString>;
283
+ topics: z.ZodArray<z.ZodString>;
284
+ }, z.core.$strip>>;
285
+ externalLinks: z.ZodOptional<z.ZodArray<z.ZodObject<{
286
+ url: z.ZodString;
287
+ text: z.ZodString;
288
+ }, z.core.$strip>>>;
289
+ structuredDataTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
290
+ freshness: z.ZodOptional<z.ZodObject<{
291
+ publishDate: z.ZodNullable<z.ZodString>;
292
+ modifiedDate: z.ZodNullable<z.ZodString>;
293
+ ageInMonths: z.ZodNullable<z.ZodNumber>;
294
+ hasModifiedDate: z.ZodBoolean;
295
+ }, z.core.$strip>>;
296
+ questionsFound: z.ZodOptional<z.ZodArray<z.ZodString>>;
297
+ avgSentenceLength: z.ZodOptional<z.ZodNumber>;
298
+ readabilityScore: z.ZodOptional<z.ZodNumber>;
299
+ imageAccessibility: z.ZodOptional<z.ZodObject<{
300
+ imageCount: z.ZodNumber;
301
+ imagesWithAlt: z.ZodNumber;
302
+ figcaptionCount: z.ZodNumber;
303
+ }, z.core.$strip>>;
304
+ schemaCompleteness: z.ZodOptional<z.ZodObject<{
305
+ totalTypes: z.ZodNumber;
306
+ avgCompleteness: z.ZodNumber;
307
+ details: z.ZodArray<z.ZodObject<{
308
+ type: z.ZodString;
309
+ present: z.ZodArray<z.ZodString>;
310
+ missing: z.ZodArray<z.ZodString>;
311
+ }, z.core.$strip>>;
312
+ }, z.core.$strip>>;
313
+ entityConsistency: z.ZodOptional<z.ZodObject<{
314
+ entityName: z.ZodNullable<z.ZodString>;
315
+ surfacesFound: z.ZodNumber;
316
+ surfacesChecked: z.ZodNumber;
317
+ }, z.core.$strip>>;
318
+ }, z.core.$strip>;
319
+ }, z.core.$strip>;
320
+ type AuditResultType = z.infer<typeof AuditResultSchema>;
321
+ type CategoryNameType = z.infer<typeof CategoryNameSchema>;
322
+ type CategoryResultType = z.infer<typeof CategoryResultSchema>;
323
+ type DomainSignalsType = z.infer<typeof DomainSignalsSchema>;
324
+ type FactorResultType = z.infer<typeof FactorResultSchema>;
325
+
326
+ declare const PageStatsSchema: z.ZodObject<{
327
+ wordCount: z.ZodNumber;
328
+ sentenceCount: z.ZodNumber;
329
+ paragraphCount: z.ZodNumber;
330
+ headingCount: z.ZodNumber;
331
+ h1Count: z.ZodNumber;
332
+ h2Count: z.ZodNumber;
333
+ h3Count: z.ZodNumber;
334
+ linkCount: z.ZodNumber;
335
+ externalLinkCount: z.ZodNumber;
336
+ imageCount: z.ZodNumber;
337
+ imagesWithAlt: z.ZodNumber;
338
+ listCount: z.ZodNumber;
339
+ listItemCount: z.ZodNumber;
340
+ tableCount: z.ZodNumber;
341
+ boilerplateRatio: z.ZodNumber;
342
+ rawByteLength: z.ZodNumber;
343
+ cleanTextLength: z.ZodNumber;
344
+ }, z.core.$strip>;
345
+ declare const ExtractedPageDataSchema: z.ZodObject<{
346
+ url: z.ZodString;
347
+ html: z.ZodString;
348
+ cleanText: z.ZodString;
349
+ title: z.ZodString;
350
+ metaDescription: z.ZodString;
351
+ stats: z.ZodObject<{
352
+ wordCount: z.ZodNumber;
353
+ sentenceCount: z.ZodNumber;
354
+ paragraphCount: z.ZodNumber;
355
+ headingCount: z.ZodNumber;
356
+ h1Count: z.ZodNumber;
357
+ h2Count: z.ZodNumber;
358
+ h3Count: z.ZodNumber;
359
+ linkCount: z.ZodNumber;
360
+ externalLinkCount: z.ZodNumber;
361
+ imageCount: z.ZodNumber;
362
+ imagesWithAlt: z.ZodNumber;
363
+ listCount: z.ZodNumber;
364
+ listItemCount: z.ZodNumber;
365
+ tableCount: z.ZodNumber;
366
+ boilerplateRatio: z.ZodNumber;
367
+ rawByteLength: z.ZodNumber;
368
+ cleanTextLength: z.ZodNumber;
369
+ }, z.core.$strip>;
370
+ }, z.core.$strip>;
371
+ declare const ExternalLinkSchema: z.ZodObject<{
372
+ url: z.ZodString;
373
+ text: z.ZodString;
374
+ }, z.core.$strip>;
375
+ type PageStatsType = z.infer<typeof PageStatsSchema>;
376
+ type ExtractedPageDataType = z.infer<typeof ExtractedPageDataSchema>;
377
+ type ExternalLinkType = z.infer<typeof ExternalLinkSchema>;
378
+ interface ExtractedPageType extends ExtractedPageDataType {
379
+ $: CheerioAPI;
380
+ externalLinks: ExternalLinkType[];
381
+ }
382
+
383
+ declare const FetchResultSchema: z.ZodObject<{
384
+ url: z.ZodString;
385
+ finalUrl: z.ZodString;
386
+ statusCode: z.ZodNumber;
387
+ contentType: z.ZodString;
388
+ html: z.ZodString;
389
+ byteLength: z.ZodNumber;
390
+ fetchTimeMs: z.ZodNumber;
391
+ redirected: z.ZodBoolean;
392
+ }, z.core.$strip>;
393
+ type FetchResultType = z.infer<typeof FetchResultSchema>;
394
+
395
+ declare const RecommendationSchema: z.ZodObject<{
396
+ category: z.ZodString;
397
+ factor: z.ZodString;
398
+ currentValue: z.ZodString;
399
+ priority: z.ZodEnum<{
400
+ high: "high";
401
+ medium: "medium";
402
+ low: "low";
403
+ }>;
404
+ recommendation: z.ZodString;
405
+ }, z.core.$strip>;
406
+ type RecommendationType = z.infer<typeof RecommendationSchema>;
407
+
408
+ declare const GradeSchema: z.ZodEnum<{
409
+ A: "A";
410
+ B: "B";
411
+ C: "C";
412
+ D: "D";
413
+ F: "F";
414
+ "A+": "A+";
415
+ "A-": "A-";
416
+ "B+": "B+";
417
+ "B-": "B-";
418
+ "C+": "C+";
419
+ "C-": "C-";
420
+ }>;
421
+ declare const ScoreSummarySchema: z.ZodObject<{
422
+ overallScore: z.ZodNumber;
423
+ grade: z.ZodEnum<{
424
+ A: "A";
425
+ B: "B";
426
+ C: "C";
427
+ D: "D";
428
+ F: "F";
429
+ "A+": "A+";
430
+ "A-": "A-";
431
+ "B+": "B+";
432
+ "B-": "B-";
433
+ "C+": "C+";
434
+ "C-": "C-";
435
+ }>;
436
+ totalPoints: z.ZodNumber;
437
+ maxPoints: z.ZodNumber;
438
+ }, z.core.$strip>;
439
+ type GradeType = z.infer<typeof GradeSchema>;
440
+ type ScoreSummaryType = z.infer<typeof ScoreSummarySchema>;
441
+
442
+ export { type AiseoConfigType, type AnalyzerOptionsType, type AnalyzerResultType, type AuditResultType, type CategoryNameType, type CategoryResultType, type CategoryWeightType, type DomainSignalsType, type ExternalLinkType, type ExtractedPageType, type FactorResultType, type FetchResultType, type GradeType, type PageStatsType, type RecommendationType, type RenderOptionsType, type ReportFormatType, type ScoreSummaryType, analyzeUrl, loadConfig, renderReport };