@studyportals/fawkes 6.0.1-2 → 6.0.1-20
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.
- package/dist/src/common/IPolicyMetaData.d.ts +6 -0
- package/dist/src/common/policies/BaseSeoIndexabilityPolicy.d.ts +1 -1
- package/dist/src/organisations/OrganisationsRuleBasedIndexabilityPolicy.d.ts +11 -0
- package/dist/src/organisations/OrganisationsRuleBasedIndexabilityPolicy.js +19 -0
- package/dist/src/organisations/rules/OnlineAttendanceRule.d.ts +1 -0
- package/dist/src/organisations/rules/OnlineAttendanceRule.js +3 -0
- package/dist/src/programmes/IProgrammeSearchApplicationState.d.ts +4 -0
- package/dist/src/programmes/IProgrammeSearchApplicationState.js +1 -0
- package/dist/src/programmes/IProgrammeSearchDependencies.d.ts +7 -0
- package/dist/src/programmes/IProgrammeSearchDependencies.js +1 -0
- package/dist/src/programmes/IProgrammesSeoDependencies.d.ts +2 -0
- package/dist/src/programmes/IProgrammesSeoDependencies.js +1 -0
- package/dist/src/programmes/rules/OnlineAttendanceRule.d.ts +5 -0
- package/dist/src/programmes/rules/OnlineAttendanceRule.js +11 -0
- package/dist/src/sitemap-generator/ProgrammesSitemapUrlGeneratorManager.d.ts +2 -2
- package/dist/src/sitemap-generator/ProgrammesSitemapUrlGeneratorManager.js +57 -27
- package/package.json +2 -2
- package/dist/src/common/IRankingApiClient.d.ts +0 -3
- package/dist/src/sitemap-generator/SitemapUrlGeneratorManager.d.ts +0 -9
- package/dist/src/sitemap-generator/SitemapUrlGeneratorManager.js +0 -34
- /package/dist/src/common/{IRankingApiClient.js → IPolicyMetaData.js} +0 -0
|
@@ -17,7 +17,7 @@ export declare abstract class BaseSeoIndexabilityPolicy<TDependencies extends ID
|
|
|
17
17
|
generateSitemapUrls(): Promise<string[]>;
|
|
18
18
|
protected isIndexable(): Promise<boolean>;
|
|
19
19
|
protected checkRulesForSearch(dependencies: ISearchDependencies): Promise<boolean>;
|
|
20
|
-
|
|
20
|
+
checkRulesForSitemap(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
|
|
21
21
|
protected isIndexabilityPolicyDependencies(): boolean;
|
|
22
22
|
protected isSitemapUrlGeneratorDependencies(): boolean;
|
|
23
23
|
getAllRules(): IRule[];
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ISitemapUrlGenerator } from '../common/ISitemapUrlGenerator';
|
|
2
1
|
import { ISearchApiClient } from '../sitemap-generator/ISearchApiClient';
|
|
3
2
|
import { BaseSitemapUrlGeneratorManager } from './BaseSitemapUrlGeneratorManager';
|
|
4
3
|
import { PortalType } from '@studyportals/domain-client';
|
|
5
4
|
import { IPageNumberProvider } from './IPageNumberProvider';
|
|
6
5
|
import { FilterKey } from '@studyportals/search-filters';
|
|
7
6
|
import { IPresenter } from '../common';
|
|
7
|
+
import { IProgrammeSitemapUrlGenerator } from '../programmes/types/IProgrammeSitemapUrlGenerator';
|
|
8
8
|
export declare class ProgrammesSitemapUrlGeneratorManager extends BaseSitemapUrlGeneratorManager {
|
|
9
9
|
readonly portalType: PortalType;
|
|
10
|
-
readonly policies:
|
|
10
|
+
readonly policies: IProgrammeSitemapUrlGenerator[];
|
|
11
11
|
readonly presenters: Map<FilterKey, IPresenter>;
|
|
12
12
|
constructor(portalType: PortalType, searchApiClient: ISearchApiClient, pageNumberProvider: IPageNumberProvider);
|
|
13
13
|
}
|
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
import { DependencyTypes } from '../enums/DependencyTypes';
|
|
2
2
|
import { BaseSitemapUrlGeneratorManager } from './BaseSitemapUrlGeneratorManager';
|
|
3
|
-
import { Area,
|
|
3
|
+
import { Area,
|
|
4
|
+
// Attendance,
|
|
5
|
+
// AttendanceDegree,
|
|
6
|
+
// Continent,
|
|
7
|
+
// ContinentTuitionFee,
|
|
8
|
+
// Country,
|
|
9
|
+
// CountryAttendance,
|
|
10
|
+
Discipline,
|
|
11
|
+
// SpecialProgrammes,
|
|
12
|
+
// TuitionFee,
|
|
13
|
+
Unfiltered,
|
|
14
|
+
// CountryAttendanceDegree,
|
|
15
|
+
// CountryDegree,
|
|
16
|
+
// CountryDuration,
|
|
17
|
+
// CountryDurationDegree,
|
|
18
|
+
// CountryEducationalForm,
|
|
19
|
+
// CountryFormat,
|
|
20
|
+
// CountryTuitionFee,
|
|
21
|
+
DisciplineArea,
|
|
22
|
+
// DisciplineAttendance,
|
|
23
|
+
// DisciplineContinent,
|
|
24
|
+
// DisciplineCountry,
|
|
25
|
+
// DisciplineCountryDegree,
|
|
26
|
+
// DisciplineCountryEducationalForm,
|
|
27
|
+
// DisciplineDegree,
|
|
28
|
+
// DisciplineDuration,
|
|
29
|
+
// DisciplineEducationalForm,
|
|
30
|
+
// DisciplineFormat,
|
|
31
|
+
// DisciplineTuitionFee,
|
|
32
|
+
// DisciplineTuitionFeeAttendance
|
|
33
|
+
} from '../programmes/policies';
|
|
4
34
|
import { FilterKey } from '@studyportals/search-filters';
|
|
5
35
|
import { AreaPresenter } from '../presenters/AreaPresenter';
|
|
6
36
|
import { AttendancePresenter } from '../presenters/AttendancePresenter';
|
|
@@ -28,35 +58,35 @@ export class ProgrammesSitemapUrlGeneratorManager extends BaseSitemapUrlGenerato
|
|
|
28
58
|
};
|
|
29
59
|
this.policies = [
|
|
30
60
|
new Area(dependencies),
|
|
31
|
-
new Attendance(dependencies),
|
|
32
|
-
new AttendanceDegree(dependencies),
|
|
33
|
-
new Continent(dependencies),
|
|
34
|
-
new ContinentTuitionFee(dependencies),
|
|
35
|
-
new Country(dependencies),
|
|
36
|
-
new CountryAttendance(dependencies),
|
|
61
|
+
// new Attendance(dependencies),
|
|
62
|
+
// new AttendanceDegree(dependencies),
|
|
63
|
+
// new Continent(dependencies),
|
|
64
|
+
// new ContinentTuitionFee(dependencies),
|
|
65
|
+
// new Country(dependencies),
|
|
66
|
+
// new CountryAttendance(dependencies),
|
|
37
67
|
new Discipline(dependencies),
|
|
38
|
-
new SpecialProgrammes(dependencies),
|
|
39
|
-
new TuitionFee(dependencies),
|
|
68
|
+
// new SpecialProgrammes(dependencies),
|
|
69
|
+
// new TuitionFee(dependencies),
|
|
40
70
|
new Unfiltered(dependencies),
|
|
41
|
-
new CountryAttendanceDegree(dependencies),
|
|
42
|
-
new CountryDegree(dependencies),
|
|
43
|
-
new CountryDuration(dependencies),
|
|
44
|
-
new CountryDurationDegree(dependencies),
|
|
45
|
-
new CountryEducationalForm(dependencies),
|
|
46
|
-
new CountryFormat(dependencies),
|
|
47
|
-
new CountryTuitionFee(dependencies),
|
|
71
|
+
// new CountryAttendanceDegree(dependencies),
|
|
72
|
+
// new CountryDegree(dependencies),
|
|
73
|
+
// new CountryDuration(dependencies),
|
|
74
|
+
// new CountryDurationDegree(dependencies),
|
|
75
|
+
// new CountryEducationalForm(dependencies),
|
|
76
|
+
// new CountryFormat(dependencies),
|
|
77
|
+
// new CountryTuitionFee(dependencies),
|
|
48
78
|
new DisciplineArea(dependencies),
|
|
49
|
-
new DisciplineAttendance(dependencies),
|
|
50
|
-
new DisciplineContinent(dependencies),
|
|
51
|
-
new DisciplineCountry(dependencies),
|
|
52
|
-
new DisciplineCountryDegree(dependencies),
|
|
53
|
-
new DisciplineCountryEducationalForm(dependencies),
|
|
54
|
-
new DisciplineDegree(dependencies),
|
|
55
|
-
new DisciplineDuration(dependencies),
|
|
56
|
-
new DisciplineEducationalForm(dependencies),
|
|
57
|
-
new DisciplineFormat(dependencies),
|
|
58
|
-
new DisciplineTuitionFee(dependencies),
|
|
59
|
-
new DisciplineTuitionFeeAttendance(dependencies)
|
|
79
|
+
// new DisciplineAttendance(dependencies),
|
|
80
|
+
// new DisciplineContinent(dependencies),
|
|
81
|
+
// new DisciplineCountry(dependencies),
|
|
82
|
+
// new DisciplineCountryDegree(dependencies),
|
|
83
|
+
// new DisciplineCountryEducationalForm(dependencies),
|
|
84
|
+
// new DisciplineDegree(dependencies),
|
|
85
|
+
// new DisciplineDuration(dependencies),
|
|
86
|
+
// new DisciplineEducationalForm(dependencies),
|
|
87
|
+
// new DisciplineFormat(dependencies),
|
|
88
|
+
// new DisciplineTuitionFee(dependencies),
|
|
89
|
+
// new DisciplineTuitionFeeAttendance(dependencies)
|
|
60
90
|
];
|
|
61
91
|
this.presenters.set(FilterKey.AREA, AreaPresenter.getInstance());
|
|
62
92
|
this.presenters.set(FilterKey.DELIVERY_METHOD, AttendancePresenter.getInstance());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studyportals/fawkes",
|
|
3
|
-
"version": "6.0.1-
|
|
3
|
+
"version": "6.0.1-20",
|
|
4
4
|
"description": "A package to centralize SEO related logic for SBLP and Sitemap Generator.",
|
|
5
5
|
"files": [
|
|
6
6
|
"./dist"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"publish-beta": "npm run prepare-deployment && npm version prerelease && npm publish --tag beta --access=public",
|
|
17
17
|
"prepare": "husky install",
|
|
18
18
|
"test": "vitest run --coverage",
|
|
19
|
-
"test:dev": "vitest --coverage",
|
|
19
|
+
"test:dev": "vitest --coverage tests/programmes",
|
|
20
20
|
"lint": "eslint . --ext .ts",
|
|
21
21
|
"lint:fix": "eslint . --ext .ts --fix",
|
|
22
22
|
"prettier:fix": "npx prettier --use-tabs --ignore-path .gitignore --write ."
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ISitemapUrlGeneratorManager } from './ISitemapUrlGeneratorManager';
|
|
2
|
-
import { FilterCombinations } from '../enums/FilterCombinations';
|
|
3
|
-
import { IOrganisationsClient } from '../sitemap-generator/IOrganisationsClient';
|
|
4
|
-
import { ISearchApiClient } from '../sitemap-generator/ISearchApiClient';
|
|
5
|
-
export declare class SitemapUrlGeneratorManager implements ISitemapUrlGeneratorManager {
|
|
6
|
-
private readonly policies;
|
|
7
|
-
constructor(searchApiClient: ISearchApiClient, organisationsClient: IOrganisationsClient);
|
|
8
|
-
generateUrls(): Promise<Map<FilterCombinations, string[]>>;
|
|
9
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { DependencyTypes } from '../enums/DependencyTypes';
|
|
2
|
-
import { Area } from '../scholarships/policies/Area';
|
|
3
|
-
import { Country } from '../scholarships/policies/Country';
|
|
4
|
-
import { Discipline } from '../scholarships/policies/Discipline';
|
|
5
|
-
import { DisciplineCountry } from '../scholarships/policies/DisciplineCountry';
|
|
6
|
-
import { UniversityCountry } from '../scholarships/policies/UniversityCountry';
|
|
7
|
-
import { Unfiltered } from '../scholarships/policies/Unfiltered';
|
|
8
|
-
export class SitemapUrlGeneratorManager {
|
|
9
|
-
policies;
|
|
10
|
-
constructor(searchApiClient, organisationsClient) {
|
|
11
|
-
const dependencies = {
|
|
12
|
-
dependencyType: DependencyTypes.SITEMAP_GENERATOR,
|
|
13
|
-
searchApiClient,
|
|
14
|
-
organisationsClient
|
|
15
|
-
};
|
|
16
|
-
this.policies = [
|
|
17
|
-
new Area(dependencies),
|
|
18
|
-
new Country(dependencies),
|
|
19
|
-
new DisciplineCountry(dependencies),
|
|
20
|
-
new Discipline(dependencies),
|
|
21
|
-
new UniversityCountry(dependencies),
|
|
22
|
-
new Unfiltered(dependencies)
|
|
23
|
-
];
|
|
24
|
-
}
|
|
25
|
-
async generateUrls() {
|
|
26
|
-
const map = new Map();
|
|
27
|
-
await Promise.all(this.policies.map(async (policy) => {
|
|
28
|
-
const filterCombination = policy.filterCombination;
|
|
29
|
-
const urls = await policy.generateSitemapUrls();
|
|
30
|
-
map.set(filterCombination, urls);
|
|
31
|
-
}));
|
|
32
|
-
return map;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
File without changes
|