@studyportals/fawkes 1.0.1-2 → 1.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.
Files changed (75) hide show
  1. package/dist/fawkes.js +0 -0
  2. package/dist/index.d.ts +0 -0
  3. package/dist/index.js +1 -0
  4. package/dist/organisations-seo/index.js +1 -0
  5. package/dist/organisations-seo.js +0 -2
  6. package/dist/scholarships-seo/index.d.ts +3 -2
  7. package/dist/scholarships-seo/index.js +2 -7
  8. package/dist/scholarships-seo.js +1 -1
  9. package/dist/scholarships-seo.js.map +1 -1
  10. package/dist/sitemap-generator-seo/index.js +9 -0
  11. package/dist/src/common/BaseSeoIndexabilityPolicy.d.ts +5 -10
  12. package/dist/src/common/BaseSeoIndexabilityPolicy.js +12 -51
  13. package/dist/src/common/IPrettyPathGenerator.js +1 -2
  14. package/dist/src/common/ISearchIndexabilityManager.d.ts +3 -0
  15. package/dist/src/common/ISearchIndexabilityManager.js +1 -0
  16. package/dist/src/common/ISeoFilterOptions.d.ts +4 -0
  17. package/dist/src/common/ISeoFilterOptions.js +1 -0
  18. package/dist/src/common/ISeoFilterState.d.ts +5 -0
  19. package/dist/src/common/ISeoFilterState.js +1 -0
  20. package/dist/src/common/ISeoIndexabilityPolicy.js +1 -2
  21. package/dist/src/common/ISeoInfoBase.d.ts +5 -7
  22. package/dist/src/common/ISeoInfoBase.js +1 -2
  23. package/dist/src/common/ISeoSearchApplicationState.d.ts +3 -0
  24. package/dist/src/common/ISeoSearchApplicationState.js +1 -0
  25. package/dist/src/common/index.d.ts +4 -2
  26. package/dist/src/common/index.js +1 -2
  27. package/dist/src/organisations/FilterKeyValuePairs.js +1 -2
  28. package/dist/src/organisations/IOrganisationsProvider.js +1 -2
  29. package/dist/src/organisations/ISeoInfoBaseOrganisations.js +1 -2
  30. package/dist/src/organisations/ISortState.js +1 -2
  31. package/dist/src/organisations/SearchIndexabilityManager.d.ts +6 -0
  32. package/dist/src/organisations/SearchIndexabilityManager.js +6 -0
  33. package/dist/src/organisations/SeoIndexabilityPolicy.d.ts +2 -4
  34. package/dist/src/organisations/SeoIndexabilityPolicy.js +11 -32
  35. package/dist/src/organisations/SeoRuleBasedIndexabilityPolicy.d.ts +2 -7
  36. package/dist/src/organisations/SeoRuleBasedIndexabilityPolicy.js +5 -32
  37. package/dist/src/organisations/SortingOptions.js +2 -5
  38. package/dist/src/organisations/index.js +1 -2
  39. package/dist/src/scholarships/SearchIndexabilityManager.d.ts +3 -13
  40. package/dist/src/scholarships/SearchIndexabilityManager.js +22 -75
  41. package/dist/src/scholarships/index.d.ts +4 -0
  42. package/dist/src/scholarships/index.js +4 -6
  43. package/dist/src/scholarships/policies/AreaPolicy.d.ts +8 -14
  44. package/dist/src/scholarships/policies/AreaPolicy.js +29 -101
  45. package/dist/src/scholarships/policies/CountryPolicy.d.ts +4 -8
  46. package/dist/src/scholarships/policies/CountryPolicy.js +14 -85
  47. package/dist/src/scholarships/policies/DisciplineAreaPolicy.d.ts +4 -8
  48. package/dist/src/scholarships/policies/DisciplineAreaPolicy.js +21 -96
  49. package/dist/src/scholarships/policies/DisciplineCountryPolicy.d.ts +6 -11
  50. package/dist/src/scholarships/policies/DisciplineCountryPolicy.js +24 -96
  51. package/dist/src/scholarships/policies/DisciplinePolicy.d.ts +4 -8
  52. package/dist/src/scholarships/policies/DisciplinePolicy.js +14 -85
  53. package/dist/src/scholarships/policies/UnfilteredPolicy.d.ts +4 -8
  54. package/dist/src/scholarships/policies/UnfilteredPolicy.js +9 -73
  55. package/dist/src/scholarships/policies/UniversityCountryPolicy.d.ts +4 -8
  56. package/dist/src/scholarships/policies/UniversityCountryPolicy.js +18 -91
  57. package/dist/src/scholarships/types.d.ts +7 -0
  58. package/dist/src/scholarships/types.js +7 -0
  59. package/dist/src/sitemap-generator/CombinationType.js +2 -5
  60. package/dist/src/sitemap-generator/IRankingApiClient.js +1 -2
  61. package/dist/src/sitemap-generator/ISitemapPathGeneratorChain.js +1 -2
  62. package/dist/src/sitemap-generator/SitemapPathGeneratorChain.js +6 -10
  63. package/dist/src/sitemap-generator/index.js +3 -19
  64. package/package.json +11 -6
  65. package/dist/organisations-seo.js.map +0 -1
  66. package/dist/src/common/IFilterOptions.d.ts +0 -4
  67. package/dist/src/common/IFilterOptions.js +0 -2
  68. package/dist/src/common/IFilterSelectionState.d.ts +0 -4
  69. package/dist/src/common/IFilterSelectionState.js +0 -2
  70. package/dist/src/common/ISearchApplicationState.d.ts +0 -3
  71. package/dist/src/common/ISearchApplicationState.js +0 -2
  72. package/dist/src/common/ISearchPolicyChain.d.ts +0 -3
  73. package/dist/src/common/ISearchPolicyChain.js +0 -2
  74. package/dist/src/organisations/SearchPolicyChain.d.ts +0 -6
  75. package/dist/src/organisations/SearchPolicyChain.js +0 -13
@@ -1,110 +1,38 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
1
+ import { FilterKey } from '@studyportals/search-filters';
2
+ import { BaseSeoIndexabilityPolicy } from '@/common/BaseSeoIndexabilityPolicy';
3
+ export class AreaPolicy extends BaseSeoIndexabilityPolicy {
4
+ static AUSTRALIA_CODE = 202;
5
+ filterOptions;
6
+ constructor(seoInfoBase, filterState, filterOptions) {
7
+ super(seoInfoBase, filterState);
8
+ this.filterOptions = filterOptions;
51
9
  }
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.AreaPolicy = void 0;
55
- var search_filters_1 = require("@studyportals/search-filters");
56
- var BaseSeoIndexabilityPolicy_1 = require("@/common/BaseSeoIndexabilityPolicy");
57
- var AreaPolicy = /** @class */ (function (_super) {
58
- __extends(AreaPolicy, _super);
59
- function AreaPolicy(seoInfoBase, filterState, filterOptions) {
60
- var _this = _super.call(this, seoInfoBase, filterState) || this;
61
- _this.seoInfoBase = seoInfoBase;
62
- _this.filterState = filterState;
63
- _this.filterOptions = filterOptions;
64
- return _this;
10
+ async matchesFilters() {
11
+ const singleAreaSelected = await this.seoInfoBase.singleSelectionFor(FilterKey.AREA, this.filterState);
12
+ const singleCountrySelected = await this.seoInfoBase.singleSelectionFor(FilterKey.COUNTRY, this.filterState);
13
+ const onlyAreaAndCountrySelected = await this.seoInfoBase.selectionOnlyFor([
14
+ FilterKey.AREA,
15
+ FilterKey.COUNTRY
16
+ ], this.filterState);
17
+ const areaSelected = this.seoInfoBase.getFilterOptionValueBy(FilterKey.AREA, this.filterState);
18
+ const isPartOfAustralia = this.isPartOfAustralia(areaSelected ?? undefined);
19
+ return singleAreaSelected
20
+ && singleCountrySelected
21
+ && onlyAreaAndCountrySelected
22
+ && !isPartOfAustralia;
65
23
  }
66
- AreaPolicy.prototype.matchesFilters = function () {
67
- return __awaiter(this, void 0, void 0, function () {
68
- var singleAreaSelected, singleCountrySelected, onlyAreaAndCountrySelected, areaSelected, isPartOfAustralia;
69
- return __generator(this, function (_a) {
70
- switch (_a.label) {
71
- case 0: return [4 /*yield*/, this.seoInfoBase.singleSelectionFor(search_filters_1.FilterKey.AREA, this.filterState)];
72
- case 1:
73
- singleAreaSelected = _a.sent();
74
- return [4 /*yield*/, this.seoInfoBase.singleSelectionFor(search_filters_1.FilterKey.COUNTRY, this.filterState)];
75
- case 2:
76
- singleCountrySelected = _a.sent();
77
- return [4 /*yield*/, this.seoInfoBase.selectionOnlyFor([
78
- search_filters_1.FilterKey.AREA,
79
- search_filters_1.FilterKey.COUNTRY
80
- ], this.filterState)];
81
- case 3:
82
- onlyAreaAndCountrySelected = _a.sent();
83
- areaSelected = this.seoInfoBase.getFilterOptionValueBy(search_filters_1.FilterKey.AREA, this.filterState);
84
- isPartOfAustralia = this.isPartOfAustralia(areaSelected !== null && areaSelected !== void 0 ? areaSelected : undefined);
85
- return [2 /*return*/, singleAreaSelected
86
- && singleCountrySelected
87
- && onlyAreaAndCountrySelected
88
- && !isPartOfAustralia];
89
- }
90
- });
91
- });
92
- };
93
- AreaPolicy.prototype.isPartOfAustralia = function (areaId) {
24
+ isPartOfAustralia(areaId) {
94
25
  if (!areaId) {
95
26
  throw new Error('Area ID is not defined');
96
27
  }
97
- var areas = this.filterOptions.getFor(search_filters_1.FilterKey.AREA);
98
- var identifiedArea = areas.find(function (area) { return area.optionValue === areaId; });
28
+ const areas = this.filterOptions.getOptionsInformationFor(FilterKey.AREA);
29
+ const identifiedArea = areas.find((area) => area.optionValue === areaId);
99
30
  if (identifiedArea === undefined) {
100
- throw new Error("Area ".concat(areaId, " not found"));
31
+ throw new Error(`Area ${areaId} not found`);
101
32
  }
102
33
  return identifiedArea.countryIdentity === AreaPolicy.AUSTRALIA_CODE.toString();
103
- };
104
- AreaPolicy.prototype.generatePaths = function () {
34
+ }
35
+ generatePaths() {
105
36
  throw new Error('Method not implemented.');
106
- };
107
- AreaPolicy.AUSTRALIA_CODE = 202;
108
- return AreaPolicy;
109
- }(BaseSeoIndexabilityPolicy_1.BaseSeoIndexabilityPolicy));
110
- exports.AreaPolicy = AreaPolicy;
37
+ }
38
+ }
@@ -1,10 +1,6 @@
1
- import { BaseSeoIndexabilityPolicy } from '@/common/BaseSeoIndexabilityPolicy';
2
- import { IFilterSelectionState } from '@/common/IFilterSelectionState';
3
- import { ISeoInfoBase } from '@/common/ISeoInfoBase';
1
+ import { BaseSeoIndexabilityPolicy } from "@/common/BaseSeoIndexabilityPolicy";
4
2
  export declare class CountryPolicy extends BaseSeoIndexabilityPolicy {
5
- protected readonly seoInfoBase: ISeoInfoBase;
6
- protected readonly filterState: IFilterSelectionState;
7
- constructor(seoInfoBase: ISeoInfoBase, filterState: IFilterSelectionState);
8
- protected matchesFilters(): Promise<boolean>;
9
- generatePaths(): string[];
3
+ constructor(seoInfoBase: any, filterState: any);
4
+ matchesFilters(): Promise<any>;
5
+ generatePaths(): void;
10
6
  }
@@ -1,88 +1,17 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
1
+ import { FilterKey } from '@studyportals/search-filters';
2
+ import { BaseSeoIndexabilityPolicy } from '@/common/BaseSeoIndexabilityPolicy';
3
+ export class CountryPolicy extends BaseSeoIndexabilityPolicy {
4
+ constructor(seoInfoBase, filterState) {
5
+ super(seoInfoBase, filterState);
51
6
  }
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.CountryPolicy = void 0;
55
- var search_filters_1 = require("@studyportals/search-filters");
56
- var BaseSeoIndexabilityPolicy_1 = require("@/common/BaseSeoIndexabilityPolicy");
57
- var CountryPolicy = /** @class */ (function (_super) {
58
- __extends(CountryPolicy, _super);
59
- function CountryPolicy(seoInfoBase, filterState) {
60
- var _this = _super.call(this, seoInfoBase, filterState) || this;
61
- _this.seoInfoBase = seoInfoBase;
62
- _this.filterState = filterState;
63
- return _this;
7
+ async matchesFilters() {
8
+ const singleCountrySelected = await this.seoInfoBase.singleSelectionFor(FilterKey.COUNTRY, this.filterState);
9
+ const onlyCountrySelected = await this.seoInfoBase.selectionOnlyFor([
10
+ FilterKey.COUNTRY
11
+ ], this.filterState);
12
+ return singleCountrySelected && onlyCountrySelected;
64
13
  }
65
- CountryPolicy.prototype.matchesFilters = function () {
66
- return __awaiter(this, void 0, void 0, function () {
67
- var singleCountrySelected, onlyCountrySelected;
68
- return __generator(this, function (_a) {
69
- switch (_a.label) {
70
- case 0: return [4 /*yield*/, this.seoInfoBase.singleSelectionFor(search_filters_1.FilterKey.COUNTRY, this.filterState)];
71
- case 1:
72
- singleCountrySelected = _a.sent();
73
- return [4 /*yield*/, this.seoInfoBase.selectionOnlyFor([
74
- search_filters_1.FilterKey.COUNTRY
75
- ], this.filterState)];
76
- case 2:
77
- onlyCountrySelected = _a.sent();
78
- return [2 /*return*/, singleCountrySelected && onlyCountrySelected];
79
- }
80
- });
81
- });
82
- };
83
- CountryPolicy.prototype.generatePaths = function () {
14
+ generatePaths() {
84
15
  throw new Error('Method not implemented.');
85
- };
86
- return CountryPolicy;
87
- }(BaseSeoIndexabilityPolicy_1.BaseSeoIndexabilityPolicy));
88
- exports.CountryPolicy = CountryPolicy;
16
+ }
17
+ }
@@ -1,10 +1,6 @@
1
- import { BaseSeoIndexabilityPolicy } from '@/common/BaseSeoIndexabilityPolicy';
2
- import { IFilterSelectionState } from '@/common/IFilterSelectionState';
3
- import { ISeoInfoBase } from '@/common/ISeoInfoBase';
1
+ import { BaseSeoIndexabilityPolicy } from "@/common/BaseSeoIndexabilityPolicy";
4
2
  export declare class DisciplineAreaPolicy extends BaseSeoIndexabilityPolicy {
5
- protected readonly seoInfoBase: ISeoInfoBase;
6
- protected readonly filterState: IFilterSelectionState;
7
- constructor(seoInfoBase: ISeoInfoBase, filterState: IFilterSelectionState);
8
- protected matchesFilters(): Promise<boolean>;
9
- generatePaths(): string[];
3
+ constructor(seoInfoBase: any, filterState: any);
4
+ matchesFilters(): Promise<any>;
5
+ generatePaths(): void;
10
6
  }
@@ -1,99 +1,24 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
1
+ import { FilterKey } from '@studyportals/search-filters';
2
+ import { BaseSeoIndexabilityPolicy } from '@/common/BaseSeoIndexabilityPolicy';
3
+ export class DisciplineAreaPolicy extends BaseSeoIndexabilityPolicy {
4
+ constructor(seoInfoBase, filterState) {
5
+ super(seoInfoBase, filterState);
51
6
  }
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.DisciplineAreaPolicy = void 0;
55
- var search_filters_1 = require("@studyportals/search-filters");
56
- var BaseSeoIndexabilityPolicy_1 = require("@/common/BaseSeoIndexabilityPolicy");
57
- var DisciplineAreaPolicy = /** @class */ (function (_super) {
58
- __extends(DisciplineAreaPolicy, _super);
59
- function DisciplineAreaPolicy(seoInfoBase, filterState) {
60
- var _this = _super.call(this, seoInfoBase, filterState) || this;
61
- _this.seoInfoBase = seoInfoBase;
62
- _this.filterState = filterState;
63
- return _this;
7
+ async matchesFilters() {
8
+ const singleDisciplineSelected = await this.seoInfoBase.singleSelectionFor(FilterKey.DISCIPLINES, this.filterState);
9
+ const singleCountrySelected = await this.seoInfoBase.singleSelectionFor(FilterKey.COUNTRY, this.filterState);
10
+ const singleAreaSelected = await this.seoInfoBase.singleSelectionFor(FilterKey.AREA, this.filterState);
11
+ const onlyDisciplineAndAreaSelected = await this.seoInfoBase.selectionOnlyFor([
12
+ FilterKey.DISCIPLINES,
13
+ FilterKey.COUNTRY,
14
+ FilterKey.AREA
15
+ ], this.filterState);
16
+ return singleDisciplineSelected
17
+ && singleCountrySelected
18
+ && singleAreaSelected
19
+ && onlyDisciplineAndAreaSelected;
64
20
  }
65
- DisciplineAreaPolicy.prototype.matchesFilters = function () {
66
- return __awaiter(this, void 0, void 0, function () {
67
- var singleDisciplineSelected, singleCountrySelected, singleAreaSelected, onlyDisciplineAndAreaSelected;
68
- return __generator(this, function (_a) {
69
- switch (_a.label) {
70
- case 0: return [4 /*yield*/, this.seoInfoBase.singleSelectionFor(search_filters_1.FilterKey.DISCIPLINES, this.filterState)];
71
- case 1:
72
- singleDisciplineSelected = _a.sent();
73
- return [4 /*yield*/, this.seoInfoBase.singleSelectionFor(search_filters_1.FilterKey.COUNTRY, this.filterState)];
74
- case 2:
75
- singleCountrySelected = _a.sent();
76
- return [4 /*yield*/, this.seoInfoBase.singleSelectionFor(search_filters_1.FilterKey.AREA, this.filterState)];
77
- case 3:
78
- singleAreaSelected = _a.sent();
79
- return [4 /*yield*/, this.seoInfoBase.selectionOnlyFor([
80
- search_filters_1.FilterKey.DISCIPLINES,
81
- search_filters_1.FilterKey.COUNTRY,
82
- search_filters_1.FilterKey.AREA
83
- ], this.filterState)];
84
- case 4:
85
- onlyDisciplineAndAreaSelected = _a.sent();
86
- return [2 /*return*/, singleDisciplineSelected
87
- && singleCountrySelected
88
- && singleAreaSelected
89
- && onlyDisciplineAndAreaSelected];
90
- }
91
- });
92
- });
93
- };
94
- DisciplineAreaPolicy.prototype.generatePaths = function () {
21
+ generatePaths() {
95
22
  throw new Error('Method not implemented.');
96
- };
97
- return DisciplineAreaPolicy;
98
- }(BaseSeoIndexabilityPolicy_1.BaseSeoIndexabilityPolicy));
99
- exports.DisciplineAreaPolicy = DisciplineAreaPolicy;
23
+ }
24
+ }
@@ -1,13 +1,8 @@
1
- import { BaseSeoIndexabilityPolicy } from '@/common/BaseSeoIndexabilityPolicy';
2
- import { ISearchApplicationState } from '@/common/ISearchApplicationState';
3
- import { IFilterSelectionState } from '@/common/IFilterSelectionState';
4
- import { ISeoInfoBase } from '@/common/ISeoInfoBase';
1
+ import { BaseSeoIndexabilityPolicy } from "@/common/BaseSeoIndexabilityPolicy";
5
2
  export declare class DisciplineCountryPolicy extends BaseSeoIndexabilityPolicy {
6
- protected readonly seoInfoBase: ISeoInfoBase;
7
- protected readonly filterState: IFilterSelectionState;
8
- protected readonly applicationState: ISearchApplicationState;
9
- constructor(seoInfoBase: ISeoInfoBase, filterState: IFilterSelectionState, applicationState: ISearchApplicationState);
10
- protected matchesFilters(): Promise<boolean>;
11
- private hasEnoughResults;
12
- generatePaths(): string[];
3
+ applicationState: any;
4
+ constructor(seoInfoBase: any, filterState: any, applicationState: any);
5
+ matchesFilters(): Promise<any>;
6
+ hasEnoughResults(): boolean;
7
+ generatePaths(): void;
13
8
  }
@@ -1,100 +1,28 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
1
+ import { FilterKey } from '@studyportals/search-filters';
2
+ import { BaseSeoIndexabilityPolicy } from '@/common/BaseSeoIndexabilityPolicy';
3
+ export class DisciplineCountryPolicy extends BaseSeoIndexabilityPolicy {
4
+ applicationState;
5
+ constructor(seoInfoBase, filterState, applicationState) {
6
+ super(seoInfoBase, filterState);
7
+ this.applicationState = applicationState;
51
8
  }
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.DisciplineCountryPolicy = void 0;
55
- var search_filters_1 = require("@studyportals/search-filters");
56
- var BaseSeoIndexabilityPolicy_1 = require("@/common/BaseSeoIndexabilityPolicy");
57
- var DisciplineCountryPolicy = /** @class */ (function (_super) {
58
- __extends(DisciplineCountryPolicy, _super);
59
- function DisciplineCountryPolicy(seoInfoBase, filterState, applicationState) {
60
- var _this = _super.call(this, seoInfoBase, filterState) || this;
61
- _this.seoInfoBase = seoInfoBase;
62
- _this.filterState = filterState;
63
- _this.applicationState = applicationState;
64
- return _this;
9
+ async matchesFilters() {
10
+ const singleDisciplineSelected = await this.seoInfoBase.singleSelectionFor(FilterKey.DISCIPLINES, this.filterState);
11
+ const singleCountrySelected = await this.seoInfoBase.singleSelectionFor(FilterKey.COUNTRY, this.filterState);
12
+ const onlyDisciplineAndCountrySelected = await this.seoInfoBase.selectionOnlyFor([
13
+ FilterKey.DISCIPLINES,
14
+ FilterKey.COUNTRY
15
+ ], this.filterState);
16
+ const hasEnoughResults = this.hasEnoughResults();
17
+ return singleDisciplineSelected
18
+ && singleCountrySelected
19
+ && onlyDisciplineAndCountrySelected
20
+ && hasEnoughResults;
65
21
  }
66
- DisciplineCountryPolicy.prototype.matchesFilters = function () {
67
- return __awaiter(this, void 0, void 0, function () {
68
- var singleDisciplineSelected, singleCountrySelected, onlyDisciplineAndCountrySelected, hasEnoughResults;
69
- return __generator(this, function (_a) {
70
- switch (_a.label) {
71
- case 0: return [4 /*yield*/, this.seoInfoBase.singleSelectionFor(search_filters_1.FilterKey.DISCIPLINES, this.filterState)];
72
- case 1:
73
- singleDisciplineSelected = _a.sent();
74
- return [4 /*yield*/, this.seoInfoBase.singleSelectionFor(search_filters_1.FilterKey.COUNTRY, this.filterState)];
75
- case 2:
76
- singleCountrySelected = _a.sent();
77
- return [4 /*yield*/, this.seoInfoBase.selectionOnlyFor([
78
- search_filters_1.FilterKey.DISCIPLINES,
79
- search_filters_1.FilterKey.COUNTRY
80
- ], this.filterState)];
81
- case 3:
82
- onlyDisciplineAndCountrySelected = _a.sent();
83
- hasEnoughResults = this.hasEnoughResults();
84
- return [2 /*return*/, singleDisciplineSelected
85
- && singleCountrySelected
86
- && onlyDisciplineAndCountrySelected
87
- && hasEnoughResults];
88
- }
89
- });
90
- });
91
- };
92
- DisciplineCountryPolicy.prototype.hasEnoughResults = function () {
22
+ hasEnoughResults() {
93
23
  return this.applicationState.getNumberOfResults() > 31;
94
- };
95
- DisciplineCountryPolicy.prototype.generatePaths = function () {
24
+ }
25
+ generatePaths() {
96
26
  throw new Error('Method not implemented.');
97
- };
98
- return DisciplineCountryPolicy;
99
- }(BaseSeoIndexabilityPolicy_1.BaseSeoIndexabilityPolicy));
100
- exports.DisciplineCountryPolicy = DisciplineCountryPolicy;
27
+ }
28
+ }
@@ -1,10 +1,6 @@
1
- import { BaseSeoIndexabilityPolicy } from '@/common/BaseSeoIndexabilityPolicy';
2
- import { IFilterSelectionState } from '@/common/IFilterSelectionState';
3
- import { ISeoInfoBase } from '@/common/ISeoInfoBase';
1
+ import { BaseSeoIndexabilityPolicy } from "@/common/BaseSeoIndexabilityPolicy";
4
2
  export declare class DisciplinePolicy extends BaseSeoIndexabilityPolicy {
5
- protected readonly seoInfoBase: ISeoInfoBase;
6
- protected readonly filterState: IFilterSelectionState;
7
- constructor(seoInfoBase: ISeoInfoBase, filterState: IFilterSelectionState);
8
- protected matchesFilters(): Promise<boolean>;
9
- generatePaths(): string[];
3
+ constructor(seoInfoBase: any, filterState: any);
4
+ matchesFilters(): Promise<any>;
5
+ generatePaths(): void;
10
6
  }