@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
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // import {
3
+ // ISitemapPathGeneratorChain,
4
+ // SitemapPathGeneratorChain,
5
+ // } from '@/sitemap-generator';
6
+ // export {
7
+ // ISitemapPathGeneratorChain,
8
+ // SitemapPathGeneratorChain,
9
+ // }
@@ -1,12 +1,7 @@
1
- import { IFilterSelectionState } from "./IFilterSelectionState";
2
- import { IPrettyPathGenerator } from "./IPrettyPathGenerator";
3
- import { ISeoIndexabilityPolicy } from "./ISeoIndexabilityPolicy";
4
- import { ISeoInfoBase } from "./ISeoInfoBase";
5
- export declare abstract class BaseSeoIndexabilityPolicy implements ISeoIndexabilityPolicy, IPrettyPathGenerator {
6
- protected readonly seoInfoBase: ISeoInfoBase;
7
- protected readonly filterState: IFilterSelectionState;
8
- constructor(seoInfoBase: ISeoInfoBase, filterState: IFilterSelectionState);
1
+ export declare class BaseSeoIndexabilityPolicy {
2
+ seoInfoBase: any;
3
+ filterState: any;
4
+ constructor(seoInfoBase: any, filterState: any);
9
5
  shouldIndex(): Promise<boolean>;
10
- abstract generatePaths(): string[];
11
- protected abstract matchesFilters(): Promise<boolean>;
6
+ matchesFilters(): Promise<boolean>;
12
7
  }
@@ -1,54 +1,15 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- 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);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- 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;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.BaseSeoIndexabilityPolicy = void 0;
40
- var BaseSeoIndexabilityPolicy = /** @class */ (function () {
41
- function BaseSeoIndexabilityPolicy(seoInfoBase, filterState) {
1
+ export class BaseSeoIndexabilityPolicy {
2
+ seoInfoBase;
3
+ filterState;
4
+ constructor(seoInfoBase, filterState) {
42
5
  this.seoInfoBase = seoInfoBase;
43
6
  this.filterState = filterState;
44
7
  }
45
- BaseSeoIndexabilityPolicy.prototype.shouldIndex = function () {
46
- return __awaiter(this, void 0, void 0, function () {
47
- return __generator(this, function (_a) {
48
- return [2 /*return*/, this.matchesFilters()];
49
- });
50
- });
51
- };
52
- return BaseSeoIndexabilityPolicy;
53
- }());
54
- exports.BaseSeoIndexabilityPolicy = BaseSeoIndexabilityPolicy;
8
+ async shouldIndex() {
9
+ return this.matchesFilters();
10
+ }
11
+ async matchesFilters() {
12
+ // Default implementation
13
+ return Promise.resolve(false);
14
+ }
15
+ }
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export interface ISearchIndexabilityManager {
2
+ shouldIndex(): Promise<boolean>;
3
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { FilterKey, FilterOptionInformation } from "@studyportals/search-filters";
2
+ export interface ISeoFilterOptions {
3
+ getOptionsInformationFor(key: FilterKey): FilterOptionInformation[];
4
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { FilterKey } from "@studyportals/search-filters";
2
+ export interface ISeoFilterState {
3
+ getSelectedValuesFor(key: FilterKey): readonly string[];
4
+ getSelectedFilters(): readonly FilterKey[];
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,10 +1,8 @@
1
1
  import { FilterKey } from '@studyportals/search-filters';
2
- import { IFilterSelectionState } from './IFilterSelectionState';
2
+ import { ISeoFilterState } from './ISeoFilterState';
3
3
  export interface ISeoInfoBase {
4
- selectionOnlyFor(filterKeys: FilterKey[], filterSelectionState: IFilterSelectionState): Promise<boolean>;
5
- singleSelectionFor(filterKey: FilterKey, filterSelectionState: IFilterSelectionState): Promise<boolean>;
6
- getFilterOptionValueBy(filterKey: FilterKey, filterSelectionState: IFilterSelectionState): string | null;
7
- getFilterOptionValueBy(filterKey: FilterKey, filterSelectionState: IFilterSelectionState): string | null;
8
- getSelectionTypeCount(filterSelectionState: IFilterSelectionState): number;
9
- getSelectedValuesFor(fiterKey: FilterKey, filterSelectionState: IFilterSelectionState): string[];
4
+ selectionOnlyFor(filterKeys: FilterKey[], filterSelectionState: ISeoFilterState): Promise<boolean>;
5
+ singleSelectionFor(filterKey: FilterKey, filterSelectionState: ISeoFilterState): Promise<boolean>;
6
+ getFilterOptionValueBy(filterKey: FilterKey, filterSelectionState: ISeoFilterState): string | null;
7
+ getSelectionTypeCount(filterSelectionState: ISeoFilterState): number;
10
8
  }
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export interface ISeoSearchApplicationState {
2
+ getNumberOfResults(): number;
3
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,5 @@
1
1
  import { ISeoInfoBase } from "./ISeoInfoBase";
2
- import { IFilterSelectionState } from "./IFilterSelectionState";
3
- export { ISeoInfoBase, IFilterSelectionState };
2
+ import { ISeoFilterState } from "./ISeoFilterState";
3
+ import { ISeoFilterOptions } from "./ISeoFilterOptions";
4
+ import { ISeoSearchApplicationState } from "./ISeoSearchApplicationState";
5
+ export { ISeoFilterOptions, ISeoInfoBase, ISeoFilterState, ISeoSearchApplicationState };
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import { ISearchIndexabilityManager } from "@/common/ISearchIndexabilityManager";
2
+ import { ISeoIndexabilityPolicy } from "@/common/ISeoIndexabilityPolicy";
3
+ export declare class SearchIndexabilityManager implements ISearchIndexabilityManager {
4
+ policies: ISeoIndexabilityPolicy[];
5
+ shouldIndex(): Promise<boolean>;
6
+ }
@@ -0,0 +1,6 @@
1
+ export class SearchIndexabilityManager {
2
+ policies = [];
3
+ shouldIndex() {
4
+ throw new Error("Method not implemented.");
5
+ }
6
+ }
@@ -1,14 +1,12 @@
1
1
  import { BaseSeoIndexabilityPolicy } from "../common/BaseSeoIndexabilityPolicy";
2
- import { IFilterSelectionState } from "../common/IFilterSelectionState";
2
+ import { ISeoFilterState } from "../common/ISeoFilterState";
3
3
  import { ISeoInfoBase } from "../common/ISeoInfoBase";
4
4
  import { IOrganisationsProvider } from "./IOrganisationsProvider";
5
5
  import { IRankingApiClient } from "@/sitemap-generator/IRankingApiClient";
6
6
  import { ISortState } from "./ISortState";
7
7
  export declare abstract class SeoIndexabilityPolicy<T> extends BaseSeoIndexabilityPolicy {
8
- protected readonly seoInfoBase: ISeoInfoBase;
9
- protected readonly filterState: IFilterSelectionState;
10
8
  protected readonly organisationsProvider: IOrganisationsProvider<T>;
11
9
  protected readonly rankingApiClient: IRankingApiClient;
12
10
  protected readonly sortState: ISortState;
13
- constructor(seoInfoBase: ISeoInfoBase, filterState: IFilterSelectionState, organisationsProvider: IOrganisationsProvider<T>, rankingApiClient: IRankingApiClient, sortState: ISortState);
11
+ constructor(seoInfoBase: ISeoInfoBase, filterState: ISeoFilterState, organisationsProvider: IOrganisationsProvider<T>, rankingApiClient: IRankingApiClient, sortState: ISortState);
14
12
  }
@@ -1,33 +1,12 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.SeoIndexabilityPolicy = void 0;
19
- var BaseSeoIndexabilityPolicy_1 = require("../common/BaseSeoIndexabilityPolicy");
20
- var SeoIndexabilityPolicy = /** @class */ (function (_super) {
21
- __extends(SeoIndexabilityPolicy, _super);
22
- function SeoIndexabilityPolicy(seoInfoBase, filterState, organisationsProvider, rankingApiClient, sortState) {
23
- var _this = _super.call(this, seoInfoBase, filterState) || this;
24
- _this.seoInfoBase = seoInfoBase;
25
- _this.filterState = filterState;
26
- _this.organisationsProvider = organisationsProvider;
27
- _this.rankingApiClient = rankingApiClient;
28
- _this.sortState = sortState;
29
- return _this;
1
+ import { BaseSeoIndexabilityPolicy } from "../common/BaseSeoIndexabilityPolicy";
2
+ export class SeoIndexabilityPolicy extends BaseSeoIndexabilityPolicy {
3
+ organisationsProvider;
4
+ rankingApiClient;
5
+ sortState;
6
+ constructor(seoInfoBase, filterState, organisationsProvider, rankingApiClient, sortState) {
7
+ super(seoInfoBase, filterState);
8
+ this.organisationsProvider = organisationsProvider;
9
+ this.rankingApiClient = rankingApiClient;
10
+ this.sortState = sortState;
30
11
  }
31
- return SeoIndexabilityPolicy;
32
- }(BaseSeoIndexabilityPolicy_1.BaseSeoIndexabilityPolicy));
33
- exports.SeoIndexabilityPolicy = SeoIndexabilityPolicy;
12
+ }
@@ -1,16 +1,11 @@
1
1
  import { SeoIndexabilityPolicy } from "@/organisations/SeoIndexabilityPolicy";
2
- import { IFilterSelectionState } from "@/common/IFilterSelectionState";
2
+ import { ISeoFilterState } from "@/common/ISeoFilterState";
3
3
  import { ISeoInfoBase } from "@/common/ISeoInfoBase";
4
4
  import { IOrganisationsProvider } from "@/organisations/IOrganisationsProvider";
5
5
  import { IRankingApiClient } from "@/sitemap-generator/IRankingApiClient";
6
6
  import { FilterKeyValuePairs } from "@/organisations/FilterKeyValuePairs";
7
7
  import { ISortState } from "@/organisations/ISortState";
8
8
  export declare abstract class SeoRuleBasedIndexabilityPolicy<T> extends SeoIndexabilityPolicy<T> {
9
- protected readonly seoInfoBase: ISeoInfoBase;
10
- protected readonly filterState: IFilterSelectionState;
11
- protected readonly organisationsProvider: IOrganisationsProvider<T>;
12
- protected readonly rankingApiClient: IRankingApiClient;
13
- protected readonly sortState: ISortState;
14
- constructor(seoInfoBase: ISeoInfoBase, filterState: IFilterSelectionState, organisationsProvider: IOrganisationsProvider<T>, rankingApiClient: IRankingApiClient, sortState: ISortState);
9
+ constructor(seoInfoBase: ISeoInfoBase, filterState: ISeoFilterState, organisationsProvider: IOrganisationsProvider<T>, rankingApiClient: IRankingApiClient, sortState: ISortState);
15
10
  protected abstract matchesRule(pairs: FilterKeyValuePairs, ...values: []): boolean;
16
11
  }
@@ -1,33 +1,6 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.SeoRuleBasedIndexabilityPolicy = void 0;
19
- var SeoIndexabilityPolicy_1 = require("@/organisations/SeoIndexabilityPolicy");
20
- var SeoRuleBasedIndexabilityPolicy = /** @class */ (function (_super) {
21
- __extends(SeoRuleBasedIndexabilityPolicy, _super);
22
- function SeoRuleBasedIndexabilityPolicy(seoInfoBase, filterState, organisationsProvider, rankingApiClient, sortState) {
23
- var _this = _super.call(this, seoInfoBase, filterState, organisationsProvider, rankingApiClient, sortState) || this;
24
- _this.seoInfoBase = seoInfoBase;
25
- _this.filterState = filterState;
26
- _this.organisationsProvider = organisationsProvider;
27
- _this.rankingApiClient = rankingApiClient;
28
- _this.sortState = sortState;
29
- return _this;
1
+ import { SeoIndexabilityPolicy } from "@/organisations/SeoIndexabilityPolicy";
2
+ export class SeoRuleBasedIndexabilityPolicy extends SeoIndexabilityPolicy {
3
+ constructor(seoInfoBase, filterState, organisationsProvider, rankingApiClient, sortState) {
4
+ super(seoInfoBase, filterState, organisationsProvider, rankingApiClient, sortState);
30
5
  }
31
- return SeoRuleBasedIndexabilityPolicy;
32
- }(SeoIndexabilityPolicy_1.SeoIndexabilityPolicy));
33
- exports.SeoRuleBasedIndexabilityPolicy = SeoRuleBasedIndexabilityPolicy;
6
+ }
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SortingOptions = void 0;
4
- var SortingOptions;
1
+ export var SortingOptions;
5
2
  (function (SortingOptions) {
6
3
  SortingOptions["OUR_PICKS"] = "Our picks";
7
4
  SortingOptions["UNIVERSITY_META_RANKING"] = "University Meta Ranking";
8
- })(SortingOptions || (exports.SortingOptions = SortingOptions = {}));
5
+ })(SortingOptions || (SortingOptions = {}));
@@ -1,6 +1,5 @@
1
- "use strict";
2
1
  // export * from "./IOrganisationsProvider";
3
2
  // export * from "./ISeoInfoBaseOrganisations";
4
3
  // export * from "./ISortState";
5
4
  // export * from "./SortingOptions";
6
- Object.defineProperty(exports, "__esModule", { value: true });
5
+ export {};
@@ -1,15 +1,5 @@
1
- import { ISearchPolicyChain } from "@/common/ISearchPolicyChain";
2
- import { ISeoIndexabilityPolicy } from "@/common/ISeoIndexabilityPolicy";
3
- import { ISeoInfoBase } from "@/common/ISeoInfoBase";
4
- import { IFilterSelectionState } from "@/common/IFilterSelectionState";
5
- import { ISearchApplicationState } from "@/common/ISearchApplicationState";
6
- import { IFilterOptions } from "@/common/IFilterOptions";
7
- export declare class SearchIndexabilityManager implements ISearchPolicyChain {
8
- private readonly seoInfoBase;
9
- private readonly filterState;
10
- private readonly applicationState;
11
- private readonly filterOptions;
12
- constructor(seoInfoBase: ISeoInfoBase, filterState: IFilterSelectionState, applicationState: ISearchApplicationState, filterOptions: IFilterOptions);
13
- policies: ISeoIndexabilityPolicy[];
1
+ export declare class SearchIndexabilityManager {
2
+ policies: any;
3
+ constructor(seoInfoBase: any, filterState: any, applicationState: any, filterOptions: any);
14
4
  shouldIndex(): Promise<boolean>;
15
5
  }
@@ -1,78 +1,25 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- 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);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- 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;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.SearchIndexabilityManager = void 0;
40
- var AreaPolicy_1 = require("./policies/AreaPolicy");
41
- var CountryPolicy_1 = require("./policies/CountryPolicy");
42
- var DisciplineAreaPolicy_1 = require("./policies/DisciplineAreaPolicy");
43
- var DisciplineCountryPolicy_1 = require("./policies/DisciplineCountryPolicy");
44
- var DisciplinePolicy_1 = require("./policies/DisciplinePolicy");
45
- var UniversityCountryPolicy_1 = require("./policies/UniversityCountryPolicy");
46
- var UnfilteredPolicy_1 = require("./policies/UnfilteredPolicy");
47
- var SearchIndexabilityManager = /** @class */ (function () {
48
- function SearchIndexabilityManager(seoInfoBase, filterState, applicationState, filterOptions) {
49
- this.seoInfoBase = seoInfoBase;
50
- this.filterState = filterState;
51
- this.applicationState = applicationState;
52
- this.filterOptions = filterOptions;
1
+ import { AreaPolicy } from "./policies/AreaPolicy";
2
+ import { CountryPolicy } from "./policies/CountryPolicy";
3
+ import { DisciplineAreaPolicy } from "./policies/DisciplineAreaPolicy";
4
+ import { DisciplineCountryPolicy } from "./policies/DisciplineCountryPolicy";
5
+ import { DisciplinePolicy } from "./policies/DisciplinePolicy";
6
+ import { UniversityCountryPolicy } from "./policies/UniversityCountryPolicy";
7
+ import { UnfilteredPolicy } from "./policies/UnfilteredPolicy";
8
+ export class SearchIndexabilityManager {
9
+ policies;
10
+ constructor(seoInfoBase, filterState, applicationState, filterOptions) {
53
11
  this.policies = [
54
- new AreaPolicy_1.AreaPolicy(this.seoInfoBase, this.filterState, this.filterOptions),
55
- new CountryPolicy_1.CountryPolicy(this.seoInfoBase, this.filterState),
56
- new DisciplineAreaPolicy_1.DisciplineAreaPolicy(this.seoInfoBase, this.filterState),
57
- new DisciplineCountryPolicy_1.DisciplineCountryPolicy(this.seoInfoBase, this.filterState, this.applicationState),
58
- new DisciplinePolicy_1.DisciplinePolicy(this.seoInfoBase, this.filterState),
59
- new UniversityCountryPolicy_1.UniversityCountryPolicy(this.seoInfoBase, this.filterState),
60
- new UnfilteredPolicy_1.UnfilteredPolicy(this.seoInfoBase, this.filterState)
12
+ new AreaPolicy(seoInfoBase, filterState, filterOptions),
13
+ new CountryPolicy(seoInfoBase, filterState),
14
+ new DisciplineAreaPolicy(seoInfoBase, filterState),
15
+ new DisciplineCountryPolicy(seoInfoBase, filterState, applicationState),
16
+ new DisciplinePolicy(seoInfoBase, filterState),
17
+ new UniversityCountryPolicy(seoInfoBase, filterState),
18
+ new UnfilteredPolicy(seoInfoBase, filterState)
61
19
  ];
62
20
  }
63
- SearchIndexabilityManager.prototype.shouldIndex = function () {
64
- return __awaiter(this, void 0, void 0, function () {
65
- var results;
66
- return __generator(this, function (_a) {
67
- switch (_a.label) {
68
- case 0: return [4 /*yield*/, Promise.all(this.policies.map(function (policy) { return policy.shouldIndex(); }))];
69
- case 1:
70
- results = _a.sent();
71
- return [2 /*return*/, results.some(function (result) { return result; })];
72
- }
73
- });
74
- });
75
- };
76
- return SearchIndexabilityManager;
77
- }());
78
- exports.SearchIndexabilityManager = SearchIndexabilityManager;
21
+ async shouldIndex() {
22
+ const results = await Promise.all(this.policies.map(policy => policy.shouldIndex()));
23
+ return results.some(result => result);
24
+ }
25
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./SearchIndexabilityManager";
2
+ import { SearchIndexabilityManager } from "./SearchIndexabilityManager";
3
+ import { types } from "./types";
4
+ export { SearchIndexabilityManager, types };
@@ -1,6 +1,4 @@
1
- "use strict";
2
- // export * from "./SearchIndexabilityManager";
3
- // import { SearchIndexabilityManager } from "./SearchIndexabilityManager";
4
- // export {
5
- // SearchIndexabilityManager
6
- // }
1
+ export * from "./SearchIndexabilityManager";
2
+ import { SearchIndexabilityManager } from "./SearchIndexabilityManager";
3
+ import { types } from "./types";
4
+ export { SearchIndexabilityManager, types };
@@ -1,15 +1,9 @@
1
- import { BaseSeoIndexabilityPolicy } from '@/common/BaseSeoIndexabilityPolicy';
2
- import { IFilterSelectionState } from '@/common/IFilterSelectionState';
3
- import { ISeoInfoBase } from '@/common/ISeoInfoBase';
4
- import { ISeoIndexabilityPolicy } from '@/common/ISeoIndexabilityPolicy';
5
- import { IFilterOptions } from '@/common/IFilterOptions';
6
- export declare class AreaPolicy extends BaseSeoIndexabilityPolicy implements ISeoIndexabilityPolicy {
7
- protected readonly seoInfoBase: ISeoInfoBase;
8
- protected readonly filterState: IFilterSelectionState;
9
- protected readonly filterOptions: IFilterOptions;
10
- private static readonly AUSTRALIA_CODE;
11
- constructor(seoInfoBase: ISeoInfoBase, filterState: IFilterSelectionState, filterOptions: IFilterOptions);
12
- protected matchesFilters(): Promise<boolean>;
13
- private isPartOfAustralia;
14
- generatePaths(): string[];
1
+ import { BaseSeoIndexabilityPolicy } from "@/common/BaseSeoIndexabilityPolicy";
2
+ export declare class AreaPolicy extends BaseSeoIndexabilityPolicy {
3
+ static AUSTRALIA_CODE: number;
4
+ filterOptions: any;
5
+ constructor(seoInfoBase: any, filterState: any, filterOptions: any);
6
+ matchesFilters(): Promise<any>;
7
+ isPartOfAustralia(areaId: any): boolean;
8
+ generatePaths(): void;
15
9
  }