Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion packages/spacecat-shared-data-access/src/models/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
import { hasText, isIsoDate, isObject } from '@adobe/spacecat-shared-utils';
import { Base } from './base.js';

export const AUDIT_TYPE_BROKEN_BACKLINKS = 'broken-backlinks';
export const AUDIT_TYPE_CWV = 'cwv';
export const AUDIT_TYPE_LHS_DESKTOP = 'lhs-desktop';
export const AUDIT_TYPE_LHS_MOBILE = 'lhs-mobile';

const EXPIRES_IN_DAYS = 30;

const AUDIT_TYPE_PROPERTIES = {
[AUDIT_TYPE_BROKEN_BACKLINKS]: [],
[AUDIT_TYPE_CWV]: [],
[AUDIT_TYPE_LHS_DESKTOP]: ['performance', 'seo', 'accessibility', 'best-practices'],
[AUDIT_TYPE_LHS_MOBILE]: ['performance', 'seo', 'accessibility', 'best-practices'],
Expand All @@ -36,7 +38,7 @@ const validateScores = (auditResult, auditType) => {
return true;
}

if (!isObject(auditResult.scores)) {
if (auditType !== AUDIT_TYPE_BROKEN_BACKLINKS && !isObject(auditResult.scores)) {
throw new Error(`Missing scores property for audit type '${auditType}'`);
}

Expand Down