@studyportals/fawkes 8.7.2-1 → 8.7.2-3
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/sitemap-generator-seo/index.d.ts +0 -1
- package/dist/src/common/FilterKeyToFilterTypeMap.d.ts +2 -0
- package/dist/src/common/FilterKeyToFilterTypeMap.js +14 -0
- package/dist/src/common/FilterTypeMap.d.ts +2 -0
- package/dist/src/common/FilterTypeMap.js +1 -0
- package/dist/src/organisations/policies/RankedOrganisationsSeoIndexabilityPolicy.js +1 -1
- package/dist/src/organisations/policies/ranked/RankedArea.js +1 -1
- package/dist/src/organisations/policies/ranked/RankedAttendance.js +3 -1
- package/dist/src/organisations/policies/ranked/RankedAttendanceDiscipline.js +1 -1
- package/dist/src/organisations/policies/ranked/RankedContinent.js +3 -1
- package/dist/src/organisations/policies/ranked/RankedContinentAttendance.js +1 -1
- package/dist/src/organisations/policies/ranked/RankedCountry.js +3 -1
- package/dist/src/organisations/policies/ranked/RankedCountryDiscipline.js +1 -1
- package/dist/src/organisations/policies/ranked/RankedDiscipline.js +3 -1
- package/dist/src/organisations/rules/MinimumAmountOfRankedResultsRule.d.ts +3 -4
- package/dist/src/organisations/rules/MinimumAmountOfRankedResultsRule.js +6 -6
- package/dist/src/organisations/types/IOrganisationsSitemapDependencies.d.ts +0 -2
- package/dist/src/sitemap-generator/ISearchApiClient.d.ts +1 -1
- package/dist/src/sitemap-generator/OrganisationsSitemapUrlGeneratorManager.d.ts +1 -2
- package/dist/src/sitemap-generator/OrganisationsSitemapUrlGeneratorManager.js +1 -2
- package/package.json +2 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { IOrganisationsClient } from '../src/sitemap-generator/IOrganisationsClient';
|
|
2
2
|
export { IOrganisation } from '../src/sitemap-generator/IOrganisation';
|
|
3
|
-
export { IRankingApiClient } from '../src/sitemap-generator/IRankingApiClient';
|
|
4
3
|
export { ISearchApiClient } from '../src/sitemap-generator/ISearchApiClient';
|
|
5
4
|
export { ISitemapUrlGeneratorManager } from '../src/sitemap-generator/ISitemapUrlGeneratorManager';
|
|
6
5
|
export { OrganisationsSitemapUrlGeneratorManager } from '../src/sitemap-generator/OrganisationsSitemapUrlGeneratorManager';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
2
|
+
import { FilterType } from '@studyportals/omnisearch-interfaces';
|
|
3
|
+
export const FILTER_KEY_TO_FILTER_TYPE_MAP = new Map([
|
|
4
|
+
[FilterKey.COUNTRY, FilterType.COUNTRY],
|
|
5
|
+
[FilterKey.DISCIPLINES, FilterType.DISCIPLINES],
|
|
6
|
+
[FilterKey.CITY, FilterType.CITY],
|
|
7
|
+
[FilterKey.AREA, FilterType.AREA],
|
|
8
|
+
[FilterKey.ATTENDANCE, FilterType.DENSITIES],
|
|
9
|
+
[FilterKey.DELIVERY_METHOD, FilterType.ATTENDANCE],
|
|
10
|
+
[FilterKey.CAMPAIGN_TYPE, FilterType.CAMPAIGN_TYPE],
|
|
11
|
+
[FilterKey.DEGREE_TYPE, FilterType.DEGREE_TYPE],
|
|
12
|
+
[FilterKey.KEYWORD, FilterType.KEYWORD],
|
|
13
|
+
[FilterKey.CONTINENT, FilterType.CONTINENT],
|
|
14
|
+
]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,7 +9,7 @@ export class RankedOrganisationsSeoIndexabilityPolicy extends OrganisationsSeoIn
|
|
|
9
9
|
let rankedResultsCountRule;
|
|
10
10
|
if (super.isSitemapUrlGeneratorDependencies()) {
|
|
11
11
|
const dependencies = this.dependencies;
|
|
12
|
-
rankedResultsCountRule = new MinimumAmountOfRankedResultsRule(dependencies.
|
|
12
|
+
rankedResultsCountRule = new MinimumAmountOfRankedResultsRule(dependencies.searchApiClient);
|
|
13
13
|
}
|
|
14
14
|
else {
|
|
15
15
|
rankedResultsCountRule = new MinimumAmountOfRankedResultsRule();
|
|
@@ -21,7 +21,7 @@ export class RankedArea extends RankedOrganisationsSeoIndexabilityPolicy {
|
|
|
21
21
|
for (const area of areaFragments) {
|
|
22
22
|
const filterKeyValues = new Map([
|
|
23
23
|
[FilterKey.AREA, [area.id]],
|
|
24
|
-
[FilterKey.COUNTRY, [area.countryId]]
|
|
24
|
+
[FilterKey.COUNTRY, [area.countryId]],
|
|
25
25
|
]);
|
|
26
26
|
const result = await this.checkRulesForSitemap(filterKeyValues);
|
|
27
27
|
if (result) {
|
|
@@ -20,7 +20,9 @@ export class RankedAttendance extends RankedOrganisationsSeoIndexabilityPolicy {
|
|
|
20
20
|
const attendanceFragments = AttendancePresenter.getInstance().getFragments();
|
|
21
21
|
const paths = [];
|
|
22
22
|
for (const attendance of attendanceFragments) {
|
|
23
|
-
const filterKeyValues = new Map([
|
|
23
|
+
const filterKeyValues = new Map([
|
|
24
|
+
[FilterKey.DELIVERY_METHOD, [attendance.id]],
|
|
25
|
+
]);
|
|
24
26
|
const result = await this.checkRulesForSitemap(filterKeyValues);
|
|
25
27
|
if (result) {
|
|
26
28
|
paths.push(this.getPathWithSortingOption(attendance.path));
|
|
@@ -29,7 +29,7 @@ export class RankedAttendanceDiscipline extends RankedOrganisationsSeoIndexabili
|
|
|
29
29
|
for (const discipline of disciplineFragments) {
|
|
30
30
|
const filterKeyValues = new Map([
|
|
31
31
|
[FilterKey.DELIVERY_METHOD, [attendance.id]],
|
|
32
|
-
[FilterKey.DISCIPLINES, [discipline.id]]
|
|
32
|
+
[FilterKey.DISCIPLINES, [discipline.id]],
|
|
33
33
|
]);
|
|
34
34
|
const result = await this.checkRulesForSitemap(filterKeyValues);
|
|
35
35
|
if (result) {
|
|
@@ -18,7 +18,9 @@ export class RankedContinent extends RankedOrganisationsSeoIndexabilityPolicy {
|
|
|
18
18
|
const continentFragments = ContinentPresenter.getInstance().getFragments();
|
|
19
19
|
const paths = [];
|
|
20
20
|
for (const continent of continentFragments) {
|
|
21
|
-
const filterKeyValues = new Map([
|
|
21
|
+
const filterKeyValues = new Map([
|
|
22
|
+
[FilterKey.CONTINENT, [continent.id]],
|
|
23
|
+
]);
|
|
22
24
|
const result = await this.checkRulesForSitemap(filterKeyValues);
|
|
23
25
|
if (result) {
|
|
24
26
|
paths.push(this.getPathWithSortingOption(continent.path));
|
|
@@ -28,7 +28,7 @@ export class RankedContinentAttendance extends RankedOrganisationsSeoIndexabilit
|
|
|
28
28
|
for (const attendance of attendanceFragments) {
|
|
29
29
|
const filterKeyValues = new Map([
|
|
30
30
|
[FilterKey.CONTINENT, [continent.id]],
|
|
31
|
-
[FilterKey.DELIVERY_METHOD, [attendance.id]]
|
|
31
|
+
[FilterKey.DELIVERY_METHOD, [attendance.id]],
|
|
32
32
|
]);
|
|
33
33
|
const result = await this.checkRulesForSitemap(filterKeyValues);
|
|
34
34
|
if (result) {
|
|
@@ -15,7 +15,9 @@ export class RankedCountry extends RankedOrganisationsSeoIndexabilityPolicy {
|
|
|
15
15
|
const countryFragments = CountryPresenter.getInstance().getFragments();
|
|
16
16
|
const paths = [];
|
|
17
17
|
for (const country of countryFragments) {
|
|
18
|
-
const filterKeyValues = new Map([
|
|
18
|
+
const filterKeyValues = new Map([
|
|
19
|
+
[FilterKey.COUNTRY, [country.id]],
|
|
20
|
+
]);
|
|
19
21
|
const result = await this.checkRulesForSitemap(filterKeyValues);
|
|
20
22
|
if (result) {
|
|
21
23
|
paths.push(this.getPathWithSortingOption(country.path));
|
|
@@ -24,7 +24,7 @@ export class RankedCountryDiscipline extends RankedOrganisationsSeoIndexabilityP
|
|
|
24
24
|
for (const discipline of disciplineFragments) {
|
|
25
25
|
const filterKeyValues = new Map([
|
|
26
26
|
[FilterKey.COUNTRY, [country.id]],
|
|
27
|
-
[FilterKey.DISCIPLINES, [discipline.id]]
|
|
27
|
+
[FilterKey.DISCIPLINES, [discipline.id]],
|
|
28
28
|
]);
|
|
29
29
|
const result = await this.checkRulesForSitemap(filterKeyValues);
|
|
30
30
|
if (result) {
|
|
@@ -18,7 +18,9 @@ export class RankedDiscipline extends RankedOrganisationsSeoIndexabilityPolicy {
|
|
|
18
18
|
const disciplineFragments = DisciplinePresenter.getInstance().getFragments();
|
|
19
19
|
const paths = [];
|
|
20
20
|
for (const discipline of disciplineFragments) {
|
|
21
|
-
const filterKeyValues = new Map([
|
|
21
|
+
const filterKeyValues = new Map([
|
|
22
|
+
[FilterKey.DISCIPLINES, [discipline.id]]
|
|
23
|
+
]);
|
|
22
24
|
const result = await this.checkRulesForSitemap(filterKeyValues);
|
|
23
25
|
if (result) {
|
|
24
26
|
paths.push(this.getPathWithSortingOption(discipline.path));
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { IRule } from '../../common/IRule';
|
|
2
2
|
import { IOrganisationSearchDependencies } from '../types/IOrganisationSearchDependencies';
|
|
3
|
-
import { FilterKeyValuesMap } from '
|
|
4
|
-
import { IRankingApiClient } from '../../sitemap-generator/IRankingApiClient';
|
|
3
|
+
import { FilterKeyValuesMap, ISearchApiClient } from '../../../sitemap-generator-seo';
|
|
5
4
|
export declare class MinimumAmountOfRankedResultsRule implements IRule {
|
|
6
5
|
private readonly minimumRankedResultsCount;
|
|
7
|
-
private readonly
|
|
8
|
-
constructor(
|
|
6
|
+
private readonly searchApiClient?;
|
|
7
|
+
constructor(searchApiClient?: ISearchApiClient);
|
|
9
8
|
forSearch(dependencies: IOrganisationSearchDependencies): Promise<boolean>;
|
|
10
9
|
forSitemapGenerator(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
|
|
11
10
|
getName(): string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DependencyMissingError } from '../../errors/DependencyMissingError';
|
|
2
2
|
export class MinimumAmountOfRankedResultsRule {
|
|
3
3
|
minimumRankedResultsCount = 4;
|
|
4
|
-
|
|
5
|
-
constructor(
|
|
6
|
-
this.
|
|
4
|
+
searchApiClient;
|
|
5
|
+
constructor(searchApiClient) {
|
|
6
|
+
this.searchApiClient = searchApiClient;
|
|
7
7
|
}
|
|
8
8
|
forSearch(dependencies) {
|
|
9
9
|
const { applicationState } = dependencies;
|
|
@@ -11,10 +11,10 @@ export class MinimumAmountOfRankedResultsRule {
|
|
|
11
11
|
return Promise.resolve(rankedResultsCount >= this.minimumRankedResultsCount);
|
|
12
12
|
}
|
|
13
13
|
async forSitemapGenerator(filterKeyValues) {
|
|
14
|
-
if (!this.
|
|
15
|
-
throw new DependencyMissingError('
|
|
14
|
+
if (!this.searchApiClient) {
|
|
15
|
+
throw new DependencyMissingError('SearchApiClient');
|
|
16
16
|
}
|
|
17
|
-
const rankedResultsCount = await this.
|
|
17
|
+
const rankedResultsCount = await this.searchApiClient.getCount(filterKeyValues, true);
|
|
18
18
|
return rankedResultsCount >= this.minimumRankedResultsCount;
|
|
19
19
|
}
|
|
20
20
|
getName() {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ISitemapDependencies } from '../../common/ISitemapDependencies';
|
|
2
|
-
import { IRankingApiClient } from '../../sitemap-generator/IRankingApiClient';
|
|
3
2
|
import { PortalType } from '@studyportals/domain-client';
|
|
4
3
|
import { IOrganisationsClient } from '../../sitemap-generator/IOrganisationsClient';
|
|
5
4
|
export interface IOrganisationsSitemapDependencies extends ISitemapDependencies {
|
|
6
5
|
organisationsClient: IOrganisationsClient;
|
|
7
6
|
portalType: PortalType;
|
|
8
|
-
rankingApiClient: IRankingApiClient;
|
|
9
7
|
}
|
|
@@ -10,5 +10,5 @@ export interface ISearchApiClient {
|
|
|
10
10
|
countryIsoCode: string;
|
|
11
11
|
}[]>;
|
|
12
12
|
getProgrammeCount?(filterKeyValues: FilterKeyValuesMap): Promise<number>;
|
|
13
|
-
getCount(filterKeyValues: FilterKeyValuesMap): Promise<number>;
|
|
13
|
+
getCount(filterKeyValues: FilterKeyValuesMap, isRanking?: boolean): Promise<number>;
|
|
14
14
|
}
|
|
@@ -3,12 +3,11 @@ import { IOrganisationsClient } from '../sitemap-generator/IOrganisationsClient'
|
|
|
3
3
|
import { ISearchApiClient } from '../sitemap-generator/ISearchApiClient';
|
|
4
4
|
import { BaseSitemapUrlGeneratorManager } from './BaseSitemapUrlGeneratorManager';
|
|
5
5
|
import { PortalType } from '@studyportals/domain-client';
|
|
6
|
-
import { IRankingApiClient } from './IRankingApiClient';
|
|
7
6
|
import { FilterKey } from '@studyportals/search-filters/server-side';
|
|
8
7
|
import { IPresenter } from '../common';
|
|
9
8
|
export declare class OrganisationsSitemapUrlGeneratorManager extends BaseSitemapUrlGeneratorManager {
|
|
10
9
|
readonly portalType: PortalType;
|
|
11
10
|
readonly policies: ISitemapUrlGenerator[];
|
|
12
11
|
readonly presenters: Map<FilterKey, IPresenter>;
|
|
13
|
-
constructor(portalType: PortalType, searchApiClient: ISearchApiClient, organisationsClient: IOrganisationsClient
|
|
12
|
+
constructor(portalType: PortalType, searchApiClient: ISearchApiClient, organisationsClient: IOrganisationsClient);
|
|
14
13
|
}
|
|
@@ -12,7 +12,7 @@ export class OrganisationsSitemapUrlGeneratorManager extends BaseSitemapUrlGener
|
|
|
12
12
|
portalType;
|
|
13
13
|
policies;
|
|
14
14
|
presenters = new Map();
|
|
15
|
-
constructor(portalType, searchApiClient, organisationsClient
|
|
15
|
+
constructor(portalType, searchApiClient, organisationsClient) {
|
|
16
16
|
super();
|
|
17
17
|
this.portalType = portalType;
|
|
18
18
|
const dependencies = {
|
|
@@ -20,7 +20,6 @@ export class OrganisationsSitemapUrlGeneratorManager extends BaseSitemapUrlGener
|
|
|
20
20
|
portalType,
|
|
21
21
|
searchApiClient,
|
|
22
22
|
organisationsClient,
|
|
23
|
-
rankingApiClient
|
|
24
23
|
};
|
|
25
24
|
this.policies = [
|
|
26
25
|
new CountryCity(dependencies),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studyportals/fawkes",
|
|
3
|
-
"version": "8.7.2-
|
|
3
|
+
"version": "8.7.2-3",
|
|
4
4
|
"description": "A package to centralize SEO related logic for SBLP and Sitemap Generator.",
|
|
5
5
|
"files": [
|
|
6
6
|
"./dist"
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@studyportals/domain-client": "^8.1.0",
|
|
94
|
-
"@studyportals/
|
|
94
|
+
"@studyportals/search-api-interface": "^5.9.2",
|
|
95
95
|
"@studyportals/search-filters": "^6.3.1",
|
|
96
96
|
"@studyportals/static-domain-data": "^6.1.0"
|
|
97
97
|
},
|