@studyportals/fawkes 8.5.3-1 → 8.5.3-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.
Files changed (41) hide show
  1. package/README.md +176 -176
  2. package/dist/src/enums/FilterCombinations.d.ts +0 -2
  3. package/dist/src/enums/FilterCombinations.js +0 -2
  4. package/dist/src/organisations/SearchIndexabilityManager.js +1 -3
  5. package/dist/src/organisations/policies/index.d.ts +0 -2
  6. package/dist/src/organisations/policies/index.js +0 -2
  7. package/dist/src/programmes/ProgrammesBaseIndexabilityPolicy.js +5 -0
  8. package/dist/src/programmes/policies/AttendanceDegree.d.ts +2 -5
  9. package/dist/src/programmes/policies/AttendanceDegree.js +11 -7
  10. package/dist/src/programmes/policies/CountryAttendanceDegree.js +1 -1
  11. package/dist/src/programmes/policies/CountryDegree.d.ts +2 -4
  12. package/dist/src/programmes/policies/CountryDegree.js +10 -6
  13. package/dist/src/programmes/policies/CountryDurationDegree.js +1 -1
  14. package/dist/src/programmes/policies/CountryEducationalForm.d.ts +2 -4
  15. package/dist/src/programmes/policies/CountryEducationalForm.js +11 -7
  16. package/dist/src/programmes/policies/DegreeAttendanceTuitionFee.d.ts +2 -6
  17. package/dist/src/programmes/policies/DegreeAttendanceTuitionFee.js +13 -9
  18. package/dist/src/programmes/policies/DegreeContinent.d.ts +2 -4
  19. package/dist/src/programmes/policies/DegreeContinent.js +10 -6
  20. package/dist/src/programmes/policies/DegreeContinentTuitionFee.d.ts +2 -4
  21. package/dist/src/programmes/policies/DegreeContinentTuitionFee.js +11 -7
  22. package/dist/src/programmes/policies/DegreeDuration.d.ts +2 -5
  23. package/dist/src/programmes/policies/DegreeDuration.js +11 -7
  24. package/dist/src/programmes/policies/DegreeFormat.d.ts +2 -4
  25. package/dist/src/programmes/policies/DegreeFormat.js +10 -6
  26. package/dist/src/programmes/policies/DegreeFormatTuitionFee.d.ts +2 -6
  27. package/dist/src/programmes/policies/DegreeFormatTuitionFee.js +13 -9
  28. package/dist/src/programmes/policies/DisciplineCountryEducationalForm.d.ts +2 -4
  29. package/dist/src/programmes/policies/DisciplineCountryEducationalForm.js +12 -8
  30. package/dist/src/programmes/policies/DisciplineEducationalForm.d.ts +2 -4
  31. package/dist/src/programmes/policies/DisciplineEducationalForm.js +11 -7
  32. package/dist/src/programmes/rules/IndexableDegreeRule.d.ts +4 -1
  33. package/dist/src/programmes/rules/IndexableDegreeRule.js +53 -27
  34. package/dist/src/programmes/rules/IndexableEducationalFormRule.d.ts +3 -0
  35. package/dist/src/programmes/rules/IndexableEducationalFormRule.js +18 -5
  36. package/dist/src/sitemap-generator/OrganisationsSitemapUrlGeneratorManager.js +1 -3
  37. package/package.json +105 -105
  38. package/dist/src/organisations/policies/ranked/RankedCountryAreaCity.d.ts +0 -13
  39. package/dist/src/organisations/policies/ranked/RankedCountryAreaCity.js +0 -43
  40. package/dist/src/organisations/policies/ranked/RankedCountryCity.d.ts +0 -14
  41. package/dist/src/organisations/policies/ranked/RankedCountryCity.js +0 -41
@@ -1,15 +1,13 @@
1
1
  import { FilterKey } from '@studyportals/search-filters/server-side';
2
- import { OnlyFiltersSelectedRule } from '../../common/rules/OnlyFiltersSelectedRule';
3
- import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValueSelectedForFilterRule';
4
2
  import { FilterCombinations } from '../../enums/FilterCombinations';
5
- import { IndexableDegreeRule } from '../rules/IndexableDegreeRule';
6
3
  import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
7
4
  import { IProgrammeSeoDependencies } from '../types/IProgrammeSeoDependencies';
5
+ import { IRule } from '../../common/IRule';
8
6
  export declare class DegreeContinent extends ProgrammesBaseIndexabilityPolicy {
9
7
  readonly name: string;
10
8
  readonly description: string;
11
9
  readonly filterKeys: FilterKey[];
12
- protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule | IndexableDegreeRule)[];
10
+ protected readonly rules: IRule[];
13
11
  constructor(dependencies: IProgrammeSeoDependencies);
14
12
  protected generateUrls(): Promise<string[]>;
15
13
  get filterCombination(): FilterCombinations;
@@ -10,14 +10,18 @@ export class DegreeContinent extends ProgrammesBaseIndexabilityPolicy {
10
10
  name = 'Degree Continent Policy';
11
11
  description = 'Determines indexing rules for pages filtered by both degree type, and continent.';
12
12
  filterKeys = [FilterKey.DEGREE_TYPE, FilterKey.CONTINENT];
13
- rules = [
14
- new SingleValueSelectedForFilterRule(FilterKey.CONTINENT),
15
- new SingleValueSelectedForFilterRule(FilterKey.DEGREE_TYPE),
16
- new OnlyFiltersSelectedRule([FilterKey.CONTINENT, FilterKey.DEGREE_TYPE]),
17
- new IndexableDegreeRule()
18
- ];
13
+ rules;
19
14
  constructor(dependencies) {
20
15
  super(dependencies);
16
+ const portalType = this.isSitemapUrlGeneratorDependencies()
17
+ ? dependencies.portalType
18
+ : undefined;
19
+ this.rules = [
20
+ new SingleValueSelectedForFilterRule(FilterKey.CONTINENT),
21
+ new SingleValueSelectedForFilterRule(FilterKey.DEGREE_TYPE),
22
+ new OnlyFiltersSelectedRule([FilterKey.CONTINENT, FilterKey.DEGREE_TYPE]),
23
+ new IndexableDegreeRule(portalType)
24
+ ];
21
25
  this.initateBaseRules();
22
26
  }
23
27
  async generateUrls() {
@@ -1,15 +1,13 @@
1
1
  import { FilterKey } from '@studyportals/search-filters/server-side';
2
- import { OnlyFiltersSelectedRule } from '../../common/rules/OnlyFiltersSelectedRule';
3
- import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValueSelectedForFilterRule';
4
2
  import { FilterCombinations } from '../../enums/FilterCombinations';
5
- import { IndexableDegreeRule } from '../rules/IndexableDegreeRule';
6
3
  import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
7
4
  import { IProgrammeSeoDependencies } from '../types/IProgrammeSeoDependencies';
5
+ import { IRule } from '../../common/IRule';
8
6
  export declare class DegreeContinentTuitionFee extends ProgrammesBaseIndexabilityPolicy {
9
7
  readonly name: string;
10
8
  readonly description: string;
11
9
  readonly filterKeys: FilterKey[];
12
- protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule | IndexableDegreeRule)[];
10
+ protected readonly rules: IRule[];
13
11
  constructor(dependencies: IProgrammeSeoDependencies);
14
12
  protected generateUrls(): Promise<string[]>;
15
13
  get filterCombination(): FilterCombinations;
@@ -11,15 +11,19 @@ export class DegreeContinentTuitionFee extends ProgrammesBaseIndexabilityPolicy
11
11
  name = 'Degree Continent Tuition Fee Policy';
12
12
  description = 'Determines indexing rules for pages filtered by degree type, continent, and tuition fee.';
13
13
  filterKeys = [FilterKey.DEGREE_TYPE, FilterKey.CONTINENT, FilterKey.TUITION_FEE];
14
- rules = [
15
- new SingleValueSelectedForFilterRule(FilterKey.CONTINENT),
16
- new SingleValueSelectedForFilterRule(FilterKey.DEGREE_TYPE),
17
- new SingleValueSelectedForFilterRule(FilterKey.TUITION_FEE),
18
- new OnlyFiltersSelectedRule([FilterKey.CONTINENT, FilterKey.DEGREE_TYPE, FilterKey.TUITION_FEE]),
19
- new IndexableDegreeRule()
20
- ];
14
+ rules;
21
15
  constructor(dependencies) {
22
16
  super(dependencies);
17
+ const portalType = this.isSitemapUrlGeneratorDependencies()
18
+ ? dependencies.portalType
19
+ : undefined;
20
+ this.rules = [
21
+ new SingleValueSelectedForFilterRule(FilterKey.CONTINENT),
22
+ new SingleValueSelectedForFilterRule(FilterKey.DEGREE_TYPE),
23
+ new SingleValueSelectedForFilterRule(FilterKey.TUITION_FEE),
24
+ new OnlyFiltersSelectedRule([FilterKey.CONTINENT, FilterKey.DEGREE_TYPE, FilterKey.TUITION_FEE]),
25
+ new IndexableDegreeRule(portalType)
26
+ ];
23
27
  this.initateBaseRules();
24
28
  }
25
29
  async generateUrls() {
@@ -1,16 +1,13 @@
1
1
  import { FilterKey } from '@studyportals/search-filters/server-side';
2
- import { OnlyFiltersSelectedRule } from '../../common/rules/OnlyFiltersSelectedRule';
3
- import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValueSelectedForFilterRule';
4
2
  import { FilterCombinations } from '../../enums/FilterCombinations';
5
- import { IndexableDegreeRule } from '../rules/IndexableDegreeRule';
6
3
  import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
7
4
  import { IProgrammeSeoDependencies } from '../types/IProgrammeSeoDependencies';
8
- import { OneOrTwoYearDurationRule } from '../rules/OneOrTwoYearDurationRule';
5
+ import { IRule } from '../../common/IRule';
9
6
  export declare class DegreeDuration extends ProgrammesBaseIndexabilityPolicy {
10
7
  readonly name: string;
11
8
  readonly description: string;
12
9
  readonly filterKeys: FilterKey[];
13
- protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule | IndexableDegreeRule | OneOrTwoYearDurationRule)[];
10
+ protected readonly rules: IRule[];
14
11
  constructor(dependencies: IProgrammeSeoDependencies);
15
12
  protected generateUrls(): Promise<string[]>;
16
13
  get filterCombination(): FilterCombinations;
@@ -11,15 +11,19 @@ export class DegreeDuration extends ProgrammesBaseIndexabilityPolicy {
11
11
  name = 'Degree Duration Policy';
12
12
  description = 'Determines indexing rules for pages filtered by degree type and duration (2 years).';
13
13
  filterKeys = [FilterKey.DEGREE_TYPE, FilterKey.DURATION];
14
- rules = [
15
- new SingleValueSelectedForFilterRule(FilterKey.DURATION),
16
- new SingleValueSelectedForFilterRule(FilterKey.DEGREE_TYPE),
17
- new OnlyFiltersSelectedRule([FilterKey.DURATION, FilterKey.DEGREE_TYPE]),
18
- new IndexableDegreeRule(),
19
- new OneOrTwoYearDurationRule()
20
- ];
14
+ rules;
21
15
  constructor(dependencies) {
22
16
  super(dependencies);
17
+ const portalType = this.isSitemapUrlGeneratorDependencies()
18
+ ? dependencies.portalType
19
+ : undefined;
20
+ this.rules = [
21
+ new SingleValueSelectedForFilterRule(FilterKey.DURATION),
22
+ new SingleValueSelectedForFilterRule(FilterKey.DEGREE_TYPE),
23
+ new OnlyFiltersSelectedRule([FilterKey.DURATION, FilterKey.DEGREE_TYPE]),
24
+ new IndexableDegreeRule(portalType),
25
+ new OneOrTwoYearDurationRule()
26
+ ];
23
27
  this.initateBaseRules();
24
28
  }
25
29
  async generateUrls() {
@@ -1,15 +1,13 @@
1
1
  import { FilterKey } from '@studyportals/search-filters/server-side';
2
- import { OnlyFiltersSelectedRule } from '../../common/rules/OnlyFiltersSelectedRule';
3
- import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValueSelectedForFilterRule';
4
2
  import { FilterCombinations } from '../../enums/FilterCombinations';
5
- import { IndexableDegreeRule } from '../rules/IndexableDegreeRule';
6
3
  import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
7
4
  import { IProgrammeSeoDependencies } from '../types/IProgrammeSeoDependencies';
5
+ import { IRule } from '../../common/IRule';
8
6
  export declare class DegreeFormat extends ProgrammesBaseIndexabilityPolicy {
9
7
  readonly name: string;
10
8
  readonly description: string;
11
9
  readonly filterKeys: FilterKey[];
12
- protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule | IndexableDegreeRule)[];
10
+ protected readonly rules: IRule[];
13
11
  constructor(dependencies: IProgrammeSeoDependencies);
14
12
  protected generateUrls(): Promise<string[]>;
15
13
  get filterCombination(): FilterCombinations;
@@ -10,14 +10,18 @@ export class DegreeFormat extends ProgrammesBaseIndexabilityPolicy {
10
10
  name = 'Degree Format Policy';
11
11
  description = 'Determines indexing rules for pages filtered by degree type and format.';
12
12
  filterKeys = [FilterKey.DEGREE_TYPE, FilterKey.ATTENDANCE];
13
- rules = [
14
- new SingleValueSelectedForFilterRule(FilterKey.ATTENDANCE),
15
- new SingleValueSelectedForFilterRule(FilterKey.DEGREE_TYPE),
16
- new OnlyFiltersSelectedRule([FilterKey.ATTENDANCE, FilterKey.DEGREE_TYPE]),
17
- new IndexableDegreeRule()
18
- ];
13
+ rules;
19
14
  constructor(dependencies) {
20
15
  super(dependencies);
16
+ const portalType = this.isSitemapUrlGeneratorDependencies()
17
+ ? dependencies.portalType
18
+ : undefined;
19
+ this.rules = [
20
+ new SingleValueSelectedForFilterRule(FilterKey.ATTENDANCE),
21
+ new SingleValueSelectedForFilterRule(FilterKey.DEGREE_TYPE),
22
+ new OnlyFiltersSelectedRule([FilterKey.ATTENDANCE, FilterKey.DEGREE_TYPE]),
23
+ new IndexableDegreeRule(portalType)
24
+ ];
21
25
  this.initateBaseRules();
22
26
  }
23
27
  async generateUrls() {
@@ -1,17 +1,13 @@
1
1
  import { FilterKey } from '@studyportals/search-filters/server-side';
2
- import { OnlyFiltersSelectedRule } from '../../common/rules/OnlyFiltersSelectedRule';
3
- import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValueSelectedForFilterRule';
4
2
  import { FilterCombinations } from '../../enums/FilterCombinations';
5
- import { IndexableDegreeRule } from '../rules/IndexableDegreeRule';
6
3
  import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
7
4
  import { IProgrammeSeoDependencies } from '../types/IProgrammeSeoDependencies';
8
- import { AffordableTuitionFeeRule } from '../rules/AffordableTuitionFeeRule';
9
- import { PartTimeFormatRule } from '../rules/PartTimeFormatRule';
5
+ import { IRule } from '../../common/IRule';
10
6
  export declare class DegreeFormatTuitionFee extends ProgrammesBaseIndexabilityPolicy {
11
7
  readonly name: string;
12
8
  readonly description: string;
13
9
  readonly filterKeys: FilterKey[];
14
- protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule | IndexableDegreeRule | AffordableTuitionFeeRule | PartTimeFormatRule)[];
10
+ protected readonly rules: IRule[];
15
11
  constructor(dependencies: IProgrammeSeoDependencies);
16
12
  protected generateUrls(): Promise<string[]>;
17
13
  get filterCombination(): FilterCombinations;
@@ -13,17 +13,21 @@ export class DegreeFormatTuitionFee extends ProgrammesBaseIndexabilityPolicy {
13
13
  name = 'Degree Format Tuition Fee Policy';
14
14
  description = 'Determines indexing rules for pages filtered by degree type, format and tuition fee.';
15
15
  filterKeys = [FilterKey.DEGREE_TYPE, FilterKey.ATTENDANCE, FilterKey.TUITION_FEE];
16
- rules = [
17
- new SingleValueSelectedForFilterRule(FilterKey.ATTENDANCE),
18
- new SingleValueSelectedForFilterRule(FilterKey.DEGREE_TYPE),
19
- new SingleValueSelectedForFilterRule(FilterKey.TUITION_FEE),
20
- new OnlyFiltersSelectedRule([FilterKey.ATTENDANCE, FilterKey.DEGREE_TYPE, FilterKey.TUITION_FEE]),
21
- new IndexableDegreeRule(),
22
- new AffordableTuitionFeeRule(),
23
- new PartTimeFormatRule()
24
- ];
16
+ rules;
25
17
  constructor(dependencies) {
26
18
  super(dependencies);
19
+ const portalType = this.isSitemapUrlGeneratorDependencies()
20
+ ? dependencies.portalType
21
+ : undefined;
22
+ this.rules = [
23
+ new SingleValueSelectedForFilterRule(FilterKey.ATTENDANCE),
24
+ new SingleValueSelectedForFilterRule(FilterKey.DEGREE_TYPE),
25
+ new SingleValueSelectedForFilterRule(FilterKey.TUITION_FEE),
26
+ new OnlyFiltersSelectedRule([FilterKey.ATTENDANCE, FilterKey.DEGREE_TYPE, FilterKey.TUITION_FEE]),
27
+ new IndexableDegreeRule(portalType),
28
+ new AffordableTuitionFeeRule(),
29
+ new PartTimeFormatRule()
30
+ ];
27
31
  this.initateBaseRules();
28
32
  }
29
33
  async generateUrls() {
@@ -1,15 +1,13 @@
1
1
  import { FilterKey } from '@studyportals/search-filters/server-side';
2
- import { OnlyFiltersSelectedRule } from '../../common/rules/OnlyFiltersSelectedRule';
3
- import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValueSelectedForFilterRule';
4
2
  import { FilterCombinations } from '../../enums/FilterCombinations';
5
- import { IndexableEducationalFormRule } from '../rules/IndexableEducationalFormRule';
6
3
  import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
7
4
  import { IProgrammeSeoDependencies } from '../types/IProgrammeSeoDependencies';
5
+ import { IRule } from '../../common/IRule';
8
6
  export declare class DisciplineCountryEducationalForm extends ProgrammesBaseIndexabilityPolicy {
9
7
  readonly name: string;
10
8
  readonly description: string;
11
9
  readonly filterKeys: FilterKey[];
12
- protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule | IndexableEducationalFormRule)[];
10
+ protected readonly rules: IRule[];
13
11
  constructor(dependencies: IProgrammeSeoDependencies);
14
12
  protected generateUrls(): Promise<string[]>;
15
13
  get filterCombination(): FilterCombinations;
@@ -9,18 +9,22 @@ import { CountryPresenter } from '../../presenters/CountryPresenter';
9
9
  import { EducationalFormPresenter } from '../../presenters/EducationalFormPresenter';
10
10
  export class DisciplineCountryEducationalForm extends ProgrammesBaseIndexabilityPolicy {
11
11
  name = 'Discipline Country Educational Form Policy';
12
- description = `Determines indexing rules for pages filtered by discipline,
12
+ description = `Determines indexing rules for pages filtered by discipline,
13
13
  country, and educational form (academic, semester, summer school, etc.).`;
14
14
  filterKeys = [FilterKey.DISCIPLINES, FilterKey.COUNTRY, FilterKey.EDUCATIONAL_FORM];
15
- rules = [
16
- new SingleValueSelectedForFilterRule(FilterKey.DISCIPLINES),
17
- new SingleValueSelectedForFilterRule(FilterKey.COUNTRY),
18
- new SingleValueSelectedForFilterRule(FilterKey.EDUCATIONAL_FORM),
19
- new OnlyFiltersSelectedRule([FilterKey.DISCIPLINES, FilterKey.COUNTRY, FilterKey.EDUCATIONAL_FORM]),
20
- new IndexableEducationalFormRule()
21
- ];
15
+ rules;
22
16
  constructor(dependencies) {
23
17
  super(dependencies);
18
+ const portalType = this.isSitemapUrlGeneratorDependencies()
19
+ ? dependencies.portalType
20
+ : undefined;
21
+ this.rules = [
22
+ new SingleValueSelectedForFilterRule(FilterKey.DISCIPLINES),
23
+ new SingleValueSelectedForFilterRule(FilterKey.COUNTRY),
24
+ new SingleValueSelectedForFilterRule(FilterKey.EDUCATIONAL_FORM),
25
+ new OnlyFiltersSelectedRule([FilterKey.DISCIPLINES, FilterKey.COUNTRY, FilterKey.EDUCATIONAL_FORM]),
26
+ new IndexableEducationalFormRule(portalType)
27
+ ];
24
28
  this.initateBaseRules();
25
29
  }
26
30
  async generateUrls() {
@@ -1,15 +1,13 @@
1
1
  import { FilterKey } from '@studyportals/search-filters/server-side';
2
- import { OnlyFiltersSelectedRule } from '../../common/rules/OnlyFiltersSelectedRule';
3
- import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValueSelectedForFilterRule';
4
2
  import { FilterCombinations } from '../../enums/FilterCombinations';
5
- import { IndexableEducationalFormRule } from '../rules/IndexableEducationalFormRule';
6
3
  import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
7
4
  import { IProgrammeSeoDependencies } from '../types/IProgrammeSeoDependencies';
5
+ import { IRule } from '../../common/IRule';
8
6
  export declare class DisciplineEducationalForm extends ProgrammesBaseIndexabilityPolicy {
9
7
  readonly name: string;
10
8
  readonly description: string;
11
9
  readonly filterKeys: FilterKey[];
12
- protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule | IndexableEducationalFormRule)[];
10
+ protected readonly rules: IRule[];
13
11
  constructor(dependencies: IProgrammeSeoDependencies);
14
12
  protected generateUrls(): Promise<string[]>;
15
13
  get filterCombination(): FilterCombinations;
@@ -8,17 +8,21 @@ import { DisciplinePresenter } from '../../presenters/DisciplinePresenter';
8
8
  import { EducationalFormPresenter } from '../../presenters/EducationalFormPresenter';
9
9
  export class DisciplineEducationalForm extends ProgrammesBaseIndexabilityPolicy {
10
10
  name = 'Discipline Educational Form Policy';
11
- description = `Determines indexing rules for pages filtered by both discipline,
11
+ description = `Determines indexing rules for pages filtered by both discipline,
12
12
  and educational form (academic, semester, summer school, etc.).`;
13
13
  filterKeys = [FilterKey.DISCIPLINES, FilterKey.EDUCATIONAL_FORM];
14
- rules = [
15
- new SingleValueSelectedForFilterRule(FilterKey.DISCIPLINES),
16
- new SingleValueSelectedForFilterRule(FilterKey.EDUCATIONAL_FORM),
17
- new OnlyFiltersSelectedRule([FilterKey.DISCIPLINES, FilterKey.EDUCATIONAL_FORM]),
18
- new IndexableEducationalFormRule()
19
- ];
14
+ rules;
20
15
  constructor(dependencies) {
21
16
  super(dependencies);
17
+ const portalType = this.isSitemapUrlGeneratorDependencies()
18
+ ? dependencies.portalType
19
+ : undefined;
20
+ this.rules = [
21
+ new SingleValueSelectedForFilterRule(FilterKey.DISCIPLINES),
22
+ new SingleValueSelectedForFilterRule(FilterKey.EDUCATIONAL_FORM),
23
+ new OnlyFiltersSelectedRule([FilterKey.DISCIPLINES, FilterKey.EDUCATIONAL_FORM]),
24
+ new IndexableEducationalFormRule(portalType)
25
+ ];
22
26
  this.initateBaseRules();
23
27
  }
24
28
  async generateUrls() {
@@ -1,10 +1,13 @@
1
1
  import { ISearchDependencies } from '../../common/ISearchDependencies';
2
2
  import { FilterKeyValuesMap } from '../../common/FilterKeyValuesMap';
3
3
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
4
+ import { PortalType } from '@studyportals/domain-client';
4
5
  export declare class IndexableDegreeRule extends BaseProgrammeRule {
6
+ private readonly portalType;
7
+ constructor(portalType?: PortalType);
5
8
  forSearch(dependencies: ISearchDependencies): Promise<boolean>;
6
9
  forSitemapGenerator(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
7
10
  getName(): string;
8
11
  getDescription(): string;
9
- private get indexableDegreeTypes();
12
+ private getIndexableDegreeTypes;
10
13
  }
@@ -1,53 +1,79 @@
1
1
  import { FilterKey } from '@studyportals/search-filters/server-side';
2
2
  import { DegreeTypeFilterOptionValue } from '@studyportals/search-filters/server-side';
3
3
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
4
+ import { PortalType } from '@studyportals/domain-client';
5
+ import { DependencyMissingError } from '../../errors/DependencyMissingError';
4
6
  export class IndexableDegreeRule extends BaseProgrammeRule {
7
+ portalType;
8
+ constructor(portalType) {
9
+ super();
10
+ this.portalType = portalType;
11
+ }
5
12
  forSearch(dependencies) {
6
13
  const { seoInfoBase, filterState } = dependencies;
14
+ const programmeSearchDependencies = dependencies;
15
+ const portalType = programmeSearchDependencies.portalType;
7
16
  const selectedDegree = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
8
17
  if (!selectedDegree) {
9
18
  return Promise.resolve(false);
10
19
  }
11
- const isIndexable = this.indexableDegreeTypes.includes(selectedDegree);
20
+ const isIndexable = this.getIndexableDegreeTypes(portalType).includes(selectedDegree);
12
21
  return Promise.resolve(isIndexable);
13
22
  }
14
23
  forSitemapGenerator(filterKeyValues) {
24
+ if (!this.portalType) {
25
+ throw new DependencyMissingError('PortalType');
26
+ }
15
27
  const [selectedDegree] = filterKeyValues.get(FilterKey.DEGREE_TYPE);
16
28
  if (!selectedDegree) {
17
29
  return Promise.resolve(false);
18
30
  }
19
- const isIndexable = this.indexableDegreeTypes.includes(selectedDegree);
31
+ const isIndexable = this.getIndexableDegreeTypes(this.portalType).includes(selectedDegree);
20
32
  return Promise.resolve(isIndexable);
21
33
  }
22
34
  getName() {
23
35
  return 'IndexableDegreeRule';
24
36
  }
25
37
  getDescription() {
26
- return `Indexable if the selected degree type is one of the following: ${this.indexableDegreeTypes.join(', ')}`;
38
+ return `Indexable if the selected degree type is one of the indexable degrees for the portal type`;
27
39
  }
28
- get indexableDegreeTypes() {
29
- return [
30
- DegreeTypeFilterOptionValue.DOCTORATE,
31
- DegreeTypeFilterOptionValue.DBA,
32
- DegreeTypeFilterOptionValue.PHD,
33
- DegreeTypeFilterOptionValue.MSC,
34
- DegreeTypeFilterOptionValue.MA,
35
- DegreeTypeFilterOptionValue.MBA,
36
- DegreeTypeFilterOptionValue.LLM,
37
- DegreeTypeFilterOptionValue.MPHIL,
38
- DegreeTypeFilterOptionValue.MED,
39
- DegreeTypeFilterOptionValue.MENG,
40
- DegreeTypeFilterOptionValue.POSTGRADIP,
41
- DegreeTypeFilterOptionValue.POSTGRADCERT,
42
- DegreeTypeFilterOptionValue.PREMASTER,
43
- DegreeTypeFilterOptionValue.BSC,
44
- DegreeTypeFilterOptionValue.BA,
45
- DegreeTypeFilterOptionValue.BBA,
46
- DegreeTypeFilterOptionValue.ASSOCIATE_DEGREE,
47
- DegreeTypeFilterOptionValue.GRADUATE_CERTTIFICATE,
48
- DegreeTypeFilterOptionValue.GRADUATE_DIPLOMA,
49
- DegreeTypeFilterOptionValue.PREBACHELOR,
50
- DegreeTypeFilterOptionValue.CERTIFICATE
51
- ];
40
+ getIndexableDegreeTypes(portalType) {
41
+ switch (portalType) {
42
+ case PortalType.MASTER:
43
+ return [
44
+ DegreeTypeFilterOptionValue.MSC,
45
+ DegreeTypeFilterOptionValue.MA,
46
+ DegreeTypeFilterOptionValue.MBA,
47
+ DegreeTypeFilterOptionValue.LLM,
48
+ DegreeTypeFilterOptionValue.MPHIL,
49
+ DegreeTypeFilterOptionValue.MED,
50
+ DegreeTypeFilterOptionValue.MENG,
51
+ DegreeTypeFilterOptionValue.POSTGRADIP,
52
+ DegreeTypeFilterOptionValue.POSTGRADCERT,
53
+ DegreeTypeFilterOptionValue.PREMASTER
54
+ ];
55
+ case PortalType.BACHELOR:
56
+ return [
57
+ DegreeTypeFilterOptionValue.BSC,
58
+ DegreeTypeFilterOptionValue.BA,
59
+ DegreeTypeFilterOptionValue.BBA,
60
+ DegreeTypeFilterOptionValue.ASSOCIATE_DEGREE,
61
+ DegreeTypeFilterOptionValue.GRADUATE_CERTTIFICATE,
62
+ DegreeTypeFilterOptionValue.GRADUATE_DIPLOMA,
63
+ DegreeTypeFilterOptionValue.PREBACHELOR
64
+ ];
65
+ case PortalType.PHD:
66
+ return [
67
+ DegreeTypeFilterOptionValue.PHD,
68
+ DegreeTypeFilterOptionValue.DBA,
69
+ DegreeTypeFilterOptionValue.DOCTORATE
70
+ ];
71
+ case PortalType.SHORT:
72
+ return [
73
+ DegreeTypeFilterOptionValue.CERTIFICATE
74
+ ];
75
+ default:
76
+ return [];
77
+ }
52
78
  }
53
79
  }
@@ -1,7 +1,10 @@
1
1
  import { ISearchDependencies } from '../../common/ISearchDependencies';
2
2
  import { FilterKeyValuesMap } from '../../common/FilterKeyValuesMap';
3
3
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
4
+ import { PortalType } from '@studyportals/domain-client';
4
5
  export declare class IndexableEducationalFormRule extends BaseProgrammeRule {
6
+ private readonly portalType;
7
+ constructor(portalType?: PortalType);
5
8
  forSearch(dependencies: ISearchDependencies): Promise<boolean>;
6
9
  forSitemapGenerator(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
7
10
  getName(): string;
@@ -1,22 +1,33 @@
1
- import { FilterKey } from '@studyportals/search-filters/server-side';
2
- import { EducationalFormFilterOptionValue } from '@studyportals/search-filters/server-side';
1
+ import { EducationalFormFilterOptionValue, FilterKey } from '@studyportals/search-filters/server-side';
3
2
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
3
+ import { PortalType } from '@studyportals/domain-client';
4
+ import { DependencyMissingError } from '../../errors/DependencyMissingError';
4
5
  export class IndexableEducationalFormRule extends BaseProgrammeRule {
6
+ portalType;
7
+ constructor(portalType) {
8
+ super();
9
+ this.portalType = portalType;
10
+ }
5
11
  forSearch(dependencies) {
6
12
  const { seoInfoBase, filterState } = dependencies;
13
+ const programmeSearchDependencies = dependencies;
14
+ const portalType = programmeSearchDependencies.portalType;
7
15
  const selectedEducationalForm = seoInfoBase.getFilterOptionValueBy(FilterKey.EDUCATIONAL_FORM, filterState);
8
16
  if (!selectedEducationalForm) {
9
17
  return Promise.resolve(false);
10
18
  }
11
- const isIndexable = this.isIndexable(selectedEducationalForm);
19
+ const isIndexable = this.isIndexable(portalType, selectedEducationalForm);
12
20
  return Promise.resolve(isIndexable);
13
21
  }
14
22
  forSitemapGenerator(filterKeyValues) {
23
+ if (!this.portalType) {
24
+ throw new DependencyMissingError('PortalType');
25
+ }
15
26
  const [selectedEducationalForm] = filterKeyValues.get(FilterKey.EDUCATIONAL_FORM);
16
27
  if (!selectedEducationalForm) {
17
28
  return Promise.resolve(false);
18
29
  }
19
- const isIndexable = this.isIndexable(selectedEducationalForm);
30
+ const isIndexable = this.isIndexable(this.portalType, selectedEducationalForm);
20
31
  return Promise.resolve(isIndexable);
21
32
  }
22
33
  getName() {
@@ -25,7 +36,9 @@ export class IndexableEducationalFormRule extends BaseProgrammeRule {
25
36
  getDescription() {
26
37
  return `Indexable if educational form is Academic Course, Summer School, Semester Study Abroad, or Skill Professional Course.`;
27
38
  }
28
- isIndexable(value) {
39
+ isIndexable(portalType, value) {
40
+ if (portalType !== PortalType.SHORT)
41
+ return false;
29
42
  return (value === EducationalFormFilterOptionValue.ACADEMIC_COURSE ||
30
43
  value === EducationalFormFilterOptionValue.SUMMER_SCHOOL ||
31
44
  value === EducationalFormFilterOptionValue.SEMESTER_STUDY_ABROAD ||
@@ -1,6 +1,6 @@
1
1
  import { DependencyTypes } from '../enums/DependencyTypes';
2
2
  import { BaseSitemapUrlGeneratorManager } from './BaseSitemapUrlGeneratorManager';
3
- import { Area, AreaAttendance, Attendance, Continent, Country, CountryCity, CountryAttendance, RankedArea, RankedAreaDiscipline, RankedAttendance, RankedAttendanceDiscipline, RankedContinent, RankedContinentAttendance, RankedCountry, RankedCountryAttendance, RankedCountryDiscipline, RankedDiscipline, RankedUnfiltered, Unfiltered, RankedCountryCity, RankedCountryAreaCity } 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';
@@ -39,8 +39,6 @@ export class OrganisationsSitemapUrlGeneratorManager extends BaseSitemapUrlGener
39
39
  new RankedContinent(dependencies),
40
40
  new RankedContinentAttendance(dependencies),
41
41
  new RankedCountry(dependencies),
42
- new RankedCountryCity(dependencies),
43
- new RankedCountryAreaCity(dependencies),
44
42
  new RankedCountryAttendance(dependencies),
45
43
  new RankedCountryDiscipline(dependencies),
46
44
  new RankedDiscipline(dependencies),