@studyportals/fawkes 7.5.1-0 → 7.5.1-2

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 (51) hide show
  1. package/README.md +176 -176
  2. package/dist/src/programmes/policies/AttendanceDegree.d.ts +2 -1
  3. package/dist/src/programmes/policies/AttendanceDegree.js +3 -1
  4. package/dist/src/programmes/policies/AttendanceTuitionFee.d.ts +2 -1
  5. package/dist/src/programmes/policies/AttendanceTuitionFee.js +3 -1
  6. package/dist/src/programmes/policies/ContinentFormat.d.ts +2 -1
  7. package/dist/src/programmes/policies/ContinentFormat.js +2 -0
  8. package/dist/src/programmes/policies/ContinentSpecialProgrammes.d.ts +2 -1
  9. package/dist/src/programmes/policies/ContinentSpecialProgrammes.js +2 -0
  10. package/dist/src/programmes/policies/CountryAttendanceDegree.js +1 -1
  11. package/dist/src/programmes/policies/CountryDurationDegree.js +1 -1
  12. package/dist/src/programmes/policies/CountryEducationalForm.js +1 -1
  13. package/dist/src/programmes/policies/CountrySpecialProgrammes.d.ts +2 -1
  14. package/dist/src/programmes/policies/CountrySpecialProgrammes.js +2 -0
  15. package/dist/src/programmes/policies/DegreeAttendanceTuitionFee.d.ts +3 -1
  16. package/dist/src/programmes/policies/DegreeAttendanceTuitionFee.js +5 -1
  17. package/dist/src/programmes/policies/DegreeDuration.d.ts +2 -1
  18. package/dist/src/programmes/policies/DegreeDuration.js +3 -1
  19. package/dist/src/programmes/policies/DegreeTuitionFee.d.ts +2 -1
  20. package/dist/src/programmes/policies/DegreeTuitionFee.js +2 -0
  21. package/dist/src/programmes/policies/DisciplineCountryDegree.js +1 -1
  22. package/dist/src/programmes/policies/DisciplineCountryEducationalForm.js +1 -1
  23. package/dist/src/programmes/policies/DisciplineEducationalForm.js +1 -1
  24. package/dist/src/programmes/policies/DisciplineSpecialProgrammes.d.ts +2 -1
  25. package/dist/src/programmes/policies/DisciplineSpecialProgrammes.js +2 -0
  26. package/dist/src/programmes/policies/SpecialProgrammes.js +1 -1
  27. package/dist/src/programmes/rules/BlendedOrOnlineAttendanceRule.d.ts +6 -0
  28. package/dist/src/programmes/rules/BlendedOrOnlineAttendanceRule.js +18 -0
  29. package/dist/src/programmes/rules/DegreeCountryTuitionFeeRule.js +2 -1
  30. package/dist/src/programmes/rules/ErasmusOrExecutiveSpecialProgrammeRule.d.ts +6 -0
  31. package/dist/src/programmes/rules/ErasmusOrExecutiveSpecialProgrammeRule.js +19 -0
  32. package/dist/src/programmes/rules/ErasmusSpecialProgrammeRule.d.ts +6 -0
  33. package/dist/src/programmes/rules/ErasmusSpecialProgrammeRule.js +19 -0
  34. package/dist/src/programmes/rules/MasterOfLawsCountryAttendanceRule.js +2 -1
  35. package/dist/src/programmes/rules/MasterOfLawsCountryTuitionFeeRule.js +2 -1
  36. package/dist/src/programmes/rules/MasterOfPhilosophyCountryAttendanceRule.js +2 -1
  37. package/dist/src/programmes/rules/OneOrTwoYearDurationRule.d.ts +6 -0
  38. package/dist/src/programmes/rules/OneOrTwoYearDurationRule.js +19 -0
  39. package/dist/src/programmes/rules/TwoYearDurationRule.d.ts +6 -0
  40. package/dist/src/programmes/rules/TwoYearDurationRule.js +19 -0
  41. package/package.json +105 -105
  42. package/dist/src/common/IPolicyMetaData.d.ts +0 -6
  43. package/dist/src/common/IPolicyMetaData.js +0 -1
  44. package/dist/src/programmes/rules/DegreeAttendanceSpecificRule.d.ts +0 -10
  45. package/dist/src/programmes/rules/DegreeAttendanceSpecificRule.js +0 -42
  46. package/dist/src/programmes/rules/MasterOfArtsDisciplineRule.d.ts +0 -10
  47. package/dist/src/programmes/rules/MasterOfArtsDisciplineRule.js +0 -41
  48. package/dist/src/programmes/rules/MasterOfScienceDisciplineRule.d.ts +0 -10
  49. package/dist/src/programmes/rules/MasterOfScienceDisciplineRule.js +0 -41
  50. package/dist/src/sitemap-generator/IPageNumberProvider.d.ts +0 -3
  51. package/dist/src/sitemap-generator/IPageNumberProvider.js +0 -1
@@ -6,6 +6,7 @@ import { FilterCombinations } from '../../enums/FilterCombinations';
6
6
  import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
7
7
  import { DegreePresenter } from '../../presenters/DegreePresenter';
8
8
  import { TuitionFeePresenter } from '../../presenters/TuitionFeePresenter';
9
+ import { AffordableTuitionFeeRule } from '../rules/AffordableTuitionFeeRule';
9
10
  export class DegreeTuitionFee extends ProgrammesBaseIndexabilityPolicy {
10
11
  name = 'Tuition Fee Degree Policy';
11
12
  description = 'Determines indexing rules for pages filtered by tuition fee and degree type.';
@@ -14,6 +15,7 @@ export class DegreeTuitionFee extends ProgrammesBaseIndexabilityPolicy {
14
15
  new SingleValueSelectedForFilterRule(FilterKey.DEGREE_TYPE),
15
16
  new SingleValueSelectedForFilterRule(FilterKey.TUITION_FEE),
16
17
  new OnlyFiltersSelectedRule([FilterKey.DEGREE_TYPE, FilterKey.TUITION_FEE]),
18
+ new AffordableTuitionFeeRule()
17
19
  ];
18
20
  constructor(dependencies) {
19
21
  super(dependencies);
@@ -9,7 +9,7 @@ import { CountryPresenter } from '../../presenters/CountryPresenter';
9
9
  import { DegreePresenter } from '../../presenters/DegreePresenter';
10
10
  export class DisciplineCountryDegree extends ProgrammesBaseIndexabilityPolicy {
11
11
  name = 'Discipline Country Degree 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 degree type.`;
14
14
  filterKeys = [FilterKey.DISCIPLINES, FilterKey.COUNTRY, FilterKey.DEGREE_TYPE];
15
15
  rules = [
@@ -9,7 +9,7 @@ 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
15
  rules = [
@@ -8,7 +8,7 @@ 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
14
  rules = [
@@ -4,11 +4,12 @@ import { SingleValueSelectedForFilterRule } from '../../common/rules/SingleValue
4
4
  import { FilterCombinations } from '../../enums/FilterCombinations';
5
5
  import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
6
6
  import { IProgrammeSeoDependencies } from '../types/IProgrammeSeoDependencies';
7
+ import { ErasmusSpecialProgrammeRule } from '../rules/ErasmusSpecialProgrammeRule';
7
8
  export declare class DisciplineSpecialProgrammes extends ProgrammesBaseIndexabilityPolicy {
8
9
  readonly name: string;
9
10
  readonly description: string;
10
11
  readonly filterKeys: FilterKey[];
11
- protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule)[];
12
+ protected readonly rules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule | ErasmusSpecialProgrammeRule)[];
12
13
  constructor(dependencies: IProgrammeSeoDependencies);
13
14
  protected generateUrls(): Promise<string[]>;
14
15
  get filterCombination(): FilterCombinations;
@@ -5,6 +5,7 @@ import { FilterCombinations } from '../../enums/FilterCombinations';
5
5
  import { ProgrammesBaseIndexabilityPolicy } from '../ProgrammesBaseIndexabilityPolicy';
6
6
  import { DisciplinePresenter } from '../../presenters/DisciplinePresenter';
7
7
  import { SpecialProgrammesPresenter } from '../../presenters/SpecialProgrammesPresenter';
8
+ import { ErasmusSpecialProgrammeRule } from '../rules/ErasmusSpecialProgrammeRule';
8
9
  export class DisciplineSpecialProgrammes extends ProgrammesBaseIndexabilityPolicy {
9
10
  name = 'Discipline Special Programmes Policy';
10
11
  description = 'Determines indexing rules for pages filtered by discipline and special programmes (Erasmus Mundus).';
@@ -13,6 +14,7 @@ export class DisciplineSpecialProgrammes extends ProgrammesBaseIndexabilityPolic
13
14
  new SingleValueSelectedForFilterRule(FilterKey.SPECIAL_PROGRAMMES),
14
15
  new SingleValueSelectedForFilterRule(FilterKey.DISCIPLINES),
15
16
  new OnlyFiltersSelectedRule([FilterKey.SPECIAL_PROGRAMMES, FilterKey.DISCIPLINES]),
17
+ new ErasmusSpecialProgrammeRule()
16
18
  ];
17
19
  constructor(dependencies) {
18
20
  super(dependencies);
@@ -10,7 +10,7 @@ export class SpecialProgrammes extends ProgrammesBaseIndexabilityPolicy {
10
10
  filterKeys = [FilterKey.SPECIAL_PROGRAMMES];
11
11
  rules = [
12
12
  new SingleValueSelectedForFilterRule(FilterKey.SPECIAL_PROGRAMMES),
13
- new OnlyFiltersSelectedRule([FilterKey.SPECIAL_PROGRAMMES])
13
+ new OnlyFiltersSelectedRule([FilterKey.SPECIAL_PROGRAMMES]),
14
14
  ];
15
15
  constructor(dependencies) {
16
16
  super(dependencies);
@@ -0,0 +1,6 @@
1
+ import { BaseProgrammeFilterKeyValueRule } from '../BaseProgrammeFilterKeyValueRule';
2
+ export declare class BlendedOrOnlineAttendanceRule extends BaseProgrammeFilterKeyValueRule {
3
+ constructor();
4
+ getName(): string;
5
+ getDescription(): string;
6
+ }
@@ -0,0 +1,18 @@
1
+ import { FilterKey } from '@studyportals/search-filters/server-side';
2
+ import { AttendanceFilterOptionValue } from '@studyportals/search-filters/server-side';
3
+ import { BaseProgrammeFilterKeyValueRule } from '../BaseProgrammeFilterKeyValueRule';
4
+ export class BlendedOrOnlineAttendanceRule extends BaseProgrammeFilterKeyValueRule {
5
+ constructor() {
6
+ const filterKeyValues = new Map([[
7
+ FilterKey.DELIVERY_METHOD,
8
+ [AttendanceFilterOptionValue.BLENDED, AttendanceFilterOptionValue.ONLINE]
9
+ ]]);
10
+ super(filterKeyValues);
11
+ }
12
+ getName() {
13
+ return 'BlendedOrOnlineAttendanceRule';
14
+ }
15
+ getDescription() {
16
+ return 'Is indexable if the selected delivery method is blended or online.';
17
+ }
18
+ }
@@ -1,8 +1,9 @@
1
1
  import { FilterKey } from '@studyportals/search-filters';
2
+ import { DegreeTypeFilterOptionValue } from '@studyportals/search-filters';
2
3
  import { TuitionFeeFilterOptionValue } from '@studyportals/search-filters';
3
4
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
4
5
  export class DegreeCountryTuitionFeeRule extends BaseProgrammeRule {
5
- degreeValue = 'master-of-business-administration';
6
+ degreeValue = DegreeTypeFilterOptionValue.MBA;
6
7
  tuitionFeeValue = TuitionFeeFilterOptionValue.ZERO_TO_TWO_THOUSAND_FIVE_HUNDRED;
7
8
  getName() {
8
9
  return 'DegreeCountryTuitionFeeRule';
@@ -0,0 +1,6 @@
1
+ import { BaseProgrammeFilterKeyValueRule } from '../BaseProgrammeFilterKeyValueRule';
2
+ export declare class ErasmusOrExecutiveSpecialProgrammeRule extends BaseProgrammeFilterKeyValueRule {
3
+ constructor();
4
+ getName(): string;
5
+ getDescription(): string;
6
+ }
@@ -0,0 +1,19 @@
1
+ import { FilterKey } from '@studyportals/search-filters/server-side';
2
+ import { SpecialProgrammesFilterOptionValue } from '@studyportals/search-filters/server-side';
3
+ import { BaseProgrammeFilterKeyValueRule } from '../BaseProgrammeFilterKeyValueRule';
4
+ export class ErasmusOrExecutiveSpecialProgrammeRule extends BaseProgrammeFilterKeyValueRule {
5
+ constructor() {
6
+ const filterKeyValues = new Map([[
7
+ FilterKey.SPECIAL_PROGRAMMES,
8
+ [SpecialProgrammesFilterOptionValue.ERASMUS_MUNDUS, SpecialProgrammesFilterOptionValue.EXECUTIVE_PROGRAMMES]
9
+ ]
10
+ ]);
11
+ super(filterKeyValues);
12
+ }
13
+ getName() {
14
+ return 'ErasmusOrExecutiveSpecialProgrammeRule';
15
+ }
16
+ getDescription() {
17
+ return 'Is indexable if the selected special programme is Erasmus Mundus or Executive Programmes.';
18
+ }
19
+ }
@@ -0,0 +1,6 @@
1
+ import { BaseProgrammeFilterKeyValueRule } from '../BaseProgrammeFilterKeyValueRule';
2
+ export declare class ErasmusSpecialProgrammeRule extends BaseProgrammeFilterKeyValueRule {
3
+ constructor();
4
+ getName(): string;
5
+ getDescription(): string;
6
+ }
@@ -0,0 +1,19 @@
1
+ import { FilterKey } from '@studyportals/search-filters/server-side';
2
+ import { SpecialProgrammesFilterOptionValue } from '@studyportals/search-filters/server-side';
3
+ import { BaseProgrammeFilterKeyValueRule } from '../BaseProgrammeFilterKeyValueRule';
4
+ export class ErasmusSpecialProgrammeRule extends BaseProgrammeFilterKeyValueRule {
5
+ constructor() {
6
+ const filterKeyValues = new Map([[
7
+ FilterKey.SPECIAL_PROGRAMMES,
8
+ [SpecialProgrammesFilterOptionValue.ERASMUS_MUNDUS]
9
+ ]
10
+ ]);
11
+ super(filterKeyValues);
12
+ }
13
+ getName() {
14
+ return 'ErasmusSpecialProgrammeRule';
15
+ }
16
+ getDescription() {
17
+ return 'Is indexable if the selected special programme is Erasmus Mundus.';
18
+ }
19
+ }
@@ -1,7 +1,8 @@
1
1
  import { FilterKey } from '@studyportals/search-filters';
2
+ import { DegreeTypeFilterOptionValue } from '@studyportals/search-filters';
2
3
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
3
4
  export class MasterOfLawsCountryAttendanceRule extends BaseProgrammeRule {
4
- degreeValue = 'master-of-laws';
5
+ degreeValue = DegreeTypeFilterOptionValue.LLM;
5
6
  attendanceValue = 'online';
6
7
  allowedCountryIds = ['82', '30', '32', '108'];
7
8
  getName() {
@@ -1,8 +1,9 @@
1
1
  import { FilterKey } from '@studyportals/search-filters';
2
+ import { DegreeTypeFilterOptionValue } from '@studyportals/search-filters';
2
3
  import { TuitionFeeFilterOptionValue } from '@studyportals/search-filters';
3
4
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
4
5
  export class MasterOfLawsCountryTuitionFeeRule extends BaseProgrammeRule {
5
- degreeValue = 'master-of-laws';
6
+ degreeValue = DegreeTypeFilterOptionValue.LLM;
6
7
  allowedCountryIds = ['82', '30', '32', '108']; // USA, UK, Canada, India
7
8
  tuitionFeeValue = TuitionFeeFilterOptionValue.ZERO_TO_TWO_THOUSAND_FIVE_HUNDRED;
8
9
  getName() {
@@ -1,7 +1,8 @@
1
1
  import { FilterKey } from '@studyportals/search-filters';
2
+ import { DegreeTypeFilterOptionValue } from '@studyportals/search-filters';
2
3
  import { BaseProgrammeRule } from '../BaseProgrammeRule';
3
4
  export class MasterOfPhilosophyCountryAttendanceRule extends BaseProgrammeRule {
4
- degreeValue = 'master-of-philosophy';
5
+ degreeValue = DegreeTypeFilterOptionValue.MPHIL;
5
6
  attendanceValue = 'online';
6
7
  allowedCountryIds = ['82', '30', '108']; // USA, UK, India
7
8
  getName() {
@@ -0,0 +1,6 @@
1
+ import { BaseProgrammeFilterKeyValueRule } from '../BaseProgrammeFilterKeyValueRule';
2
+ export declare class OneOrTwoYearDurationRule extends BaseProgrammeFilterKeyValueRule {
3
+ constructor();
4
+ getName(): string;
5
+ getDescription(): string;
6
+ }
@@ -0,0 +1,19 @@
1
+ import { FilterKey } from '@studyportals/search-filters/server-side';
2
+ import { DurationFilterOptionValue } from '@studyportals/search-filters/server-side';
3
+ import { BaseProgrammeFilterKeyValueRule } from '../BaseProgrammeFilterKeyValueRule';
4
+ export class OneOrTwoYearDurationRule extends BaseProgrammeFilterKeyValueRule {
5
+ constructor() {
6
+ const filterKeyValues = new Map([[
7
+ FilterKey.DURATION,
8
+ [DurationFilterOptionValue.ONE_YEAR, DurationFilterOptionValue.TWO_YEARS]
9
+ ]
10
+ ]);
11
+ super(filterKeyValues);
12
+ }
13
+ getName() {
14
+ return 'OneOrTwoYearDurationRule';
15
+ }
16
+ getDescription() {
17
+ return 'Is indexable if the selected duration is one or two years.';
18
+ }
19
+ }
@@ -0,0 +1,6 @@
1
+ import { BaseProgrammeFilterKeyValueRule } from '../BaseProgrammeFilterKeyValueRule';
2
+ export declare class TwoYearDurationRule extends BaseProgrammeFilterKeyValueRule {
3
+ constructor();
4
+ getName(): string;
5
+ getDescription(): string;
6
+ }
@@ -0,0 +1,19 @@
1
+ import { FilterKey } from '@studyportals/search-filters/server-side';
2
+ import { DurationFilterOptionValue } from '@studyportals/search-filters/server-side';
3
+ import { BaseProgrammeFilterKeyValueRule } from '../BaseProgrammeFilterKeyValueRule';
4
+ export class TwoYearDurationRule extends BaseProgrammeFilterKeyValueRule {
5
+ constructor() {
6
+ const filterKeyValues = new Map([[
7
+ FilterKey.DURATION,
8
+ [DurationFilterOptionValue.TWO_YEARS]
9
+ ]
10
+ ]);
11
+ super(filterKeyValues);
12
+ }
13
+ getName() {
14
+ return 'TwoYearDurationRule';
15
+ }
16
+ getDescription() {
17
+ return 'Is indexable if the selected duration is two years.';
18
+ }
19
+ }
package/package.json CHANGED
@@ -1,105 +1,105 @@
1
- {
2
- "name": "@studyportals/fawkes",
3
- "version": "7.5.1-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.1.0",
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": "7.5.1-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.1.0",
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 +0,0 @@
1
- export {};
@@ -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 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
- }
@@ -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 MasterOfScienceDisciplineRule 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
- }