@studyportals/fawkes 1.0.1-7 → 1.0.1-8

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 (61) hide show
  1. package/dist/organisations-seo.js +0 -2
  2. package/dist/scholarships-seo/index.d.ts +3 -2
  3. package/dist/scholarships-seo.js +1 -1
  4. package/dist/scholarships-seo.js.map +1 -1
  5. package/dist/src/common/BaseSeoIndexabilityPolicy.d.ts +5 -10
  6. package/dist/src/common/ISearchIndexabilityManager.d.ts +3 -0
  7. package/dist/src/common/ISeoFilterOptions.d.ts +4 -0
  8. package/dist/src/common/ISeoSearchApplicationState.d.ts +3 -0
  9. package/dist/src/common/index.d.ts +3 -1
  10. package/dist/src/organisations/SearchIndexabilityManager.d.ts +6 -0
  11. package/dist/src/organisations/SearchPolicyChain.d.ts +1 -2
  12. package/dist/src/organisations/SeoIndexabilityPolicy.d.ts +0 -2
  13. package/dist/src/organisations/SeoRuleBasedIndexabilityPolicy.d.ts +0 -5
  14. package/dist/src/scholarships/SearchIndexabilityManager.d.ts +3 -13
  15. package/dist/src/scholarships/index.d.ts +3 -0
  16. package/dist/src/scholarships/policies/AreaPolicy.d.ts +8 -14
  17. package/dist/src/scholarships/policies/CountryPolicy.d.ts +4 -8
  18. package/dist/src/scholarships/policies/DisciplineAreaPolicy.d.ts +4 -8
  19. package/dist/src/scholarships/policies/DisciplineCountryPolicy.d.ts +6 -11
  20. package/dist/src/scholarships/policies/DisciplinePolicy.d.ts +4 -8
  21. package/dist/src/scholarships/policies/UnfilteredPolicy.d.ts +4 -8
  22. package/dist/src/scholarships/policies/UniversityCountryPolicy.d.ts +4 -8
  23. package/package.json +4 -3
  24. package/dist/organisations-seo.js.map +0 -1
  25. package/dist/scholarships-seo/index.js +0 -7
  26. package/dist/src/common/BaseSeoIndexabilityPolicy.js +0 -54
  27. package/dist/src/common/IFilterOptions.d.ts +0 -4
  28. package/dist/src/common/IFilterOptions.js +0 -2
  29. package/dist/src/common/IFilterSelectionState.d.ts +0 -5
  30. package/dist/src/common/IFilterSelectionState.js +0 -2
  31. package/dist/src/common/IPrettyPathGenerator.js +0 -2
  32. package/dist/src/common/ISearchApplicationState.d.ts +0 -3
  33. package/dist/src/common/ISearchApplicationState.js +0 -2
  34. package/dist/src/common/ISearchPolicyChain.d.ts +0 -3
  35. package/dist/src/common/ISearchPolicyChain.js +0 -2
  36. package/dist/src/common/ISeoIndexabilityPolicy.js +0 -2
  37. package/dist/src/common/ISeoInfoBase.js +0 -2
  38. package/dist/src/common/index.js +0 -2
  39. package/dist/src/organisations/FilterKeyValuePairs.js +0 -2
  40. package/dist/src/organisations/IOrganisationsProvider.js +0 -2
  41. package/dist/src/organisations/ISeoInfoBaseOrganisations.js +0 -2
  42. package/dist/src/organisations/ISortState.js +0 -2
  43. package/dist/src/organisations/SearchPolicyChain.js +0 -13
  44. package/dist/src/organisations/SeoIndexabilityPolicy.js +0 -33
  45. package/dist/src/organisations/SeoRuleBasedIndexabilityPolicy.js +0 -33
  46. package/dist/src/organisations/SortingOptions.js +0 -8
  47. package/dist/src/organisations/index.js +0 -6
  48. package/dist/src/scholarships/SearchIndexabilityManager.js +0 -78
  49. package/dist/src/scholarships/index.js +0 -6
  50. package/dist/src/scholarships/policies/AreaPolicy.js +0 -110
  51. package/dist/src/scholarships/policies/CountryPolicy.js +0 -88
  52. package/dist/src/scholarships/policies/DisciplineAreaPolicy.js +0 -99
  53. package/dist/src/scholarships/policies/DisciplineCountryPolicy.js +0 -100
  54. package/dist/src/scholarships/policies/DisciplinePolicy.js +0 -88
  55. package/dist/src/scholarships/policies/UnfilteredPolicy.js +0 -76
  56. package/dist/src/scholarships/policies/UniversityCountryPolicy.js +0 -94
  57. package/dist/src/sitemap-generator/CombinationType.js +0 -6
  58. package/dist/src/sitemap-generator/IRankingApiClient.js +0 -2
  59. package/dist/src/sitemap-generator/ISitemapPathGeneratorChain.js +0 -2
  60. package/dist/src/sitemap-generator/SitemapPathGeneratorChain.js +0 -13
  61. package/dist/src/sitemap-generator/index.js +0 -19
@@ -1,110 +0,0 @@
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 };
51
- }
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;
65
- }
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) {
94
- if (!areaId) {
95
- throw new Error('Area ID is not defined');
96
- }
97
- var areas = this.filterOptions.getFor(search_filters_1.FilterKey.AREA);
98
- var identifiedArea = areas.find(function (area) { return area.optionValue === areaId; });
99
- if (identifiedArea === undefined) {
100
- throw new Error("Area ".concat(areaId, " not found"));
101
- }
102
- return identifiedArea.countryIdentity === AreaPolicy.AUSTRALIA_CODE.toString();
103
- };
104
- AreaPolicy.prototype.generatePaths = function () {
105
- throw new Error('Method not implemented.');
106
- };
107
- AreaPolicy.AUSTRALIA_CODE = 202;
108
- return AreaPolicy;
109
- }(BaseSeoIndexabilityPolicy_1.BaseSeoIndexabilityPolicy));
110
- exports.AreaPolicy = AreaPolicy;
@@ -1,88 +0,0 @@
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 };
51
- }
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;
64
- }
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 () {
84
- throw new Error('Method not implemented.');
85
- };
86
- return CountryPolicy;
87
- }(BaseSeoIndexabilityPolicy_1.BaseSeoIndexabilityPolicy));
88
- exports.CountryPolicy = CountryPolicy;
@@ -1,99 +0,0 @@
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 };
51
- }
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;
64
- }
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 () {
95
- throw new Error('Method not implemented.');
96
- };
97
- return DisciplineAreaPolicy;
98
- }(BaseSeoIndexabilityPolicy_1.BaseSeoIndexabilityPolicy));
99
- exports.DisciplineAreaPolicy = DisciplineAreaPolicy;
@@ -1,100 +0,0 @@
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 };
51
- }
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;
65
- }
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 () {
93
- return this.applicationState.getNumberOfResults() > 31;
94
- };
95
- DisciplineCountryPolicy.prototype.generatePaths = function () {
96
- throw new Error('Method not implemented.');
97
- };
98
- return DisciplineCountryPolicy;
99
- }(BaseSeoIndexabilityPolicy_1.BaseSeoIndexabilityPolicy));
100
- exports.DisciplineCountryPolicy = DisciplineCountryPolicy;
@@ -1,88 +0,0 @@
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 };
51
- }
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.DisciplinePolicy = void 0;
55
- var search_filters_1 = require("@studyportals/search-filters");
56
- var BaseSeoIndexabilityPolicy_1 = require("@/common/BaseSeoIndexabilityPolicy");
57
- var DisciplinePolicy = /** @class */ (function (_super) {
58
- __extends(DisciplinePolicy, _super);
59
- function DisciplinePolicy(seoInfoBase, filterState) {
60
- var _this = _super.call(this, seoInfoBase, filterState) || this;
61
- _this.seoInfoBase = seoInfoBase;
62
- _this.filterState = filterState;
63
- return _this;
64
- }
65
- DisciplinePolicy.prototype.matchesFilters = function () {
66
- return __awaiter(this, void 0, void 0, function () {
67
- var singleDisciplineSelected, onlyDisciplineSelected;
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.selectionOnlyFor([
74
- search_filters_1.FilterKey.DISCIPLINES
75
- ], this.filterState)];
76
- case 2:
77
- onlyDisciplineSelected = _a.sent();
78
- return [2 /*return*/, singleDisciplineSelected && onlyDisciplineSelected];
79
- }
80
- });
81
- });
82
- };
83
- DisciplinePolicy.prototype.generatePaths = function () {
84
- throw new Error('Method not implemented.');
85
- };
86
- return DisciplinePolicy;
87
- }(BaseSeoIndexabilityPolicy_1.BaseSeoIndexabilityPolicy));
88
- exports.DisciplinePolicy = DisciplinePolicy;
@@ -1,76 +0,0 @@
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 };
51
- }
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.UnfilteredPolicy = void 0;
55
- var BaseSeoIndexabilityPolicy_1 = require("@/common/BaseSeoIndexabilityPolicy");
56
- var UnfilteredPolicy = /** @class */ (function (_super) {
57
- __extends(UnfilteredPolicy, _super);
58
- function UnfilteredPolicy(seoInfoBase, filterState) {
59
- var _this = _super.call(this, seoInfoBase, filterState) || this;
60
- _this.seoInfoBase = seoInfoBase;
61
- _this.filterState = filterState;
62
- return _this;
63
- }
64
- UnfilteredPolicy.prototype.matchesFilters = function () {
65
- return __awaiter(this, void 0, void 0, function () {
66
- return __generator(this, function (_a) {
67
- return [2 /*return*/, Promise.resolve(this.seoInfoBase.getSelectionTypeCount(this.filterState) === 0)];
68
- });
69
- });
70
- };
71
- UnfilteredPolicy.prototype.generatePaths = function () {
72
- throw new Error('Method not implemented.');
73
- };
74
- return UnfilteredPolicy;
75
- }(BaseSeoIndexabilityPolicy_1.BaseSeoIndexabilityPolicy));
76
- exports.UnfilteredPolicy = UnfilteredPolicy;