@studyportals/fawkes 8.1.3-4 → 8.1.3-6
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SearchResultsPage, WithContext, Offer, AggregateRating, Thing, FAQPage } from 'schema-dts';
|
|
1
|
+
import { SearchResultsPage, WithContext, Offer, AggregateRating, Thing, FAQPage, WebPage } from 'schema-dts';
|
|
2
2
|
import { ReviewRatingDTO } from './dto/ReviewRatingDTO';
|
|
3
3
|
import { OfferDTO } from './dto/OfferDTO';
|
|
4
4
|
import { EntityDTO } from './dto/EntityDTO';
|
|
@@ -6,7 +6,7 @@ import { FAQItemDto } from './dto/FAQItemDto';
|
|
|
6
6
|
import { BreadcrumbDTO } from './dto/BreadcrumbDTO';
|
|
7
7
|
import { PaywallDTO } from './dto/PaywallDTO';
|
|
8
8
|
export declare abstract class SearchStructuredDataFactory<TCard> {
|
|
9
|
-
buildStructuredData(title: string, description: string, cards: TCard[], faqItems?: FAQItemDto[], breadcrumbs?: BreadcrumbDTO[], listItemStructure?: boolean): Promise<WithContext<SearchResultsPage>>;
|
|
9
|
+
buildStructuredData(title: string, description: string, cards: TCard[], faqItems?: FAQItemDto[], breadcrumbs?: BreadcrumbDTO[], listItemStructure?: boolean): Promise<WithContext<SearchResultsPage | WebPage>>;
|
|
10
10
|
private generateMainEntities;
|
|
11
11
|
protected abstract buildStructuredDataForCard(entity: EntityDTO<TCard>): Promise<Thing | undefined> | Thing | undefined;
|
|
12
12
|
/**
|
|
@@ -15,7 +15,7 @@ export class SearchStructuredDataFactory {
|
|
|
15
15
|
const mainEntities = await this.generateMainEntities(entities, listItemStructure);
|
|
16
16
|
const data = {
|
|
17
17
|
'@context': 'https://schema.org',
|
|
18
|
-
'@type': 'SearchResultsPage',
|
|
18
|
+
'@type': !listItemStructure ? 'SearchResultsPage' : 'WebPage',
|
|
19
19
|
'name': title,
|
|
20
20
|
description,
|
|
21
21
|
'mainEntity': mainEntities
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studyportals/fawkes",
|
|
3
|
-
"version": "8.1.3-
|
|
3
|
+
"version": "8.1.3-6",
|
|
4
4
|
"description": "A package to centralize SEO related logic for SBLP and Sitemap Generator.",
|
|
5
5
|
"files": [
|
|
6
6
|
"./dist"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"publish-patch": "npm run prepare-deployment && npm version patch && npm publish",
|
|
18
18
|
"publish-minor": "npm run prepare-deployment && npm version minor && npm publish",
|
|
19
19
|
"prepare": "husky install",
|
|
20
|
-
"test": "",
|
|
20
|
+
"test": "vitest run --coverage",
|
|
21
21
|
"test:dev": "vitest --coverage tests/programmes",
|
|
22
22
|
"lint": "eslint . --ext .ts",
|
|
23
23
|
"lint:fix": "eslint . --ext .ts --fix",
|