@studyportals/fawkes 4.0.2-1 → 4.0.2-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/IPresenter.d.ts +6 -0
- package/dist/src/common/IPresenter.js +1 -0
- package/dist/src/common/index.d.ts +1 -0
- package/dist/src/common/index.js +1 -0
- package/dist/src/presenters/AreaPresenter.d.ts +4 -1
- package/dist/src/presenters/AreaPresenter.js +2 -0
- package/dist/src/presenters/AttendancePresenter.d.ts +4 -1
- package/dist/src/presenters/AttendancePresenter.js +2 -0
- package/dist/src/presenters/ContinentPresenter.d.ts +4 -1
- package/dist/src/presenters/ContinentPresenter.js +2 -0
- package/dist/src/presenters/CountryPresenter.d.ts +4 -1
- package/dist/src/presenters/CountryPresenter.js +2 -0
- package/dist/src/presenters/DisciplinePresenter.d.ts +4 -1
- package/dist/src/presenters/DisciplinePresenter.js +2 -0
- package/dist/src/sitemap-generator/BaseSitemapUrlGeneratorManager.d.ts +6 -0
- package/dist/src/sitemap-generator/BaseSitemapUrlGeneratorManager.js +10 -0
- package/dist/src/sitemap-generator/ISitemapUrlGeneratorManager.d.ts +2 -0
- package/dist/src/sitemap-generator/OrganisationsSitemapUrlGeneratorManager.d.ts +6 -0
- package/dist/src/sitemap-generator/OrganisationsSitemapUrlGeneratorManager.js +13 -0
- package/dist/src/sitemap-generator/ScholarshipsSitemapUrlGeneratorManager.d.ts +1 -0
- package/dist/src/sitemap-generator/ScholarshipsSitemapUrlGeneratorManager.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/src/common/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { IAreaFragment } from './fragments/IAreaFragment';
|
|
2
|
-
|
|
2
|
+
import { IPresenter } from '../common';
|
|
3
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
4
|
+
export declare class AreaPresenter implements IPresenter {
|
|
5
|
+
readonly filterKey: FilterKey;
|
|
3
6
|
private static instance;
|
|
4
7
|
private readonly fragments;
|
|
5
8
|
private constructor();
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { areasAll } from '@studyportals/static-domain-data/areas/areas';
|
|
2
2
|
import { areaGetPath } from '@studyportals/static-domain-data/areas/area-get-path';
|
|
3
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
3
4
|
export class AreaPresenter {
|
|
5
|
+
filterKey = FilterKey.AREA;
|
|
4
6
|
static instance;
|
|
5
7
|
fragments;
|
|
6
8
|
constructor() {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { IPresenter } from '../common';
|
|
1
2
|
import { IFragment } from './fragments/IFragment';
|
|
2
|
-
|
|
3
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
4
|
+
export declare class AttendancePresenter implements IPresenter {
|
|
5
|
+
readonly filterKey: FilterKey;
|
|
3
6
|
private static instance;
|
|
4
7
|
private readonly fragments;
|
|
5
8
|
private constructor();
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { IFragment } from './fragments/IFragment';
|
|
2
|
-
|
|
2
|
+
import { IPresenter } from '../common';
|
|
3
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
4
|
+
export declare class ContinentPresenter implements IPresenter {
|
|
5
|
+
readonly filterKey: FilterKey;
|
|
3
6
|
private static instance;
|
|
4
7
|
private readonly fragments;
|
|
5
8
|
private constructor();
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { continentsAll } from '@studyportals/static-domain-data/continents/continents';
|
|
2
2
|
import { continentGetPath } from '@studyportals/static-domain-data/continents/continent-get-path';
|
|
3
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
3
4
|
export class ContinentPresenter {
|
|
5
|
+
filterKey = FilterKey.CONTINENT;
|
|
4
6
|
static instance;
|
|
5
7
|
fragments;
|
|
6
8
|
constructor() {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ICountryFragment } from './fragments/ICountryFragment';
|
|
2
|
-
|
|
2
|
+
import { IPresenter } from '../common';
|
|
3
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
4
|
+
export declare class CountryPresenter implements IPresenter {
|
|
5
|
+
readonly filterKey: FilterKey;
|
|
3
6
|
private static instance;
|
|
4
7
|
private readonly fragments;
|
|
5
8
|
private constructor();
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { countriesExtendedAll } from '@studyportals/static-domain-data/countries/countries-extended';
|
|
2
2
|
import { countryGetIsoCodePath } from '@studyportals/static-domain-data/countries/country-get-iso-path';
|
|
3
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
3
4
|
export class CountryPresenter {
|
|
5
|
+
filterKey = FilterKey.COUNTRY;
|
|
4
6
|
static instance;
|
|
5
7
|
fragments;
|
|
6
8
|
constructor() {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { IFragment } from './fragments/IFragment';
|
|
2
|
-
|
|
2
|
+
import { IPresenter } from '../common';
|
|
3
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
4
|
+
export declare class DisciplinePresenter implements IPresenter {
|
|
5
|
+
readonly filterKey: FilterKey;
|
|
3
6
|
private static instance;
|
|
4
7
|
private readonly fragments;
|
|
5
8
|
private constructor();
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { disciplinesAll } from '@studyportals/static-domain-data/disciplines/disciplines';
|
|
2
2
|
import { subdisciplinesAll } from '@studyportals/static-domain-data/disciplines/subdisciplines';
|
|
3
3
|
import { disciplineGetVirtualPath } from '@studyportals/static-domain-data/disciplines/discipline-get-virtual-path';
|
|
4
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
4
5
|
export class DisciplinePresenter {
|
|
6
|
+
filterKey = FilterKey.DISCIPLINES;
|
|
5
7
|
static instance;
|
|
6
8
|
fragments;
|
|
7
9
|
constructor() {
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { ISitemapUrlGenerator } from '../common/ISitemapUrlGenerator';
|
|
2
2
|
import { ISitemapUrlGeneratorManager } from './ISitemapUrlGeneratorManager';
|
|
3
3
|
import { FilterCombinations } from '../enums/FilterCombinations';
|
|
4
|
+
import { IPresenter } from '../common';
|
|
5
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
4
6
|
export declare abstract class BaseSitemapUrlGeneratorManager implements ISitemapUrlGeneratorManager {
|
|
5
7
|
abstract readonly policies: ISitemapUrlGenerator[];
|
|
8
|
+
protected abstract readonly presenters: IPresenter[];
|
|
9
|
+
protected readonly filterKeyValueCounts: Map<FilterKey, number>;
|
|
6
10
|
generateUrls(): Promise<Map<FilterCombinations, string[]>>;
|
|
11
|
+
getFilterKeyValueCounts(): Map<FilterKey, number>;
|
|
12
|
+
protected setFilterKeyValueCounts(): void;
|
|
7
13
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export class BaseSitemapUrlGeneratorManager {
|
|
2
|
+
filterKeyValueCounts = new Map();
|
|
2
3
|
async generateUrls() {
|
|
3
4
|
const map = new Map();
|
|
4
5
|
await Promise.all(this.policies.map(async (policy) => {
|
|
@@ -8,4 +9,13 @@ export class BaseSitemapUrlGeneratorManager {
|
|
|
8
9
|
}));
|
|
9
10
|
return map;
|
|
10
11
|
}
|
|
12
|
+
getFilterKeyValueCounts() {
|
|
13
|
+
return this.filterKeyValueCounts;
|
|
14
|
+
}
|
|
15
|
+
setFilterKeyValueCounts() {
|
|
16
|
+
for (const presenter of this.presenters) {
|
|
17
|
+
const count = presenter.getFragments().length;
|
|
18
|
+
this.filterKeyValueCounts.set(presenter.filterKey, count);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
11
21
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { FilterCombinations } from '../enums/FilterCombinations';
|
|
2
|
+
import { FilterKey } from '@studyportals/search-filters';
|
|
2
3
|
export interface ISitemapUrlGeneratorManager {
|
|
3
4
|
generateUrls(): Promise<Map<FilterCombinations, string[]>>;
|
|
5
|
+
getFilterKeyValueCounts(): Map<FilterKey, number>;
|
|
4
6
|
}
|
|
@@ -4,8 +4,14 @@ import { ISearchApiClient } from '../sitemap-generator/ISearchApiClient';
|
|
|
4
4
|
import { BaseSitemapUrlGeneratorManager } from './BaseSitemapUrlGeneratorManager';
|
|
5
5
|
import { PortalType } from '@studyportals/domain-client';
|
|
6
6
|
import { IRankingApiClient } from './IRankingApiClient';
|
|
7
|
+
import { AreaPresenter } from '../presenters/AreaPresenter';
|
|
8
|
+
import { AttendancePresenter } from '../presenters/AttendancePresenter';
|
|
9
|
+
import { ContinentPresenter } from '../presenters/ContinentPresenter';
|
|
10
|
+
import { CountryPresenter } from '../presenters/CountryPresenter';
|
|
11
|
+
import { DisciplinePresenter } from '../presenters/DisciplinePresenter';
|
|
7
12
|
export declare class OrganisationsSitemapUrlGeneratorManager extends BaseSitemapUrlGeneratorManager {
|
|
8
13
|
readonly portalType: PortalType;
|
|
9
14
|
readonly policies: ISitemapUrlGenerator[];
|
|
15
|
+
protected readonly presenters: (AreaPresenter | AttendancePresenter | ContinentPresenter | CountryPresenter | DisciplinePresenter)[];
|
|
10
16
|
constructor(portalType: PortalType, searchApiClient: ISearchApiClient, organisationsClient: IOrganisationsClient, rankingApiClient: IRankingApiClient);
|
|
11
17
|
}
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import { DependencyTypes } from '../enums/DependencyTypes';
|
|
2
2
|
import { BaseSitemapUrlGeneratorManager } from './BaseSitemapUrlGeneratorManager';
|
|
3
3
|
import { Area, AreaAttendance, Attendance, Continent, Country, CountryAttendance, RankedArea, RankedAreaDiscipline, RankedAttendance, RankedAttendanceDiscipline, RankedContinent, RankedContinentAttendance, RankedCountry, RankedCountryAttendance, RankedCountryDiscipline, RankedDiscipline, RankedUnfiltered, Unfiltered } from '../organisations/policies';
|
|
4
|
+
import { AreaPresenter } from '../presenters/AreaPresenter';
|
|
5
|
+
import { AttendancePresenter } from '../presenters/AttendancePresenter';
|
|
6
|
+
import { ContinentPresenter } from '../presenters/ContinentPresenter';
|
|
7
|
+
import { CountryPresenter } from '../presenters/CountryPresenter';
|
|
8
|
+
import { DisciplinePresenter } from '../presenters/DisciplinePresenter';
|
|
4
9
|
export class OrganisationsSitemapUrlGeneratorManager extends BaseSitemapUrlGeneratorManager {
|
|
5
10
|
portalType;
|
|
6
11
|
policies;
|
|
12
|
+
presenters = [
|
|
13
|
+
AreaPresenter.getInstance(),
|
|
14
|
+
AttendancePresenter.getInstance(),
|
|
15
|
+
ContinentPresenter.getInstance(),
|
|
16
|
+
CountryPresenter.getInstance(),
|
|
17
|
+
DisciplinePresenter.getInstance()
|
|
18
|
+
];
|
|
7
19
|
constructor(portalType, searchApiClient, organisationsClient, rankingApiClient) {
|
|
8
20
|
super();
|
|
9
21
|
this.portalType = portalType;
|
|
@@ -34,5 +46,6 @@ export class OrganisationsSitemapUrlGeneratorManager extends BaseSitemapUrlGener
|
|
|
34
46
|
new RankedDiscipline(dependencies),
|
|
35
47
|
new RankedUnfiltered(dependencies)
|
|
36
48
|
];
|
|
49
|
+
this.setFilterKeyValueCounts();
|
|
37
50
|
}
|
|
38
51
|
}
|
|
@@ -4,5 +4,6 @@ import { ISearchApiClient } from '../sitemap-generator/ISearchApiClient';
|
|
|
4
4
|
import { BaseSitemapUrlGeneratorManager } from './BaseSitemapUrlGeneratorManager';
|
|
5
5
|
export declare class ScholarshipsSitemapUrlGeneratorManager extends BaseSitemapUrlGeneratorManager {
|
|
6
6
|
readonly policies: ISitemapUrlGenerator[];
|
|
7
|
+
protected readonly presenters: never[];
|
|
7
8
|
constructor(searchApiClient: ISearchApiClient, organisationsClient: IOrganisationsClient);
|
|
8
9
|
}
|
|
@@ -8,6 +8,7 @@ import { Unfiltered } from '../scholarships/policies/Unfiltered';
|
|
|
8
8
|
import { BaseSitemapUrlGeneratorManager } from './BaseSitemapUrlGeneratorManager';
|
|
9
9
|
export class ScholarshipsSitemapUrlGeneratorManager extends BaseSitemapUrlGeneratorManager {
|
|
10
10
|
policies;
|
|
11
|
+
presenters = [];
|
|
11
12
|
constructor(searchApiClient, organisationsClient) {
|
|
12
13
|
super();
|
|
13
14
|
const dependencies = {
|