@studyportals/fawkes 3.0.1-4 → 4.0.1-0
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/README.md +18 -17
- package/dist/organisations-seo/index.d.ts +3 -3
- package/dist/organisations-seo/index.js +1 -4
- package/dist/scholarships-seo/index.d.ts +5 -5
- package/dist/scholarships-seo/index.js +2 -2
- package/dist/sitemap-generator-seo/index.d.ts +6 -6
- package/dist/sitemap-generator-seo/index.js +2 -2
- package/dist/src/common/FilterKeyValuesMap.d.ts +1 -1
- package/dist/src/common/IDependencies.d.ts +1 -1
- package/dist/src/common/IRule.d.ts +2 -2
- package/dist/src/common/ISearchDependencies.d.ts +2 -2
- package/dist/src/common/ISeoDependencies.d.ts +2 -2
- package/dist/src/common/ISeoFilterState.d.ts +1 -1
- package/dist/src/common/ISitemapDependencies.d.ts +3 -3
- package/dist/src/common/ISitemapUrlGenerator.d.ts +1 -1
- package/dist/src/common/index.d.ts +4 -4
- package/dist/src/common/index.js +4 -4
- package/dist/src/common/policies/BaseSeoIndexabilityPolicy.d.ts +15 -9
- package/dist/src/common/policies/BaseSeoIndexabilityPolicy.js +23 -2
- package/dist/src/common/rules/BaseFilterKeyValueRule.d.ts +3 -3
- package/dist/src/common/rules/BaseFilterKeyValueRule.js +6 -5
- package/dist/src/common/rules/NoFiltersSelectedRule.d.ts +8 -0
- package/dist/src/{organisations → common}/rules/NoFiltersSelectedRule.js +3 -3
- package/dist/src/common/rules/OnlyFiltersSelectedRule.d.ts +4 -4
- package/dist/src/common/rules/OnlyFiltersSelectedRule.js +1 -1
- package/dist/src/common/rules/SingleValueSelectedForFilterRule.d.ts +4 -4
- package/dist/src/common/rules/SingleValueSelectedForFilterRule.js +1 -1
- package/dist/src/enums/FilterCombinations.js +0 -1
- package/dist/src/errors/InvalidFilterValueError.d.ts +1 -1
- package/dist/src/organisations/IOrganisationSearchApplicationState.d.ts +1 -1
- package/dist/src/organisations/ISeoSortingState.d.ts +1 -1
- package/dist/src/organisations/SearchIndexabilityManager.d.ts +6 -6
- package/dist/src/organisations/SearchIndexabilityManager.js +4 -4
- package/dist/src/organisations/index.d.ts +4 -4
- package/dist/src/organisations/index.js +4 -4
- package/dist/src/organisations/policies/OrganisationsSeoIndexabilityPolicy.d.ts +13 -0
- package/dist/src/organisations/policies/OrganisationsSeoIndexabilityPolicy.js +32 -0
- package/dist/src/organisations/policies/RankedOrganisationsSeoIndexabilityPolicy.d.ts +8 -0
- package/dist/src/organisations/policies/RankedOrganisationsSeoIndexabilityPolicy.js +19 -0
- package/dist/src/organisations/policies/index.d.ts +18 -18
- package/dist/src/organisations/policies/index.js +18 -18
- package/dist/src/organisations/policies/our-picks/Area.d.ts +6 -6
- package/dist/src/organisations/policies/our-picks/Area.js +21 -8
- package/dist/src/organisations/policies/our-picks/AreaAttendance.d.ts +8 -8
- package/dist/src/organisations/policies/our-picks/AreaAttendance.js +28 -10
- package/dist/src/organisations/policies/our-picks/Attendance.d.ts +7 -7
- package/dist/src/organisations/policies/our-picks/Attendance.js +19 -9
- package/dist/src/organisations/policies/our-picks/Continent.d.ts +7 -7
- package/dist/src/organisations/policies/our-picks/Continent.js +20 -10
- package/dist/src/organisations/policies/our-picks/Country.d.ts +7 -7
- package/dist/src/organisations/policies/our-picks/Country.js +21 -14
- package/dist/src/organisations/policies/our-picks/CountryAttendance.d.ts +9 -9
- package/dist/src/organisations/policies/our-picks/CountryAttendance.js +30 -13
- package/dist/src/organisations/policies/our-picks/Unfiltered.d.ts +5 -5
- package/dist/src/organisations/policies/our-picks/Unfiltered.js +8 -10
- package/dist/src/organisations/policies/ranked/RankedArea.d.ts +8 -9
- package/dist/src/organisations/policies/ranked/RankedArea.js +25 -12
- package/dist/src/organisations/policies/ranked/RankedAreaDiscipline.d.ts +9 -10
- package/dist/src/organisations/policies/ranked/RankedAreaDiscipline.js +32 -14
- package/dist/src/organisations/policies/ranked/RankedAttendance.d.ts +9 -10
- package/dist/src/organisations/policies/ranked/RankedAttendance.js +24 -14
- package/dist/src/organisations/policies/ranked/RankedAttendanceDiscipline.d.ts +10 -11
- package/dist/src/organisations/policies/ranked/RankedAttendanceDiscipline.js +30 -13
- package/dist/src/organisations/policies/ranked/RankedContinent.d.ts +8 -9
- package/dist/src/organisations/policies/ranked/RankedContinent.js +23 -13
- package/dist/src/organisations/policies/ranked/RankedContinentAttendance.d.ts +10 -11
- package/dist/src/organisations/policies/ranked/RankedContinentAttendance.js +30 -13
- package/dist/src/organisations/policies/ranked/RankedCountry.d.ts +8 -9
- package/dist/src/organisations/policies/ranked/RankedCountry.js +22 -15
- package/dist/src/organisations/policies/ranked/RankedCountryAttendance.d.ts +9 -10
- package/dist/src/organisations/policies/ranked/RankedCountryAttendance.js +29 -12
- package/dist/src/organisations/policies/ranked/RankedCountryDiscipline.d.ts +8 -9
- package/dist/src/organisations/policies/ranked/RankedCountryDiscipline.js +29 -12
- package/dist/src/organisations/policies/ranked/RankedDiscipline.d.ts +8 -9
- package/dist/src/organisations/policies/ranked/RankedDiscipline.js +22 -12
- package/dist/src/organisations/policies/ranked/RankedUnfiltered.d.ts +7 -8
- package/dist/src/organisations/policies/ranked/RankedUnfiltered.js +13 -11
- package/dist/src/organisations/rules/AtLeastTwoRankedResultsRule.d.ts +7 -3
- package/dist/src/organisations/rules/AtLeastTwoRankedResultsRule.js +14 -5
- package/dist/src/{scholarships/rules/SearchVolumeCountryDisciplineRule.d.ts → organisations/rules/BaseSearchVolumeOrganisationsRule.d.ts} +7 -7
- package/dist/src/organisations/rules/BaseSearchVolumeOrganisationsRule.js +30 -0
- package/dist/src/organisations/rules/ContinentIsEuropeRule.d.ts +3 -7
- package/dist/src/organisations/rules/ContinentIsEuropeRule.js +8 -12
- package/dist/src/organisations/rules/OnlineAttendanceRule.d.ts +1 -1
- package/dist/src/organisations/rules/OnlineAttendanceRule.js +3 -5
- package/dist/src/organisations/rules/SearchVolumeAreasAttendanceRule.d.ts +3 -9
- package/dist/src/organisations/rules/SearchVolumeAreasAttendanceRule.js +10 -22
- package/dist/src/organisations/rules/SearchVolumeAreasDisciplineRule.d.ts +3 -9
- package/dist/src/organisations/rules/SearchVolumeAreasDisciplineRule.js +11 -23
- package/dist/src/organisations/rules/SearchVolumeCountriesAttendanceRule.d.ts +3 -9
- package/dist/src/organisations/rules/SearchVolumeCountriesAttendanceRule.js +10 -24
- package/dist/src/organisations/types/IOrganisationSearchDependencies.d.ts +4 -4
- package/dist/src/organisations/types/IOrganisationsSeoDependencies.d.ts +2 -2
- package/dist/src/organisations/types/IOrganisationsSitemapDependencies.d.ts +4 -2
- package/dist/src/organisations/types.js +4 -4
- package/dist/src/presenters/AreaPresenter.d.ts +1 -1
- package/dist/src/presenters/AreaPresenter.js +1 -1
- package/dist/src/presenters/AttendancePresenter.d.ts +8 -0
- package/dist/src/presenters/AttendancePresenter.js +21 -0
- package/dist/src/presenters/ContinentPresenter.d.ts +9 -0
- package/dist/src/presenters/ContinentPresenter.js +31 -0
- package/dist/src/presenters/CountryPresenter.d.ts +1 -1
- package/dist/src/presenters/CountryPresenter.js +1 -1
- package/dist/src/presenters/DisciplinePresenter.d.ts +1 -1
- package/dist/src/presenters/DisciplinePresenter.js +1 -1
- package/dist/src/presenters/fragments/IAreaFragment.d.ts +1 -1
- package/dist/src/presenters/fragments/ICountryFragment.d.ts +1 -1
- package/dist/src/scholarships/SearchIndexabilityManager.d.ts +4 -4
- package/dist/src/scholarships/SearchIndexabilityManager.js +9 -9
- package/dist/src/scholarships/index.d.ts +2 -2
- package/dist/src/scholarships/index.js +2 -2
- package/dist/src/scholarships/policies/Area.d.ts +3 -3
- package/dist/src/scholarships/policies/Area.js +2 -2
- package/dist/src/scholarships/policies/Country.d.ts +4 -4
- package/dist/src/scholarships/policies/Country.js +3 -5
- package/dist/src/scholarships/policies/Discipline.d.ts +3 -3
- package/dist/src/scholarships/policies/Discipline.js +3 -5
- package/dist/src/scholarships/policies/DisciplineCountry.d.ts +3 -3
- package/dist/src/scholarships/policies/DisciplineCountry.js +2 -2
- package/dist/src/scholarships/policies/Unfiltered.d.ts +4 -3
- package/dist/src/scholarships/policies/Unfiltered.js +5 -7
- package/dist/src/scholarships/policies/UniversityCountry.d.ts +3 -3
- package/dist/src/scholarships/policies/UniversityCountry.js +3 -3
- package/dist/src/scholarships/rules/ExceptAustaliaAreasRule.d.ts +3 -3
- package/dist/src/scholarships/rules/ExceptAustaliaAreasRule.js +2 -2
- package/dist/src/scholarships/rules/SearchVolumeAreasRule.d.ts +3 -3
- package/dist/src/scholarships/rules/SearchVolumeAreasRule.js +1 -1
- package/dist/src/scholarships/rules/SearchVolumeCountriesDisciplinesRule.js +1 -1
- package/dist/src/scholarships/rules/SearchVolumeCountriesRule.d.ts +3 -3
- package/dist/src/scholarships/rules/SearchVolumeCountriesRule.js +1 -1
- package/dist/src/scholarships/rules/SearchVolumeDisciplinesRule.d.ts +3 -3
- package/dist/src/scholarships/rules/SearchVolumeDisciplinesRule.js +2 -4
- package/dist/src/scholarships/types.js +4 -4
- package/dist/src/sitemap-generator/IOrganisationsClient.d.ts +1 -1
- package/dist/src/sitemap-generator/IRankingApiClient.d.ts +4 -0
- package/dist/src/sitemap-generator/IRankingApiClient.js +1 -0
- package/dist/src/sitemap-generator/ISitemapUrlGeneratorManager.d.ts +1 -1
- package/dist/src/sitemap-generator/SitemapUrlGeneratorManager.d.ts +4 -4
- package/dist/src/sitemap-generator/SitemapUrlGeneratorManager.js +7 -7
- package/package.json +82 -80
- package/dist/src/common/policies/RuleBasedIndexabilityPolicy.d.ts +0 -11
- package/dist/src/common/policies/RuleBasedIndexabilityPolicy.js +0 -24
- package/dist/src/organisations/OrganisationsBaseSeoIndexabilityPolicy.d.ts +0 -11
- package/dist/src/organisations/OrganisationsBaseSeoIndexabilityPolicy.js +0 -20
- package/dist/src/organisations/OrganisationsRuleBasedIndexabilityPolicy.d.ts +0 -11
- package/dist/src/organisations/OrganisationsRuleBasedIndexabilityPolicy.js +0 -20
- package/dist/src/organisations/rules/NoFiltersSelectedRule.d.ts +0 -8
- package/dist/src/scholarships/rules/SearchVolumeCountryDisciplineRule.js +0 -40
package/README.md
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
# fawkes
|
|
2
|
-
|
|
3
|
-
This project is used to centralize indexability logic for our Search
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
# fawkes
|
|
2
|
+
|
|
3
|
+
This project is used to centralize indexability logic for our Search
|
|
4
|
+
microservices and Sitemap Generator. The main purpose is to completely remove
|
|
5
|
+
discrepancies between pages indexed by Search and page URLs stored in Sitemap.
|
|
6
|
+
|
|
7
|
+
Link to documentation: https://studyportals.atlassian.net/wiki/x/BwAdvw
|
|
8
|
+
|
|
9
|
+
## Base structure
|
|
10
|
+
|
|
11
|
+
- organisations-seo (used by Organisation Search)
|
|
12
|
+
- scholarships-seo (used by Scholarship Search)
|
|
13
|
+
- sitemap-generator-seo (used by Sitemap Generator)
|
|
14
|
+
- src
|
|
15
|
+
- common
|
|
16
|
+
- organisations
|
|
17
|
+
- scholarships
|
|
18
|
+
- sitemap-generator
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISeoInfoBase } from
|
|
2
|
-
import { ISeoFilterState } from
|
|
3
|
-
import { IOrganisationSearchApplicationState, SearchIndexabilityManager, ISeoSortingState, types } from
|
|
1
|
+
import { ISeoInfoBase } from '../src/common/ISeoInfoBase';
|
|
2
|
+
import { ISeoFilterState } from '../src/common/ISeoFilterState';
|
|
3
|
+
import { IOrganisationSearchApplicationState, SearchIndexabilityManager, ISeoSortingState, types } from '../src/organisations';
|
|
4
4
|
export { ISeoInfoBase, ISeoFilterState, IOrganisationSearchApplicationState, SearchIndexabilityManager, ISeoSortingState, types };
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
// export * from "../src/common/ISeoFilterState";
|
|
3
|
-
// export * from "../src/organisations";
|
|
4
|
-
import { SearchIndexabilityManager, types } from "../src/organisations";
|
|
1
|
+
import { SearchIndexabilityManager, types } from '../src/organisations';
|
|
5
2
|
export { SearchIndexabilityManager, types };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ISeoFilterState } from
|
|
2
|
-
import { ISeoInfoBase } from
|
|
3
|
-
import { ISearchIndexabilityManager } from
|
|
4
|
-
import { SearchIndexabilityManager } from
|
|
5
|
-
import { types } from
|
|
1
|
+
import { ISeoFilterState } from '../src/common/ISeoFilterState';
|
|
2
|
+
import { ISeoInfoBase } from '../src/common/ISeoInfoBase';
|
|
3
|
+
import { ISearchIndexabilityManager } from '../src/common/ISearchIndexabilityManager';
|
|
4
|
+
import { SearchIndexabilityManager } from '../src/scholarships/SearchIndexabilityManager';
|
|
5
|
+
import { types } from '../src/scholarships/types';
|
|
6
6
|
export { ISeoFilterState, ISeoInfoBase, ISearchIndexabilityManager, SearchIndexabilityManager, types };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SearchIndexabilityManager } from
|
|
2
|
-
import { types } from
|
|
1
|
+
import { SearchIndexabilityManager } from '../src/scholarships/SearchIndexabilityManager';
|
|
2
|
+
import { types } from '../src/scholarships/types';
|
|
3
3
|
export { SearchIndexabilityManager, types };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IOrganisationsClient } from
|
|
2
|
-
import { IOrganisation } from
|
|
3
|
-
import { ISearchApiClient } from
|
|
4
|
-
import { ISitemapUrlGeneratorManager } from
|
|
5
|
-
import { SitemapUrlGeneratorManager } from
|
|
6
|
-
import { FilterCombinations } from
|
|
1
|
+
import { IOrganisationsClient } from '../src/sitemap-generator/IOrganisationsClient';
|
|
2
|
+
import { IOrganisation } from '../src/sitemap-generator/IOrganisation';
|
|
3
|
+
import { ISearchApiClient } from '../src/sitemap-generator/ISearchApiClient';
|
|
4
|
+
import { ISitemapUrlGeneratorManager } from '../src/sitemap-generator/ISitemapUrlGeneratorManager';
|
|
5
|
+
import { SitemapUrlGeneratorManager } from '../src/sitemap-generator/SitemapUrlGeneratorManager';
|
|
6
|
+
import { FilterCombinations } from '../src/enums/FilterCombinations';
|
|
7
7
|
export { IOrganisationsClient, IOrganisation, ISearchApiClient, ISitemapUrlGeneratorManager, SitemapUrlGeneratorManager, FilterCombinations };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { SitemapUrlGeneratorManager } from
|
|
2
|
-
import { FilterCombinations } from
|
|
1
|
+
import { SitemapUrlGeneratorManager } from '../src/sitemap-generator/SitemapUrlGeneratorManager';
|
|
2
|
+
import { FilterCombinations } from '../src/enums/FilterCombinations';
|
|
3
3
|
export { SitemapUrlGeneratorManager, FilterCombinations };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FilterKey } from
|
|
1
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
2
2
|
export type FilterKeyValuesMap = Map<FilterKey, string[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FilterKeyValuesMap } from
|
|
2
|
-
import { ISearchDependencies } from
|
|
1
|
+
import { FilterKeyValuesMap } from './FilterKeyValuesMap';
|
|
2
|
+
import { ISearchDependencies } from './ISearchDependencies';
|
|
3
3
|
export interface IRule {
|
|
4
4
|
getName(): string;
|
|
5
5
|
forSearch(dependencies: ISearchDependencies): Promise<boolean>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ISeoInfoBase, ISeoFilterState, ISearchApplicationState } from
|
|
2
|
-
import { IDependencies } from
|
|
1
|
+
import { ISeoInfoBase, ISeoFilterState, ISearchApplicationState } from '../common';
|
|
2
|
+
import { IDependencies } from './IDependencies';
|
|
3
3
|
export interface ISearchDependencies extends IDependencies {
|
|
4
4
|
seoInfoBase: ISeoInfoBase;
|
|
5
5
|
filterState: ISeoFilterState;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ISearchDependencies } from
|
|
2
|
-
import { ISitemapDependencies } from
|
|
1
|
+
import { ISearchDependencies } from '../common/ISearchDependencies';
|
|
2
|
+
import { ISitemapDependencies } from '../common/ISitemapDependencies';
|
|
3
3
|
export type ISeoDependencies = ISearchDependencies | ISitemapDependencies;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IDependencies } from
|
|
2
|
-
import { ISearchApiClient } from
|
|
3
|
-
import { IOrganisationsClient } from
|
|
1
|
+
import { IDependencies } from '../common/IDependencies';
|
|
2
|
+
import { ISearchApiClient } from '../sitemap-generator/ISearchApiClient';
|
|
3
|
+
import { IOrganisationsClient } from '../sitemap-generator/IOrganisationsClient';
|
|
4
4
|
export interface ISitemapDependencies extends IDependencies {
|
|
5
5
|
searchApiClient: ISearchApiClient;
|
|
6
6
|
organisationsClient: IOrganisationsClient;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from './ISeoInfoBase';
|
|
2
|
+
export * from './ISeoFilterState';
|
|
3
|
+
export * from './ISearchApplicationState';
|
|
4
|
+
export * from './ISearchIndexabilityManager';
|
package/dist/src/common/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from './ISeoInfoBase';
|
|
2
|
+
export * from './ISeoFilterState';
|
|
3
|
+
export * from './ISearchApplicationState';
|
|
4
|
+
export * from './ISearchIndexabilityManager';
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { ISearchDependencies } from '../ISearchDependencies';
|
|
2
|
+
import { IDependencies } from '../IDependencies';
|
|
3
|
+
import { IRule } from '../IRule';
|
|
4
|
+
import { FilterKeyValuesMap } from '../FilterKeyValuesMap';
|
|
5
|
+
import { ISeoIndexabilityPolicy } from '../ISeoIndexabilityPolicy';
|
|
6
|
+
import { ISitemapUrlGenerator } from '../ISitemapUrlGenerator';
|
|
7
|
+
import { FilterCombinations } from '../../../sitemap-generator-seo';
|
|
5
8
|
export declare abstract class BaseSeoIndexabilityPolicy<TDependencies extends IDependencies> implements ISeoIndexabilityPolicy, ISitemapUrlGenerator {
|
|
6
9
|
protected readonly dependencies: TDependencies;
|
|
10
|
+
protected abstract readonly rules: IRule[];
|
|
7
11
|
constructor(dependencies: TDependencies);
|
|
12
|
+
abstract get filterCombination(): FilterCombinations;
|
|
13
|
+
protected abstract generateUrls(): Promise<string[]>;
|
|
8
14
|
shouldIndex(): Promise<boolean>;
|
|
9
15
|
generateSitemapUrls(): Promise<string[]>;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
protected
|
|
13
|
-
protected
|
|
14
|
-
|
|
16
|
+
protected isIndexable(): Promise<boolean>;
|
|
17
|
+
protected checkRulesForSearch(dependencies: ISearchDependencies): Promise<boolean>;
|
|
18
|
+
protected checkRulesForSitemap(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
|
|
19
|
+
protected isIndexabilityPolicyDependencies(): boolean;
|
|
20
|
+
protected isSitemapUrlGeneratorDependencies(): boolean;
|
|
15
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { InvalidDependencyTypeError } from '../../errors/InvalidDependencyTypeError';
|
|
2
|
+
import { DependencyTypes } from '../../enums/DependencyTypes';
|
|
3
3
|
export class BaseSeoIndexabilityPolicy {
|
|
4
4
|
dependencies;
|
|
5
5
|
constructor(dependencies) {
|
|
@@ -17,6 +17,27 @@ export class BaseSeoIndexabilityPolicy {
|
|
|
17
17
|
}
|
|
18
18
|
return await this.generateUrls();
|
|
19
19
|
}
|
|
20
|
+
async isIndexable() {
|
|
21
|
+
return await this.checkRulesForSearch(this.dependencies);
|
|
22
|
+
}
|
|
23
|
+
async checkRulesForSearch(dependencies) {
|
|
24
|
+
for (const rule of this.rules) {
|
|
25
|
+
const result = await rule.forSearch(dependencies);
|
|
26
|
+
if (!result) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
async checkRulesForSitemap(filterKeyValues) {
|
|
33
|
+
for (const rule of this.rules) {
|
|
34
|
+
const result = await rule.forSitemapGenerator(filterKeyValues);
|
|
35
|
+
if (!result) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
20
41
|
isIndexabilityPolicyDependencies() {
|
|
21
42
|
return this.dependencies.dependencyType === DependencyTypes.SEARCH;
|
|
22
43
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FilterKeyValuesMap } from
|
|
2
|
-
import { IRule } from
|
|
3
|
-
import { ISearchDependencies } from
|
|
1
|
+
import { FilterKeyValuesMap } from '../FilterKeyValuesMap';
|
|
2
|
+
import { IRule } from '../IRule';
|
|
3
|
+
import { ISearchDependencies } from '../ISearchDependencies';
|
|
4
4
|
export declare abstract class BaseFilterKeyValueRule implements IRule {
|
|
5
5
|
private readonly expectedFilterKeyValues;
|
|
6
6
|
constructor(expectedFilterKeyValues: FilterKeyValuesMap);
|
|
@@ -5,12 +5,13 @@ export class BaseFilterKeyValueRule {
|
|
|
5
5
|
}
|
|
6
6
|
forSearch(dependencies) {
|
|
7
7
|
const { seoInfoBase, filterState } = dependencies;
|
|
8
|
-
const
|
|
9
|
-
.reduce((acc, [key, values]) => {
|
|
8
|
+
for (const [key, values] of this.expectedFilterKeyValues) {
|
|
10
9
|
const optionValue = seoInfoBase.getFilterOptionValueBy(key, filterState);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
if (!optionValue || !values.includes(optionValue)) {
|
|
11
|
+
return Promise.resolve(false);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return Promise.resolve(true);
|
|
14
15
|
}
|
|
15
16
|
forSitemapGenerator(filterKeyValues) {
|
|
16
17
|
for (const [key, values] of this.expectedFilterKeyValues) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IRule } from '../../common/IRule';
|
|
2
|
+
import { FilterKeyValuesMap } from '../../common/FilterKeyValuesMap';
|
|
3
|
+
import { ISearchDependencies } from '../ISearchDependencies';
|
|
4
|
+
export declare class NoFiltersSelectedRule implements IRule {
|
|
5
|
+
forSearch(dependencies: ISearchDependencies): Promise<boolean>;
|
|
6
|
+
forSitemapGenerator(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
|
|
7
|
+
getName(): string;
|
|
8
|
+
}
|
|
@@ -4,11 +4,11 @@ export class NoFiltersSelectedRule {
|
|
|
4
4
|
const selectionCount = seoInfoBase.getSelectionTypeCount(filterState);
|
|
5
5
|
return Promise.resolve(selectionCount === 0);
|
|
6
6
|
}
|
|
7
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8
7
|
forSitemapGenerator(filterKeyValues) {
|
|
9
|
-
|
|
8
|
+
const filterKeys = Array.from(filterKeyValues.keys());
|
|
9
|
+
return Promise.resolve(filterKeys.length === 0);
|
|
10
10
|
}
|
|
11
11
|
getName() {
|
|
12
|
-
return
|
|
12
|
+
return 'NoFiltersSelectedRule';
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IRule } from
|
|
2
|
-
import { FilterKey } from
|
|
3
|
-
import { ISearchDependencies } from
|
|
4
|
-
import { FilterKeyValuesMap } from
|
|
1
|
+
import { IRule } from '../../common/IRule';
|
|
2
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
3
|
+
import { ISearchDependencies } from '../../common/ISearchDependencies';
|
|
4
|
+
import { FilterKeyValuesMap } from '../FilterKeyValuesMap';
|
|
5
5
|
export declare class OnlyFiltersSelectedRule implements IRule {
|
|
6
6
|
private readonly filterKeys;
|
|
7
7
|
constructor(filterKeys: FilterKey[]);
|
|
@@ -4,7 +4,7 @@ export class OnlyFiltersSelectedRule {
|
|
|
4
4
|
this.filterKeys = filterKeys;
|
|
5
5
|
}
|
|
6
6
|
getName() {
|
|
7
|
-
return '
|
|
7
|
+
return `OnlyFiltersSelectedRule-${this.filterKeys.join('-')}`;
|
|
8
8
|
}
|
|
9
9
|
async forSearch(dependencies) {
|
|
10
10
|
const seoInfoBase = dependencies.seoInfoBase;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IRule } from
|
|
2
|
-
import { FilterKey } from
|
|
3
|
-
import { ISearchDependencies } from
|
|
4
|
-
import { FilterKeyValuesMap } from
|
|
1
|
+
import { IRule } from '../../common/IRule';
|
|
2
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
3
|
+
import { ISearchDependencies } from '../../common/ISearchDependencies';
|
|
4
|
+
import { FilterKeyValuesMap } from '../FilterKeyValuesMap';
|
|
5
5
|
export declare class SingleValueSelectedForFilterRule implements IRule {
|
|
6
6
|
private readonly filterKey;
|
|
7
7
|
constructor(filterKey: FilterKey);
|
|
@@ -4,7 +4,7 @@ export class SingleValueSelectedForFilterRule {
|
|
|
4
4
|
this.filterKey = filterKey;
|
|
5
5
|
}
|
|
6
6
|
getName() {
|
|
7
|
-
return
|
|
7
|
+
return `SingleValueSelectedForFilterRule-${this.filterKey}`;
|
|
8
8
|
}
|
|
9
9
|
async forSearch(dependencies) {
|
|
10
10
|
const seoInfoBase = dependencies.seoInfoBase;
|
|
@@ -10,7 +10,6 @@ export var FilterCombinations;
|
|
|
10
10
|
FilterCombinations["DISCIPLINE"] = "discipline";
|
|
11
11
|
FilterCombinations["UNFILTERED"] = "unfiltered";
|
|
12
12
|
FilterCombinations["UNIVERSITY_COUNTRY"] = "universityCountry";
|
|
13
|
-
// TODO: orgs
|
|
14
13
|
FilterCombinations["ATTENDANCE_DISCIPLINE"] = "attendancedDiscipline";
|
|
15
14
|
FilterCombinations["CONTINENT_ATTENDANCE"] = "continentAttendance";
|
|
16
15
|
FilterCombinations["COUNTRY_ATTENDANCE"] = "countryAttendance";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ISearchIndexabilityManager } from
|
|
2
|
-
import { ISeoIndexabilityPolicy } from
|
|
3
|
-
import { IOrganisationSearchApplicationState } from
|
|
4
|
-
import { ISeoFilterState, ISeoInfoBase } from
|
|
5
|
-
import { PortalType } from
|
|
6
|
-
import { ISeoSortingState } from
|
|
1
|
+
import { ISearchIndexabilityManager } from '../common/ISearchIndexabilityManager';
|
|
2
|
+
import { ISeoIndexabilityPolicy } from '../common/ISeoIndexabilityPolicy';
|
|
3
|
+
import { IOrganisationSearchApplicationState } from './IOrganisationSearchApplicationState';
|
|
4
|
+
import { ISeoFilterState, ISeoInfoBase } from '../common';
|
|
5
|
+
import { PortalType } from '@studyportals/domain-client';
|
|
6
|
+
import { ISeoSortingState } from '../organisations/ISeoSortingState';
|
|
7
7
|
export declare class SearchIndexabilityManager implements ISearchIndexabilityManager {
|
|
8
8
|
policies: ISeoIndexabilityPolicy[];
|
|
9
9
|
constructor(portalType: PortalType, seoInfoBase: ISeoInfoBase, filterState: ISeoFilterState, sortingState: ISeoSortingState, applicationState: IOrganisationSearchApplicationState);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DependencyTypes } from
|
|
2
|
-
import { Area, AreaAttendance, Attendance, Continent, Country, CountryAttendance, Unfiltered, RankedArea, RankedAreaDiscipline, RankedAttendance, RankedAttendanceDiscipline, RankedContinent, RankedContinentAttendance, RankedCountry, RankedCountryAttendance, RankedCountryDiscipline, RankedDiscipline, RankedUnfiltered } from
|
|
1
|
+
import { DependencyTypes } from '../enums/DependencyTypes';
|
|
2
|
+
import { Area, AreaAttendance, Attendance, Continent, Country, CountryAttendance, Unfiltered, RankedArea, RankedAreaDiscipline, RankedAttendance, RankedAttendanceDiscipline, RankedContinent, RankedContinentAttendance, RankedCountry, RankedCountryAttendance, RankedCountryDiscipline, RankedDiscipline, RankedUnfiltered } from '../organisations/policies';
|
|
3
3
|
export class SearchIndexabilityManager {
|
|
4
4
|
policies;
|
|
5
5
|
constructor(portalType, seoInfoBase, filterState, sortingState, applicationState) {
|
|
@@ -33,7 +33,7 @@ export class SearchIndexabilityManager {
|
|
|
33
33
|
];
|
|
34
34
|
}
|
|
35
35
|
async shouldIndex() {
|
|
36
|
-
const results = await Promise.all(this.policies.map(policy => policy.shouldIndex()));
|
|
37
|
-
return results.some(result => result);
|
|
36
|
+
const results = await Promise.all(this.policies.map((policy) => policy.shouldIndex()));
|
|
37
|
+
return results.some((result) => result);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from './IOrganisationSearchApplicationState';
|
|
2
|
+
export * from './ISeoSortingState';
|
|
3
|
+
export * from './SearchIndexabilityManager';
|
|
4
|
+
export * from './types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from './IOrganisationSearchApplicationState';
|
|
2
|
+
export * from './ISeoSortingState';
|
|
3
|
+
export * from './SearchIndexabilityManager';
|
|
4
|
+
export * from './types';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PortalType } from '@studyportals/domain-client';
|
|
2
|
+
import { BaseSeoIndexabilityPolicy } from '../../common/policies/BaseSeoIndexabilityPolicy';
|
|
3
|
+
import { IOrganisationsSeoDependencies } from '../types/IOrganisationsSeoDependencies';
|
|
4
|
+
import { SortingOptions } from '../../enums/SortingOptions';
|
|
5
|
+
export declare abstract class OrganisationsSeoIndexabilityPolicy extends BaseSeoIndexabilityPolicy<IOrganisationsSeoDependencies> {
|
|
6
|
+
protected readonly indexablePortalTypes: PortalType[];
|
|
7
|
+
protected abstract readonly sortingOption: SortingOptions;
|
|
8
|
+
constructor(dependencies: IOrganisationsSeoDependencies);
|
|
9
|
+
generateSitemapUrls(): Promise<string[]>;
|
|
10
|
+
protected isIndexable(): Promise<boolean>;
|
|
11
|
+
protected getPathWithSortingOption(path: string): string;
|
|
12
|
+
private matchesSortingOption;
|
|
13
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { PortalType } from '@studyportals/domain-client';
|
|
2
|
+
import { BaseSeoIndexabilityPolicy } from '../../common/policies/BaseSeoIndexabilityPolicy';
|
|
3
|
+
import { SortingOptions } from '../../enums/SortingOptions';
|
|
4
|
+
export class OrganisationsSeoIndexabilityPolicy extends BaseSeoIndexabilityPolicy {
|
|
5
|
+
indexablePortalTypes = [PortalType.MASTER];
|
|
6
|
+
constructor(dependencies) {
|
|
7
|
+
super(dependencies);
|
|
8
|
+
}
|
|
9
|
+
async generateSitemapUrls() {
|
|
10
|
+
if (this.indexablePortalTypes.includes(this.dependencies.portalType)) {
|
|
11
|
+
return super.generateSitemapUrls();
|
|
12
|
+
}
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
async isIndexable() {
|
|
16
|
+
const isIndexable = await super.isIndexable();
|
|
17
|
+
if (!isIndexable) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
return this.indexablePortalTypes.includes(this.dependencies.portalType) && this.matchesSortingOption();
|
|
21
|
+
}
|
|
22
|
+
getPathWithSortingOption(path) {
|
|
23
|
+
if (this.sortingOption === SortingOptions.UNIVERSITY_META_RANKING) {
|
|
24
|
+
return 'rankings/' + path;
|
|
25
|
+
}
|
|
26
|
+
return path;
|
|
27
|
+
}
|
|
28
|
+
matchesSortingOption() {
|
|
29
|
+
const dependencies = this.dependencies;
|
|
30
|
+
return dependencies.sortingState.getSelectedOption() === this.sortingOption;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PortalType } from '@studyportals/domain-client';
|
|
2
|
+
import { SortingOptions } from '../../enums/SortingOptions';
|
|
3
|
+
import { OrganisationsSeoIndexabilityPolicy } from './OrganisationsSeoIndexabilityPolicy';
|
|
4
|
+
export declare abstract class RankedOrganisationsSeoIndexabilityPolicy extends OrganisationsSeoIndexabilityPolicy {
|
|
5
|
+
protected readonly indexablePortalTypes: PortalType[];
|
|
6
|
+
protected readonly sortingOption: SortingOptions;
|
|
7
|
+
protected addRankedResultsCountRule(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PortalType } from '@studyportals/domain-client';
|
|
2
|
+
import { SortingOptions } from '../../enums/SortingOptions';
|
|
3
|
+
import { OrganisationsSeoIndexabilityPolicy } from './OrganisationsSeoIndexabilityPolicy';
|
|
4
|
+
import { AtLeastTwoRankedResultsRule } from '../rules/AtLeastTwoRankedResultsRule';
|
|
5
|
+
export class RankedOrganisationsSeoIndexabilityPolicy extends OrganisationsSeoIndexabilityPolicy {
|
|
6
|
+
indexablePortalTypes = [PortalType.MASTER];
|
|
7
|
+
sortingOption = SortingOptions.UNIVERSITY_META_RANKING;
|
|
8
|
+
addRankedResultsCountRule() {
|
|
9
|
+
let rankedResultsCountRule;
|
|
10
|
+
if (super.isSitemapUrlGeneratorDependencies()) {
|
|
11
|
+
const dependencies = this.dependencies;
|
|
12
|
+
rankedResultsCountRule = new AtLeastTwoRankedResultsRule(dependencies.rankingApiClient);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
rankedResultsCountRule = new AtLeastTwoRankedResultsRule();
|
|
16
|
+
}
|
|
17
|
+
this.rules.push(rankedResultsCountRule);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
1
|
+
export * from './our-picks/Area';
|
|
2
|
+
export * from './our-picks/AreaAttendance';
|
|
3
|
+
export * from './our-picks/Attendance';
|
|
4
|
+
export * from './our-picks/Continent';
|
|
5
|
+
export * from './our-picks/Country';
|
|
6
|
+
export * from './our-picks/CountryAttendance';
|
|
7
|
+
export * from './our-picks/Unfiltered';
|
|
8
|
+
export * from './ranked/RankedArea';
|
|
9
|
+
export * from './ranked/RankedAreaDiscipline';
|
|
10
|
+
export * from './ranked/RankedAttendance';
|
|
11
|
+
export * from './ranked/RankedAttendanceDiscipline';
|
|
12
|
+
export * from './ranked/RankedContinent';
|
|
13
|
+
export * from './ranked/RankedContinentAttendance';
|
|
14
|
+
export * from './ranked/RankedCountry';
|
|
15
|
+
export * from './ranked/RankedCountryAttendance';
|
|
16
|
+
export * from './ranked/RankedCountryDiscipline';
|
|
17
|
+
export * from './ranked/RankedDiscipline';
|
|
18
|
+
export * from './ranked/RankedUnfiltered';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
1
|
+
export * from './our-picks/Area';
|
|
2
|
+
export * from './our-picks/AreaAttendance';
|
|
3
|
+
export * from './our-picks/Attendance';
|
|
4
|
+
export * from './our-picks/Continent';
|
|
5
|
+
export * from './our-picks/Country';
|
|
6
|
+
export * from './our-picks/CountryAttendance';
|
|
7
|
+
export * from './our-picks/Unfiltered';
|
|
8
|
+
export * from './ranked/RankedArea';
|
|
9
|
+
export * from './ranked/RankedAreaDiscipline';
|
|
10
|
+
export * from './ranked/RankedAttendance';
|
|
11
|
+
export * from './ranked/RankedAttendanceDiscipline';
|
|
12
|
+
export * from './ranked/RankedContinent';
|
|
13
|
+
export * from './ranked/RankedContinentAttendance';
|
|
14
|
+
export * from './ranked/RankedCountry';
|
|
15
|
+
export * from './ranked/RankedCountryAttendance';
|
|
16
|
+
export * from './ranked/RankedCountryDiscipline';
|
|
17
|
+
export * from './ranked/RankedDiscipline';
|
|
18
|
+
export * from './ranked/RankedUnfiltered';
|