@studyportals/fawkes 2.0.1-20 → 2.0.1-21

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 (107) hide show
  1. package/dist/index.d.ts +1 -8
  2. package/dist/index.js +1 -3
  3. package/dist/scholarships-seo/index.d.ts +7 -7
  4. package/dist/scholarships-seo/index.js +2 -2
  5. package/dist/sitemap-generator-seo/index.d.ts +5 -0
  6. package/dist/sitemap-generator-seo/index.js +2 -1
  7. package/dist/src/common/BaseSeoIndexabilityPolicy.d.ts +13 -9
  8. package/dist/src/common/BaseSeoIndexabilityPolicy.js +18 -8
  9. package/dist/src/common/ICustomRule.d.ts +6 -0
  10. package/dist/src/common/IDependencies.d.ts +4 -0
  11. package/dist/src/common/IFilterKeyValues.d.ts +6 -0
  12. package/dist/src/common/IFilterKeyValues.js +1 -0
  13. package/dist/src/common/IIndexabilityPolicyDependencies.d.ts +8 -0
  14. package/dist/src/common/ISitemapUrlGenerator.d.ts +5 -0
  15. package/dist/src/common/ISitemapUrlGenerator.js +1 -0
  16. package/dist/src/common/RuleBasedIndexabilityPolicy.d.ts +10 -0
  17. package/dist/src/common/RuleBasedIndexabilityPolicy.js +12 -0
  18. package/dist/src/enums/DependencyTypes.d.ts +4 -0
  19. package/dist/src/enums/DependencyTypes.js +5 -0
  20. package/dist/src/enums/FilterCombinations.d.ts +9 -0
  21. package/dist/src/enums/FilterCombinations.js +10 -0
  22. package/dist/src/organisations/ISeoInfoBaseOrganisations.d.ts +1 -1
  23. package/dist/src/organisations/SearchIndexabilityManager.d.ts +2 -2
  24. package/dist/src/organisations/SeoIndexabilityPolicy.d.ts +3 -4
  25. package/dist/src/organisations/SeoIndexabilityPolicy.js +2 -2
  26. package/dist/src/organisations/SeoRuleBasedIndexabilityPolicy.d.ts +7 -8
  27. package/dist/src/organisations/SeoRuleBasedIndexabilityPolicy.js +4 -3
  28. package/dist/src/presenters/AreaPresenter.d.ts +9 -0
  29. package/dist/src/presenters/AreaPresenter.js +33 -0
  30. package/dist/src/presenters/CountryPresenter.d.ts +9 -0
  31. package/dist/src/presenters/CountryPresenter.js +36 -0
  32. package/dist/src/presenters/DisciplinePresenter.d.ts +9 -0
  33. package/dist/src/presenters/DisciplinePresenter.js +31 -0
  34. package/dist/src/presenters/fragments/IAreaFragment.d.ts +4 -0
  35. package/dist/src/presenters/fragments/IAreaFragment.js +1 -0
  36. package/dist/src/presenters/fragments/ICountryFragment.d.ts +4 -0
  37. package/dist/src/presenters/fragments/ICountryFragment.js +1 -0
  38. package/dist/src/presenters/fragments/IFragment.d.ts +4 -0
  39. package/dist/src/presenters/fragments/IFragment.js +1 -0
  40. package/dist/src/scholarships/SearchIndexabilityManager.d.ts +6 -5
  41. package/dist/src/scholarships/SearchIndexabilityManager.js +14 -11
  42. package/dist/src/scholarships/index.d.ts +0 -1
  43. package/dist/src/scholarships/index.js +0 -1
  44. package/dist/src/scholarships/policies/AreaPolicy.d.ts +10 -9
  45. package/dist/src/scholarships/policies/AreaPolicy.js +36 -16
  46. package/dist/src/scholarships/policies/CountryPolicy.d.ts +10 -6
  47. package/dist/src/scholarships/policies/CountryPolicy.js +32 -10
  48. package/dist/src/scholarships/policies/DisciplineCountryPolicy.d.ts +10 -9
  49. package/dist/src/scholarships/policies/DisciplineCountryPolicy.js +43 -15
  50. package/dist/src/scholarships/policies/DisciplinePolicy.d.ts +10 -6
  51. package/dist/src/scholarships/policies/DisciplinePolicy.js +33 -10
  52. package/dist/src/scholarships/policies/UnfilteredPolicy.d.ts +6 -5
  53. package/dist/src/scholarships/policies/UnfilteredPolicy.js +11 -6
  54. package/dist/src/scholarships/policies/UniversityCountryPolicy.d.ts +6 -5
  55. package/dist/src/scholarships/policies/UniversityCountryPolicy.js +35 -9
  56. package/dist/src/scholarships/rules/ExceptAustaliaAreasRule.d.ts +14 -0
  57. package/dist/src/scholarships/rules/ExceptAustaliaAreasRule.js +45 -0
  58. package/dist/src/scholarships/rules/SearchVolumeAreasRule.d.ts +12 -0
  59. package/dist/src/scholarships/rules/SearchVolumeAreasRule.js +34 -0
  60. package/dist/src/scholarships/rules/SearchVolumeCountriesRule.d.ts +12 -0
  61. package/dist/src/scholarships/rules/SearchVolumeCountriesRule.js +34 -0
  62. package/dist/src/scholarships/rules/SearchVolumeCountryDisciplineRule.d.ts +12 -0
  63. package/dist/src/scholarships/rules/SearchVolumeCountryDisciplineRule.js +37 -0
  64. package/dist/src/scholarships/rules/SearchVolumeDisciplinesRule.d.ts +12 -0
  65. package/dist/src/scholarships/rules/SearchVolumeDisciplinesRule.js +38 -0
  66. package/dist/src/scholarships/rules/files/search-volume.json +39334 -0
  67. package/dist/src/sitemap-generator/IOrganisation.d.ts +6 -0
  68. package/dist/src/sitemap-generator/IOrganisation.js +1 -0
  69. package/dist/src/sitemap-generator/IOrganisationsClient.d.ts +4 -0
  70. package/dist/src/sitemap-generator/IOrganisationsClient.js +1 -0
  71. package/dist/src/sitemap-generator/ISearchApiClient.d.ts +3 -0
  72. package/dist/src/sitemap-generator/ISearchApiClient.js +1 -0
  73. package/dist/src/sitemap-generator/ISitemapUrlGeneratorDependencies.d.ts +9 -0
  74. package/dist/src/sitemap-generator/ISitemapUrlGeneratorDependencies.js +1 -0
  75. package/dist/src/sitemap-generator/ISitemapUrlGeneratorManager.d.ts +4 -0
  76. package/dist/src/sitemap-generator/ISitemapUrlGeneratorManager.js +1 -0
  77. package/dist/src/sitemap-generator/SitemapUrlGeneratorManager.d.ts +8 -0
  78. package/dist/src/sitemap-generator/SitemapUrlGeneratorManager.js +20 -0
  79. package/dist/src/sitemap-generator/index.d.ts +0 -2
  80. package/dist/src/sitemap-generator/index.js +1 -2
  81. package/dist/src/types/SeoDependencies.d.ts +3 -0
  82. package/dist/src/types/SeoDependencies.js +1 -0
  83. package/package.json +16 -6
  84. package/dist/fawkes.js +0 -2
  85. package/dist/fawkes.js.map +0 -1
  86. package/dist/organisations-seo.js +0 -0
  87. package/dist/scholarships-seo.js +0 -2
  88. package/dist/scholarships-seo.js.map +0 -1
  89. package/dist/sitemap-generator-seo.js +0 -0
  90. package/dist/src/common/DisciplinePresenter.d.ts +0 -5
  91. package/dist/src/common/DisciplinePresenter.js +0 -48
  92. package/dist/src/common/IPrettyPathGenerator.d.ts +0 -3
  93. package/dist/src/common/fragments/Fragment.d.ts +0 -6
  94. package/dist/src/common/fragments/Fragment.js +0 -8
  95. package/dist/src/common/fragments/IFragment.d.ts +0 -4
  96. package/dist/src/scholarships/CustomRules.d.ts +0 -6
  97. package/dist/src/scholarships/CustomRules.js +0 -18
  98. package/dist/src/scholarships/policies/DisciplineAreaPolicy.d.ts +0 -12
  99. package/dist/src/scholarships/policies/DisciplineAreaPolicy.js +0 -34
  100. package/dist/src/sitemap-generator/CombinationType.d.ts +0 -2
  101. package/dist/src/sitemap-generator/CombinationType.js +0 -3
  102. package/dist/src/sitemap-generator/ISitemapPathGeneratorChain.d.ts +0 -4
  103. package/dist/src/sitemap-generator/SitemapPathGeneratorChain.d.ts +0 -7
  104. package/dist/src/sitemap-generator/SitemapPathGeneratorChain.js +0 -9
  105. /package/dist/src/common/{IPrettyPathGenerator.js → ICustomRule.js} +0 -0
  106. /package/dist/src/common/{fragments/IFragment.js → IDependencies.js} +0 -0
  107. /package/dist/src/{sitemap-generator/ISitemapPathGeneratorChain.js → common/IIndexabilityPolicyDependencies.js} +0 -0
File without changes
@@ -1,5 +0,0 @@
1
- import { IFragment } from './fragments/IFragment';
2
- export declare class DisciplinePresenter {
3
- constructor();
4
- getFragments(): IFragment[];
5
- }
@@ -1,48 +0,0 @@
1
- import { areasAll } from '@studyportals/static-domain-data/areas/areas';
2
- import { Fragment } from './fragments/Fragment';
3
- export class DisciplinePresenter {
4
- // private fragments: IFragment[];
5
- constructor() {
6
- // this.fragments = this.getFragments();
7
- }
8
- // private fragments: IFragment[];
9
- // private generatePaths(): IFragment[] {
10
- // const disciplines: IFragment[] = [];
11
- // const allDisciplines = [...disciplinesAll, ...subdisciplinesAll];
12
- // allDisciplines.forEach((discipline) => {
13
- // const path = disciplineGetVirtualPath(discipline.id);
14
- // if (path === null) {
15
- // return;
16
- // }
17
- // disciplines.push(new Fragment(discipline.id, path));
18
- // });
19
- // return disciplines;
20
- // }
21
- // private generatePaths(): IFragment[] {
22
- // const allDisciplines = [...disciplinesAll, ...subdisciplinesAll];
23
- // const allDisciplines = [...disciplinesAll];
24
- // const disciplines = allDisciplines.map((discipline) => {
25
- // return new Fragment(
26
- // discipline.id,
27
- // disciplineGetVirtualPath(discipline.id) ?? ""
28
- // );
29
- // }).filter((d) => d.path !== "");
30
- // return disciplines;
31
- // }
32
- getFragments() {
33
- const disciplines = [];
34
- // const allDisciplines = [...disciplinesAll, ...subdisciplinesAll];
35
- // const allDisciplines = [...disciplinesAll];
36
- console.warn(areasAll);
37
- const allDisciplines = [{ id: "1", path: "some_path" }, { id: "2", path: "some_path" }];
38
- allDisciplines.forEach((discipline) => {
39
- // const path = disciplineGetVirtualPath(discipline.id);
40
- const path = discipline.path;
41
- if (path === null) {
42
- return;
43
- }
44
- disciplines.push(new Fragment(discipline.id, path));
45
- });
46
- return disciplines;
47
- }
48
- }
@@ -1,3 +0,0 @@
1
- export interface IPrettyPathGenerator {
2
- generatePaths(): string[];
3
- }
@@ -1,6 +0,0 @@
1
- import { IFragment } from "./IFragment";
2
- export declare class Fragment implements IFragment {
3
- readonly id: string;
4
- readonly path: string;
5
- constructor(id: string, path: string);
6
- }
@@ -1,8 +0,0 @@
1
- export class Fragment {
2
- id;
3
- path;
4
- constructor(id, path) {
5
- this.id = id;
6
- this.path = path;
7
- }
8
- }
@@ -1,4 +0,0 @@
1
- export interface IFragment {
2
- readonly id: string;
3
- readonly path: string;
4
- }
@@ -1,6 +0,0 @@
1
- import { ISeoFilterOptions } from "@/common/ISeoFilterOptions";
2
- import { ISeoSearchApplicationState } from "@/common/ISeoSearchApplicationState";
3
- export declare class CustomRules {
4
- static isPartOfAustralia(filterOptions: ISeoFilterOptions, areaId?: string): boolean;
5
- static hasMoreThan31Results(applicationState: ISeoSearchApplicationState): boolean;
6
- }
@@ -1,18 +0,0 @@
1
- import { FilterKey } from "@studyportals/search-filters";
2
- export class CustomRules {
3
- static isPartOfAustralia(filterOptions, areaId) {
4
- const australiaCode = 202;
5
- if (!areaId) {
6
- return false;
7
- }
8
- const areas = filterOptions.getOptionsInformationFor(FilterKey.AREA);
9
- const identifiedArea = areas.find((area) => area.optionValue === areaId);
10
- if (identifiedArea === undefined) {
11
- return false;
12
- }
13
- return identifiedArea.countryIdentity === australiaCode.toString();
14
- }
15
- static hasMoreThan31Results(applicationState) {
16
- return applicationState.getNumberOfResults() > 31;
17
- }
18
- }
@@ -1,12 +0,0 @@
1
- import { BaseSeoIndexabilityPolicy } from '@/common/BaseSeoIndexabilityPolicy';
2
- import { ISeoFilterState } from '@/common/ISeoFilterState';
3
- import { ISeoInfoBase } from '@/common/ISeoInfoBase';
4
- import { ISeoFilterOptions } from '@/common/ISeoFilterOptions';
5
- import { ISeoSearchApplicationState } from '@/common/ISeoSearchApplicationState';
6
- export declare class DisciplineAreaPolicy extends BaseSeoIndexabilityPolicy {
7
- private filterOptions;
8
- private applicationState;
9
- constructor(seoInfoBase: ISeoInfoBase, filterState: ISeoFilterState, filterOptions: ISeoFilterOptions, applicationState: ISeoSearchApplicationState);
10
- protected matchesFilters(): Promise<boolean>;
11
- generatePaths(): string[];
12
- }
@@ -1,34 +0,0 @@
1
- import { FilterKey } from '@studyportals/search-filters';
2
- import { BaseSeoIndexabilityPolicy } from '@/common/BaseSeoIndexabilityPolicy';
3
- import { CustomRules } from '../CustomRules';
4
- export class DisciplineAreaPolicy extends BaseSeoIndexabilityPolicy {
5
- filterOptions;
6
- applicationState;
7
- constructor(seoInfoBase, filterState, filterOptions, applicationState) {
8
- super(seoInfoBase, filterState);
9
- this.filterOptions = filterOptions;
10
- this.applicationState = applicationState;
11
- }
12
- async matchesFilters() {
13
- const singleDisciplineSelected = await this.seoInfoBase.singleSelectionFor(FilterKey.DISCIPLINES, this.filterState);
14
- const singleCountrySelected = await this.seoInfoBase.singleSelectionFor(FilterKey.COUNTRY, this.filterState);
15
- const singleAreaSelected = await this.seoInfoBase.singleSelectionFor(FilterKey.AREA, this.filterState);
16
- const onlyDisciplineAndAreaSelected = await this.seoInfoBase.selectionOnlyFor([
17
- FilterKey.DISCIPLINES,
18
- FilterKey.COUNTRY,
19
- FilterKey.AREA
20
- ], this.filterState);
21
- const areaSelected = this.seoInfoBase.getFilterOptionValueBy(FilterKey.AREA, this.filterState);
22
- const isPartOfAustralia = CustomRules.isPartOfAustralia(this.filterOptions, areaSelected ?? undefined);
23
- const hasMoreThan31Results = CustomRules.hasMoreThan31Results(this.applicationState);
24
- return singleDisciplineSelected
25
- && singleCountrySelected
26
- && singleAreaSelected
27
- && onlyDisciplineAndAreaSelected
28
- && !isPartOfAustralia
29
- && hasMoreThan31Results;
30
- }
31
- generatePaths() {
32
- throw new Error('Method not implemented.');
33
- }
34
- }
@@ -1,2 +0,0 @@
1
- export declare enum CombinationTypes {
2
- }
@@ -1,3 +0,0 @@
1
- export var CombinationTypes;
2
- (function (CombinationTypes) {
3
- })(CombinationTypes || (CombinationTypes = {}));
@@ -1,4 +0,0 @@
1
- import { CombinationTypes } from "./CombinationType";
2
- export interface ISitemapPathGeneratorChain {
3
- generatePaths(): Map<CombinationTypes, string[]>;
4
- }
@@ -1,7 +0,0 @@
1
- import { ISitemapPathGeneratorChain } from "./ISitemapPathGeneratorChain";
2
- import { CombinationTypes } from "./CombinationType";
3
- export declare class SitemapPathGeneratorChain implements ISitemapPathGeneratorChain {
4
- private handlers;
5
- constructor();
6
- generatePaths(): Map<CombinationTypes, string[]>;
7
- }
@@ -1,9 +0,0 @@
1
- export class SitemapPathGeneratorChain {
2
- handlers;
3
- constructor() {
4
- this.handlers = [];
5
- }
6
- generatePaths() {
7
- throw new Error("Method not implemented.");
8
- }
9
- }