@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
package/package.json CHANGED
@@ -1,105 +1,105 @@
1
- {
2
- "name": "@studyportals/fawkes",
3
- "version": "8.5.3-1",
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 <=24",
103
- "npm": ">=8 <=11"
104
- }
105
- }
1
+ {
2
+ "name": "@studyportals/fawkes",
3
+ "version": "8.5.3-3",
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 <=24",
103
+ "npm": ">=8 <=11"
104
+ }
105
+ }
@@ -1,13 +0,0 @@
1
- import { RankedOrganisationsSeoIndexabilityPolicy } from "../RankedOrganisationsSeoIndexabilityPolicy";
2
- import { IOrganisationsSeoDependencies } from "../../../organisations/types/IOrganisationsSeoDependencies";
3
- import { OnlyFiltersSelectedRule } from "../../../common/rules/OnlyFiltersSelectedRule";
4
- import { SingleValueSelectedForFilterRule } from "../../../common/rules/SingleValueSelectedForFilterRule";
5
- import { FilterCombinations } from "../../../enums/FilterCombinations";
6
- export declare class RankedCountryAreaCity extends RankedOrganisationsSeoIndexabilityPolicy {
7
- readonly name: string;
8
- readonly description: string;
9
- protected readonly baseRules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule)[];
10
- constructor(dependencies: IOrganisationsSeoDependencies);
11
- protected generateUrls(): Promise<string[]>;
12
- get filterCombination(): FilterCombinations;
13
- }
@@ -1,43 +0,0 @@
1
- import { RankedOrganisationsSeoIndexabilityPolicy } from "../RankedOrganisationsSeoIndexabilityPolicy";
2
- import { OnlyFiltersSelectedRule } from "../../../common/rules/OnlyFiltersSelectedRule";
3
- import { FilterKey } from "@studyportals/search-filters/server-side";
4
- import { SingleValueSelectedForFilterRule } from "../../../common/rules/SingleValueSelectedForFilterRule";
5
- import { CityPresenter } from "../../../presenters/CityPresenter";
6
- import { FilterCombinations } from "../../../enums/FilterCombinations";
7
- export class RankedCountryAreaCity extends RankedOrganisationsSeoIndexabilityPolicy {
8
- name = 'Ranked Country/Area/City Policy';
9
- description = 'Regulates indexability of ranking-sorted country, area, and city-level filtered pages, prioritizing high-value geographic views with quality-based sorting.';
10
- baseRules = [
11
- new SingleValueSelectedForFilterRule(FilterKey.CONTINENT),
12
- new OnlyFiltersSelectedRule([FilterKey.CONTINENT])
13
- ];
14
- constructor(dependencies) {
15
- super(dependencies);
16
- }
17
- async generateUrls() {
18
- const cityFragments = await CityPresenter
19
- .getInstance(this.dependencies.searchApiClient)
20
- .getFragments();
21
- const paths = [];
22
- const filteredFragmentsForCountryAreaCity = cityFragments.filter(city => city.areaId !== null && city.areaId !== undefined);
23
- for (const city of filteredFragmentsForCountryAreaCity) {
24
- const areaId = city.areaId?.toString() || '';
25
- if (areaId === '') {
26
- continue;
27
- }
28
- const filterKeyValues = new Map([
29
- [FilterKey.CITY, [city.id]],
30
- [FilterKey.AREA, [areaId]],
31
- [FilterKey.COUNTRY, [city.countryId]]
32
- ]);
33
- const result = await this.checkRulesForSitemap(filterKeyValues);
34
- if (result) {
35
- paths.push(this.getPathWithSortingOption(city.path));
36
- }
37
- }
38
- return paths;
39
- }
40
- get filterCombination() {
41
- return FilterCombinations.RANKED_COUNTRY_AREA_CITY;
42
- }
43
- }
@@ -1,14 +0,0 @@
1
- import { RankedOrganisationsSeoIndexabilityPolicy } from "../RankedOrganisationsSeoIndexabilityPolicy";
2
- import { IOrganisationsSeoDependencies } from "../../../organisations/types/IOrganisationsSeoDependencies";
3
- import { OnlyFiltersSelectedRule } from "../../../common/rules/OnlyFiltersSelectedRule";
4
- import { SingleValueSelectedForFilterRule } from "../../../common/rules/SingleValueSelectedForFilterRule";
5
- import { ExcludeByIdForCitiesRule } from "../../../organisations/rules/ExcludeByIdForCitiesRule";
6
- import { FilterCombinations } from "../../../enums/FilterCombinations";
7
- export declare class RankedCountryCity extends RankedOrganisationsSeoIndexabilityPolicy {
8
- readonly name: string;
9
- readonly description: string;
10
- protected readonly baseRules: (SingleValueSelectedForFilterRule | OnlyFiltersSelectedRule | ExcludeByIdForCitiesRule)[];
11
- constructor(dependencies: IOrganisationsSeoDependencies);
12
- protected generateUrls(): Promise<string[]>;
13
- get filterCombination(): FilterCombinations;
14
- }
@@ -1,41 +0,0 @@
1
- import { RankedOrganisationsSeoIndexabilityPolicy } from "../RankedOrganisationsSeoIndexabilityPolicy";
2
- import { OnlyFiltersSelectedRule } from "../../../common/rules/OnlyFiltersSelectedRule";
3
- import { FilterKey } from "@studyportals/search-filters/server-side";
4
- import { SingleValueSelectedForFilterRule } from "../../../common/rules/SingleValueSelectedForFilterRule";
5
- import { ExcludeByIdForCitiesRule } from "../../../organisations/rules/ExcludeByIdForCitiesRule";
6
- import { CityPresenter } from "../../../presenters/CityPresenter";
7
- import { FilterCombinations } from "../../../enums/FilterCombinations";
8
- export class RankedCountryCity extends RankedOrganisationsSeoIndexabilityPolicy {
9
- name = 'Ranked Country/City Policy';
10
- description = 'Regulates indexability of ranking-sorted country, and city-level filtered pages, prioritizing high-value geographic views with quality-based sorting.';
11
- baseRules = [
12
- new SingleValueSelectedForFilterRule(FilterKey.CITY),
13
- new SingleValueSelectedForFilterRule(FilterKey.COUNTRY),
14
- new OnlyFiltersSelectedRule([FilterKey.CITY, FilterKey.COUNTRY]),
15
- new ExcludeByIdForCitiesRule(FilterKey.CITY)
16
- ];
17
- constructor(dependencies) {
18
- super(dependencies);
19
- }
20
- async generateUrls() {
21
- const cityFragments = await CityPresenter
22
- .getInstance(this.dependencies.searchApiClient)
23
- .getFragments();
24
- const paths = [];
25
- const filteredFragmentsForCountryCity = cityFragments.filter(city => city.areaId === null || city.areaId === undefined);
26
- for (const city of filteredFragmentsForCountryCity) {
27
- const filterKeyValues = new Map([
28
- [FilterKey.CITY, [city.id]],
29
- [FilterKey.COUNTRY, [city.countryId]]
30
- ]);
31
- const result = await this.checkRulesForSitemap(filterKeyValues);
32
- if (result) {
33
- paths.push(this.getPathWithSortingOption(city.path));
34
- }
35
- }
36
- return paths;
37
- }
38
- get filterCombination() {
39
- return FilterCombinations.RANKED_COUNTRY_CITY;
40
- }
41
- }