@studyportals/fawkes 6.0.1-2 → 6.0.1-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.
- package/dist/src/common/IPolicyMetaData.d.ts +6 -0
- 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/package.json +1 -1
- 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
|
@@ -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
|
}
|
package/package.json
CHANGED
|
@@ -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
|