@studyportals/fawkes 8.2.2 → 8.2.4-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.
Files changed (89) hide show
  1. package/README.md +176 -176
  2. package/dist/src/common/IPresenter.d.ts +1 -1
  3. package/dist/src/enums/AttendanceFilterOptionValue.d.ts +5 -0
  4. package/dist/src/enums/AttendanceFilterOptionValue.js +6 -0
  5. package/dist/src/enums/DegreeTypeFilterOptionValue.d.ts +29 -0
  6. package/dist/src/enums/DegreeTypeFilterOptionValue.js +30 -0
  7. package/dist/src/enums/DurationFilterOptionValue.d.ts +16 -0
  8. package/dist/src/enums/DurationFilterOptionValue.js +17 -0
  9. package/dist/src/enums/EducationalFormFilterOptionValue.d.ts +8 -0
  10. package/dist/src/enums/EducationalFormFilterOptionValue.js +9 -0
  11. package/dist/src/enums/FilterCombinations.d.ts +1 -0
  12. package/dist/src/enums/FilterCombinations.js +1 -0
  13. package/dist/src/enums/FilterKey.d.ts +21 -0
  14. package/dist/src/enums/FilterKey.js +22 -0
  15. package/dist/src/enums/FormatFilterOptionValue.d.ts +4 -0
  16. package/dist/src/enums/FormatFilterOptionValue.js +5 -0
  17. package/dist/src/enums/SpecialProgrammesFilterOptionValue.d.ts +5 -0
  18. package/dist/src/enums/SpecialProgrammesFilterOptionValue.js +6 -0
  19. package/dist/src/enums/TuitionFeeFilterOptionValue.d.ts +3 -0
  20. package/dist/src/enums/TuitionFeeFilterOptionValue.js +4 -0
  21. package/dist/src/organisations/SearchIndexabilityManager.js +2 -1
  22. package/dist/src/organisations/policies/index.d.ts +1 -0
  23. package/dist/src/organisations/policies/index.js +1 -0
  24. package/dist/src/organisations/policies/our-picks/City.d.ts +12 -0
  25. package/dist/src/organisations/policies/our-picks/City.js +35 -0
  26. package/dist/src/organisations/rules/OnlyFullLocationFiltersSelectedRule.d.ts +10 -0
  27. package/dist/src/organisations/rules/OnlyFullLocationFiltersSelectedRule.js +32 -0
  28. package/dist/src/presenters/AreaPresenter.d.ts +1 -0
  29. package/dist/src/presenters/AreaPresenter.js +3 -0
  30. package/dist/src/presenters/CityPresenter.d.ts +14 -0
  31. package/dist/src/presenters/CityPresenter.js +60 -0
  32. package/dist/src/presenters/fragments/ICityFragment.d.ts +5 -0
  33. package/dist/src/programmes/policies/CountryAttendanceDegree.js +1 -1
  34. package/dist/src/programmes/policies/CountryDurationDegree.js +1 -1
  35. package/dist/src/programmes/policies/CountryEducationalForm.js +1 -1
  36. package/dist/src/programmes/policies/DisciplineArea.d.ts +1 -1
  37. package/dist/src/programmes/policies/DisciplineArea.js +1 -1
  38. package/dist/src/programmes/policies/DisciplineCountryEducationalForm.js +1 -1
  39. package/dist/src/programmes/policies/DisciplineEducationalForm.js +1 -1
  40. package/dist/src/programmes/rules/ErasmusOrJointSpecialProgrammesRule.js +2 -2
  41. package/dist/src/sitemap-generator/ISearchApiClient.d.ts +9 -0
  42. package/dist/src/sitemap-generator/OrganisationsSitemapUrlGeneratorManager.js +2 -1
  43. package/dist/src/structured-data/ScholarshipStructuredDataFactory.d.ts +17 -0
  44. package/dist/src/structured-data/ScholarshipStructuredDataFactory.js +63 -0
  45. package/dist/src/structured-data/SearchStructuredDataFactory.d.ts +16 -3
  46. package/dist/src/structured-data/SearchStructuredDataFactory.js +71 -7
  47. package/dist/src/structured-data/dto/EntityDTO.d.ts +2 -0
  48. package/dist/src/structured-data/dto/PaywallDTO.d.ts +14 -0
  49. package/dist/src/structured-data/dto/index.d.ts +1 -0
  50. package/dist/src/structured-data/dto/index.js +1 -0
  51. package/dist/src/structured-data/index.d.ts +1 -0
  52. package/dist/src/structured-data/index.js +1 -0
  53. package/package.json +105 -105
  54. package/dist/src/common/IPolicyMetaData.d.ts +0 -6
  55. package/dist/src/organisations/OrganisationsRuleBasedIndexabilityPolicy.d.ts +0 -11
  56. package/dist/src/organisations/OrganisationsRuleBasedIndexabilityPolicy.js +0 -19
  57. package/dist/src/organisations/rules/OnlineAttendanceRule.d.ts +0 -6
  58. package/dist/src/organisations/rules/OnlineAttendanceRule.js +0 -14
  59. package/dist/src/programmes/IProgrammeSearchApplicationState.d.ts +0 -4
  60. package/dist/src/programmes/IProgrammeSearchDependencies.d.ts +0 -7
  61. package/dist/src/programmes/IProgrammeSearchDependencies.js +0 -1
  62. package/dist/src/programmes/IProgrammesSeoDependencies.d.ts +0 -2
  63. package/dist/src/programmes/IProgrammesSeoDependencies.js +0 -1
  64. package/dist/src/programmes/policies/DisciplineCountryDegree.d.ts +0 -16
  65. package/dist/src/programmes/policies/DisciplineCountryDegree.js +0 -53
  66. package/dist/src/programmes/rules/DegreeAttendanceSpecificRule.d.ts +0 -10
  67. package/dist/src/programmes/rules/DegreeAttendanceSpecificRule.js +0 -42
  68. package/dist/src/programmes/rules/DegreeCountrySpecificRule.d.ts +0 -10
  69. package/dist/src/programmes/rules/DegreeCountrySpecificRule.js +0 -43
  70. package/dist/src/programmes/rules/DegreeCountryTuitionFeeRule.d.ts +0 -11
  71. package/dist/src/programmes/rules/DegreeCountryTuitionFeeRule.js +0 -40
  72. package/dist/src/programmes/rules/MBACountryAttendanceRule.d.ts +0 -11
  73. package/dist/src/programmes/rules/MBACountryAttendanceRule.js +0 -40
  74. package/dist/src/programmes/rules/MasterOfArtsDisciplineRule.d.ts +0 -10
  75. package/dist/src/programmes/rules/MasterOfArtsDisciplineRule.js +0 -41
  76. package/dist/src/programmes/rules/MasterOfEducationCountryDisciplineRule.d.ts +0 -11
  77. package/dist/src/programmes/rules/MasterOfEducationCountryDisciplineRule.js +0 -69
  78. package/dist/src/programmes/rules/MasterOfLawsCountryAttendanceRule.d.ts +0 -12
  79. package/dist/src/programmes/rules/MasterOfLawsCountryAttendanceRule.js +0 -43
  80. package/dist/src/programmes/rules/MasterOfLawsCountryTuitionFeeRule.d.ts +0 -12
  81. package/dist/src/programmes/rules/MasterOfLawsCountryTuitionFeeRule.js +0 -46
  82. package/dist/src/programmes/rules/MasterOfPhilosophyCountryAttendanceRule.d.ts +0 -12
  83. package/dist/src/programmes/rules/MasterOfPhilosophyCountryAttendanceRule.js +0 -43
  84. package/dist/src/programmes/rules/MasterOfScienceDisciplineRule.d.ts +0 -10
  85. package/dist/src/programmes/rules/MasterOfScienceDisciplineRule.js +0 -41
  86. package/dist/src/sitemap-generator/IPageNumberProvider.d.ts +0 -3
  87. package/dist/src/sitemap-generator/IPageNumberProvider.js +0 -1
  88. /package/dist/src/{common/IPolicyMetaData.js → presenters/fragments/ICityFragment.js} +0 -0
  89. /package/dist/src/{programmes/IProgrammeSearchApplicationState.js → structured-data/dto/PaywallDTO.js} +0 -0
package/package.json CHANGED
@@ -1,105 +1,105 @@
1
- {
2
- "name": "@studyportals/fawkes",
3
- "version": "8.2.2",
4
- "description": "A package to centralize SEO related logic for SBLP and Sitemap Generator.",
5
- "files": [
6
- "./dist"
7
- ],
8
- "scripts": {
9
- "prepush": "npm run test",
10
- "precommit": "npm run lint",
11
- "compile": "npx tsc && tsc-alias && rm -r ./dist/tests",
12
- "build": "npm run clean && npm run compile",
13
- "clean": "rimraf \"!(node_modules)/**/dist\"",
14
- "prepare-deployment": "npm run test && npm run build",
15
- "publish-major": "npm run prepare-deployment && npm version major && npm publish",
16
- "publish-beta": "npm run prepare-deployment && npm version prerelease && npm publish --tag beta --access=public",
17
- "publish-patch": "npm run prepare-deployment && npm version patch && npm publish",
18
- "publish-minor": "npm run prepare-deployment && npm version minor && npm publish",
19
- "prepare": "husky install",
20
- "test": "vitest run --coverage",
21
- "test:dev": "vitest --coverage tests/programmes",
22
- "lint": "eslint . --ext .ts",
23
- "lint:fix": "eslint . --ext .ts --fix",
24
- "prettier:fix": "npx prettier --use-tabs --ignore-path .gitignore --write ."
25
- },
26
- "exports": {
27
- "./organisations-search-seo": {
28
- "import": "./dist/organisations-seo/index.js",
29
- "require": "./dist/organisations-seo/index.js",
30
- "types": "./dist/organisations-seo/index.d.ts"
31
- },
32
- "./programmes-search-seo": {
33
- "import": "./dist/programmes-seo/index.js",
34
- "require": "./dist/programmes-seo/index.js",
35
- "types": "./dist/programmes-seo/index.d.ts"
36
- },
37
- "./scholarships-search-seo": {
38
- "import": "./dist/scholarships-seo/index.js",
39
- "require": "./dist/scholarships-seo/index.js",
40
- "types": "./dist/scholarships-seo/index.d.ts"
41
- },
42
- "./sitemap-generator-seo": {
43
- "import": "./dist/sitemap-generator-seo/index.js",
44
- "require": "./dist/sitemap-generator-seo/index.js",
45
- "types": "./dist/sitemap-generator-seo/index.d.ts"
46
- },
47
- "./structured-data-seo": {
48
- "import": "./dist/structured-data-seo/index.js",
49
- "require": "./dist/structured-data-seo/index.js",
50
- "types": "./dist/structured-data-seo/index.d.ts"
51
- }
52
- },
53
- "typesVersions": {
54
- "*": {
55
- "organisations-search-seo": [
56
- "dist/organisations-seo/index.d.ts"
57
- ],
58
- "programmes-search-seo": [
59
- "dist/programmes-seo/index.d.ts"
60
- ],
61
- "scholarships-search-seo": [
62
- "dist/scholarships-seo/index.d.ts"
63
- ],
64
- "sitemap-generator-seo": [
65
- "dist/sitemap-generator-seo/index.d.ts"
66
- ],
67
- "structured-data-seo": [
68
- "dist/structured-data-seo/index.d.ts"
69
- ],
70
- "*": [
71
- "dist/index.d.ts"
72
- ]
73
- }
74
- },
75
- "author": "The Jedi Council",
76
- "license": "ISC",
77
- "devDependencies": {
78
- "@adobe/structured-data-validator": "^1.4.1",
79
- "@studyportals/code-style": "^2.2.1",
80
- "@studyportals/webpack-helper": "^6.0.6",
81
- "@vitest/coverage-istanbul": "^2.1.8",
82
- "husky": "^8.0.3",
83
- "jsdom": "^26.0.0",
84
- "prettier": "^3.5.3",
85
- "schema-dts": "^1.1.5",
86
- "ts-loader": "^9.5.2",
87
- "tsc-alias": "^1.8.11",
88
- "typemoq": "^2.1.0",
89
- "typescript": "^5.7.3",
90
- "vitest": "^2.1.8"
91
- },
92
- "dependencies": {
93
- "@studyportals/domain-client": "7.1.0",
94
- "@studyportals/ranking-api-interface": "^1.3.12",
95
- "@studyportals/search-filters": "^6.3.1",
96
- "@studyportals/static-domain-data": "^6.1.0"
97
- },
98
- "optionalDependencies": {
99
- "@rollup/rollup-linux-x64-gnu": "4.24.0"
100
- },
101
- "engines": {
102
- "node": ">=18 <=22",
103
- "npm": ">=8 <=10"
104
- }
105
- }
1
+ {
2
+ "name": "@studyportals/fawkes",
3
+ "version": "8.2.4-0",
4
+ "description": "A package to centralize SEO related logic for SBLP and Sitemap Generator.",
5
+ "files": [
6
+ "./dist"
7
+ ],
8
+ "scripts": {
9
+ "prepush": "npm run test",
10
+ "precommit": "npm run lint",
11
+ "compile": "npx tsc && tsc-alias && rm -r ./dist/tests",
12
+ "build": "npm run clean && npm run compile",
13
+ "clean": "rimraf \"!(node_modules)/**/dist\"",
14
+ "prepare-deployment": "npm run test && npm run build",
15
+ "publish-major": "npm run prepare-deployment && npm version major && npm publish",
16
+ "publish-beta": "npm run prepare-deployment && npm version prerelease && npm publish --tag beta --access=public",
17
+ "publish-patch": "npm run prepare-deployment && npm version patch && npm publish",
18
+ "publish-minor": "npm run prepare-deployment && npm version minor && npm publish",
19
+ "prepare": "husky install",
20
+ "test": "vitest run --coverage",
21
+ "test:dev": "vitest --coverage tests/programmes",
22
+ "lint": "eslint . --ext .ts",
23
+ "lint:fix": "eslint . --ext .ts --fix",
24
+ "prettier:fix": "npx prettier --use-tabs --ignore-path .gitignore --write ."
25
+ },
26
+ "exports": {
27
+ "./organisations-search-seo": {
28
+ "import": "./dist/organisations-seo/index.js",
29
+ "require": "./dist/organisations-seo/index.js",
30
+ "types": "./dist/organisations-seo/index.d.ts"
31
+ },
32
+ "./programmes-search-seo": {
33
+ "import": "./dist/programmes-seo/index.js",
34
+ "require": "./dist/programmes-seo/index.js",
35
+ "types": "./dist/programmes-seo/index.d.ts"
36
+ },
37
+ "./scholarships-search-seo": {
38
+ "import": "./dist/scholarships-seo/index.js",
39
+ "require": "./dist/scholarships-seo/index.js",
40
+ "types": "./dist/scholarships-seo/index.d.ts"
41
+ },
42
+ "./sitemap-generator-seo": {
43
+ "import": "./dist/sitemap-generator-seo/index.js",
44
+ "require": "./dist/sitemap-generator-seo/index.js",
45
+ "types": "./dist/sitemap-generator-seo/index.d.ts"
46
+ },
47
+ "./structured-data-seo": {
48
+ "import": "./dist/structured-data-seo/index.js",
49
+ "require": "./dist/structured-data-seo/index.js",
50
+ "types": "./dist/structured-data-seo/index.d.ts"
51
+ }
52
+ },
53
+ "typesVersions": {
54
+ "*": {
55
+ "organisations-search-seo": [
56
+ "dist/organisations-seo/index.d.ts"
57
+ ],
58
+ "programmes-search-seo": [
59
+ "dist/programmes-seo/index.d.ts"
60
+ ],
61
+ "scholarships-search-seo": [
62
+ "dist/scholarships-seo/index.d.ts"
63
+ ],
64
+ "sitemap-generator-seo": [
65
+ "dist/sitemap-generator-seo/index.d.ts"
66
+ ],
67
+ "structured-data-seo": [
68
+ "dist/structured-data-seo/index.d.ts"
69
+ ],
70
+ "*": [
71
+ "dist/index.d.ts"
72
+ ]
73
+ }
74
+ },
75
+ "author": "The Jedi Council",
76
+ "license": "ISC",
77
+ "devDependencies": {
78
+ "@adobe/structured-data-validator": "^1.4.1",
79
+ "@studyportals/code-style": "^2.2.1",
80
+ "@studyportals/webpack-helper": "^6.0.6",
81
+ "@vitest/coverage-istanbul": "^2.1.8",
82
+ "husky": "^8.0.3",
83
+ "jsdom": "^26.0.0",
84
+ "prettier": "^3.5.3",
85
+ "schema-dts": "^1.1.5",
86
+ "ts-loader": "^9.5.2",
87
+ "tsc-alias": "^1.8.11",
88
+ "typemoq": "^2.1.0",
89
+ "typescript": "^5.7.3",
90
+ "vitest": "^2.1.8"
91
+ },
92
+ "dependencies": {
93
+ "@studyportals/domain-client": "7.1.0",
94
+ "@studyportals/ranking-api-interface": "^1.3.12",
95
+ "@studyportals/search-filters": "^6.3.1",
96
+ "@studyportals/static-domain-data": "^6.1.0"
97
+ },
98
+ "optionalDependencies": {
99
+ "@rollup/rollup-linux-x64-gnu": "4.24.0"
100
+ },
101
+ "engines": {
102
+ "node": ">=18 <=22",
103
+ "npm": ">=8 <=10"
104
+ }
105
+ }
@@ -1,6 +0,0 @@
1
- import { IRule } from "./IRule";
2
- export interface IPolicyMetaData {
3
- getAllRules(): IRule[];
4
- getName(): string;
5
- getDescription(): string;
6
- }
@@ -1,11 +0,0 @@
1
- import { PortalType } from '@studyportals/domain-client';
2
- import { IOrganisationsSeoDependencies } from './types/IOrganisationsSeoDependencies';
3
- import { SortingOptions } from '../enums/SortingOptions';
4
- import { BaseSeoIndexabilityPolicy } from '../common/policies/BaseSeoIndexabilityPolicy';
5
- export declare abstract class OrganisationsRuleBasedIndexabilityPolicy extends BaseSeoIndexabilityPolicy<IOrganisationsSeoDependencies> {
6
- protected readonly indexablePortalTypes: PortalType[];
7
- protected abstract readonly sortingOption: SortingOptions;
8
- constructor(dependencies: IOrganisationsSeoDependencies);
9
- protected isIndexable(): Promise<boolean>;
10
- private matchesSortingOption;
11
- }
@@ -1,19 +0,0 @@
1
- import { PortalType } from '@studyportals/domain-client';
2
- import { BaseSeoIndexabilityPolicy } from '../common/policies/BaseSeoIndexabilityPolicy';
3
- export class OrganisationsRuleBasedIndexabilityPolicy extends BaseSeoIndexabilityPolicy {
4
- indexablePortalTypes = [PortalType.MASTER];
5
- constructor(dependencies) {
6
- super(dependencies);
7
- }
8
- async isIndexable() {
9
- const isIndexable = await super.isIndexable();
10
- if (!isIndexable) {
11
- return false;
12
- }
13
- return this.indexablePortalTypes.includes(this.dependencies.portalType) && this.matchesSortingOption();
14
- }
15
- matchesSortingOption() {
16
- const dependencies = this.dependencies;
17
- return dependencies.sortingState.getSelectedOption() === this.sortingOption;
18
- }
19
- }
@@ -1,6 +0,0 @@
1
- import { BaseFilterKeyValueRule } from '../../common/rules/BaseFilterKeyValueRule';
2
- export declare class OnlineAttendanceRule extends BaseFilterKeyValueRule {
3
- constructor();
4
- getName(): string;
5
- getDescription(): string;
6
- }
@@ -1,14 +0,0 @@
1
- import { FilterKey } from '@studyportals/search-filters';
2
- import { BaseFilterKeyValueRule } from '../../common/rules/BaseFilterKeyValueRule';
3
- export class OnlineAttendanceRule extends BaseFilterKeyValueRule {
4
- constructor() {
5
- const filterKeyValues = new Map([[FilterKey.DELIVERY_METHOD, ['online']]]);
6
- super(filterKeyValues);
7
- }
8
- getName() {
9
- return 'OnlineAttendanceRule';
10
- }
11
- getDescription() {
12
- return 'Indexable if attendance is online';
13
- }
14
- }
@@ -1,4 +0,0 @@
1
- import { ISearchApplicationState } from '../common';
2
- export interface IProgrammeSearchApplicationState extends ISearchApplicationState {
3
- getPageNumber(): number;
4
- }
@@ -1,7 +0,0 @@
1
- import { ISearchDependencies } from '../common/ISearchDependencies';
2
- import { IProgrammeSearchApplicationState } from './IProgrammeSearchApplicationState';
3
- import { PortalType } from '@studyportals/domain-client';
4
- export interface IProgrammeSearchDependencies extends ISearchDependencies {
5
- portalType: PortalType;
6
- applicationState: IProgrammeSearchApplicationState;
7
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import { IProgrammeSearchDependencies } from "./IProgrammeSearchDependencies";
2
- export type IProgrammesSeoDependencies = IProgrammeSearchDependencies;
@@ -1 +0,0 @@
1
- export {};
@@ -1,16 +0,0 @@
1
- import { FilterKey } from '@studyportals/search-filters';
2
- import { OnlyFiltersSelectedRule } from '../../common/rules/OnlyFiltersSelectedRule';
3
- import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValueSelectedForFilterRule';
4
- import { FilterCombinations } from '../../enums/FilterCombinations';
5
- import { IndexableDegreeRule } from '../rules/IndexableDegreeRule';
6
- import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
7
- import { IProgrammeSeoDependencies } from '../types/IProgrammeSeoDependencies';
8
- export declare class DisciplineCountryDegree extends ProgrammesBaseIndexabilityPolicy {
9
- readonly name: string;
10
- readonly description: string;
11
- readonly filterKeys: FilterKey[];
12
- protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule | IndexableDegreeRule)[];
13
- constructor(dependencies: IProgrammeSeoDependencies);
14
- protected generateUrls(): Promise<string[]>;
15
- get filterCombination(): FilterCombinations;
16
- }
@@ -1,53 +0,0 @@
1
- import { FilterKey } from '@studyportals/search-filters';
2
- import { OnlyFiltersSelectedRule } from '../../common/rules/OnlyFiltersSelectedRule';
3
- import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValueSelectedForFilterRule';
4
- import { FilterCombinations } from '../../enums/FilterCombinations';
5
- import { IndexableDegreeRule } from '../rules/IndexableDegreeRule';
6
- import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
7
- import { DisciplinePresenter } from '../../presenters/DisciplinePresenter';
8
- import { CountryPresenter } from '../../presenters/CountryPresenter';
9
- import { DegreePresenter } from '../../presenters/DegreePresenter';
10
- export class DisciplineCountryDegree extends ProgrammesBaseIndexabilityPolicy {
11
- name = 'Discipline Country Degree Policy';
12
- description = `Determines indexing rules for pages filtered by discipline,
13
- country, and degree type.`;
14
- filterKeys = [FilterKey.DISCIPLINES, FilterKey.COUNTRY, FilterKey.DEGREE_TYPE];
15
- rules = [
16
- new SingleValueSelectedForFilterRule(FilterKey.DISCIPLINES),
17
- new SingleValueSelectedForFilterRule(FilterKey.COUNTRY),
18
- new SingleValueSelectedForFilterRule(FilterKey.DEGREE_TYPE),
19
- new OnlyFiltersSelectedRule([FilterKey.DISCIPLINES, FilterKey.COUNTRY, FilterKey.DEGREE_TYPE]),
20
- new IndexableDegreeRule()
21
- ];
22
- constructor(dependencies) {
23
- super(dependencies);
24
- this.initateBaseRules();
25
- }
26
- async generateUrls() {
27
- const disciplineFragments = DisciplinePresenter.getInstance().getFragments();
28
- const countryFragments = CountryPresenter.getInstance().getFragments();
29
- const degreeFragments = DegreePresenter.getInstance().getFragments();
30
- const paths = [];
31
- for (const pageNumber of this.indexablePageNumbers) {
32
- for (const discipline of disciplineFragments) {
33
- for (const country of countryFragments) {
34
- for (const degree of degreeFragments) {
35
- const filterKeyValues = new Map([
36
- [FilterKey.DISCIPLINES, [discipline.id]],
37
- [FilterKey.COUNTRY, [country.id]],
38
- [FilterKey.DEGREE_TYPE, [degree.id]]
39
- ]);
40
- const result = await this.checkRulesForSitemapWithPageNumber(filterKeyValues, pageNumber);
41
- if (result) {
42
- paths.push(this.getPathWithPageNumber(`${degree.path}/${discipline.path}/${country.path}`, pageNumber));
43
- }
44
- }
45
- }
46
- }
47
- }
48
- return paths;
49
- }
50
- get filterCombination() {
51
- return FilterCombinations.DISCIPLINE_COUNTRY_DEGREE;
52
- }
53
- }
@@ -1,10 +0,0 @@
1
- import { ISearchDependencies } from '../../common/ISearchDependencies';
2
- import { FilterKeyValuesMap } from '../../common/FilterKeyValuesMap';
3
- import { BaseProgrammeRule } from '../BaseProgrammeRule';
4
- export declare class DegreeAttendanceSpecificRule extends BaseProgrammeRule {
5
- private readonly validCombinations;
6
- getName(): string;
7
- getDescription(): string;
8
- forSearch(dependencies: ISearchDependencies): Promise<boolean>;
9
- forSitemapGenerator(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
10
- }
@@ -1,42 +0,0 @@
1
- import { FilterKey } from '@studyportals/search-filters';
2
- import { BaseProgrammeRule } from '../BaseProgrammeRule';
3
- export class DegreeAttendanceSpecificRule extends BaseProgrammeRule {
4
- validCombinations = {
5
- 'master-of-science': ['online'], // MSc with online attendance
6
- 'master-of-arts': ['online'], // MA with online attendance
7
- 'master-of-business-administration': ['online'] // MBA with online attendance
8
- };
9
- getName() {
10
- return 'DegreeAttendanceSpecificRule';
11
- }
12
- getDescription() {
13
- return 'Indexes: master-of-science (online); master-of-arts (online); master-of-business-administration (online)';
14
- }
15
- forSearch(dependencies) {
16
- const { seoInfoBase, filterState } = dependencies;
17
- const degreeTypeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
18
- const attendanceValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DELIVERY_METHOD, filterState);
19
- if (!degreeTypeValue || !attendanceValue) {
20
- return Promise.resolve(false);
21
- }
22
- const allowedAttendance = this.validCombinations[degreeTypeValue];
23
- if (!allowedAttendance) {
24
- return Promise.resolve(false);
25
- }
26
- return Promise.resolve(allowedAttendance.includes(attendanceValue));
27
- }
28
- forSitemapGenerator(filterKeyValues) {
29
- const degreeTypeValues = filterKeyValues.get(FilterKey.DEGREE_TYPE);
30
- const attendanceValues = filterKeyValues.get(FilterKey.DELIVERY_METHOD);
31
- if (!degreeTypeValues?.length || !attendanceValues?.length) {
32
- return Promise.resolve(false);
33
- }
34
- const degreeTypeValue = degreeTypeValues[0];
35
- const attendanceValue = attendanceValues[0];
36
- const allowedAttendance = this.validCombinations[degreeTypeValue];
37
- if (!allowedAttendance) {
38
- return Promise.resolve(false);
39
- }
40
- return Promise.resolve(allowedAttendance.includes(attendanceValue));
41
- }
42
- }
@@ -1,10 +0,0 @@
1
- import { ISearchDependencies } from '../../common/ISearchDependencies';
2
- import { FilterKeyValuesMap } from '../../common/FilterKeyValuesMap';
3
- import { BaseProgrammeRule } from '../BaseProgrammeRule';
4
- export declare class DegreeCountrySpecificRule extends BaseProgrammeRule {
5
- private readonly validCombinations;
6
- getName(): string;
7
- getDescription(): string;
8
- forSearch(dependencies: ISearchDependencies): Promise<boolean>;
9
- forSitemapGenerator(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
10
- }
@@ -1,43 +0,0 @@
1
- import { FilterKey } from '@studyportals/search-filters';
2
- import { DegreeTypeFilterOptionValue } from '@studyportals/search-filters';
3
- import { BaseProgrammeRule } from '../BaseProgrammeRule';
4
- export class DegreeCountrySpecificRule extends BaseProgrammeRule {
5
- validCombinations = {
6
- [DegreeTypeFilterOptionValue.MSC]: ['82', '56', '11', '30'],
7
- [DegreeTypeFilterOptionValue.MBA]: ['82', '30'],
8
- [DegreeTypeFilterOptionValue.MED]: ['202', '56']
9
- };
10
- getName() {
11
- return 'DegreeCountrySpecificRule';
12
- }
13
- getDescription() {
14
- return 'Indexes: master-of-science (USA, Canada, Germany, UK); master-of-business-administration (USA, UK); master-of-education (Australia, Canada)';
15
- }
16
- forSearch(dependencies) {
17
- const { seoInfoBase, filterState } = dependencies;
18
- const degreeTypeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
19
- const countryValue = seoInfoBase.getFilterOptionValueBy(FilterKey.COUNTRY, filterState);
20
- if (!degreeTypeValue || !countryValue) {
21
- return Promise.resolve(false);
22
- }
23
- const allowedCountries = this.validCombinations[degreeTypeValue];
24
- if (!allowedCountries) {
25
- return Promise.resolve(false);
26
- }
27
- return Promise.resolve(allowedCountries.includes(countryValue));
28
- }
29
- forSitemapGenerator(filterKeyValues) {
30
- const degreeTypeValues = filterKeyValues.get(FilterKey.DEGREE_TYPE);
31
- const countryValues = filterKeyValues.get(FilterKey.COUNTRY);
32
- if (!degreeTypeValues?.length || !countryValues?.length) {
33
- return Promise.resolve(false);
34
- }
35
- const degreeTypeValue = degreeTypeValues[0];
36
- const countryValue = countryValues[0];
37
- const allowedCountries = this.validCombinations[degreeTypeValue];
38
- if (!allowedCountries) {
39
- return Promise.resolve(false);
40
- }
41
- return Promise.resolve(allowedCountries.includes(countryValue));
42
- }
43
- }
@@ -1,11 +0,0 @@
1
- import { ISearchDependencies } from '../../common/ISearchDependencies';
2
- import { FilterKeyValuesMap } from '../../common/FilterKeyValuesMap';
3
- import { BaseProgrammeRule } from '../BaseProgrammeRule';
4
- export declare class DegreeCountryTuitionFeeRule extends BaseProgrammeRule {
5
- private readonly degreeValue;
6
- private readonly tuitionFeeValue;
7
- getName(): string;
8
- getDescription(): string;
9
- forSearch(dependencies: ISearchDependencies): Promise<boolean>;
10
- forSitemapGenerator(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
11
- }
@@ -1,40 +0,0 @@
1
- import { FilterKey } from '@studyportals/search-filters';
2
- import { TuitionFeeFilterOptionValue } from '@studyportals/search-filters';
3
- import { BaseProgrammeRule } from '../BaseProgrammeRule';
4
- export class DegreeCountryTuitionFeeRule extends BaseProgrammeRule {
5
- degreeValue = 'master-of-business-administration';
6
- tuitionFeeValue = TuitionFeeFilterOptionValue.ZERO_TO_TWO_THOUSAND_FIVE_HUNDRED;
7
- getName() {
8
- return 'DegreeCountryTuitionFeeRule';
9
- }
10
- getDescription() {
11
- return 'Indexes: master-of-business-administration + all countries + affordable tuition (0-2500)';
12
- }
13
- forSearch(dependencies) {
14
- const { seoInfoBase, filterState } = dependencies;
15
- const degreeTypeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
16
- const countryValue = seoInfoBase.getFilterOptionValueBy(FilterKey.COUNTRY, filterState);
17
- const tuitionFeeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.TUITION_FEE, filterState);
18
- if (degreeTypeValue !== this.degreeValue) {
19
- return Promise.resolve(true);
20
- }
21
- if (!countryValue || !tuitionFeeValue) {
22
- return Promise.resolve(false);
23
- }
24
- return Promise.resolve(tuitionFeeValue === this.tuitionFeeValue);
25
- }
26
- forSitemapGenerator(filterKeyValues) {
27
- const degreeTypeValues = filterKeyValues.get(FilterKey.DEGREE_TYPE);
28
- const countryValues = filterKeyValues.get(FilterKey.COUNTRY);
29
- const tuitionFeeValues = filterKeyValues.get(FilterKey.TUITION_FEE);
30
- if (!degreeTypeValues?.length || !countryValues?.length || !tuitionFeeValues?.length) {
31
- return Promise.resolve(false);
32
- }
33
- const degreeTypeValue = degreeTypeValues[0];
34
- const tuitionFeeValue = tuitionFeeValues[0];
35
- if (degreeTypeValue !== this.degreeValue) {
36
- return Promise.resolve(true);
37
- }
38
- return Promise.resolve(tuitionFeeValue === this.tuitionFeeValue);
39
- }
40
- }
@@ -1,11 +0,0 @@
1
- import { ISearchDependencies } from '../../common/ISearchDependencies';
2
- import { FilterKeyValuesMap } from '../../common/FilterKeyValuesMap';
3
- import { BaseProgrammeRule } from '../BaseProgrammeRule';
4
- export declare class MbaCountryAttendanceRule extends BaseProgrammeRule {
5
- private readonly degreeValue;
6
- private readonly attendanceValue;
7
- getName(): string;
8
- getDescription(): string;
9
- forSearch(dependencies: ISearchDependencies): Promise<boolean>;
10
- forSitemapGenerator(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
11
- }
@@ -1,40 +0,0 @@
1
- import { FilterKey } from '@studyportals/search-filters';
2
- import { DegreeTypeFilterOptionValue } from '@studyportals/search-filters';
3
- import { BaseProgrammeRule } from '../BaseProgrammeRule';
4
- export class MbaCountryAttendanceRule extends BaseProgrammeRule {
5
- degreeValue = DegreeTypeFilterOptionValue.MBA;
6
- attendanceValue = 'online';
7
- getName() {
8
- return 'MbaCountryAttendanceRule';
9
- }
10
- getDescription() {
11
- return 'Indexes: master-of-business-administration + all countries + online attendance';
12
- }
13
- forSearch(dependencies) {
14
- const { seoInfoBase, filterState } = dependencies;
15
- const degreeTypeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
16
- const countryValue = seoInfoBase.getFilterOptionValueBy(FilterKey.COUNTRY, filterState);
17
- const attendanceValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DELIVERY_METHOD, filterState);
18
- if (degreeTypeValue !== this.degreeValue) {
19
- return Promise.resolve(true);
20
- }
21
- if (!countryValue || !attendanceValue) {
22
- return Promise.resolve(false);
23
- }
24
- return Promise.resolve(attendanceValue === this.attendanceValue);
25
- }
26
- forSitemapGenerator(filterKeyValues) {
27
- const degreeTypeValues = filterKeyValues.get(FilterKey.DEGREE_TYPE);
28
- const countryValues = filterKeyValues.get(FilterKey.COUNTRY);
29
- const attendanceValues = filterKeyValues.get(FilterKey.DELIVERY_METHOD);
30
- if (!degreeTypeValues?.length || !countryValues?.length || !attendanceValues?.length) {
31
- return Promise.resolve(false);
32
- }
33
- const degreeTypeValue = degreeTypeValues[0];
34
- const attendanceValue = attendanceValues[0];
35
- if (degreeTypeValue !== this.degreeValue) {
36
- return Promise.resolve(true);
37
- }
38
- return Promise.resolve(attendanceValue === this.attendanceValue);
39
- }
40
- }
@@ -1,10 +0,0 @@
1
- import { ISearchDependencies } from '../../common/ISearchDependencies';
2
- import { FilterKeyValuesMap } from '../../common/FilterKeyValuesMap';
3
- import { BaseProgrammeRule } from '../BaseProgrammeRule';
4
- export declare class MasterOfArtsDisciplineRule extends BaseProgrammeRule {
5
- private readonly degreeValue;
6
- getName(): string;
7
- getDescription(): string;
8
- forSearch(dependencies: ISearchDependencies): Promise<boolean>;
9
- forSitemapGenerator(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
10
- }
@@ -1,41 +0,0 @@
1
- import { FilterKey } from '@studyportals/search-filters';
2
- import { BaseProgrammeRule } from '../BaseProgrammeRule';
3
- export class MasterOfArtsDisciplineRule extends BaseProgrammeRule {
4
- // Master of Arts accepts all disciplines
5
- degreeValue = 'master-of-arts';
6
- getName() {
7
- return 'MasterOfArtsDisciplineRule';
8
- }
9
- getDescription() {
10
- return 'Indexes: master-of-arts + all disciplines';
11
- }
12
- forSearch(dependencies) {
13
- const { seoInfoBase, filterState } = dependencies;
14
- const degreeTypeValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DEGREE_TYPE, filterState);
15
- const disciplineValue = seoInfoBase.getFilterOptionValueBy(FilterKey.DISCIPLINES, filterState);
16
- // This rule only applies to Master of Arts
17
- if (degreeTypeValue !== this.degreeValue) {
18
- return Promise.resolve(true); // Rule doesn't apply to other degrees
19
- }
20
- // Must have a discipline selected
21
- if (!disciplineValue) {
22
- return Promise.resolve(false);
23
- }
24
- // Master of Arts accepts all disciplines
25
- return Promise.resolve(true);
26
- }
27
- forSitemapGenerator(filterKeyValues) {
28
- const degreeTypeValues = filterKeyValues.get(FilterKey.DEGREE_TYPE);
29
- const disciplineValues = filterKeyValues.get(FilterKey.DISCIPLINES);
30
- if (!degreeTypeValues?.length || !disciplineValues?.length) {
31
- return Promise.resolve(false);
32
- }
33
- const degreeTypeValue = degreeTypeValues[0];
34
- // This rule only applies to Master of Arts
35
- if (degreeTypeValue !== this.degreeValue) {
36
- return Promise.resolve(true); // Rule doesn't apply to other degrees
37
- }
38
- // Master of Arts accepts all disciplines
39
- return Promise.resolve(true);
40
- }
41
- }