@hamur/seo 0.0.0-stage → 0.0.1
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/LICENSE +22 -0
- package/README.md +26 -2
- package/dist/chunks/bun-index-rnjhv41c.js +62 -0
- package/dist/chunks/bun-index-xf4srhvn.js +97 -0
- package/dist/src/adapters/html.js +40 -0
- package/dist/src/adapters/preact.js +36 -0
- package/dist/src/adapters/react.js +36 -0
- package/dist/src/adapters/solid.js +35 -0
- package/dist/src/adapters/svelte.js +35 -0
- package/dist/src/adapters/vue.js +43 -0
- package/dist/src/index.js +1375 -0
- package/dist/src/schema.js +51 -0
- package/dist/src/server/index.js +1 -0
- package/dist/src/share.js +40 -0
- package/dist/types/src/adapters/html.d.ts +6 -0
- package/dist/types/src/adapters/preact.d.ts +5 -0
- package/dist/types/src/adapters/react.d.ts +5 -0
- package/dist/types/src/adapters/solid.d.ts +6 -0
- package/dist/types/src/adapters/svelte.d.ts +5 -0
- package/dist/types/src/adapters/vue.d.ts +9 -0
- package/dist/types/src/build/links.d.ts +4 -0
- package/dist/types/src/build/llms.d.ts +6 -0
- package/dist/types/src/build/own.d.ts +5 -0
- package/dist/types/src/build/robots.d.ts +3 -0
- package/dist/types/src/build/schema.d.ts +4 -0
- package/dist/types/src/build/sitemap.d.ts +7 -0
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/links/check.d.ts +7 -0
- package/dist/types/src/links/external.d.ts +6 -0
- package/dist/types/src/links/options.d.ts +12 -0
- package/dist/types/src/links/report.d.ts +4 -0
- package/dist/types/src/links/scan.d.ts +24 -0
- package/dist/types/src/llms/options.d.ts +9 -0
- package/dist/types/src/llms/paths.d.ts +8 -0
- package/dist/types/src/llms/text.d.ts +12 -0
- package/dist/types/src/module.d.ts +3 -0
- package/dist/types/src/robots/ai-bots.d.ts +2 -0
- package/dist/types/src/robots/body.d.ts +16 -0
- package/dist/types/src/robots/options.d.ts +9 -0
- package/dist/types/src/runtime/breadcrumbs.d.ts +37 -0
- package/dist/types/src/runtime/markdown.d.ts +15 -0
- package/dist/types/src/runtime/schema-plugin.d.ts +2 -0
- package/dist/types/src/runtime/schema-store.d.ts +34 -0
- package/dist/types/src/schema/graph.d.ts +13 -0
- package/dist/types/src/schema/helpers.d.ts +358 -0
- package/dist/types/src/schema/options.d.ts +7 -0
- package/dist/types/src/schema.d.ts +10 -0
- package/dist/types/src/server/agent.d.ts +4 -0
- package/dist/types/src/server/door.d.ts +5 -0
- package/dist/types/src/server/index.d.ts +1 -0
- package/dist/types/src/server/llms.d.ts +2 -0
- package/dist/types/src/server/render.d.ts +9 -0
- package/dist/types/src/server/robots.d.ts +1 -0
- package/dist/types/src/server/sitemap.d.ts +5 -0
- package/dist/types/src/share.d.ts +18 -0
- package/dist/types/src/sitemap/alternates.d.ts +14 -0
- package/dist/types/src/sitemap/answer.d.ts +6 -0
- package/dist/types/src/sitemap/entries.d.ts +9 -0
- package/dist/types/src/sitemap/options.d.ts +7 -0
- package/dist/types/src/sitemap/paths.d.ts +13 -0
- package/dist/types/src/sitemap/xml.d.ts +23 -0
- package/dist/types/src/types.d.ts +73 -0
- package/package.json +106 -4
- package/src/adapters/html.ts +43 -0
- package/src/adapters/preact.ts +37 -0
- package/src/adapters/react.ts +37 -0
- package/src/adapters/solid.ts +38 -0
- package/src/adapters/svelte.ts +37 -0
- package/src/adapters/vue.ts +55 -0
- package/src/build/links.ts +13 -0
- package/src/build/llms.ts +79 -0
- package/src/build/own.ts +46 -0
- package/src/build/robots.ts +58 -0
- package/src/build/schema.ts +23 -0
- package/src/build/sitemap.ts +101 -0
- package/src/env.d.ts +44 -0
- package/src/index.ts +14 -0
- package/src/links/check.ts +233 -0
- package/src/links/external.ts +41 -0
- package/src/links/options.ts +69 -0
- package/src/links/report.ts +49 -0
- package/src/links/scan.ts +123 -0
- package/src/llms/options.ts +49 -0
- package/src/llms/paths.ts +33 -0
- package/src/llms/text.ts +26 -0
- package/src/module.ts +22 -0
- package/src/robots/ai-bots.ts +14 -0
- package/src/robots/body.ts +51 -0
- package/src/robots/options.ts +75 -0
- package/src/runtime/breadcrumbs.ts +84 -0
- package/src/runtime/markdown.ts +381 -0
- package/src/runtime/schema-plugin.ts +22 -0
- package/src/runtime/schema-store.ts +144 -0
- package/src/schema/graph.ts +125 -0
- package/src/schema/helpers.ts +372 -0
- package/src/schema/options.ts +39 -0
- package/src/schema.ts +5 -0
- package/src/server/agent.ts +45 -0
- package/src/server/door.ts +8 -0
- package/src/server/index.ts +1 -0
- package/src/server/llms.ts +139 -0
- package/src/server/render.ts +33 -0
- package/src/server/robots.ts +19 -0
- package/src/server/sitemap.ts +222 -0
- package/src/share.ts +56 -0
- package/src/sitemap/alternates.ts +66 -0
- package/src/sitemap/answer.ts +42 -0
- package/src/sitemap/entries.ts +136 -0
- package/src/sitemap/options.ts +47 -0
- package/src/sitemap/paths.ts +39 -0
- package/src/sitemap/xml.ts +71 -0
- package/src/types.ts +89 -0
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import type { SchemaNode } from "../schema.ts";
|
|
2
|
+
export type DateLike = string | Date;
|
|
3
|
+
export type NodeRef = SchemaNode | {
|
|
4
|
+
"@id": string;
|
|
5
|
+
};
|
|
6
|
+
type Many<T> = T | T[];
|
|
7
|
+
type Link = Many<string | NodeRef>;
|
|
8
|
+
type Price = number | `${number}`;
|
|
9
|
+
type Typed<Type extends string, Input> = Omit<Input, "@type"> & {
|
|
10
|
+
"@type": Type;
|
|
11
|
+
};
|
|
12
|
+
type Base = {
|
|
13
|
+
"@id"?: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
alternateName?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
url?: string;
|
|
18
|
+
image?: Link;
|
|
19
|
+
sameAs?: Many<string>;
|
|
20
|
+
identifier?: string;
|
|
21
|
+
};
|
|
22
|
+
export type WebPageType = "WebPage" | "AboutPage" | "CheckoutPage" | "CollectionPage" | "ContactPage" | "FAQPage" | "ItemPage" | "MedicalWebPage" | "ProfilePage" | "QAPage" | "RealEstateListing" | "SearchResultsPage";
|
|
23
|
+
export type WebSiteInput = Base & {
|
|
24
|
+
publisher?: Link;
|
|
25
|
+
inLanguage?: string;
|
|
26
|
+
potentialAction?: Link;
|
|
27
|
+
};
|
|
28
|
+
export type WebPageInput = Base & {
|
|
29
|
+
"@type"?: WebPageType;
|
|
30
|
+
isPartOf?: Link;
|
|
31
|
+
breadcrumb?: Link;
|
|
32
|
+
datePublished?: DateLike;
|
|
33
|
+
dateModified?: DateLike;
|
|
34
|
+
inLanguage?: string;
|
|
35
|
+
primaryImageOfPage?: Link;
|
|
36
|
+
mainEntity?: Link;
|
|
37
|
+
about?: Link;
|
|
38
|
+
lastReviewed?: DateLike;
|
|
39
|
+
};
|
|
40
|
+
export type PostalAddressInput = {
|
|
41
|
+
"@id"?: string;
|
|
42
|
+
streetAddress?: string;
|
|
43
|
+
addressLocality?: string;
|
|
44
|
+
addressRegion?: string;
|
|
45
|
+
postalCode?: string;
|
|
46
|
+
addressCountry?: string;
|
|
47
|
+
};
|
|
48
|
+
export type ContactPointInput = {
|
|
49
|
+
"@id"?: string;
|
|
50
|
+
contactType?: string;
|
|
51
|
+
telephone?: string;
|
|
52
|
+
email?: string;
|
|
53
|
+
areaServed?: Many<string>;
|
|
54
|
+
availableLanguage?: Many<string>;
|
|
55
|
+
};
|
|
56
|
+
type Address = string | PostalAddressInput | NodeRef;
|
|
57
|
+
export type OrganizationInput = Base & {
|
|
58
|
+
name: string;
|
|
59
|
+
legalName?: string;
|
|
60
|
+
logo?: string | NodeRef;
|
|
61
|
+
email?: string;
|
|
62
|
+
telephone?: string;
|
|
63
|
+
address?: Address;
|
|
64
|
+
contactPoint?: Many<ContactPointInput | NodeRef>;
|
|
65
|
+
foundingDate?: DateLike;
|
|
66
|
+
founder?: Link;
|
|
67
|
+
parentOrganization?: Link;
|
|
68
|
+
taxID?: string;
|
|
69
|
+
vatID?: string;
|
|
70
|
+
};
|
|
71
|
+
export type PersonInput = Base & {
|
|
72
|
+
name: string;
|
|
73
|
+
givenName?: string;
|
|
74
|
+
familyName?: string;
|
|
75
|
+
email?: string;
|
|
76
|
+
telephone?: string;
|
|
77
|
+
jobTitle?: string;
|
|
78
|
+
worksFor?: Link;
|
|
79
|
+
birthDate?: DateLike;
|
|
80
|
+
address?: Address;
|
|
81
|
+
nationality?: string;
|
|
82
|
+
};
|
|
83
|
+
export type LocalBusinessInput = Base & {
|
|
84
|
+
name: string;
|
|
85
|
+
address: Address;
|
|
86
|
+
telephone?: string;
|
|
87
|
+
email?: string;
|
|
88
|
+
priceRange?: string;
|
|
89
|
+
logo?: string | NodeRef;
|
|
90
|
+
geo?: NodeRef | {
|
|
91
|
+
"@type": "GeoCoordinates";
|
|
92
|
+
latitude: number;
|
|
93
|
+
longitude: number;
|
|
94
|
+
};
|
|
95
|
+
openingHours?: Many<string>;
|
|
96
|
+
openingHoursSpecification?: Many<NodeRef>;
|
|
97
|
+
servesCuisine?: Many<string>;
|
|
98
|
+
areaServed?: Many<string | NodeRef>;
|
|
99
|
+
aggregateRating?: AggregateRatingInput | NodeRef;
|
|
100
|
+
review?: Many<ReviewInput | NodeRef>;
|
|
101
|
+
};
|
|
102
|
+
type ArticleFields = Base & {
|
|
103
|
+
headline: string;
|
|
104
|
+
author?: Link;
|
|
105
|
+
publisher?: Link;
|
|
106
|
+
datePublished?: DateLike;
|
|
107
|
+
dateModified?: DateLike;
|
|
108
|
+
articleSection?: string;
|
|
109
|
+
articleBody?: string;
|
|
110
|
+
wordCount?: number;
|
|
111
|
+
inLanguage?: string;
|
|
112
|
+
keywords?: Many<string>;
|
|
113
|
+
mainEntityOfPage?: string | NodeRef;
|
|
114
|
+
isAccessibleForFree?: boolean;
|
|
115
|
+
};
|
|
116
|
+
export type ArticleInput = ArticleFields;
|
|
117
|
+
export type BlogPostingInput = ArticleFields;
|
|
118
|
+
export type OfferInput = {
|
|
119
|
+
"@id"?: string;
|
|
120
|
+
price: Price;
|
|
121
|
+
priceCurrency: string;
|
|
122
|
+
availability?: string;
|
|
123
|
+
itemCondition?: string;
|
|
124
|
+
priceValidUntil?: DateLike;
|
|
125
|
+
validFrom?: DateLike;
|
|
126
|
+
url?: string;
|
|
127
|
+
seller?: Link;
|
|
128
|
+
name?: string;
|
|
129
|
+
sku?: string;
|
|
130
|
+
};
|
|
131
|
+
export type AggregateRatingInput = {
|
|
132
|
+
"@id"?: string;
|
|
133
|
+
ratingValue: number | `${number}`;
|
|
134
|
+
bestRating?: number | `${number}`;
|
|
135
|
+
worstRating?: number | `${number}`;
|
|
136
|
+
itemReviewed?: Link;
|
|
137
|
+
} & ({
|
|
138
|
+
ratingCount: number;
|
|
139
|
+
reviewCount?: number;
|
|
140
|
+
} | {
|
|
141
|
+
reviewCount: number;
|
|
142
|
+
ratingCount?: number;
|
|
143
|
+
});
|
|
144
|
+
export type RatingInput = {
|
|
145
|
+
"@id"?: string;
|
|
146
|
+
ratingValue: number | `${number}`;
|
|
147
|
+
bestRating?: number | `${number}`;
|
|
148
|
+
worstRating?: number | `${number}`;
|
|
149
|
+
};
|
|
150
|
+
export type ReviewInput = Base & {
|
|
151
|
+
reviewRating: RatingInput | NodeRef;
|
|
152
|
+
author: string | NodeRef;
|
|
153
|
+
reviewBody?: string;
|
|
154
|
+
datePublished?: DateLike;
|
|
155
|
+
itemReviewed?: Link;
|
|
156
|
+
publisher?: Link;
|
|
157
|
+
};
|
|
158
|
+
export type ProductInput = Base & {
|
|
159
|
+
name: string;
|
|
160
|
+
offers?: Many<OfferInput | NodeRef>;
|
|
161
|
+
aggregateRating?: AggregateRatingInput | NodeRef;
|
|
162
|
+
review?: Many<ReviewInput | NodeRef>;
|
|
163
|
+
brand?: string | NodeRef;
|
|
164
|
+
sku?: string;
|
|
165
|
+
gtin?: string;
|
|
166
|
+
gtin13?: string;
|
|
167
|
+
mpn?: string;
|
|
168
|
+
color?: string;
|
|
169
|
+
category?: string;
|
|
170
|
+
};
|
|
171
|
+
export type ListItemInput = {
|
|
172
|
+
"@type"?: "ListItem";
|
|
173
|
+
"@id"?: string;
|
|
174
|
+
position?: number;
|
|
175
|
+
name?: string;
|
|
176
|
+
item?: string | NodeRef;
|
|
177
|
+
};
|
|
178
|
+
export type BreadcrumbListInput = {
|
|
179
|
+
"@id"?: string;
|
|
180
|
+
itemListElement: (ListItemInput | NodeRef)[];
|
|
181
|
+
};
|
|
182
|
+
export type AnswerInput = {
|
|
183
|
+
"@id"?: string;
|
|
184
|
+
text: string;
|
|
185
|
+
url?: string;
|
|
186
|
+
author?: Link;
|
|
187
|
+
datePublished?: DateLike;
|
|
188
|
+
};
|
|
189
|
+
export type QuestionInput = {
|
|
190
|
+
"@id"?: string;
|
|
191
|
+
name: string;
|
|
192
|
+
acceptedAnswer: AnswerInput | NodeRef;
|
|
193
|
+
text?: string;
|
|
194
|
+
answerCount?: number;
|
|
195
|
+
author?: Link;
|
|
196
|
+
datePublished?: DateLike;
|
|
197
|
+
};
|
|
198
|
+
export type FaqPageInput = Base & {
|
|
199
|
+
mainEntity: Many<QuestionInput | NodeRef>;
|
|
200
|
+
datePublished?: DateLike;
|
|
201
|
+
dateModified?: DateLike;
|
|
202
|
+
inLanguage?: string;
|
|
203
|
+
};
|
|
204
|
+
export type HowToStepInput = {
|
|
205
|
+
"@id"?: string;
|
|
206
|
+
name?: string;
|
|
207
|
+
text?: string;
|
|
208
|
+
url?: string;
|
|
209
|
+
image?: Link;
|
|
210
|
+
};
|
|
211
|
+
export type HowToInput = Base & {
|
|
212
|
+
name: string;
|
|
213
|
+
step: Many<HowToStepInput | NodeRef | string>;
|
|
214
|
+
totalTime?: string;
|
|
215
|
+
estimatedCost?: string | NodeRef;
|
|
216
|
+
supply?: Many<string | NodeRef>;
|
|
217
|
+
tool?: Many<string | NodeRef>;
|
|
218
|
+
};
|
|
219
|
+
export type EventInput = Base & {
|
|
220
|
+
name: string;
|
|
221
|
+
startDate: DateLike;
|
|
222
|
+
location: string | NodeRef | {
|
|
223
|
+
"@type"?: "Place" | "VirtualLocation";
|
|
224
|
+
name?: string;
|
|
225
|
+
address?: Address;
|
|
226
|
+
url?: string;
|
|
227
|
+
};
|
|
228
|
+
endDate?: DateLike;
|
|
229
|
+
eventStatus?: string;
|
|
230
|
+
eventAttendanceMode?: string;
|
|
231
|
+
organizer?: Link;
|
|
232
|
+
performer?: Link;
|
|
233
|
+
offers?: Many<OfferInput | NodeRef>;
|
|
234
|
+
previousStartDate?: DateLike;
|
|
235
|
+
};
|
|
236
|
+
export type RecipeInput = Base & {
|
|
237
|
+
name: string;
|
|
238
|
+
image: Link;
|
|
239
|
+
author?: Link;
|
|
240
|
+
datePublished?: DateLike;
|
|
241
|
+
prepTime?: string;
|
|
242
|
+
cookTime?: string;
|
|
243
|
+
totalTime?: string;
|
|
244
|
+
recipeYield?: Many<string | number>;
|
|
245
|
+
recipeCategory?: string;
|
|
246
|
+
recipeCuisine?: string;
|
|
247
|
+
recipeIngredient?: string[];
|
|
248
|
+
recipeInstructions?: Many<string | NodeRef>;
|
|
249
|
+
keywords?: Many<string>;
|
|
250
|
+
aggregateRating?: AggregateRatingInput | NodeRef;
|
|
251
|
+
};
|
|
252
|
+
export type VideoObjectInput = Base & {
|
|
253
|
+
name: string;
|
|
254
|
+
thumbnailUrl: Many<string>;
|
|
255
|
+
uploadDate: DateLike;
|
|
256
|
+
contentUrl?: string;
|
|
257
|
+
embedUrl?: string;
|
|
258
|
+
duration?: string;
|
|
259
|
+
expires?: DateLike;
|
|
260
|
+
interactionStatistic?: Many<NodeRef>;
|
|
261
|
+
};
|
|
262
|
+
export type ImageObjectInput = Base & {
|
|
263
|
+
contentUrl: string;
|
|
264
|
+
width?: number | string;
|
|
265
|
+
height?: number | string;
|
|
266
|
+
caption?: string;
|
|
267
|
+
creator?: Link;
|
|
268
|
+
creditText?: string;
|
|
269
|
+
copyrightNotice?: string;
|
|
270
|
+
license?: string;
|
|
271
|
+
acquireLicensePage?: string;
|
|
272
|
+
};
|
|
273
|
+
export type SoftwareAppInput = Base & {
|
|
274
|
+
name: string;
|
|
275
|
+
applicationCategory?: string;
|
|
276
|
+
operatingSystem?: string;
|
|
277
|
+
offers?: Many<OfferInput | NodeRef>;
|
|
278
|
+
aggregateRating?: AggregateRatingInput | NodeRef;
|
|
279
|
+
review?: Many<ReviewInput | NodeRef>;
|
|
280
|
+
softwareVersion?: string;
|
|
281
|
+
downloadUrl?: string;
|
|
282
|
+
};
|
|
283
|
+
export type BookInput = Base & {
|
|
284
|
+
name: string;
|
|
285
|
+
author: string | NodeRef | (string | NodeRef)[];
|
|
286
|
+
isbn?: string;
|
|
287
|
+
numberOfPages?: number;
|
|
288
|
+
bookFormat?: string;
|
|
289
|
+
datePublished?: DateLike;
|
|
290
|
+
publisher?: Link;
|
|
291
|
+
inLanguage?: string;
|
|
292
|
+
workExample?: Many<NodeRef>;
|
|
293
|
+
aggregateRating?: AggregateRatingInput | NodeRef;
|
|
294
|
+
review?: Many<ReviewInput | NodeRef>;
|
|
295
|
+
};
|
|
296
|
+
export type CourseInput = Base & {
|
|
297
|
+
name: string;
|
|
298
|
+
description: string;
|
|
299
|
+
provider?: Link;
|
|
300
|
+
courseCode?: string;
|
|
301
|
+
hasCourseInstance?: Many<NodeRef>;
|
|
302
|
+
inLanguage?: string;
|
|
303
|
+
offers?: Many<OfferInput | NodeRef>;
|
|
304
|
+
};
|
|
305
|
+
export type JobPostingInput = Base & {
|
|
306
|
+
title: string;
|
|
307
|
+
description: string;
|
|
308
|
+
datePosted: DateLike;
|
|
309
|
+
hiringOrganization: string | NodeRef;
|
|
310
|
+
validThrough?: DateLike;
|
|
311
|
+
employmentType?: Many<string>;
|
|
312
|
+
jobLocation?: Many<NodeRef | {
|
|
313
|
+
"@type": "Place";
|
|
314
|
+
address: Address;
|
|
315
|
+
}>;
|
|
316
|
+
jobLocationType?: string;
|
|
317
|
+
baseSalary?: NodeRef;
|
|
318
|
+
directApply?: boolean;
|
|
319
|
+
applicantLocationRequirements?: Many<NodeRef>;
|
|
320
|
+
identifier?: string | NodeRef;
|
|
321
|
+
};
|
|
322
|
+
export declare const defineWebSite: (input?: WebSiteInput) => Typed<"WebSite", WebSiteInput>;
|
|
323
|
+
export declare const defineWebPage: <Input extends WebPageInput>(input?: Input) => Typed<Input["@type"] extends string ? Input["@type"] : "WebPage", Input>;
|
|
324
|
+
export declare const defineOrganization: (input: OrganizationInput) => Typed<"Organization", OrganizationInput>;
|
|
325
|
+
export declare const definePerson: (input: PersonInput) => Typed<"Person", PersonInput>;
|
|
326
|
+
export declare const defineLocalBusiness: (input: LocalBusinessInput) => Typed<"LocalBusiness", LocalBusinessInput>;
|
|
327
|
+
export declare const defineArticle: (input: ArticleInput) => Typed<"Article", ArticleFields>;
|
|
328
|
+
export declare const defineBlogPosting: (input: BlogPostingInput) => Typed<"BlogPosting", ArticleFields>;
|
|
329
|
+
export declare const defineProduct: (input: ProductInput) => Typed<"Product", ProductInput>;
|
|
330
|
+
export declare const defineOffer: (input: OfferInput) => Typed<"Offer", OfferInput>;
|
|
331
|
+
export declare const defineAggregateRating: (input: AggregateRatingInput) => Typed<"AggregateRating", AggregateRatingInput>;
|
|
332
|
+
export declare const defineReview: (input: ReviewInput) => Typed<"Review", ReviewInput>;
|
|
333
|
+
export declare const defineQuestion: (input: QuestionInput) => Typed<"Question", QuestionInput>;
|
|
334
|
+
export declare const defineFaqPage: (input: FaqPageInput) => Typed<"FAQPage", {
|
|
335
|
+
"@id"?: string;
|
|
336
|
+
name?: string;
|
|
337
|
+
alternateName?: string;
|
|
338
|
+
description?: string;
|
|
339
|
+
url?: string;
|
|
340
|
+
image?: Link;
|
|
341
|
+
sameAs?: Many<string>;
|
|
342
|
+
identifier?: string;
|
|
343
|
+
datePublished?: DateLike;
|
|
344
|
+
dateModified?: DateLike;
|
|
345
|
+
inLanguage?: string;
|
|
346
|
+
mainEntity: FaqPageInput["mainEntity"];
|
|
347
|
+
}>;
|
|
348
|
+
export declare const defineHowTo: (input: HowToInput) => Typed<"HowTo", HowToInput>;
|
|
349
|
+
export declare const defineEvent: (input: EventInput) => Typed<"Event", EventInput>;
|
|
350
|
+
export declare const defineRecipe: (input: RecipeInput) => Typed<"Recipe", RecipeInput>;
|
|
351
|
+
export declare const defineVideoObject: (input: VideoObjectInput) => Typed<"VideoObject", VideoObjectInput>;
|
|
352
|
+
export declare const defineImageObject: (input: ImageObjectInput) => Typed<"ImageObject", ImageObjectInput>;
|
|
353
|
+
export declare const defineSoftwareApp: (input: SoftwareAppInput) => Typed<"SoftwareApplication", SoftwareAppInput>;
|
|
354
|
+
export declare const defineBook: (input: BookInput) => Typed<"Book", BookInput>;
|
|
355
|
+
export declare const defineCourse: (input: CourseInput) => Typed<"Course", CourseInput>;
|
|
356
|
+
export declare const defineJobPosting: (input: JobPostingInput) => Typed<"JobPosting", JobPostingInput>;
|
|
357
|
+
export declare const defineBreadcrumbList: (input: BreadcrumbListInput) => Typed<"BreadcrumbList", BreadcrumbListInput>;
|
|
358
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type SchemaNode = {
|
|
2
|
+
"@type": string | string[];
|
|
3
|
+
"@id"?: string;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
};
|
|
6
|
+
export type IdentityNode = SchemaNode & {
|
|
7
|
+
"@type": "Organization" | "Person" | "LocalBusiness";
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
export * from "./schema/helpers.ts";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** `<path>.md` and a page asked with `Accept: text/markdown` answer the Markdown of the page's rendered HTML. */
|
|
2
|
+
export declare const agentMarkdown: import("hamur/app").FunctionMiddleware<{}, {}>;
|
|
3
|
+
/** Every HTML answer of a page names `Accept` in `Vary`, since the same URL answers Markdown to an agent. */
|
|
4
|
+
export declare const varyAccept: import("hamur/server").ServerPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** One leading `/`, no backslash or control character, and the same origin once resolved: the call never leaves the app. */
|
|
2
|
+
export declare function isAppPath(path: string): boolean;
|
|
3
|
+
export interface Rendered {
|
|
4
|
+
status: number;
|
|
5
|
+
headers: Headers;
|
|
6
|
+
body: string;
|
|
7
|
+
}
|
|
8
|
+
/** A page answered in process by the bare `$fetch`; `undefined` when the call itself failed. */
|
|
9
|
+
export declare function render(path: string, accept: string): Promise<Rendered | undefined>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const robotsTxt: import("hamur/adapter").Handler<unknown, Response, unknown, Response, {}>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type HamurEvent } from "hamur/server";
|
|
2
|
+
import { type SitemapUrl } from "../sitemap/xml.ts";
|
|
3
|
+
export declare function sitemapUrls(event: HamurEvent): Promise<SitemapUrl[] | Response>;
|
|
4
|
+
export declare const sitemapXml: import("hamur/adapter").Handler<unknown, Response, unknown, Response, {}>;
|
|
5
|
+
export declare const sitemapPart: import("hamur/adapter").Handler<unknown, Response, unknown, Response, {}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ShareLinks {
|
|
2
|
+
x: string;
|
|
3
|
+
facebook: string;
|
|
4
|
+
linkedin: string;
|
|
5
|
+
bluesky: string;
|
|
6
|
+
email: string;
|
|
7
|
+
whatsapp: string;
|
|
8
|
+
reddit: string;
|
|
9
|
+
telegram: string;
|
|
10
|
+
mastodon?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ShareLinksInput {
|
|
13
|
+
url: string;
|
|
14
|
+
title: string;
|
|
15
|
+
text?: string;
|
|
16
|
+
mastodon?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function shareLinks(input: ShareLinksInput): ShareLinks;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface I18nLocales {
|
|
2
|
+
locales: Array<{
|
|
3
|
+
code: string;
|
|
4
|
+
language: string;
|
|
5
|
+
}>;
|
|
6
|
+
defaultLocale: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PageRoute {
|
|
9
|
+
name: string;
|
|
10
|
+
path: string;
|
|
11
|
+
}
|
|
12
|
+
export type Alternates = Record<string, Array<[string, string]>>;
|
|
13
|
+
export declare function readLocales(input: unknown): I18nLocales | undefined;
|
|
14
|
+
export declare function pageAlternates(pages: PageRoute[], i18n: I18nLocales, listed: ReadonlySet<string>, clean: (path: string) => string | undefined): Alternates;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type SitemapUrl } from "./xml.ts";
|
|
2
|
+
export declare function mergeUrls(lists: SitemapUrl[][]): SitemapUrl[];
|
|
3
|
+
export declare const partCount: (total: number, chunkSize: number) => number;
|
|
4
|
+
export declare function rootXml(urls: SitemapUrl[], parts: number, partLoc: (part: number) => string): string;
|
|
5
|
+
export declare function partRange(total: number, chunkSize: number, part: number): [from: number, to: number] | undefined;
|
|
6
|
+
export declare function oversize(path: string, xml: string): string | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type SitemapUrl } from "./xml.ts";
|
|
2
|
+
export interface SourceContext {
|
|
3
|
+
origin: string;
|
|
4
|
+
baseURL: string;
|
|
5
|
+
warn(message: string): void;
|
|
6
|
+
}
|
|
7
|
+
export declare function readCount(path: string, answer: unknown): number;
|
|
8
|
+
export declare function readRows(path: string, answer: unknown, limit: number): unknown[];
|
|
9
|
+
export declare function readSource(path: string, answer: unknown, { origin, baseURL, warn }: SourceContext): SitemapUrl[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createRouteRules } from "hamur/kit";
|
|
2
|
+
export interface PathsInput {
|
|
3
|
+
/** The paths of the page route table, copies of `@hamur/i18n` included, in table order. */
|
|
4
|
+
pages: string[];
|
|
5
|
+
/** `prerender.routes`. */
|
|
6
|
+
listed: string[];
|
|
7
|
+
rules: Readonly<NonNullable<Parameters<typeof createRouteRules>[0]>>;
|
|
8
|
+
exclude: string[];
|
|
9
|
+
}
|
|
10
|
+
/** An app path in the form a request has: query and hash dropped, percent-encoded, one trailing `/` run removed; `undefined` for anything else. */
|
|
11
|
+
export declare function clean(path: string): string | undefined;
|
|
12
|
+
/** The page routes without params, then the paths the build knows the prerender seeds, each once, minus `noindex`, `redirect` and `exclude`. */
|
|
13
|
+
export declare function sitemapPaths({ pages, listed, rules, exclude }: PathsInput): string[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { absoluteUrl, escapeXml, resolveUrl } from "hamur/server/internal";
|
|
2
|
+
export { absoluteUrl, escapeXml, resolveUrl };
|
|
3
|
+
export interface SitemapUrl {
|
|
4
|
+
loc: string;
|
|
5
|
+
lastmod?: string;
|
|
6
|
+
changefreq?: string;
|
|
7
|
+
priority?: number;
|
|
8
|
+
images?: string[];
|
|
9
|
+
videos?: Array<{
|
|
10
|
+
thumbnail_loc: string;
|
|
11
|
+
title: string;
|
|
12
|
+
description: string;
|
|
13
|
+
content_loc?: string;
|
|
14
|
+
player_loc?: string;
|
|
15
|
+
duration?: number;
|
|
16
|
+
}>;
|
|
17
|
+
alternates?: Array<{
|
|
18
|
+
hreflang: string;
|
|
19
|
+
href: string;
|
|
20
|
+
}>;
|
|
21
|
+
}
|
|
22
|
+
export declare function urlsetXml(urls: SitemapUrl[]): string;
|
|
23
|
+
export declare function indexXml(locs: string[]): string;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { IdentityNode } from "./schema.ts";
|
|
2
|
+
export interface RobotsGroup {
|
|
3
|
+
userAgent: string | string[];
|
|
4
|
+
allow?: string[];
|
|
5
|
+
disallow?: string[];
|
|
6
|
+
crawlDelay?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface RobotsConfig {
|
|
9
|
+
groups?: RobotsGroup[];
|
|
10
|
+
blockAiBots?: boolean;
|
|
11
|
+
fromRules?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface SitemapConfig {
|
|
14
|
+
sources?: string[];
|
|
15
|
+
exclude?: string[];
|
|
16
|
+
chunkSize?: number;
|
|
17
|
+
}
|
|
18
|
+
export type SitemapChangeFrequency = "always" | "hourly" | "daily" | "weekly" | "monthly" | "yearly" | "never";
|
|
19
|
+
export interface SitemapVideo {
|
|
20
|
+
thumbnail_loc: string;
|
|
21
|
+
title: string;
|
|
22
|
+
description: string;
|
|
23
|
+
content_loc?: string;
|
|
24
|
+
player_loc?: string;
|
|
25
|
+
duration?: number;
|
|
26
|
+
}
|
|
27
|
+
/** What a sitemap source answers; the names are the elements of the protocol and its extensions. */
|
|
28
|
+
export interface SitemapEntry {
|
|
29
|
+
loc: string;
|
|
30
|
+
lastmod?: string | Date;
|
|
31
|
+
changefreq?: SitemapChangeFrequency;
|
|
32
|
+
priority?: number;
|
|
33
|
+
images?: Array<{
|
|
34
|
+
loc: string;
|
|
35
|
+
}>;
|
|
36
|
+
videos?: SitemapVideo[];
|
|
37
|
+
alternates?: Array<{
|
|
38
|
+
hreflang: string;
|
|
39
|
+
href: string;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
/** What a paged sitemap source answers to `?offset=<o>&limit=<k>`: `total` of its entries and `entries` from `offset` to `offset + limit`. */
|
|
43
|
+
export interface SitemapPage {
|
|
44
|
+
total: number;
|
|
45
|
+
entries: SitemapEntry[];
|
|
46
|
+
}
|
|
47
|
+
export type LinkRuleId = "broken" | "missing-anchor" | "redirect" | "trailing-slash" | "absolute-site-url" | "javascript-href" | "empty-text" | "double-slash" | "uppercase" | "whitespace" | "external-broken";
|
|
48
|
+
export interface LinkCheckerConfig {
|
|
49
|
+
failOnError?: boolean;
|
|
50
|
+
external?: boolean;
|
|
51
|
+
report?: Array<"json" | "markdown" | "html">;
|
|
52
|
+
exclude?: string[];
|
|
53
|
+
rules?: Partial<Record<LinkRuleId, "error" | "warning" | false>>;
|
|
54
|
+
}
|
|
55
|
+
export interface LlmsConfig {
|
|
56
|
+
title?: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
exclude?: string[];
|
|
59
|
+
}
|
|
60
|
+
export interface SeoConfig {
|
|
61
|
+
robots?: boolean | RobotsConfig;
|
|
62
|
+
sitemap?: boolean | SitemapConfig;
|
|
63
|
+
schemaOrg?: boolean | {
|
|
64
|
+
identity?: IdentityNode;
|
|
65
|
+
};
|
|
66
|
+
linkChecker?: boolean | LinkCheckerConfig;
|
|
67
|
+
llms?: boolean | LlmsConfig;
|
|
68
|
+
}
|
|
69
|
+
declare module "hamur" {
|
|
70
|
+
interface HamurModuleOptions {
|
|
71
|
+
seo?: SeoConfig;
|
|
72
|
+
}
|
|
73
|
+
}
|