@studyportals/fawkes 8.2.4-8 → 8.2.4-9

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,5 +1,5 @@
1
1
  import { DependencyTypes } from '../enums/DependencyTypes';
2
- import { City, Area, AreaAttendance, Attendance, Continent, Country, CountryAttendance, Unfiltered, RankedArea, RankedAreaDiscipline, RankedAttendance, RankedAttendanceDiscipline, RankedContinent, RankedContinentAttendance, RankedCountry, RankedCountryAttendance, RankedCountryDiscipline, RankedDiscipline, RankedUnfiltered } from '../organisations/policies';
2
+ import { Area, AreaAttendance, Attendance, Continent, Country, CountryAttendance, Unfiltered, RankedArea, RankedAreaDiscipline, RankedAttendance, RankedAttendanceDiscipline, RankedContinent, RankedContinentAttendance, RankedCountry, RankedCountryAttendance, RankedCountryDiscipline, RankedDiscipline, RankedUnfiltered, CountryCity, CountryAreaCity } from '../organisations/policies';
3
3
  export class SearchIndexabilityManager {
4
4
  policies;
5
5
  constructor(portalType, seoInfoBase, filterState, sortingState, applicationState) {
@@ -12,12 +12,13 @@ export class SearchIndexabilityManager {
12
12
  portalType
13
13
  };
14
14
  this.policies = [
15
- new City(dependencies),
16
15
  new Area(dependencies),
17
16
  new AreaAttendance(dependencies),
18
17
  new Attendance(dependencies),
19
18
  new Continent(dependencies),
20
19
  new Country(dependencies),
20
+ new CountryCity(dependencies),
21
+ new CountryAreaCity(dependencies),
21
22
  new CountryAttendance(dependencies),
22
23
  new Unfiltered(dependencies),
23
24
  new RankedArea(dependencies),
@@ -1,9 +1,10 @@
1
- export * from './our-picks/City';
2
1
  export * from './our-picks/Area';
3
2
  export * from './our-picks/AreaAttendance';
4
3
  export * from './our-picks/Attendance';
5
4
  export * from './our-picks/Continent';
6
5
  export * from './our-picks/Country';
6
+ export * from './our-picks/CountryCity';
7
+ export * from './our-picks/CountryAreaCity';
7
8
  export * from './our-picks/CountryAttendance';
8
9
  export * from './our-picks/Unfiltered';
9
10
  export * from './ranked/RankedArea';
@@ -1,9 +1,10 @@
1
- export * from './our-picks/City';
2
1
  export * from './our-picks/Area';
3
2
  export * from './our-picks/AreaAttendance';
4
3
  export * from './our-picks/Attendance';
5
4
  export * from './our-picks/Continent';
6
5
  export * from './our-picks/Country';
6
+ export * from './our-picks/CountryCity';
7
+ export * from './our-picks/CountryAreaCity';
7
8
  export * from './our-picks/CountryAttendance';
8
9
  export * from './our-picks/Unfiltered';
9
10
  export * from './ranked/RankedArea';
@@ -0,0 +1,13 @@
1
+ import { FilterCombinations } from '../../../enums/FilterCombinations';
2
+ import { SortingOptions } from '../../../enums/SortingOptions';
3
+ import { OrganisationsSeoIndexabilityPolicy } from '../../../organisations/policies/OrganisationsSeoIndexabilityPolicy';
4
+ import { SingleValueSelectedForFilterRule } from '../../../common/rules/SingleValueSelectedForFilterRule';
5
+ import { OnlyFiltersSelectedRule } from '../../../common/rules/OnlyFiltersSelectedRule';
6
+ export declare class CountryAreaCity extends OrganisationsSeoIndexabilityPolicy {
7
+ readonly name: string;
8
+ readonly description: string;
9
+ protected readonly sortingOption = SortingOptions.OUR_PICKS;
10
+ protected readonly baseRules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule)[];
11
+ protected generateUrls(): Promise<string[]>;
12
+ get filterCombination(): FilterCombinations;
13
+ }
@@ -0,0 +1,25 @@
1
+ import { FilterCombinations } from '../../../enums/FilterCombinations';
2
+ import { FilterKey } from '@studyportals/search-filters/server-side';
3
+ import { SortingOptions } from '../../../enums/SortingOptions';
4
+ import { OrganisationsSeoIndexabilityPolicy } from '../../../organisations/policies/OrganisationsSeoIndexabilityPolicy';
5
+ import { SingleValueSelectedForFilterRule } from '../../../common/rules/SingleValueSelectedForFilterRule';
6
+ import { OnlyFiltersSelectedRule } from '../../../common/rules/OnlyFiltersSelectedRule';
7
+ export class CountryAreaCity extends OrganisationsSeoIndexabilityPolicy {
8
+ name = 'Country Area City Policy';
9
+ description = 'Controls indexing of pages filtered by geographic cities and areas, ensuring only SEO-valuable regional content with sufficient search volume is indexed.';
10
+ sortingOption = SortingOptions.OUR_PICKS;
11
+ baseRules = [
12
+ new SingleValueSelectedForFilterRule(FilterKey.CITY),
13
+ new SingleValueSelectedForFilterRule(FilterKey.COUNTRY),
14
+ new SingleValueSelectedForFilterRule(FilterKey.AREA),
15
+ new OnlyFiltersSelectedRule([FilterKey.CITY, FilterKey.COUNTRY, FilterKey.AREA])
16
+ ];
17
+ async generateUrls() {
18
+ // NOTE: Since we have a mechanism for url calculation in CountryCity policy, that covers this scenario. For that reason this method is left unimplemented.
19
+ // In any case that you delete the CountryCity policy, you should implement this method to avoid losing functionality.
20
+ return await new Promise((resolve) => resolve([]));
21
+ }
22
+ get filterCombination() {
23
+ return FilterCombinations.CITY;
24
+ }
25
+ }
@@ -0,0 +1,13 @@
1
+ import { FilterCombinations } from '../../../enums/FilterCombinations';
2
+ import { SortingOptions } from '../../../enums/SortingOptions';
3
+ import { OrganisationsSeoIndexabilityPolicy } from '../../../organisations/policies/OrganisationsSeoIndexabilityPolicy';
4
+ import { SingleValueSelectedForFilterRule } from '../../../common/rules/SingleValueSelectedForFilterRule';
5
+ import { OnlyFiltersSelectedRule } from '../../../common/rules/OnlyFiltersSelectedRule';
6
+ export declare class CountryCity extends OrganisationsSeoIndexabilityPolicy {
7
+ readonly name: string;
8
+ readonly description: string;
9
+ protected readonly sortingOption = SortingOptions.OUR_PICKS;
10
+ protected readonly baseRules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule)[];
11
+ protected generateUrls(): Promise<string[]>;
12
+ get filterCombination(): FilterCombinations;
13
+ }
@@ -0,0 +1,37 @@
1
+ import { FilterCombinations } from '../../../enums/FilterCombinations';
2
+ import { FilterKey } from '@studyportals/search-filters/server-side';
3
+ import { SortingOptions } from '../../../enums/SortingOptions';
4
+ import { OrganisationsSeoIndexabilityPolicy } from '../../../organisations/policies/OrganisationsSeoIndexabilityPolicy';
5
+ import { CityPresenter } from '../../../presenters/CityPresenter';
6
+ import { SingleValueSelectedForFilterRule } from '../../../common/rules/SingleValueSelectedForFilterRule';
7
+ import { OnlyFiltersSelectedRule } from '../../../common/rules/OnlyFiltersSelectedRule';
8
+ export class CountryCity extends OrganisationsSeoIndexabilityPolicy {
9
+ name = 'Country City Policy';
10
+ description = 'Controls indexing of pages filtered by geographic cities, ensuring only SEO-valuable regional content with sufficient search volume is indexed.';
11
+ sortingOption = SortingOptions.OUR_PICKS;
12
+ baseRules = [
13
+ new SingleValueSelectedForFilterRule(FilterKey.CITY),
14
+ new SingleValueSelectedForFilterRule(FilterKey.COUNTRY),
15
+ new OnlyFiltersSelectedRule([FilterKey.CITY, FilterKey.COUNTRY])
16
+ ];
17
+ async generateUrls() {
18
+ const cityFragments = await CityPresenter
19
+ .getInstance(this.dependencies.searchApiClient)
20
+ .getFragments();
21
+ const paths = [];
22
+ for (const city of cityFragments) {
23
+ const filterKeyValues = new Map([
24
+ [FilterKey.CITY, [city.id]],
25
+ [FilterKey.COUNTRY, [city.countryId]]
26
+ ]);
27
+ const result = await this.checkRulesForSitemap(filterKeyValues);
28
+ if (result) {
29
+ paths.push(this.getPathWithSortingOption(city.path));
30
+ }
31
+ }
32
+ return paths;
33
+ }
34
+ get filterCombination() {
35
+ return FilterCombinations.CITY;
36
+ }
37
+ }
@@ -1,12 +1,13 @@
1
1
  import { DependencyTypes } from '../enums/DependencyTypes';
2
2
  import { BaseSitemapUrlGeneratorManager } from './BaseSitemapUrlGeneratorManager';
3
- import { City, Area, AreaAttendance, Attendance, Continent, Country, CountryAttendance, RankedArea, RankedAreaDiscipline, RankedAttendance, RankedAttendanceDiscipline, RankedContinent, RankedContinentAttendance, RankedCountry, RankedCountryAttendance, RankedCountryDiscipline, RankedDiscipline, RankedUnfiltered, Unfiltered } from '../organisations/policies';
3
+ import { Area, AreaAttendance, Attendance, Continent, Country, CountryCity, CountryAttendance, RankedArea, RankedAreaDiscipline, RankedAttendance, RankedAttendanceDiscipline, RankedContinent, RankedContinentAttendance, RankedCountry, RankedCountryAttendance, RankedCountryDiscipline, RankedDiscipline, RankedUnfiltered, Unfiltered } from '../organisations/policies';
4
4
  import { AreaPresenter } from '../presenters/AreaPresenter';
5
5
  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
9
  import { FilterKey } from '@studyportals/search-filters/server-side';
10
+ import { CountryAreaCity } from '../organisations/policies/our-picks/CountryAreaCity';
10
11
  export class OrganisationsSitemapUrlGeneratorManager extends BaseSitemapUrlGeneratorManager {
11
12
  portalType;
12
13
  policies;
@@ -22,7 +23,8 @@ export class OrganisationsSitemapUrlGeneratorManager extends BaseSitemapUrlGener
22
23
  rankingApiClient
23
24
  };
24
25
  this.policies = [
25
- new City(dependencies),
26
+ new CountryCity(dependencies),
27
+ new CountryAreaCity(dependencies),
26
28
  new Area(dependencies),
27
29
  new AreaAttendance(dependencies),
28
30
  new Attendance(dependencies),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studyportals/fawkes",
3
- "version": "8.2.4-8",
3
+ "version": "8.2.4-9",
4
4
  "description": "A package to centralize SEO related logic for SBLP and Sitemap Generator.",
5
5
  "files": [
6
6
  "./dist"