@rankcli/agent-runtime 0.0.8 → 0.0.9
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/dist/index.d.mts +912 -1
- package/dist/index.d.ts +912 -1
- package/dist/index.js +587 -3
- package/dist/index.mjs +586 -3
- package/package.json +1 -1
- package/src/fixer/index.ts +1 -0
- package/src/fixer/schemas.ts +971 -0
- package/src/index.ts +3 -0
package/dist/index.mjs
CHANGED
|
@@ -27961,6 +27961,588 @@ async function applyFixes(fixes, options) {
|
|
|
27961
27961
|
return { applied, skipped };
|
|
27962
27962
|
}
|
|
27963
27963
|
|
|
27964
|
+
// src/fixer/schemas.ts
|
|
27965
|
+
function generateOrganizationSchema(data) {
|
|
27966
|
+
return {
|
|
27967
|
+
"@context": "https://schema.org",
|
|
27968
|
+
"@type": "Organization",
|
|
27969
|
+
name: data.name,
|
|
27970
|
+
url: data.url,
|
|
27971
|
+
logo: data.logo,
|
|
27972
|
+
description: data.description,
|
|
27973
|
+
foundingDate: data.foundingDate,
|
|
27974
|
+
founder: data.founders?.map((f) => ({
|
|
27975
|
+
"@type": "Person",
|
|
27976
|
+
name: f.name,
|
|
27977
|
+
url: f.url
|
|
27978
|
+
})),
|
|
27979
|
+
address: data.address ? {
|
|
27980
|
+
"@type": "PostalAddress",
|
|
27981
|
+
streetAddress: data.address.streetAddress,
|
|
27982
|
+
addressLocality: data.address.addressLocality,
|
|
27983
|
+
addressRegion: data.address.addressRegion,
|
|
27984
|
+
postalCode: data.address.postalCode,
|
|
27985
|
+
addressCountry: data.address.addressCountry
|
|
27986
|
+
} : void 0,
|
|
27987
|
+
contactPoint: data.contactPoint?.map((cp) => ({
|
|
27988
|
+
"@type": "ContactPoint",
|
|
27989
|
+
telephone: cp.telephone,
|
|
27990
|
+
contactType: cp.contactType,
|
|
27991
|
+
availableLanguage: cp.availableLanguage,
|
|
27992
|
+
areaServed: cp.areaServed
|
|
27993
|
+
})),
|
|
27994
|
+
sameAs: data.sameAs
|
|
27995
|
+
};
|
|
27996
|
+
}
|
|
27997
|
+
function generateWebSiteSchema(data) {
|
|
27998
|
+
return {
|
|
27999
|
+
"@context": "https://schema.org",
|
|
28000
|
+
"@type": "WebSite",
|
|
28001
|
+
name: data.name,
|
|
28002
|
+
url: data.url,
|
|
28003
|
+
description: data.description,
|
|
28004
|
+
publisher: data.publisher ? {
|
|
28005
|
+
"@type": "Organization",
|
|
28006
|
+
name: data.publisher
|
|
28007
|
+
} : void 0,
|
|
28008
|
+
potentialAction: data.potentialAction ? {
|
|
28009
|
+
"@type": "SearchAction",
|
|
28010
|
+
target: {
|
|
28011
|
+
"@type": "EntryPoint",
|
|
28012
|
+
urlTemplate: data.potentialAction.target
|
|
28013
|
+
},
|
|
28014
|
+
"query-input": data.potentialAction.queryInput
|
|
28015
|
+
} : void 0
|
|
28016
|
+
};
|
|
28017
|
+
}
|
|
28018
|
+
function generateArticleSchema(data) {
|
|
28019
|
+
const authors = Array.isArray(data.author) ? data.author : [data.author];
|
|
28020
|
+
return {
|
|
28021
|
+
"@context": "https://schema.org",
|
|
28022
|
+
"@type": "Article",
|
|
28023
|
+
headline: data.headline,
|
|
28024
|
+
description: data.description,
|
|
28025
|
+
image: data.image,
|
|
28026
|
+
datePublished: data.datePublished,
|
|
28027
|
+
dateModified: data.dateModified || data.datePublished,
|
|
28028
|
+
author: authors.map((a) => ({
|
|
28029
|
+
"@type": "Person",
|
|
28030
|
+
name: a.name,
|
|
28031
|
+
url: a.url,
|
|
28032
|
+
image: a.image,
|
|
28033
|
+
jobTitle: a.jobTitle,
|
|
28034
|
+
sameAs: a.sameAs
|
|
28035
|
+
})),
|
|
28036
|
+
publisher: {
|
|
28037
|
+
"@type": "Organization",
|
|
28038
|
+
name: data.publisher.name,
|
|
28039
|
+
logo: {
|
|
28040
|
+
"@type": "ImageObject",
|
|
28041
|
+
url: data.publisher.logo
|
|
28042
|
+
}
|
|
28043
|
+
},
|
|
28044
|
+
mainEntityOfPage: data.mainEntityOfPage ? {
|
|
28045
|
+
"@type": "WebPage",
|
|
28046
|
+
"@id": data.mainEntityOfPage
|
|
28047
|
+
} : void 0,
|
|
28048
|
+
wordCount: data.wordCount,
|
|
28049
|
+
articleSection: data.articleSection,
|
|
28050
|
+
keywords: data.keywords?.join(", ")
|
|
28051
|
+
};
|
|
28052
|
+
}
|
|
28053
|
+
function generateBlogPostingSchema(data) {
|
|
28054
|
+
const schema = generateArticleSchema(data);
|
|
28055
|
+
return { ...schema, "@type": "BlogPosting" };
|
|
28056
|
+
}
|
|
28057
|
+
function generateNewsArticleSchema(data) {
|
|
28058
|
+
const schema = generateArticleSchema(data);
|
|
28059
|
+
return { ...schema, "@type": "NewsArticle", dateline: data.dateline };
|
|
28060
|
+
}
|
|
28061
|
+
function generateProductSchema(data) {
|
|
28062
|
+
const offers = Array.isArray(data.offers) ? data.offers : [data.offers];
|
|
28063
|
+
return {
|
|
28064
|
+
"@context": "https://schema.org",
|
|
28065
|
+
"@type": "Product",
|
|
28066
|
+
name: data.name,
|
|
28067
|
+
description: data.description,
|
|
28068
|
+
image: data.image,
|
|
28069
|
+
sku: data.sku,
|
|
28070
|
+
mpn: data.mpn,
|
|
28071
|
+
gtin: data.gtin,
|
|
28072
|
+
brand: data.brand ? {
|
|
28073
|
+
"@type": "Brand",
|
|
28074
|
+
name: data.brand
|
|
28075
|
+
} : void 0,
|
|
28076
|
+
category: data.category,
|
|
28077
|
+
offers: offers.map((o) => ({
|
|
28078
|
+
"@type": "Offer",
|
|
28079
|
+
price: o.price,
|
|
28080
|
+
priceCurrency: o.priceCurrency || "USD",
|
|
28081
|
+
availability: `https://schema.org/${o.availability || "InStock"}`,
|
|
28082
|
+
priceValidUntil: o.priceValidUntil,
|
|
28083
|
+
url: o.url,
|
|
28084
|
+
seller: o.seller ? {
|
|
28085
|
+
"@type": "Organization",
|
|
28086
|
+
name: o.seller
|
|
28087
|
+
} : void 0,
|
|
28088
|
+
itemCondition: o.itemCondition ? `https://schema.org/${o.itemCondition}` : void 0
|
|
28089
|
+
})),
|
|
28090
|
+
aggregateRating: data.aggregateRating ? {
|
|
28091
|
+
"@type": "AggregateRating",
|
|
28092
|
+
ratingValue: data.aggregateRating.ratingValue,
|
|
28093
|
+
reviewCount: data.aggregateRating.reviewCount,
|
|
28094
|
+
ratingCount: data.aggregateRating.ratingCount,
|
|
28095
|
+
bestRating: data.aggregateRating.bestRating || 5,
|
|
28096
|
+
worstRating: data.aggregateRating.worstRating || 1
|
|
28097
|
+
} : void 0,
|
|
28098
|
+
review: data.review?.map((r) => ({
|
|
28099
|
+
"@type": "Review",
|
|
28100
|
+
author: {
|
|
28101
|
+
"@type": "Person",
|
|
28102
|
+
name: r.author
|
|
28103
|
+
},
|
|
28104
|
+
datePublished: r.datePublished,
|
|
28105
|
+
reviewBody: r.reviewBody,
|
|
28106
|
+
reviewRating: {
|
|
28107
|
+
"@type": "Rating",
|
|
28108
|
+
ratingValue: r.reviewRating.ratingValue,
|
|
28109
|
+
bestRating: r.reviewRating.bestRating || 5
|
|
28110
|
+
}
|
|
28111
|
+
}))
|
|
28112
|
+
};
|
|
28113
|
+
}
|
|
28114
|
+
function generateSoftwareApplicationSchema(data) {
|
|
28115
|
+
const offers = Array.isArray(data.offers) ? data.offers : [data.offers];
|
|
28116
|
+
return {
|
|
28117
|
+
"@context": "https://schema.org",
|
|
28118
|
+
"@type": "SoftwareApplication",
|
|
28119
|
+
name: data.name,
|
|
28120
|
+
description: data.description,
|
|
28121
|
+
applicationCategory: data.applicationCategory,
|
|
28122
|
+
operatingSystem: data.operatingSystem || "Web",
|
|
28123
|
+
offers: offers.map((o) => ({
|
|
28124
|
+
"@type": "Offer",
|
|
28125
|
+
price: o.price,
|
|
28126
|
+
priceCurrency: o.priceCurrency || "USD"
|
|
28127
|
+
})),
|
|
28128
|
+
aggregateRating: data.aggregateRating ? {
|
|
28129
|
+
"@type": "AggregateRating",
|
|
28130
|
+
ratingValue: data.aggregateRating.ratingValue,
|
|
28131
|
+
reviewCount: data.aggregateRating.reviewCount,
|
|
28132
|
+
bestRating: data.aggregateRating.bestRating || 5
|
|
28133
|
+
} : void 0,
|
|
28134
|
+
screenshot: data.screenshot,
|
|
28135
|
+
featureList: data.featureList
|
|
28136
|
+
};
|
|
28137
|
+
}
|
|
28138
|
+
function generateFAQSchema(data) {
|
|
28139
|
+
return {
|
|
28140
|
+
"@context": "https://schema.org",
|
|
28141
|
+
"@type": "FAQPage",
|
|
28142
|
+
mainEntity: data.questions.map((q) => ({
|
|
28143
|
+
"@type": "Question",
|
|
28144
|
+
name: q.question,
|
|
28145
|
+
acceptedAnswer: {
|
|
28146
|
+
"@type": "Answer",
|
|
28147
|
+
text: q.answer
|
|
28148
|
+
}
|
|
28149
|
+
}))
|
|
28150
|
+
};
|
|
28151
|
+
}
|
|
28152
|
+
function generateHowToSchema(data) {
|
|
28153
|
+
return {
|
|
28154
|
+
"@context": "https://schema.org",
|
|
28155
|
+
"@type": "HowTo",
|
|
28156
|
+
name: data.name,
|
|
28157
|
+
description: data.description,
|
|
28158
|
+
image: data.image,
|
|
28159
|
+
totalTime: data.totalTime,
|
|
28160
|
+
estimatedCost: data.estimatedCost ? {
|
|
28161
|
+
"@type": "MonetaryAmount",
|
|
28162
|
+
currency: data.estimatedCost.currency,
|
|
28163
|
+
value: data.estimatedCost.value
|
|
28164
|
+
} : void 0,
|
|
28165
|
+
supply: data.supply?.map((s) => ({
|
|
28166
|
+
"@type": "HowToSupply",
|
|
28167
|
+
name: s
|
|
28168
|
+
})),
|
|
28169
|
+
tool: data.tool?.map((t) => ({
|
|
28170
|
+
"@type": "HowToTool",
|
|
28171
|
+
name: t
|
|
28172
|
+
})),
|
|
28173
|
+
step: data.steps.map((step, i) => ({
|
|
28174
|
+
"@type": "HowToStep",
|
|
28175
|
+
position: i + 1,
|
|
28176
|
+
name: step.name,
|
|
28177
|
+
text: step.text,
|
|
28178
|
+
image: step.image,
|
|
28179
|
+
url: step.url
|
|
28180
|
+
}))
|
|
28181
|
+
};
|
|
28182
|
+
}
|
|
28183
|
+
function generateVideoSchema(data) {
|
|
28184
|
+
const stats = data.interactionStatistic;
|
|
28185
|
+
return {
|
|
28186
|
+
"@context": "https://schema.org",
|
|
28187
|
+
"@type": "VideoObject",
|
|
28188
|
+
name: data.name,
|
|
28189
|
+
description: data.description,
|
|
28190
|
+
thumbnailUrl: data.thumbnailUrl,
|
|
28191
|
+
uploadDate: data.uploadDate,
|
|
28192
|
+
duration: data.duration,
|
|
28193
|
+
contentUrl: data.contentUrl,
|
|
28194
|
+
embedUrl: data.embedUrl,
|
|
28195
|
+
interactionStatistic: stats ? [
|
|
28196
|
+
stats.watchCount ? {
|
|
28197
|
+
"@type": "InteractionCounter",
|
|
28198
|
+
interactionType: { "@type": "WatchAction" },
|
|
28199
|
+
userInteractionCount: stats.watchCount
|
|
28200
|
+
} : null,
|
|
28201
|
+
stats.likeCount ? {
|
|
28202
|
+
"@type": "InteractionCounter",
|
|
28203
|
+
interactionType: { "@type": "LikeAction" },
|
|
28204
|
+
userInteractionCount: stats.likeCount
|
|
28205
|
+
} : null,
|
|
28206
|
+
stats.commentCount ? {
|
|
28207
|
+
"@type": "InteractionCounter",
|
|
28208
|
+
interactionType: { "@type": "CommentAction" },
|
|
28209
|
+
userInteractionCount: stats.commentCount
|
|
28210
|
+
} : null
|
|
28211
|
+
].filter(Boolean) : void 0,
|
|
28212
|
+
publication: data.publication ? {
|
|
28213
|
+
"@type": "BroadcastEvent",
|
|
28214
|
+
isLiveBroadcast: data.publication.isLiveBroadcast,
|
|
28215
|
+
startDate: data.publication.startDate,
|
|
28216
|
+
endDate: data.publication.endDate
|
|
28217
|
+
} : void 0
|
|
28218
|
+
};
|
|
28219
|
+
}
|
|
28220
|
+
function generateEventSchema(data) {
|
|
28221
|
+
return {
|
|
28222
|
+
"@context": "https://schema.org",
|
|
28223
|
+
"@type": "Event",
|
|
28224
|
+
name: data.name,
|
|
28225
|
+
description: data.description,
|
|
28226
|
+
startDate: data.startDate,
|
|
28227
|
+
endDate: data.endDate,
|
|
28228
|
+
image: data.image,
|
|
28229
|
+
eventStatus: data.eventStatus ? `https://schema.org/${data.eventStatus}` : void 0,
|
|
28230
|
+
eventAttendanceMode: data.eventAttendanceMode ? `https://schema.org/${data.eventAttendanceMode}` : void 0,
|
|
28231
|
+
location: data.location.type === "VirtualLocation" ? {
|
|
28232
|
+
"@type": "VirtualLocation",
|
|
28233
|
+
url: data.location.url
|
|
28234
|
+
} : {
|
|
28235
|
+
"@type": "Place",
|
|
28236
|
+
name: data.location.name,
|
|
28237
|
+
address: data.location.address ? {
|
|
28238
|
+
"@type": "PostalAddress",
|
|
28239
|
+
...data.location.address
|
|
28240
|
+
} : void 0
|
|
28241
|
+
},
|
|
28242
|
+
performer: data.performer?.map((p) => ({
|
|
28243
|
+
"@type": "Person",
|
|
28244
|
+
name: p.name,
|
|
28245
|
+
url: p.url
|
|
28246
|
+
})),
|
|
28247
|
+
organizer: data.organizer ? {
|
|
28248
|
+
"@type": "Organization",
|
|
28249
|
+
name: data.organizer.name,
|
|
28250
|
+
url: data.organizer.url
|
|
28251
|
+
} : void 0,
|
|
28252
|
+
offers: data.offers?.map((o) => ({
|
|
28253
|
+
"@type": "Offer",
|
|
28254
|
+
price: o.price,
|
|
28255
|
+
priceCurrency: o.priceCurrency || "USD",
|
|
28256
|
+
availability: `https://schema.org/${o.availability || "InStock"}`,
|
|
28257
|
+
url: o.url,
|
|
28258
|
+
validFrom: o.priceValidUntil
|
|
28259
|
+
}))
|
|
28260
|
+
};
|
|
28261
|
+
}
|
|
28262
|
+
function generateLocalBusinessSchema(data) {
|
|
28263
|
+
return {
|
|
28264
|
+
"@context": "https://schema.org",
|
|
28265
|
+
"@type": "LocalBusiness",
|
|
28266
|
+
name: data.name,
|
|
28267
|
+
description: data.description,
|
|
28268
|
+
url: data.url,
|
|
28269
|
+
telephone: data.telephone,
|
|
28270
|
+
image: data.image,
|
|
28271
|
+
priceRange: data.priceRange,
|
|
28272
|
+
servesCuisine: data.servesCuisine,
|
|
28273
|
+
menu: data.menu,
|
|
28274
|
+
address: {
|
|
28275
|
+
"@type": "PostalAddress",
|
|
28276
|
+
streetAddress: data.address.streetAddress,
|
|
28277
|
+
addressLocality: data.address.addressLocality,
|
|
28278
|
+
addressRegion: data.address.addressRegion,
|
|
28279
|
+
postalCode: data.address.postalCode,
|
|
28280
|
+
addressCountry: data.address.addressCountry
|
|
28281
|
+
},
|
|
28282
|
+
geo: data.geo ? {
|
|
28283
|
+
"@type": "GeoCoordinates",
|
|
28284
|
+
latitude: data.geo.latitude,
|
|
28285
|
+
longitude: data.geo.longitude
|
|
28286
|
+
} : void 0,
|
|
28287
|
+
openingHoursSpecification: data.openingHours?.map(parseOpeningHours).filter(Boolean),
|
|
28288
|
+
aggregateRating: data.aggregateRating ? {
|
|
28289
|
+
"@type": "AggregateRating",
|
|
28290
|
+
ratingValue: data.aggregateRating.ratingValue,
|
|
28291
|
+
reviewCount: data.aggregateRating.reviewCount,
|
|
28292
|
+
bestRating: data.aggregateRating.bestRating || 5
|
|
28293
|
+
} : void 0,
|
|
28294
|
+
review: data.review?.map((r) => ({
|
|
28295
|
+
"@type": "Review",
|
|
28296
|
+
author: { "@type": "Person", name: r.author },
|
|
28297
|
+
datePublished: r.datePublished,
|
|
28298
|
+
reviewBody: r.reviewBody,
|
|
28299
|
+
reviewRating: {
|
|
28300
|
+
"@type": "Rating",
|
|
28301
|
+
ratingValue: r.reviewRating.ratingValue
|
|
28302
|
+
}
|
|
28303
|
+
}))
|
|
28304
|
+
};
|
|
28305
|
+
}
|
|
28306
|
+
function parseOpeningHours(hours) {
|
|
28307
|
+
const match = hours.match(/^([A-Za-z,-]+)\s+(\d{2}:\d{2})-(\d{2}:\d{2})$/);
|
|
28308
|
+
if (!match) return null;
|
|
28309
|
+
const dayMap = {
|
|
28310
|
+
"Mo": "Monday",
|
|
28311
|
+
"Tu": "Tuesday",
|
|
28312
|
+
"We": "Wednesday",
|
|
28313
|
+
"Th": "Thursday",
|
|
28314
|
+
"Fr": "Friday",
|
|
28315
|
+
"Sa": "Saturday",
|
|
28316
|
+
"Su": "Sunday"
|
|
28317
|
+
};
|
|
28318
|
+
const dayPart = match[1];
|
|
28319
|
+
const opens = match[2];
|
|
28320
|
+
const closes = match[3];
|
|
28321
|
+
if (dayPart.includes("-")) {
|
|
28322
|
+
const [start, end] = dayPart.split("-");
|
|
28323
|
+
const days = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"];
|
|
28324
|
+
const startIdx = days.indexOf(start);
|
|
28325
|
+
const endIdx = days.indexOf(end);
|
|
28326
|
+
const dayOfWeek = days.slice(startIdx, endIdx + 1).map((d) => dayMap[d]);
|
|
28327
|
+
return { "@type": "OpeningHoursSpecification", dayOfWeek, opens, closes };
|
|
28328
|
+
}
|
|
28329
|
+
return {
|
|
28330
|
+
"@type": "OpeningHoursSpecification",
|
|
28331
|
+
dayOfWeek: dayPart.split(",").map((d) => dayMap[d.trim()]),
|
|
28332
|
+
opens,
|
|
28333
|
+
closes
|
|
28334
|
+
};
|
|
28335
|
+
}
|
|
28336
|
+
function generateBreadcrumbSchema(data) {
|
|
28337
|
+
return {
|
|
28338
|
+
"@context": "https://schema.org",
|
|
28339
|
+
"@type": "BreadcrumbList",
|
|
28340
|
+
itemListElement: data.items.map((item, index) => ({
|
|
28341
|
+
"@type": "ListItem",
|
|
28342
|
+
position: index + 1,
|
|
28343
|
+
name: item.name,
|
|
28344
|
+
item: item.url
|
|
28345
|
+
}))
|
|
28346
|
+
};
|
|
28347
|
+
}
|
|
28348
|
+
function generateJobPostingSchema(data) {
|
|
28349
|
+
return {
|
|
28350
|
+
"@context": "https://schema.org",
|
|
28351
|
+
"@type": "JobPosting",
|
|
28352
|
+
title: data.title,
|
|
28353
|
+
description: data.description,
|
|
28354
|
+
datePosted: data.datePosted,
|
|
28355
|
+
validThrough: data.validThrough,
|
|
28356
|
+
employmentType: data.employmentType,
|
|
28357
|
+
hiringOrganization: {
|
|
28358
|
+
"@type": "Organization",
|
|
28359
|
+
name: data.hiringOrganization.name,
|
|
28360
|
+
sameAs: data.hiringOrganization.url,
|
|
28361
|
+
logo: data.hiringOrganization.logo
|
|
28362
|
+
},
|
|
28363
|
+
jobLocation: data.jobLocation ? {
|
|
28364
|
+
"@type": "Place",
|
|
28365
|
+
address: {
|
|
28366
|
+
"@type": "PostalAddress",
|
|
28367
|
+
...data.jobLocation.address
|
|
28368
|
+
}
|
|
28369
|
+
} : void 0,
|
|
28370
|
+
jobLocationType: data.jobLocationType,
|
|
28371
|
+
baseSalary: data.baseSalary ? {
|
|
28372
|
+
"@type": "MonetaryAmount",
|
|
28373
|
+
currency: data.baseSalary.currency,
|
|
28374
|
+
value: typeof data.baseSalary.value === "number" ? {
|
|
28375
|
+
"@type": "QuantitativeValue",
|
|
28376
|
+
value: data.baseSalary.value,
|
|
28377
|
+
unitText: data.baseSalary.unitText
|
|
28378
|
+
} : {
|
|
28379
|
+
"@type": "QuantitativeValue",
|
|
28380
|
+
minValue: data.baseSalary.value.minValue,
|
|
28381
|
+
maxValue: data.baseSalary.value.maxValue,
|
|
28382
|
+
unitText: data.baseSalary.unitText
|
|
28383
|
+
}
|
|
28384
|
+
} : void 0,
|
|
28385
|
+
experienceRequirements: data.experienceRequirements,
|
|
28386
|
+
educationRequirements: data.educationRequirements ? {
|
|
28387
|
+
"@type": "EducationalOccupationalCredential",
|
|
28388
|
+
credentialCategory: data.educationRequirements
|
|
28389
|
+
} : void 0,
|
|
28390
|
+
skills: data.skills
|
|
28391
|
+
};
|
|
28392
|
+
}
|
|
28393
|
+
function generateCourseSchema(data) {
|
|
28394
|
+
return {
|
|
28395
|
+
"@context": "https://schema.org",
|
|
28396
|
+
"@type": "Course",
|
|
28397
|
+
name: data.name,
|
|
28398
|
+
description: data.description,
|
|
28399
|
+
provider: {
|
|
28400
|
+
"@type": "Organization",
|
|
28401
|
+
name: data.provider.name,
|
|
28402
|
+
sameAs: data.provider.url
|
|
28403
|
+
},
|
|
28404
|
+
offers: data.offers ? {
|
|
28405
|
+
"@type": "Offer",
|
|
28406
|
+
price: data.offers.price,
|
|
28407
|
+
priceCurrency: data.offers.priceCurrency || "USD",
|
|
28408
|
+
availability: `https://schema.org/${data.offers.availability || "InStock"}`
|
|
28409
|
+
} : void 0,
|
|
28410
|
+
coursePrerequisites: data.coursePrerequisites,
|
|
28411
|
+
educationalLevel: data.educationalLevel,
|
|
28412
|
+
timeRequired: data.timeRequired,
|
|
28413
|
+
image: data.image,
|
|
28414
|
+
aggregateRating: data.aggregateRating ? {
|
|
28415
|
+
"@type": "AggregateRating",
|
|
28416
|
+
ratingValue: data.aggregateRating.ratingValue,
|
|
28417
|
+
reviewCount: data.aggregateRating.reviewCount
|
|
28418
|
+
} : void 0
|
|
28419
|
+
};
|
|
28420
|
+
}
|
|
28421
|
+
function generateRecipeSchema(data) {
|
|
28422
|
+
return {
|
|
28423
|
+
"@context": "https://schema.org",
|
|
28424
|
+
"@type": "Recipe",
|
|
28425
|
+
name: data.name,
|
|
28426
|
+
description: data.description,
|
|
28427
|
+
image: data.image,
|
|
28428
|
+
author: {
|
|
28429
|
+
"@type": "Person",
|
|
28430
|
+
name: data.author.name,
|
|
28431
|
+
url: data.author.url
|
|
28432
|
+
},
|
|
28433
|
+
datePublished: data.datePublished,
|
|
28434
|
+
prepTime: data.prepTime,
|
|
28435
|
+
cookTime: data.cookTime,
|
|
28436
|
+
totalTime: data.totalTime,
|
|
28437
|
+
recipeYield: data.recipeYield,
|
|
28438
|
+
recipeCategory: data.recipeCategory,
|
|
28439
|
+
recipeCuisine: data.recipeCuisine,
|
|
28440
|
+
recipeIngredient: data.recipeIngredient,
|
|
28441
|
+
recipeInstructions: data.recipeInstructions.map((step, i) => ({
|
|
28442
|
+
"@type": "HowToStep",
|
|
28443
|
+
position: i + 1,
|
|
28444
|
+
name: step.name,
|
|
28445
|
+
text: step.text
|
|
28446
|
+
})),
|
|
28447
|
+
nutrition: data.nutrition ? {
|
|
28448
|
+
"@type": "NutritionInformation",
|
|
28449
|
+
calories: data.nutrition.calories,
|
|
28450
|
+
fatContent: data.nutrition.fatContent,
|
|
28451
|
+
proteinContent: data.nutrition.proteinContent,
|
|
28452
|
+
carbohydrateContent: data.nutrition.carbohydrateContent
|
|
28453
|
+
} : void 0,
|
|
28454
|
+
aggregateRating: data.aggregateRating ? {
|
|
28455
|
+
"@type": "AggregateRating",
|
|
28456
|
+
ratingValue: data.aggregateRating.ratingValue,
|
|
28457
|
+
reviewCount: data.aggregateRating.reviewCount
|
|
28458
|
+
} : void 0,
|
|
28459
|
+
video: data.video ? generateVideoSchema(data.video) : void 0
|
|
28460
|
+
};
|
|
28461
|
+
}
|
|
28462
|
+
function generateBookSchema(data) {
|
|
28463
|
+
const authors = Array.isArray(data.author) ? data.author : [data.author];
|
|
28464
|
+
return {
|
|
28465
|
+
"@context": "https://schema.org",
|
|
28466
|
+
"@type": "Book",
|
|
28467
|
+
name: data.name,
|
|
28468
|
+
description: data.description,
|
|
28469
|
+
author: authors.map((a) => ({
|
|
28470
|
+
"@type": "Person",
|
|
28471
|
+
name: a.name,
|
|
28472
|
+
url: a.url
|
|
28473
|
+
})),
|
|
28474
|
+
isbn: data.isbn,
|
|
28475
|
+
numberOfPages: data.numberOfPages,
|
|
28476
|
+
bookFormat: data.bookFormat ? `https://schema.org/${data.bookFormat}` : void 0,
|
|
28477
|
+
publisher: data.publisher ? {
|
|
28478
|
+
"@type": "Organization",
|
|
28479
|
+
name: data.publisher
|
|
28480
|
+
} : void 0,
|
|
28481
|
+
datePublished: data.datePublished,
|
|
28482
|
+
image: data.image,
|
|
28483
|
+
inLanguage: data.inLanguage,
|
|
28484
|
+
aggregateRating: data.aggregateRating ? {
|
|
28485
|
+
"@type": "AggregateRating",
|
|
28486
|
+
ratingValue: data.aggregateRating.ratingValue,
|
|
28487
|
+
reviewCount: data.aggregateRating.reviewCount
|
|
28488
|
+
} : void 0,
|
|
28489
|
+
offers: data.offers ? {
|
|
28490
|
+
"@type": "Offer",
|
|
28491
|
+
price: data.offers.price,
|
|
28492
|
+
priceCurrency: data.offers.priceCurrency || "USD",
|
|
28493
|
+
availability: `https://schema.org/${data.offers.availability || "InStock"}`
|
|
28494
|
+
} : void 0
|
|
28495
|
+
};
|
|
28496
|
+
}
|
|
28497
|
+
function generateSpeakableSchema(data) {
|
|
28498
|
+
return {
|
|
28499
|
+
"@context": "https://schema.org",
|
|
28500
|
+
"@type": "WebPage",
|
|
28501
|
+
speakable: {
|
|
28502
|
+
"@type": "SpeakableSpecification",
|
|
28503
|
+
cssSelector: data.cssSelector,
|
|
28504
|
+
xpath: data.xpath
|
|
28505
|
+
},
|
|
28506
|
+
url: data.url
|
|
28507
|
+
};
|
|
28508
|
+
}
|
|
28509
|
+
function generateSitelinksSearchboxSchema(data) {
|
|
28510
|
+
return {
|
|
28511
|
+
"@context": "https://schema.org",
|
|
28512
|
+
"@type": "WebSite",
|
|
28513
|
+
url: data.url,
|
|
28514
|
+
potentialAction: {
|
|
28515
|
+
"@type": "SearchAction",
|
|
28516
|
+
target: {
|
|
28517
|
+
"@type": "EntryPoint",
|
|
28518
|
+
urlTemplate: data.searchUrl
|
|
28519
|
+
},
|
|
28520
|
+
"query-input": data.queryInput || "required name=search_term_string"
|
|
28521
|
+
}
|
|
28522
|
+
};
|
|
28523
|
+
}
|
|
28524
|
+
var Schemas = {
|
|
28525
|
+
organization: generateOrganizationSchema,
|
|
28526
|
+
webSite: generateWebSiteSchema,
|
|
28527
|
+
article: generateArticleSchema,
|
|
28528
|
+
blogPosting: generateBlogPostingSchema,
|
|
28529
|
+
newsArticle: generateNewsArticleSchema,
|
|
28530
|
+
product: generateProductSchema,
|
|
28531
|
+
softwareApplication: generateSoftwareApplicationSchema,
|
|
28532
|
+
faq: generateFAQSchema,
|
|
28533
|
+
howTo: generateHowToSchema,
|
|
28534
|
+
video: generateVideoSchema,
|
|
28535
|
+
event: generateEventSchema,
|
|
28536
|
+
localBusiness: generateLocalBusinessSchema,
|
|
28537
|
+
breadcrumb: generateBreadcrumbSchema,
|
|
28538
|
+
jobPosting: generateJobPostingSchema,
|
|
28539
|
+
course: generateCourseSchema,
|
|
28540
|
+
recipe: generateRecipeSchema,
|
|
28541
|
+
book: generateBookSchema,
|
|
28542
|
+
speakable: generateSpeakableSchema,
|
|
28543
|
+
sitelinksSearchbox: generateSitelinksSearchboxSchema
|
|
28544
|
+
};
|
|
28545
|
+
|
|
27964
28546
|
// src/git/commit-helper.ts
|
|
27965
28547
|
import { execSync, exec as exec2 } from "child_process";
|
|
27966
28548
|
import { promisify as promisify2 } from "util";
|
|
@@ -29598,7 +30180,7 @@ function generateKeyFacts(facts, options = {}) {
|
|
|
29598
30180
|
return formatted.join("\n");
|
|
29599
30181
|
}
|
|
29600
30182
|
}
|
|
29601
|
-
function
|
|
30183
|
+
function generateFAQSchema2(faqs, options = {}) {
|
|
29602
30184
|
const format = options.format || "json-ld";
|
|
29603
30185
|
if (format === "markdown") {
|
|
29604
30186
|
const lines = ["## FAQ", ""];
|
|
@@ -29681,7 +30263,7 @@ function generateAICitableContent(config) {
|
|
|
29681
30263
|
sections.push("");
|
|
29682
30264
|
}
|
|
29683
30265
|
if (config.faqs && config.faqs.length > 0) {
|
|
29684
|
-
sections.push(
|
|
30266
|
+
sections.push(generateFAQSchema2(config.faqs, { format: "markdown" }));
|
|
29685
30267
|
sections.push("");
|
|
29686
30268
|
}
|
|
29687
30269
|
return sections.join("\n").trim();
|
|
@@ -30522,6 +31104,7 @@ export {
|
|
|
30522
31104
|
PRIORITY_WEIGHTS,
|
|
30523
31105
|
SEO_SCOPES,
|
|
30524
31106
|
SITE_PROFILE_QUESTIONS,
|
|
31107
|
+
Schemas,
|
|
30525
31108
|
addTrackingResult,
|
|
30526
31109
|
analyzeAnchorText,
|
|
30527
31110
|
analyzeCanonicalAdvanced,
|
|
@@ -30667,7 +31250,7 @@ export {
|
|
|
30667
31250
|
generateComparisonTable,
|
|
30668
31251
|
generateCompleteSocialMetaSetup,
|
|
30669
31252
|
generateDuplicateIssues,
|
|
30670
|
-
generateFAQSchema,
|
|
31253
|
+
generateFAQSchema2 as generateFAQSchema,
|
|
30671
31254
|
generateFixes,
|
|
30672
31255
|
generateGA4EnvTemplate,
|
|
30673
31256
|
generateGA4ReactComponent,
|
package/package.json
CHANGED
package/src/fixer/index.ts
CHANGED