@studyportals/fawkes 8.0.1-5 → 8.0.1-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.
- package/dist/src/organisations/policies/RankedOrganisationsSeoIndexabilityPolicy.js +3 -3
- package/dist/src/organisations/rules/AtLeastSevenRankedResultsRule.d.ts +13 -0
- package/dist/src/organisations/rules/AtLeastSevenRankedResultsRule.js +26 -0
- package/dist/src/organisations/rules/AtLeastSevenResultsRule.js +1 -1
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PortalType } from '@studyportals/domain-client';
|
|
2
2
|
import { SortingOptions } from '../../enums/SortingOptions';
|
|
3
3
|
import { OrganisationsSeoIndexabilityPolicy } from './OrganisationsSeoIndexabilityPolicy';
|
|
4
|
-
import {
|
|
4
|
+
import { AtLeastSevenRankedResultsRule } from '../rules/AtLeastSevenRankedResultsRule';
|
|
5
5
|
export class RankedOrganisationsSeoIndexabilityPolicy extends OrganisationsSeoIndexabilityPolicy {
|
|
6
6
|
indexablePortalTypes = [PortalType.MASTER];
|
|
7
7
|
sortingOption = SortingOptions.UNIVERSITY_META_RANKING;
|
|
@@ -9,10 +9,10 @@ export class RankedOrganisationsSeoIndexabilityPolicy extends OrganisationsSeoIn
|
|
|
9
9
|
let rankedResultsCountRule;
|
|
10
10
|
if (super.isSitemapUrlGeneratorDependencies()) {
|
|
11
11
|
const dependencies = this.dependencies;
|
|
12
|
-
rankedResultsCountRule = new
|
|
12
|
+
rankedResultsCountRule = new AtLeastSevenRankedResultsRule(dependencies.rankingApiClient);
|
|
13
13
|
}
|
|
14
14
|
else {
|
|
15
|
-
rankedResultsCountRule = new
|
|
15
|
+
rankedResultsCountRule = new AtLeastSevenRankedResultsRule();
|
|
16
16
|
}
|
|
17
17
|
this.addRule(rankedResultsCountRule);
|
|
18
18
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IRule } from '../../common/IRule';
|
|
2
|
+
import { IOrganisationSearchDependencies } from '../types/IOrganisationSearchDependencies';
|
|
3
|
+
import { FilterKeyValuesMap } from '../../common/FilterKeyValuesMap';
|
|
4
|
+
import { IRankingApiClient } from '../../sitemap-generator/IRankingApiClient';
|
|
5
|
+
export declare class AtLeastSevenRankedResultsRule implements IRule {
|
|
6
|
+
private readonly minimumRankedResultsCount;
|
|
7
|
+
private readonly rankingApiClient?;
|
|
8
|
+
constructor(rankingApiClient?: IRankingApiClient);
|
|
9
|
+
forSearch(dependencies: IOrganisationSearchDependencies): Promise<boolean>;
|
|
10
|
+
forSitemapGenerator(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
|
|
11
|
+
getName(): string;
|
|
12
|
+
getDescription(): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DependencyMissingError } from '../../errors/DependencyMissingError';
|
|
2
|
+
export class AtLeastSevenRankedResultsRule {
|
|
3
|
+
minimumRankedResultsCount = 7;
|
|
4
|
+
rankingApiClient;
|
|
5
|
+
constructor(rankingApiClient) {
|
|
6
|
+
this.rankingApiClient = rankingApiClient;
|
|
7
|
+
}
|
|
8
|
+
forSearch(dependencies) {
|
|
9
|
+
const { applicationState } = dependencies;
|
|
10
|
+
const rankedResultsCount = applicationState.getRankedResultsCount();
|
|
11
|
+
return Promise.resolve(rankedResultsCount >= this.minimumRankedResultsCount);
|
|
12
|
+
}
|
|
13
|
+
async forSitemapGenerator(filterKeyValues) {
|
|
14
|
+
if (!this.rankingApiClient) {
|
|
15
|
+
throw new DependencyMissingError('RankingApiClient');
|
|
16
|
+
}
|
|
17
|
+
const rankedResultsCount = await this.rankingApiClient.getRankedOrganisationCount(filterKeyValues);
|
|
18
|
+
return rankedResultsCount >= this.minimumRankedResultsCount;
|
|
19
|
+
}
|
|
20
|
+
getName() {
|
|
21
|
+
return 'AtLeastTwoRankedResultsRule';
|
|
22
|
+
}
|
|
23
|
+
getDescription() {
|
|
24
|
+
return `At least ${this.minimumRankedResultsCount} ranked results are available`;
|
|
25
|
+
}
|
|
26
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studyportals/fawkes",
|
|
3
|
-
"version": "8.0.1-
|
|
3
|
+
"version": "8.0.1-6",
|
|
4
4
|
"description": "A package to centralize SEO related logic for SBLP and Sitemap Generator.",
|
|
5
5
|
"files": [
|
|
6
6
|
"./dist"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"compile": "npx tsc && tsc-alias && rm -r ./dist/tests",
|
|
12
12
|
"build": "npm run clean && npm run compile",
|
|
13
13
|
"clean": "rimraf \"!(node_modules)/**/dist\"",
|
|
14
|
-
"prepare-deployment": "npm run build",
|
|
14
|
+
"prepare-deployment": "npm run test && npm run build",
|
|
15
15
|
"publish-major": "npm run prepare-deployment && npm version major && npm publish",
|
|
16
16
|
"publish-beta": "npm run prepare-deployment && npm version prerelease && npm publish --tag beta --access=public",
|
|
17
17
|
"publish-patch": "npm run prepare-deployment && npm version patch && npm publish",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@studyportals/domain-client": "^6.3.0",
|
|
94
94
|
"@studyportals/ranking-api-interface": "^1.3.12",
|
|
95
|
-
"@studyportals/search-filters": "^6.
|
|
95
|
+
"@studyportals/search-filters": "^6.1.0",
|
|
96
96
|
"@studyportals/static-domain-data": "^6.1.0"
|
|
97
97
|
},
|
|
98
98
|
"optionalDependencies": {
|