@studyportals/fawkes 8.0.1-4 → 8.0.1-5

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.
@@ -9,7 +9,7 @@ export declare class AtLeastSevenResultsRule implements IRule {
9
9
  constructor(searchApiClient?: ISearchApiClient);
10
10
  forSearch(dependencies: ISearchDependencies): Promise<boolean>;
11
11
  forSitemapGeneratorWithPageNumber(filterKeyValues: FilterKeyValuesMap, pageNumber: number): Promise<boolean>;
12
- forSitemapGenerator(): Promise<boolean>;
12
+ forSitemapGenerator(filterKeyValues: FilterKeyValuesMap): Promise<boolean>;
13
13
  getName(): string;
14
14
  getDescription(): string;
15
15
  }
@@ -18,8 +18,12 @@ export class AtLeastSevenResultsRule {
18
18
  const count = await this.searchApiClient.getCount(filterKeyValues);
19
19
  return count >= (pageNumber - 1) * this.maximumPageSize + this.minimumResultsCount;
20
20
  }
21
- forSitemapGenerator() {
22
- throw new Error('Method not implemented.');
21
+ async forSitemapGenerator(filterKeyValues) {
22
+ if (!this.searchApiClient) {
23
+ throw new DependencyMissingError('SearchApiClient');
24
+ }
25
+ const resultsCount = await this.searchApiClient?.getCount(filterKeyValues);
26
+ return resultsCount >= this.minimumResultsCount;
23
27
  }
24
28
  getName() {
25
29
  return 'AtLeastSevenResultsRule';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studyportals/fawkes",
3
- "version": "8.0.1-4",
3
+ "version": "8.0.1-5",
4
4
  "description": "A package to centralize SEO related logic for SBLP and Sitemap Generator.",
5
5
  "files": [
6
6
  "./dist"