@studyportals/fawkes 4.0.2-2 → 4.0.2-21
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 +2 -1
- package/dist/src/enums/FilterCombinations.d.ts +12 -1
- package/dist/src/enums/FilterCombinations.js +11 -0
- package/dist/src/organisations/policies/RankedOrganisationsSeoIndexabilityPolicy.d.ts +0 -2
- package/dist/src/organisations/policies/RankedOrganisationsSeoIndexabilityPolicy.js +0 -2
- package/dist/src/organisations/policies/ranked/RankedArea.js +2 -1
- package/dist/src/organisations/policies/ranked/RankedAreaDiscipline.js +1 -1
- package/dist/src/organisations/policies/ranked/RankedAttendance.js +1 -1
- package/dist/src/organisations/policies/ranked/RankedAttendanceDiscipline.js +1 -1
- package/dist/src/organisations/policies/ranked/RankedContinent.js +1 -1
- package/dist/src/organisations/policies/ranked/RankedContinentAttendance.js +1 -1
- package/dist/src/organisations/policies/ranked/RankedCountry.js +1 -1
- package/dist/src/organisations/policies/ranked/RankedCountryAttendance.js +1 -1
- package/dist/src/organisations/policies/ranked/RankedCountryDiscipline.js +1 -1
- package/dist/src/organisations/policies/ranked/RankedDiscipline.js +1 -1
- package/dist/src/organisations/policies/ranked/RankedUnfiltered.js +1 -1
- package/dist/src/sitemap-generator/BaseSitemapUrlGeneratorManager.d.ts +1 -1
- package/dist/src/sitemap-generator/BaseSitemapUrlGeneratorManager.js +14 -3
- package/dist/src/sitemap-generator/ISitemapUrlGeneratorManager.d.ts +2 -0
- package/dist/src/sitemap-generator/OrganisationsSitemapUrlGeneratorManager.d.ts +3 -6
- package/dist/src/sitemap-generator/OrganisationsSitemapUrlGeneratorManager.js +8 -7
- package/dist/src/sitemap-generator/ScholarshipsSitemapUrlGeneratorManager.d.ts +1 -1
- package/dist/src/sitemap-generator/ScholarshipsSitemapUrlGeneratorManager.js +1 -1
- package/package.json +1 -1
|
@@ -7,4 +7,5 @@ import { OrganisationsSitemapUrlGeneratorManager } from '../src/sitemap-generato
|
|
|
7
7
|
import { ScholarshipsSitemapUrlGeneratorManager } from '../src/sitemap-generator/ScholarshipsSitemapUrlGeneratorManager';
|
|
8
8
|
import { FilterCombinations } from '../src/enums/FilterCombinations';
|
|
9
9
|
import { FilterKeyValuesMap } from '../src/common/FilterKeyValuesMap';
|
|
10
|
-
|
|
10
|
+
import { IPresenter } from '../src/common';
|
|
11
|
+
export { IOrganisationsClient, IOrganisation, IRankingApiClient, ISearchApiClient, ISitemapUrlGeneratorManager, OrganisationsSitemapUrlGeneratorManager, ScholarshipsSitemapUrlGeneratorManager, FilterCombinations, FilterKeyValuesMap, IPresenter };
|
|
@@ -13,5 +13,16 @@ export declare enum FilterCombinations {
|
|
|
13
13
|
CONTINENT_ATTENDANCE = "continentAttendance",
|
|
14
14
|
COUNTRY_ATTENDANCE = "countryAttendance",
|
|
15
15
|
ATTENDANCE = "attendance",
|
|
16
|
-
CONTINENT = "continent"
|
|
16
|
+
CONTINENT = "continent",
|
|
17
|
+
RANKED_AREA = "rankedArea",
|
|
18
|
+
RANKED_AREA_DISCIPLINE = "rankedAreaDiscipline",
|
|
19
|
+
RANKED_ATTENDANCE = "rankedAttendance",
|
|
20
|
+
RANKED_ATTENDANCE_DISCIPLINE = "rankedAttendancedDiscipline",
|
|
21
|
+
RANKED_CONTINENT = "rankedContinent",
|
|
22
|
+
RANKED_CONTINENT_ATTENDANCE = "rankedContinentAttendance",
|
|
23
|
+
RANKED_COUNTRY = "rankedCountry",
|
|
24
|
+
RANKED_COUNTRY_ATTENDANCE = "rankedCountryAttendance",
|
|
25
|
+
RANKED_DISCIPLINE_COUNTRY = "rankedDisciplineCountry",
|
|
26
|
+
RANKED_DISCIPLINE = "rankedDiscipline",
|
|
27
|
+
RANKED_UNFILTERED = "rankedUnfiltered"
|
|
17
28
|
}
|
|
@@ -15,4 +15,15 @@ export var FilterCombinations;
|
|
|
15
15
|
FilterCombinations["COUNTRY_ATTENDANCE"] = "countryAttendance";
|
|
16
16
|
FilterCombinations["ATTENDANCE"] = "attendance";
|
|
17
17
|
FilterCombinations["CONTINENT"] = "continent";
|
|
18
|
+
FilterCombinations["RANKED_AREA"] = "rankedArea";
|
|
19
|
+
FilterCombinations["RANKED_AREA_DISCIPLINE"] = "rankedAreaDiscipline";
|
|
20
|
+
FilterCombinations["RANKED_ATTENDANCE"] = "rankedAttendance";
|
|
21
|
+
FilterCombinations["RANKED_ATTENDANCE_DISCIPLINE"] = "rankedAttendancedDiscipline";
|
|
22
|
+
FilterCombinations["RANKED_CONTINENT"] = "rankedContinent";
|
|
23
|
+
FilterCombinations["RANKED_CONTINENT_ATTENDANCE"] = "rankedContinentAttendance";
|
|
24
|
+
FilterCombinations["RANKED_COUNTRY"] = "rankedCountry";
|
|
25
|
+
FilterCombinations["RANKED_COUNTRY_ATTENDANCE"] = "rankedCountryAttendance";
|
|
26
|
+
FilterCombinations["RANKED_DISCIPLINE_COUNTRY"] = "rankedDisciplineCountry";
|
|
27
|
+
FilterCombinations["RANKED_DISCIPLINE"] = "rankedDiscipline";
|
|
28
|
+
FilterCombinations["RANKED_UNFILTERED"] = "rankedUnfiltered";
|
|
18
29
|
})(FilterCombinations || (FilterCombinations = {}));
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { PortalType } from '@studyportals/domain-client';
|
|
2
1
|
import { SortingOptions } from '../../enums/SortingOptions';
|
|
3
2
|
import { OrganisationsSeoIndexabilityPolicy } from './OrganisationsSeoIndexabilityPolicy';
|
|
4
3
|
export declare abstract class RankedOrganisationsSeoIndexabilityPolicy extends OrganisationsSeoIndexabilityPolicy {
|
|
5
|
-
protected readonly indexablePortalTypes: PortalType[];
|
|
6
4
|
protected readonly sortingOption: SortingOptions;
|
|
7
5
|
protected addRankedResultsCountRule(): void;
|
|
8
6
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { PortalType } from '@studyportals/domain-client';
|
|
2
1
|
import { SortingOptions } from '../../enums/SortingOptions';
|
|
3
2
|
import { OrganisationsSeoIndexabilityPolicy } from './OrganisationsSeoIndexabilityPolicy';
|
|
4
3
|
import { AtLeastTwoRankedResultsRule } from '../rules/AtLeastTwoRankedResultsRule';
|
|
5
4
|
export class RankedOrganisationsSeoIndexabilityPolicy extends OrganisationsSeoIndexabilityPolicy {
|
|
6
|
-
indexablePortalTypes = [PortalType.MASTER];
|
|
7
5
|
sortingOption = SortingOptions.UNIVERSITY_META_RANKING;
|
|
8
6
|
addRankedResultsCountRule() {
|
|
9
7
|
let rankedResultsCountRule;
|
|
@@ -23,6 +23,7 @@ export class RankedArea extends RankedOrganisationsSeoIndexabilityPolicy {
|
|
|
23
23
|
[FilterKey.COUNTRY, [area.countryId]]
|
|
24
24
|
]);
|
|
25
25
|
const result = await this.checkRulesForSitemap(filterKeyValues);
|
|
26
|
+
console.log(`Result for area ${area.id} is ${result}`); // eslint-disable-line no-console
|
|
26
27
|
if (result) {
|
|
27
28
|
paths.push(this.getPathWithSortingOption(area.path));
|
|
28
29
|
}
|
|
@@ -30,6 +31,6 @@ export class RankedArea extends RankedOrganisationsSeoIndexabilityPolicy {
|
|
|
30
31
|
return paths;
|
|
31
32
|
}
|
|
32
33
|
get filterCombination() {
|
|
33
|
-
return FilterCombinations.
|
|
34
|
+
return FilterCombinations.RANKED_AREA;
|
|
34
35
|
}
|
|
35
36
|
}
|
|
@@ -19,7 +19,7 @@ export class RankedAreaDiscipline extends RankedOrganisationsSeoIndexabilityPoli
|
|
|
19
19
|
this.addRankedResultsCountRule();
|
|
20
20
|
}
|
|
21
21
|
get filterCombination() {
|
|
22
|
-
return FilterCombinations.
|
|
22
|
+
return FilterCombinations.RANKED_AREA_DISCIPLINE;
|
|
23
23
|
}
|
|
24
24
|
async generateUrls() {
|
|
25
25
|
const areaFragments = AreaPresenter.getInstance().getFragments();
|
|
@@ -18,7 +18,7 @@ export class RankedAttendanceDiscipline extends RankedOrganisationsSeoIndexabili
|
|
|
18
18
|
this.addRankedResultsCountRule();
|
|
19
19
|
}
|
|
20
20
|
get filterCombination() {
|
|
21
|
-
return FilterCombinations.
|
|
21
|
+
return FilterCombinations.RANKED_ATTENDANCE_DISCIPLINE;
|
|
22
22
|
}
|
|
23
23
|
async generateUrls() {
|
|
24
24
|
const attendanceFragments = AttendancePresenter.getInstance().getFragments();
|
|
@@ -5,7 +5,7 @@ import { IPresenter } from '../common';
|
|
|
5
5
|
import { FilterKey } from '@studyportals/search-filters';
|
|
6
6
|
export declare abstract class BaseSitemapUrlGeneratorManager implements ISitemapUrlGeneratorManager {
|
|
7
7
|
abstract readonly policies: ISitemapUrlGenerator[];
|
|
8
|
-
|
|
8
|
+
abstract readonly presenters: Map<FilterKey, IPresenter>;
|
|
9
9
|
protected readonly filterKeyValueCounts: Map<FilterKey, number>;
|
|
10
10
|
generateUrls(): Promise<Map<FilterCombinations, string[]>>;
|
|
11
11
|
getFilterKeyValueCounts(): Map<FilterKey, number>;
|
|
@@ -2,18 +2,29 @@ export class BaseSitemapUrlGeneratorManager {
|
|
|
2
2
|
filterKeyValueCounts = new Map();
|
|
3
3
|
async generateUrls() {
|
|
4
4
|
const map = new Map();
|
|
5
|
-
|
|
5
|
+
for (const policy of this.policies) {
|
|
6
|
+
console.debug(`Generating sitemap urls for policy: ${policy.filterCombination}`); // eslint-disable-line no-console
|
|
6
7
|
const filterCombination = policy.filterCombination;
|
|
7
8
|
const urls = await policy.generateSitemapUrls();
|
|
9
|
+
console.debug(`Generated ${urls.length} urls for policy: ${filterCombination}`); // eslint-disable-line no-console
|
|
8
10
|
map.set(filterCombination, urls);
|
|
9
|
-
}
|
|
11
|
+
}
|
|
12
|
+
// await Promise.all(
|
|
13
|
+
// this.policies.map(async (policy) => {
|
|
14
|
+
// console.debug(`Generating sitemap urls for policy: ${policy.filterCombination}`); // eslint-disable-line no-console
|
|
15
|
+
// const filterCombination = policy.filterCombination;
|
|
16
|
+
// const urls = await policy.generateSitemapUrls();
|
|
17
|
+
// console.debug(`Generated ${urls.length} urls for policy: ${filterCombination}`); // eslint-disable-line no-console
|
|
18
|
+
// map.set(filterCombination, urls);
|
|
19
|
+
// })
|
|
20
|
+
// );
|
|
10
21
|
return map;
|
|
11
22
|
}
|
|
12
23
|
getFilterKeyValueCounts() {
|
|
13
24
|
return this.filterKeyValueCounts;
|
|
14
25
|
}
|
|
15
26
|
setFilterKeyValueCounts() {
|
|
16
|
-
for (const presenter of this.presenters) {
|
|
27
|
+
for (const presenter of this.presenters.values()) {
|
|
17
28
|
const count = presenter.getFragments().length;
|
|
18
29
|
this.filterKeyValueCounts.set(presenter.filterKey, count);
|
|
19
30
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { FilterCombinations } from '../enums/FilterCombinations';
|
|
2
|
+
import { IPresenter } from '../common';
|
|
2
3
|
import { FilterKey } from '@studyportals/search-filters';
|
|
3
4
|
export interface ISitemapUrlGeneratorManager {
|
|
5
|
+
readonly presenters: Map<FilterKey, IPresenter>;
|
|
4
6
|
generateUrls(): Promise<Map<FilterCombinations, string[]>>;
|
|
5
7
|
getFilterKeyValueCounts(): Map<FilterKey, number>;
|
|
6
8
|
}
|
|
@@ -4,14 +4,11 @@ import { ISearchApiClient } from '../sitemap-generator/ISearchApiClient';
|
|
|
4
4
|
import { BaseSitemapUrlGeneratorManager } from './BaseSitemapUrlGeneratorManager';
|
|
5
5
|
import { PortalType } from '@studyportals/domain-client';
|
|
6
6
|
import { IRankingApiClient } from './IRankingApiClient';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { ContinentPresenter } from '../presenters/ContinentPresenter';
|
|
10
|
-
import { CountryPresenter } from '../presenters/CountryPresenter';
|
|
11
|
-
import { DisciplinePresenter } from '../presenters/DisciplinePresenter';
|
|
7
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
8
|
+
import { IPresenter } from '../common';
|
|
12
9
|
export declare class OrganisationsSitemapUrlGeneratorManager extends BaseSitemapUrlGeneratorManager {
|
|
13
10
|
readonly portalType: PortalType;
|
|
14
11
|
readonly policies: ISitemapUrlGenerator[];
|
|
15
|
-
|
|
12
|
+
readonly presenters: Map<FilterKey, IPresenter>;
|
|
16
13
|
constructor(portalType: PortalType, searchApiClient: ISearchApiClient, organisationsClient: IOrganisationsClient, rankingApiClient: IRankingApiClient);
|
|
17
14
|
}
|
|
@@ -6,16 +6,11 @@ import { AttendancePresenter } from '../presenters/AttendancePresenter';
|
|
|
6
6
|
import { ContinentPresenter } from '../presenters/ContinentPresenter';
|
|
7
7
|
import { CountryPresenter } from '../presenters/CountryPresenter';
|
|
8
8
|
import { DisciplinePresenter } from '../presenters/DisciplinePresenter';
|
|
9
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
9
10
|
export class OrganisationsSitemapUrlGeneratorManager extends BaseSitemapUrlGeneratorManager {
|
|
10
11
|
portalType;
|
|
11
12
|
policies;
|
|
12
|
-
presenters =
|
|
13
|
-
AreaPresenter.getInstance(),
|
|
14
|
-
AttendancePresenter.getInstance(),
|
|
15
|
-
ContinentPresenter.getInstance(),
|
|
16
|
-
CountryPresenter.getInstance(),
|
|
17
|
-
DisciplinePresenter.getInstance()
|
|
18
|
-
];
|
|
13
|
+
presenters = new Map();
|
|
19
14
|
constructor(portalType, searchApiClient, organisationsClient, rankingApiClient) {
|
|
20
15
|
super();
|
|
21
16
|
this.portalType = portalType;
|
|
@@ -46,5 +41,11 @@ export class OrganisationsSitemapUrlGeneratorManager extends BaseSitemapUrlGener
|
|
|
46
41
|
new RankedDiscipline(dependencies),
|
|
47
42
|
new RankedUnfiltered(dependencies)
|
|
48
43
|
];
|
|
44
|
+
this.presenters.set(FilterKey.AREA, AreaPresenter.getInstance());
|
|
45
|
+
this.presenters.set(FilterKey.DELIVERY_METHOD, AttendancePresenter.getInstance());
|
|
46
|
+
this.presenters.set(FilterKey.CONTINENT, ContinentPresenter.getInstance());
|
|
47
|
+
this.presenters.set(FilterKey.COUNTRY, CountryPresenter.getInstance());
|
|
48
|
+
this.presenters.set(FilterKey.DISCIPLINES, DisciplinePresenter.getInstance());
|
|
49
|
+
this.setFilterKeyValueCounts();
|
|
49
50
|
}
|
|
50
51
|
}
|
|
@@ -4,6 +4,6 @@ import { ISearchApiClient } from '../sitemap-generator/ISearchApiClient';
|
|
|
4
4
|
import { BaseSitemapUrlGeneratorManager } from './BaseSitemapUrlGeneratorManager';
|
|
5
5
|
export declare class ScholarshipsSitemapUrlGeneratorManager extends BaseSitemapUrlGeneratorManager {
|
|
6
6
|
readonly policies: ISitemapUrlGenerator[];
|
|
7
|
-
|
|
7
|
+
readonly presenters: Map<any, any>;
|
|
8
8
|
constructor(searchApiClient: ISearchApiClient, organisationsClient: IOrganisationsClient);
|
|
9
9
|
}
|
|
@@ -8,7 +8,7 @@ import { Unfiltered } from '../scholarships/policies/Unfiltered';
|
|
|
8
8
|
import { BaseSitemapUrlGeneratorManager } from './BaseSitemapUrlGeneratorManager';
|
|
9
9
|
export class ScholarshipsSitemapUrlGeneratorManager extends BaseSitemapUrlGeneratorManager {
|
|
10
10
|
policies;
|
|
11
|
-
presenters =
|
|
11
|
+
presenters = new Map();
|
|
12
12
|
constructor(searchApiClient, organisationsClient) {
|
|
13
13
|
super();
|
|
14
14
|
const dependencies = {
|