@studyportals/fawkes 2.0.1-8 → 3.0.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.
- package/dist/sitemap-generator-seo/index.d.ts +7 -0
- package/dist/sitemap-generator-seo/index.js +3 -1
- package/dist/src/common/BaseSeoIndexabilityPolicy.d.ts +4 -4
- package/dist/src/common/BaseSeoIndexabilityPolicy.js +3 -3
- package/dist/src/common/ICustomRule.d.ts +1 -1
- package/dist/src/common/IDependencies.d.ts +1 -1
- package/dist/src/common/IIndexabilityPolicyDependencies.d.ts +1 -1
- package/dist/src/common/ISearchDependencies.d.ts +8 -0
- package/dist/src/common/ISitemapUrlGenerator.d.ts +2 -2
- package/dist/src/common/RuleBasedIndexabilityPolicy.d.ts +4 -5
- package/dist/src/common/RuleBasedIndexabilityPolicy.js +0 -6
- package/dist/src/organisations/ISeoInfoBaseOrganisations.d.ts +1 -1
- package/dist/src/organisations/SearchIndexabilityManager.d.ts +2 -2
- package/dist/src/organisations/SeoIndexabilityPolicy.d.ts +3 -3
- package/dist/src/organisations/SeoIndexabilityPolicy.js +1 -1
- package/dist/src/organisations/SeoRuleBasedIndexabilityPolicy.d.ts +6 -6
- package/dist/src/organisations/SeoRuleBasedIndexabilityPolicy.js +1 -1
- package/dist/src/presenters/CountryPresenter.d.ts +2 -2
- package/dist/src/presenters/CountryPresenter.js +5 -1
- package/dist/src/presenters/fragments/ICountryFragment.d.ts +4 -0
- package/dist/src/scholarships/SearchIndexabilityManager.d.ts +5 -5
- package/dist/src/scholarships/SearchIndexabilityManager.js +1 -1
- package/dist/src/scholarships/index.d.ts +0 -1
- package/dist/src/scholarships/index.js +0 -1
- package/dist/src/scholarships/policies/AreaPolicy.d.ts +9 -7
- package/dist/src/scholarships/policies/AreaPolicy.js +30 -14
- package/dist/src/scholarships/policies/CountryPolicy.d.ts +9 -7
- package/dist/src/scholarships/policies/CountryPolicy.js +21 -12
- package/dist/src/scholarships/policies/DisciplineCountryPolicy.d.ts +9 -7
- package/dist/src/scholarships/policies/DisciplineCountryPolicy.js +26 -15
- package/dist/src/scholarships/policies/DisciplinePolicy.d.ts +9 -7
- package/dist/src/scholarships/policies/DisciplinePolicy.js +22 -13
- package/dist/src/scholarships/policies/UnfilteredPolicy.d.ts +4 -4
- package/dist/src/scholarships/policies/UnfilteredPolicy.js +3 -3
- package/dist/src/scholarships/policies/UniversityCountryPolicy.d.ts +4 -4
- package/dist/src/scholarships/policies/UniversityCountryPolicy.js +28 -4
- package/dist/src/scholarships/rules/ExceptAustaliaAreasRule.d.ts +3 -3
- package/dist/src/scholarships/rules/ExceptAustaliaAreasRule.js +8 -5
- package/dist/src/scholarships/rules/SearchVolumeAreasRule.d.ts +3 -3
- package/dist/src/scholarships/rules/SearchVolumeAreasRule.js +7 -3
- package/dist/src/scholarships/rules/SearchVolumeCountriesRule.d.ts +3 -3
- package/dist/src/scholarships/rules/SearchVolumeCountriesRule.js +7 -3
- package/dist/src/scholarships/rules/SearchVolumeCountryDisciplineRule.d.ts +3 -3
- package/dist/src/scholarships/rules/SearchVolumeCountryDisciplineRule.js +10 -6
- package/dist/src/scholarships/rules/SearchVolumeDisciplinesRule.d.ts +3 -3
- package/dist/src/scholarships/rules/SearchVolumeDisciplinesRule.js +7 -3
- package/dist/src/sitemap-generator/IOrganisation.d.ts +6 -0
- package/dist/src/sitemap-generator/IOrganisationsClient.d.ts +4 -0
- package/dist/src/sitemap-generator/IOrganisationsClient.js +1 -0
- package/dist/src/sitemap-generator/ISearchApiClient.d.ts +3 -0
- package/dist/src/sitemap-generator/ISearchApiClient.js +1 -0
- package/dist/src/sitemap-generator/ISitemapDependencies.d.ts +7 -0
- package/dist/src/sitemap-generator/ISitemapDependencies.js +1 -0
- package/dist/src/sitemap-generator/ISitemapUrlGeneratorDependencies.d.ts +7 -0
- package/dist/src/sitemap-generator/ISitemapUrlGeneratorDependencies.js +1 -0
- package/dist/src/sitemap-generator/ISitemapUrlGeneratorManager.d.ts +3 -3
- package/dist/src/sitemap-generator/SitemapUrlGeneratorManager.d.ts +6 -6
- package/dist/src/sitemap-generator/SitemapUrlGeneratorManager.js +18 -8
- package/dist/src/sitemap-generator/index.d.ts +0 -2
- package/dist/src/sitemap-generator/index.js +1 -2
- package/dist/src/types/SeoDependencies.d.ts +3 -3
- package/package.json +17 -10
- package/dist/fawkes.js +0 -2
- package/dist/fawkes.js.map +0 -1
- package/dist/organisations-seo.js +0 -0
- package/dist/scholarships-seo.js +0 -2
- package/dist/scholarships-seo.js.map +0 -1
- package/dist/sitemap-generator-seo.js +0 -0
- package/dist/src/common/IFilterKeyValue.d.ts +0 -5
- package/dist/src/common/IFilterKeyValue3.d.ts +0 -5
- package/dist/src/common/ISitemapUrlGeneratorDependencies.d.ts +0 -5
- package/dist/src/scholarships/CustomRules.d.ts +0 -6
- package/dist/src/scholarships/CustomRules.js +0 -18
- package/dist/src/scholarships/rules/index.d.ts +0 -4
- package/dist/src/scholarships/rules/index.js +0 -4
- /package/dist/src/common/{IFilterKeyValue.js → ISearchDependencies.js} +0 -0
- /package/dist/src/{common/IFilterKeyValue3.js → presenters/fragments/ICountryFragment.js} +0 -0
- /package/dist/src/scholarships/rules/files/{search-volume-combinations.json → search-volume.json} +0 -0
- /package/dist/src/{common/ISitemapUrlGeneratorDependencies.js → sitemap-generator/IOrganisation.js} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IOrganisationsClient } from "../src/sitemap-generator/IOrganisationsClient";
|
|
2
|
+
import { IOrganisation } from "../src/sitemap-generator/IOrganisation";
|
|
3
|
+
import { ISearchApiClient } from "../src/sitemap-generator/ISearchApiClient";
|
|
4
|
+
import { ISitemapUrlGeneratorManager } from "../src/sitemap-generator/ISitemapUrlGeneratorManager";
|
|
5
|
+
import { SitemapUrlGeneratorManager } from "../src/sitemap-generator/SitemapUrlGeneratorManager";
|
|
6
|
+
import { FilterCombinations } from "../src/enums/FilterCombinations";
|
|
7
|
+
export { IOrganisationsClient, IOrganisation, ISearchApiClient, ISitemapUrlGeneratorManager, SitemapUrlGeneratorManager, FilterCombinations };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ISitemapUrlGenerator } from "./ISitemapUrlGenerator";
|
|
2
2
|
import { ISeoIndexabilityPolicy } from "./ISeoIndexabilityPolicy";
|
|
3
|
-
import { FilterCombinations } from "@/enums/FilterCombinations";
|
|
4
3
|
import { IDependencies } from "./IDependencies";
|
|
5
|
-
import { SeoDependencies } from "
|
|
4
|
+
import { SeoDependencies } from "../types/SeoDependencies";
|
|
5
|
+
import { FilterCombinations } from "../enums/FilterCombinations";
|
|
6
6
|
export declare abstract class BaseSeoIndexabilityPolicy implements ISeoIndexabilityPolicy, ISitemapUrlGenerator {
|
|
7
7
|
protected dependencies: IDependencies;
|
|
8
8
|
constructor(dependencies: SeoDependencies);
|
|
9
9
|
shouldIndex(): Promise<boolean>;
|
|
10
|
-
generateSitemapUrls(): string[]
|
|
10
|
+
generateSitemapUrls(): Promise<string[]>;
|
|
11
11
|
protected abstract matchesFilters(): Promise<boolean>;
|
|
12
12
|
private isIndexabilityPolicyDependencies;
|
|
13
13
|
private isSitemapUrlGeneratorDependencies;
|
|
14
|
-
protected abstract generateUrls(): string[]
|
|
14
|
+
protected abstract generateUrls(): Promise<string[]>;
|
|
15
15
|
abstract get filterCombination(): FilterCombinations;
|
|
16
16
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DependencyTypes } from "
|
|
1
|
+
import { DependencyTypes } from "../enums/DependencyTypes";
|
|
2
2
|
export class BaseSeoIndexabilityPolicy {
|
|
3
3
|
dependencies;
|
|
4
4
|
constructor(dependencies) {
|
|
@@ -10,11 +10,11 @@ export class BaseSeoIndexabilityPolicy {
|
|
|
10
10
|
}
|
|
11
11
|
return this.matchesFilters();
|
|
12
12
|
}
|
|
13
|
-
generateSitemapUrls() {
|
|
13
|
+
async generateSitemapUrls() {
|
|
14
14
|
if (!this.isSitemapUrlGeneratorDependencies()) {
|
|
15
15
|
throw new Error('Dependency type is incorrect.');
|
|
16
16
|
}
|
|
17
|
-
return this.generateUrls();
|
|
17
|
+
return await this.generateUrls();
|
|
18
18
|
}
|
|
19
19
|
isIndexabilityPolicyDependencies() {
|
|
20
20
|
return this.dependencies.dependencyType === DependencyTypes.SEARCH;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IFilterKeyValues } from "./IFilterKeyValues";
|
|
2
2
|
export interface ICustomRule {
|
|
3
3
|
forSearch(filterKeyValues: IFilterKeyValues): boolean;
|
|
4
|
-
forSitemapGenerator(
|
|
4
|
+
forSitemapGenerator(filterKeyValues: IFilterKeyValues): boolean;
|
|
5
5
|
getName(): string;
|
|
6
6
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISeoInfoBase, ISeoFilterState, ISeoFilterOptions, ISeoSearchApplicationState } from "
|
|
1
|
+
import { ISeoInfoBase, ISeoFilterState, ISeoFilterOptions, ISeoSearchApplicationState } from "../common";
|
|
2
2
|
import { IDependencies } from "./IDependencies";
|
|
3
3
|
export interface IIndexabilityPolicyDependencies extends IDependencies {
|
|
4
4
|
seoInfoBase: ISeoInfoBase;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ISeoInfoBase, ISeoFilterState, ISeoFilterOptions, ISeoSearchApplicationState } from "../common";
|
|
2
|
+
import { IDependencies } from "./IDependencies";
|
|
3
|
+
export interface ISearchDependencies extends IDependencies {
|
|
4
|
+
seoInfoBase: ISeoInfoBase;
|
|
5
|
+
filterState: ISeoFilterState;
|
|
6
|
+
filterOptions?: ISeoFilterOptions;
|
|
7
|
+
applicationState?: ISeoSearchApplicationState;
|
|
8
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FilterCombinations } from "
|
|
1
|
+
import { FilterCombinations } from "../enums/FilterCombinations";
|
|
2
2
|
export interface ISitemapUrlGenerator {
|
|
3
3
|
filterCombination: FilterCombinations;
|
|
4
|
-
generateSitemapUrls(): string[]
|
|
4
|
+
generateSitemapUrls(): Promise<string[]>;
|
|
5
5
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { BaseSeoIndexabilityPolicy } from "./BaseSeoIndexabilityPolicy";
|
|
2
|
-
import { SeoDependencies } from "
|
|
3
|
-
import {
|
|
2
|
+
import { SeoDependencies } from "../types/SeoDependencies";
|
|
3
|
+
import { ISearchDependencies } from "./ISearchDependencies";
|
|
4
4
|
import { IFilterKeyValues } from "./IFilterKeyValues";
|
|
5
5
|
export declare abstract class RuleBasedIndexabilityPolicy extends BaseSeoIndexabilityPolicy {
|
|
6
|
-
protected abstract rules: ICustomRule[];
|
|
7
6
|
constructor(dependencies: SeoDependencies);
|
|
8
|
-
protected
|
|
9
|
-
protected
|
|
7
|
+
protected abstract checksRulesForSearch(searchDependencies: ISearchDependencies): boolean;
|
|
8
|
+
protected abstract checksRulesForSitemap(filters?: IFilterKeyValues): boolean;
|
|
10
9
|
}
|
|
@@ -3,10 +3,4 @@ export class RuleBasedIndexabilityPolicy extends BaseSeoIndexabilityPolicy {
|
|
|
3
3
|
constructor(dependencies) {
|
|
4
4
|
super(dependencies);
|
|
5
5
|
}
|
|
6
|
-
checksEveryRuleForSearch(filterKeyValues) {
|
|
7
|
-
return this.rules.every(rule => rule.forSearch(filterKeyValues));
|
|
8
|
-
}
|
|
9
|
-
checksEveryRuleForSitemap(subjectId, additionalId) {
|
|
10
|
-
return this.rules.every(rule => rule.forSitemapGenerator(subjectId, additionalId));
|
|
11
|
-
}
|
|
12
6
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISeoInfoBase } from "
|
|
1
|
+
import { ISeoInfoBase } from "../common/ISeoInfoBase";
|
|
2
2
|
import { ISortState } from "./ISortState";
|
|
3
3
|
import { SortingOptions } from "./SortingOptions";
|
|
4
4
|
export interface ISeoInfoBaseOrganisations<T> extends ISeoInfoBase {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ISearchIndexabilityManager } from "
|
|
2
|
-
import { ISeoIndexabilityPolicy } from "
|
|
1
|
+
import { ISearchIndexabilityManager } from "../common/ISearchIndexabilityManager";
|
|
2
|
+
import { ISeoIndexabilityPolicy } from "../common/ISeoIndexabilityPolicy";
|
|
3
3
|
export declare class SearchIndexabilityManager implements ISearchIndexabilityManager {
|
|
4
4
|
policies: ISeoIndexabilityPolicy[];
|
|
5
5
|
shouldIndex(): Promise<boolean>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BaseSeoIndexabilityPolicy } from "
|
|
1
|
+
import { BaseSeoIndexabilityPolicy } from "../common/BaseSeoIndexabilityPolicy";
|
|
2
2
|
import { IOrganisationsProvider } from "./IOrganisationsProvider";
|
|
3
|
-
import { IRankingApiClient } from "
|
|
3
|
+
import { IRankingApiClient } from "../common/IRankingApiClient";
|
|
4
4
|
import { ISortState } from "./ISortState";
|
|
5
|
-
import { SeoDependencies } from "
|
|
5
|
+
import { SeoDependencies } from "../types/SeoDependencies";
|
|
6
6
|
export declare abstract class SeoIndexabilityPolicy<T> extends BaseSeoIndexabilityPolicy {
|
|
7
7
|
protected readonly organisationsProvider: IOrganisationsProvider<T>;
|
|
8
8
|
protected readonly rankingApiClient: IRankingApiClient;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseSeoIndexabilityPolicy } from "
|
|
1
|
+
import { BaseSeoIndexabilityPolicy } from "../common/BaseSeoIndexabilityPolicy";
|
|
2
2
|
export class SeoIndexabilityPolicy extends BaseSeoIndexabilityPolicy {
|
|
3
3
|
organisationsProvider;
|
|
4
4
|
rankingApiClient;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SeoIndexabilityPolicy } from "
|
|
2
|
-
import { IOrganisationsProvider } from "
|
|
3
|
-
import { IRankingApiClient } from "
|
|
4
|
-
import { FilterKeyValuePairs } from "
|
|
5
|
-
import { ISortState } from "
|
|
6
|
-
import { SeoDependencies } from "
|
|
1
|
+
import { SeoIndexabilityPolicy } from "../organisations/SeoIndexabilityPolicy";
|
|
2
|
+
import { IOrganisationsProvider } from "../organisations/IOrganisationsProvider";
|
|
3
|
+
import { IRankingApiClient } from "../common/IRankingApiClient";
|
|
4
|
+
import { FilterKeyValuePairs } from "../organisations/FilterKeyValuePairs";
|
|
5
|
+
import { ISortState } from "../organisations/ISortState";
|
|
6
|
+
import { SeoDependencies } from "../types/SeoDependencies";
|
|
7
7
|
export declare abstract class SeoRuleBasedIndexabilityPolicy<T> extends SeoIndexabilityPolicy<T> {
|
|
8
8
|
constructor(dependencies: SeoDependencies, organisationsProvider: IOrganisationsProvider<T>, rankingApiClient: IRankingApiClient, sortState: ISortState);
|
|
9
9
|
protected abstract matchesRule(pairs: FilterKeyValuePairs, ...values: []): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SeoIndexabilityPolicy } from "
|
|
1
|
+
import { SeoIndexabilityPolicy } from "../organisations/SeoIndexabilityPolicy";
|
|
2
2
|
// TODO: Remove this class
|
|
3
3
|
export class SeoRuleBasedIndexabilityPolicy extends SeoIndexabilityPolicy {
|
|
4
4
|
constructor(dependencies, organisationsProvider, rankingApiClient, sortState) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ICountryFragment } from './fragments/ICountryFragment';
|
|
2
2
|
export declare class CountryPresenter {
|
|
3
3
|
private static instance;
|
|
4
4
|
private fragments;
|
|
5
5
|
private constructor();
|
|
6
6
|
static getInstance(): CountryPresenter;
|
|
7
7
|
private generatePaths;
|
|
8
|
-
getFragments():
|
|
8
|
+
getFragments(): ICountryFragment[];
|
|
9
9
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ISeoInfoBase } from "
|
|
2
|
-
import { ISeoFilterState } from "
|
|
3
|
-
import { ISeoSearchApplicationState } from "
|
|
4
|
-
import { ISeoFilterOptions } from "
|
|
5
|
-
import { ISearchIndexabilityManager } from "
|
|
1
|
+
import { ISeoInfoBase } from "../common/ISeoInfoBase";
|
|
2
|
+
import { ISeoFilterState } from "../common/ISeoFilterState";
|
|
3
|
+
import { ISeoSearchApplicationState } from "../common/ISeoSearchApplicationState";
|
|
4
|
+
import { ISeoFilterOptions } from "../common/ISeoFilterOptions";
|
|
5
|
+
import { ISearchIndexabilityManager } from "../common/ISearchIndexabilityManager";
|
|
6
6
|
export declare class SearchIndexabilityManager implements ISearchIndexabilityManager {
|
|
7
7
|
private policies;
|
|
8
8
|
constructor(seoInfoBase: ISeoInfoBase, filterState: ISeoFilterState, applicationState: ISeoSearchApplicationState, filterOptions: ISeoFilterOptions);
|
|
@@ -4,7 +4,7 @@ import { DisciplineCountryPolicy } from "./policies/DisciplineCountryPolicy";
|
|
|
4
4
|
import { DisciplinePolicy } from "./policies/DisciplinePolicy";
|
|
5
5
|
import { UniversityCountryPolicy } from "./policies/UniversityCountryPolicy";
|
|
6
6
|
import { UnfilteredPolicy } from "./policies/UnfilteredPolicy";
|
|
7
|
-
import { DependencyTypes } from "
|
|
7
|
+
import { DependencyTypes } from "../enums/DependencyTypes";
|
|
8
8
|
export class SearchIndexabilityManager {
|
|
9
9
|
policies;
|
|
10
10
|
constructor(seoInfoBase, filterState, applicationState, filterOptions) {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { FilterCombinations } from '
|
|
2
|
-
import { SeoDependencies } from '
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ISeoIndexabilityPolicy } from '
|
|
1
|
+
import { FilterCombinations } from '../../enums/FilterCombinations';
|
|
2
|
+
import { SeoDependencies } from '../../types/SeoDependencies';
|
|
3
|
+
import { ISearchDependencies } from '../../common/ISearchDependencies';
|
|
4
|
+
import { RuleBasedIndexabilityPolicy } from '../../common/RuleBasedIndexabilityPolicy';
|
|
5
|
+
import { ISeoIndexabilityPolicy } from '../../common/ISeoIndexabilityPolicy';
|
|
6
|
+
import { IFilterKeyValues } from '../../common/IFilterKeyValues';
|
|
6
7
|
export declare class AreaPolicy extends RuleBasedIndexabilityPolicy implements ISeoIndexabilityPolicy {
|
|
7
|
-
protected rules: ICustomRule[];
|
|
8
8
|
constructor(dependencies: SeoDependencies);
|
|
9
9
|
protected matchesFilters(): Promise<boolean>;
|
|
10
|
-
generateUrls(): string[]
|
|
10
|
+
generateUrls(): Promise<string[]>;
|
|
11
11
|
get filterCombination(): FilterCombinations;
|
|
12
|
+
protected checksRulesForSearch(dependencies: ISearchDependencies): boolean;
|
|
13
|
+
protected checksRulesForSitemap(filterKeyValues: IFilterKeyValues): boolean;
|
|
12
14
|
}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { FilterKey } from '@studyportals/search-filters';
|
|
2
|
-
import { FilterCombinations } from '
|
|
3
|
-
import { RuleBasedIndexabilityPolicy } from '
|
|
2
|
+
import { FilterCombinations } from '../../enums/FilterCombinations';
|
|
3
|
+
import { RuleBasedIndexabilityPolicy } from '../../common/RuleBasedIndexabilityPolicy';
|
|
4
4
|
import { ExceptAustraliaAreasRule } from '../rules/ExceptAustaliaAreasRule';
|
|
5
5
|
import { SearchVolumeAreasRule } from '../rules/SearchVolumeAreasRule';
|
|
6
|
-
import { AreaPresenter } from '
|
|
6
|
+
import { AreaPresenter } from '../../presenters/AreaPresenter';
|
|
7
7
|
export class AreaPolicy extends RuleBasedIndexabilityPolicy {
|
|
8
|
-
rules = [
|
|
9
|
-
SearchVolumeAreasRule.getInstance(),
|
|
10
|
-
ExceptAustraliaAreasRule.getInstance()
|
|
11
|
-
];
|
|
12
8
|
constructor(dependencies) {
|
|
13
9
|
super(dependencies);
|
|
14
10
|
}
|
|
@@ -23,23 +19,43 @@ export class AreaPolicy extends RuleBasedIndexabilityPolicy {
|
|
|
23
19
|
FilterKey.AREA,
|
|
24
20
|
FilterKey.COUNTRY
|
|
25
21
|
], filterState);
|
|
26
|
-
const
|
|
27
|
-
const hasSearchVolumeAndNotAustralia = this.checksEveryRuleForSearch({
|
|
28
|
-
[FilterKey.AREA]: areaSelected ?? undefined
|
|
29
|
-
});
|
|
22
|
+
const hasSearchVolumeAndNotAustralia = this.checksRulesForSearch(this.dependencies);
|
|
30
23
|
return singleAreaSelected
|
|
31
24
|
&& singleCountrySelected
|
|
32
25
|
&& onlyAreaAndCountrySelected
|
|
33
26
|
&& hasSearchVolumeAndNotAustralia;
|
|
34
27
|
}
|
|
35
|
-
generateUrls() {
|
|
28
|
+
async generateUrls() {
|
|
36
29
|
const areaFragments = AreaPresenter.getInstance().getFragments();
|
|
37
30
|
const paths = areaFragments
|
|
38
|
-
.filter(area => this.
|
|
31
|
+
.filter(area => this.checksRulesForSitemap({
|
|
32
|
+
[FilterKey.COUNTRY]: area.countryId,
|
|
33
|
+
[FilterKey.AREA]: area.id
|
|
34
|
+
}))
|
|
39
35
|
.map(area => area.path);
|
|
40
|
-
return paths;
|
|
36
|
+
return Promise.resolve(paths);
|
|
41
37
|
}
|
|
42
38
|
get filterCombination() {
|
|
43
39
|
return FilterCombinations.AREA;
|
|
44
40
|
}
|
|
41
|
+
checksRulesForSearch(dependencies) {
|
|
42
|
+
const { seoInfoBase, filterState } = dependencies;
|
|
43
|
+
const exceptAustraliaAreasRule = ExceptAustraliaAreasRule.getInstance();
|
|
44
|
+
const areaSelected = seoInfoBase.getFilterOptionValueBy(FilterKey.AREA, filterState);
|
|
45
|
+
const notInAustralia = exceptAustraliaAreasRule.forSearch({
|
|
46
|
+
[FilterKey.AREA]: areaSelected ?? undefined
|
|
47
|
+
});
|
|
48
|
+
const searchVolumeAreasRule = SearchVolumeAreasRule.getInstance();
|
|
49
|
+
const hasSearchVolume = searchVolumeAreasRule.forSearch({
|
|
50
|
+
[FilterKey.AREA]: areaSelected ?? undefined
|
|
51
|
+
});
|
|
52
|
+
return notInAustralia && hasSearchVolume;
|
|
53
|
+
}
|
|
54
|
+
checksRulesForSitemap(filterKeyValues) {
|
|
55
|
+
const exceptAustraliaAreasRule = ExceptAustraliaAreasRule.getInstance();
|
|
56
|
+
const notInAustralia = exceptAustraliaAreasRule.forSitemapGenerator(filterKeyValues);
|
|
57
|
+
const searchVolumeAreasRule = SearchVolumeAreasRule.getInstance();
|
|
58
|
+
const hasSearchVolume = searchVolumeAreasRule.forSitemapGenerator(filterKeyValues);
|
|
59
|
+
return notInAustralia && hasSearchVolume;
|
|
60
|
+
}
|
|
45
61
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { FilterCombinations } from '
|
|
2
|
-
import {
|
|
3
|
-
import { SeoDependencies } from '
|
|
4
|
-
import { RuleBasedIndexabilityPolicy } from '
|
|
5
|
-
import { ISeoIndexabilityPolicy } from '
|
|
1
|
+
import { FilterCombinations } from '../../enums/FilterCombinations';
|
|
2
|
+
import { ISearchDependencies } from '../../common/ISearchDependencies';
|
|
3
|
+
import { SeoDependencies } from '../../types/SeoDependencies';
|
|
4
|
+
import { RuleBasedIndexabilityPolicy } from '../../common/RuleBasedIndexabilityPolicy';
|
|
5
|
+
import { ISeoIndexabilityPolicy } from '../../common/ISeoIndexabilityPolicy';
|
|
6
|
+
import { IFilterKeyValues } from '../../common/IFilterKeyValues';
|
|
6
7
|
export declare class CountryPolicy extends RuleBasedIndexabilityPolicy implements ISeoIndexabilityPolicy {
|
|
7
|
-
protected rules: ICustomRule[];
|
|
8
8
|
constructor(dependencies: SeoDependencies);
|
|
9
9
|
protected matchesFilters(): Promise<boolean>;
|
|
10
|
-
generateUrls(): string[]
|
|
10
|
+
generateUrls(): Promise<string[]>;
|
|
11
11
|
get filterCombination(): FilterCombinations;
|
|
12
|
+
protected checksRulesForSearch(dependencies: ISearchDependencies): boolean;
|
|
13
|
+
protected checksRulesForSitemap(filters: IFilterKeyValues): boolean;
|
|
12
14
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { FilterKey } from '@studyportals/search-filters';
|
|
2
|
-
import { FilterCombinations } from '
|
|
2
|
+
import { FilterCombinations } from '../../enums/FilterCombinations';
|
|
3
3
|
import { SearchVolumeCountriesRule } from '../rules/SearchVolumeCountriesRule';
|
|
4
|
-
import { RuleBasedIndexabilityPolicy } from '
|
|
5
|
-
import { CountryPresenter } from '
|
|
4
|
+
import { RuleBasedIndexabilityPolicy } from '../../common/RuleBasedIndexabilityPolicy';
|
|
5
|
+
import { CountryPresenter } from '../../presenters/CountryPresenter';
|
|
6
6
|
export class CountryPolicy extends RuleBasedIndexabilityPolicy {
|
|
7
|
-
rules = [
|
|
8
|
-
SearchVolumeCountriesRule.getInstance()
|
|
9
|
-
];
|
|
10
7
|
constructor(dependencies) {
|
|
11
8
|
super(dependencies);
|
|
12
9
|
}
|
|
@@ -16,10 +13,7 @@ export class CountryPolicy extends RuleBasedIndexabilityPolicy {
|
|
|
16
13
|
const onlyCountrySelected = await seoInfoBase.selectionOnlyFor([
|
|
17
14
|
FilterKey.COUNTRY
|
|
18
15
|
], filterState);
|
|
19
|
-
const
|
|
20
|
-
const hasSearchVolume = this.checksEveryRuleForSearch({
|
|
21
|
-
[FilterKey.COUNTRY]: countrySelected ?? undefined
|
|
22
|
-
});
|
|
16
|
+
const hasSearchVolume = this.checksRulesForSearch(this.dependencies);
|
|
23
17
|
return singleCountrySelected
|
|
24
18
|
&& onlyCountrySelected
|
|
25
19
|
&& hasSearchVolume;
|
|
@@ -27,11 +21,26 @@ export class CountryPolicy extends RuleBasedIndexabilityPolicy {
|
|
|
27
21
|
generateUrls() {
|
|
28
22
|
const countryFragments = CountryPresenter.getInstance().getFragments();
|
|
29
23
|
const paths = countryFragments
|
|
30
|
-
.filter(country => this.
|
|
24
|
+
.filter(country => this.checksRulesForSitemap({
|
|
25
|
+
[FilterKey.COUNTRY]: country.id
|
|
26
|
+
}))
|
|
31
27
|
.map(country => country.path);
|
|
32
|
-
return paths;
|
|
28
|
+
return Promise.resolve(paths);
|
|
33
29
|
}
|
|
34
30
|
get filterCombination() {
|
|
35
31
|
return FilterCombinations.COUNTRY;
|
|
36
32
|
}
|
|
33
|
+
checksRulesForSearch(dependencies) {
|
|
34
|
+
const { seoInfoBase, filterState } = dependencies;
|
|
35
|
+
const hasSearchVolumeRule = SearchVolumeCountriesRule.getInstance();
|
|
36
|
+
const countrySelected = seoInfoBase.getFilterOptionValueBy(FilterKey.COUNTRY, filterState);
|
|
37
|
+
const hasSearchVolume = hasSearchVolumeRule.forSearch({
|
|
38
|
+
[FilterKey.COUNTRY]: countrySelected ?? undefined
|
|
39
|
+
});
|
|
40
|
+
return hasSearchVolume;
|
|
41
|
+
}
|
|
42
|
+
checksRulesForSitemap(filters) {
|
|
43
|
+
const hasSearchVolumeRule = SearchVolumeCountriesRule.getInstance();
|
|
44
|
+
return hasSearchVolumeRule.forSitemapGenerator(filters);
|
|
45
|
+
}
|
|
37
46
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { ISeoIndexabilityPolicy } from '
|
|
2
|
-
import { FilterCombinations } from '
|
|
3
|
-
import { SeoDependencies } from '
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { ISeoIndexabilityPolicy } from '../../common/ISeoIndexabilityPolicy';
|
|
2
|
+
import { FilterCombinations } from '../../enums/FilterCombinations';
|
|
3
|
+
import { SeoDependencies } from '../../types/SeoDependencies';
|
|
4
|
+
import { ISearchDependencies } from '../../common/ISearchDependencies';
|
|
5
|
+
import { RuleBasedIndexabilityPolicy } from '../../common/RuleBasedIndexabilityPolicy';
|
|
6
|
+
import { IFilterKeyValues } from '../../common/IFilterKeyValues';
|
|
6
7
|
export declare class DisciplineCountryPolicy extends RuleBasedIndexabilityPolicy implements ISeoIndexabilityPolicy {
|
|
7
|
-
protected rules: ICustomRule[];
|
|
8
8
|
constructor(dependencies: SeoDependencies);
|
|
9
9
|
protected matchesFilters(): Promise<boolean>;
|
|
10
|
-
generateUrls(): string[]
|
|
10
|
+
generateUrls(): Promise<string[]>;
|
|
11
11
|
get filterCombination(): FilterCombinations;
|
|
12
|
+
protected checksRulesForSearch(dependencies: ISearchDependencies): boolean;
|
|
13
|
+
protected checksRulesForSitemap(filters: IFilterKeyValues): boolean;
|
|
12
14
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { FilterKey } from '@studyportals/search-filters';
|
|
2
|
-
import { FilterCombinations } from '
|
|
3
|
-
import { RuleBasedIndexabilityPolicy } from '
|
|
2
|
+
import { FilterCombinations } from '../../enums/FilterCombinations';
|
|
3
|
+
import { RuleBasedIndexabilityPolicy } from '../../common/RuleBasedIndexabilityPolicy';
|
|
4
4
|
import { SearchVolumeCountriesDisciplinesRule } from '../rules/SearchVolumeCountryDisciplineRule';
|
|
5
|
-
import { CountryPresenter } from '
|
|
5
|
+
import { CountryPresenter } from '../../presenters/CountryPresenter';
|
|
6
|
+
import { DisciplinePresenter } from '../../presenters/DisciplinePresenter';
|
|
6
7
|
export class DisciplineCountryPolicy extends RuleBasedIndexabilityPolicy {
|
|
7
|
-
rules = [
|
|
8
|
-
SearchVolumeCountriesDisciplinesRule.getInstance()
|
|
9
|
-
];
|
|
10
8
|
constructor(dependencies) {
|
|
11
9
|
super(dependencies);
|
|
12
10
|
}
|
|
@@ -21,12 +19,7 @@ export class DisciplineCountryPolicy extends RuleBasedIndexabilityPolicy {
|
|
|
21
19
|
FilterKey.DISCIPLINES,
|
|
22
20
|
FilterKey.COUNTRY
|
|
23
21
|
], filterState);
|
|
24
|
-
const
|
|
25
|
-
const disciplineSelected = seoInfoBase.getFilterOptionValueBy(FilterKey.DISCIPLINES, filterState);
|
|
26
|
-
const hasSearchVolume = this.checksEveryRuleForSearch({
|
|
27
|
-
[FilterKey.COUNTRY]: countrySelected ?? undefined,
|
|
28
|
-
[FilterKey.DISCIPLINES]: disciplineSelected ?? undefined
|
|
29
|
-
});
|
|
22
|
+
const hasSearchVolume = this.checksRulesForSearch(this.dependencies);
|
|
30
23
|
return singleDisciplineSelected
|
|
31
24
|
&& singleCountrySelected
|
|
32
25
|
&& onlyDisciplineAndCountrySelected
|
|
@@ -35,17 +28,35 @@ export class DisciplineCountryPolicy extends RuleBasedIndexabilityPolicy {
|
|
|
35
28
|
generateUrls() {
|
|
36
29
|
const paths = [];
|
|
37
30
|
const countryFragments = CountryPresenter.getInstance().getFragments();
|
|
38
|
-
const disciplineFragments =
|
|
31
|
+
const disciplineFragments = DisciplinePresenter.getInstance().getFragments();
|
|
39
32
|
countryFragments.forEach(country => {
|
|
40
33
|
disciplineFragments.forEach(discipline => {
|
|
41
|
-
if (this.
|
|
34
|
+
if (this.checksRulesForSitemap({
|
|
35
|
+
[FilterKey.COUNTRY]: country.id,
|
|
36
|
+
[FilterKey.DISCIPLINES]: discipline.id
|
|
37
|
+
})) {
|
|
42
38
|
paths.push(`${country.path}/${discipline.path}`);
|
|
43
39
|
}
|
|
44
40
|
});
|
|
45
41
|
});
|
|
46
|
-
return paths;
|
|
42
|
+
return Promise.resolve(paths);
|
|
47
43
|
}
|
|
48
44
|
get filterCombination() {
|
|
49
45
|
return FilterCombinations.DISCIPLINE_COUNTRY;
|
|
50
46
|
}
|
|
47
|
+
checksRulesForSearch(dependencies) {
|
|
48
|
+
const { seoInfoBase, filterState } = dependencies;
|
|
49
|
+
const countrySelected = seoInfoBase.getFilterOptionValueBy(FilterKey.COUNTRY, filterState);
|
|
50
|
+
const disciplineSelected = seoInfoBase.getFilterOptionValueBy(FilterKey.DISCIPLINES, filterState);
|
|
51
|
+
const searchVolumeRule = SearchVolumeCountriesDisciplinesRule.getInstance();
|
|
52
|
+
const hasSearchVolume = searchVolumeRule.forSearch({
|
|
53
|
+
[FilterKey.COUNTRY]: countrySelected ?? undefined,
|
|
54
|
+
[FilterKey.DISCIPLINES]: disciplineSelected ?? undefined
|
|
55
|
+
});
|
|
56
|
+
return hasSearchVolume;
|
|
57
|
+
}
|
|
58
|
+
checksRulesForSitemap(filters) {
|
|
59
|
+
const searchVolumeRule = SearchVolumeCountriesDisciplinesRule.getInstance();
|
|
60
|
+
return searchVolumeRule.forSitemapGenerator(filters);
|
|
61
|
+
}
|
|
51
62
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { SeoDependencies } from '../../types/SeoDependencies';
|
|
2
|
+
import { ISearchDependencies } from '../../common/ISearchDependencies';
|
|
3
|
+
import { ISeoIndexabilityPolicy } from '../../common/ISeoIndexabilityPolicy';
|
|
4
|
+
import { FilterCombinations } from '../../enums/FilterCombinations';
|
|
5
|
+
import { RuleBasedIndexabilityPolicy } from '../../common/RuleBasedIndexabilityPolicy';
|
|
6
|
+
import { IFilterKeyValues } from '../../common/IFilterKeyValues';
|
|
6
7
|
export declare class DisciplinePolicy extends RuleBasedIndexabilityPolicy implements ISeoIndexabilityPolicy {
|
|
7
|
-
protected rules: ICustomRule[];
|
|
8
8
|
constructor(dependencies: SeoDependencies);
|
|
9
9
|
protected matchesFilters(): Promise<boolean>;
|
|
10
|
-
generateUrls(): string[]
|
|
10
|
+
generateUrls(): Promise<string[]>;
|
|
11
11
|
get filterCombination(): FilterCombinations;
|
|
12
|
+
protected checksRulesForSearch(dependencies: ISearchDependencies): boolean;
|
|
13
|
+
protected checksRulesForSitemap(filters: IFilterKeyValues): boolean;
|
|
12
14
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { FilterKey } from '@studyportals/search-filters';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { DisciplinePresenter } from '../../presenters/DisciplinePresenter';
|
|
3
|
+
import { SearchVolumeDisciplinesRule } from '../../scholarships/rules/SearchVolumeDisciplinesRule';
|
|
4
|
+
import { FilterCombinations } from '../../enums/FilterCombinations';
|
|
5
|
+
import { RuleBasedIndexabilityPolicy } from '../../common/RuleBasedIndexabilityPolicy';
|
|
6
6
|
export class DisciplinePolicy extends RuleBasedIndexabilityPolicy {
|
|
7
|
-
rules = [
|
|
8
|
-
SearchVolumeDisciplinesRule.getInstance()
|
|
9
|
-
];
|
|
10
7
|
constructor(dependencies) {
|
|
11
8
|
super(dependencies);
|
|
12
9
|
}
|
|
@@ -16,10 +13,7 @@ export class DisciplinePolicy extends RuleBasedIndexabilityPolicy {
|
|
|
16
13
|
const onlyDisciplineSelected = await seoInfoBase.selectionOnlyFor([
|
|
17
14
|
FilterKey.DISCIPLINES
|
|
18
15
|
], filterState);
|
|
19
|
-
const
|
|
20
|
-
const hasSearchVolume = this.checksEveryRuleForSearch({
|
|
21
|
-
[FilterKey.DISCIPLINES]: disciplineSelected ?? undefined
|
|
22
|
-
});
|
|
16
|
+
const hasSearchVolume = this.checksRulesForSearch(this.dependencies);
|
|
23
17
|
return singleDisciplineSelected
|
|
24
18
|
&& onlyDisciplineSelected
|
|
25
19
|
&& hasSearchVolume;
|
|
@@ -27,11 +21,26 @@ export class DisciplinePolicy extends RuleBasedIndexabilityPolicy {
|
|
|
27
21
|
generateUrls() {
|
|
28
22
|
const disciplineFragments = DisciplinePresenter.getInstance().getFragments();
|
|
29
23
|
const paths = disciplineFragments
|
|
30
|
-
.filter(discipline => this.
|
|
24
|
+
.filter(discipline => this.checksRulesForSitemap({
|
|
25
|
+
[FilterKey.DISCIPLINES]: discipline.id
|
|
26
|
+
}))
|
|
31
27
|
.map(discipline => discipline.path);
|
|
32
|
-
return paths;
|
|
28
|
+
return Promise.resolve(paths);
|
|
33
29
|
}
|
|
34
30
|
get filterCombination() {
|
|
35
31
|
return FilterCombinations.DISCIPLINE;
|
|
36
32
|
}
|
|
33
|
+
checksRulesForSearch(dependencies) {
|
|
34
|
+
const { seoInfoBase, filterState } = dependencies;
|
|
35
|
+
const hasSearchVolumeRule = SearchVolumeDisciplinesRule.getInstance();
|
|
36
|
+
const disciplineSelected = seoInfoBase.getFilterOptionValueBy(FilterKey.DISCIPLINES, filterState);
|
|
37
|
+
const hasSearchVolume = hasSearchVolumeRule.forSearch({
|
|
38
|
+
[FilterKey.DISCIPLINES]: disciplineSelected ?? undefined
|
|
39
|
+
});
|
|
40
|
+
return hasSearchVolume;
|
|
41
|
+
}
|
|
42
|
+
checksRulesForSitemap(filters) {
|
|
43
|
+
const hasSearchVolumeRule = SearchVolumeDisciplinesRule.getInstance();
|
|
44
|
+
return hasSearchVolumeRule.forSitemapGenerator(filters);
|
|
45
|
+
}
|
|
37
46
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BaseSeoIndexabilityPolicy } from '
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { BaseSeoIndexabilityPolicy } from '../../common/BaseSeoIndexabilityPolicy';
|
|
2
|
+
import { SeoDependencies } from '../../types/SeoDependencies';
|
|
3
|
+
import { FilterCombinations } from '../../enums/FilterCombinations';
|
|
4
4
|
export declare class UnfilteredPolicy extends BaseSeoIndexabilityPolicy {
|
|
5
5
|
constructor(dependencies: SeoDependencies);
|
|
6
6
|
protected matchesFilters(): Promise<boolean>;
|
|
7
|
-
generateUrls(): string[]
|
|
7
|
+
generateUrls(): Promise<string[]>;
|
|
8
8
|
get filterCombination(): FilterCombinations;
|
|
9
9
|
}
|