@8ms/helpers 2.3.2 → 2.3.4

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 (51) hide show
  1. package/.github/generate-exports.js +39 -48
  2. package/.yarn/install-state.gz +0 -0
  3. package/api/ApiResponseClass.js +12 -12
  4. package/api/api.d.ts +2 -2
  5. package/api/api.js +2 -2
  6. package/api/functions.js +7 -7
  7. package/brightData/serpApi/server/brightDataSerpApi.d.ts +2 -2
  8. package/brightData/serpApi/server/brightDataSerpApi.js +1 -1
  9. package/brightData/serpApi/server/getAsyncRequestId.js +2 -2
  10. package/brightData/webScraperIde/server/getRealtime.js +5 -5
  11. package/crud/crud.d.ts +2 -2
  12. package/crud/crud.js +1 -1
  13. package/date/calculation.d.ts +3 -0
  14. package/date/calculation.js +3 -0
  15. package/date/date.d.ts +2 -2
  16. package/date/date.js +1 -1
  17. package/date/financialYear.d.ts +1 -1
  18. package/date/financialYear.js +1 -1
  19. package/environment/environment.d.ts +4 -4
  20. package/environment/environment.js +9 -9
  21. package/file/getFileKey.js +2 -2
  22. package/googleAds/keywordPlanner/server/googleAdsKeywordPlanner.d.ts +2 -2
  23. package/googleAds/keywordPlanner/server/googleAdsKeywordPlanner.js +2 -2
  24. package/googleAds/server/GoogleAdsNamespace.js +1 -2
  25. package/googlePageSpeed/server/GooglePageSpeedNamespace.d.ts +1 -1
  26. package/googlePageSpeed/server/GooglePageSpeedNamespace.js +3 -3
  27. package/googlePageSpeed/server/googlePageSpeed.d.ts +4 -4
  28. package/googlePageSpeed/server/googlePageSpeed.js +2 -2
  29. package/inngest/inngest.d.ts +2 -2
  30. package/inngest/inngest.js +1 -1
  31. package/littleWarden/server/littleWarden.d.ts +2 -2
  32. package/littleWarden/server/littleWarden.js +4 -4
  33. package/lumar/api/server/buildRequest.d.ts +3 -3
  34. package/lumar/api/server/buildRequest.js +15 -15
  35. package/lumar/api/server/lumarApi.d.ts +27 -27
  36. package/lumar/api/server/lumarApi.js +3 -6
  37. package/lumar/graphql/server/columns.d.ts +28 -27
  38. package/lumar/graphql/server/columns.js +1 -1
  39. package/lumar/graphql/server/getData.js +1 -2
  40. package/lumar/graphql/server/lumarGraphql.d.ts +21 -23
  41. package/lumar/graphql/server/lumarGraphql.js +2 -6
  42. package/lumar/graphql/server/queries/getReportDifferences.d.ts +1 -1
  43. package/lumar/graphql/server/queries/getReportDifferences.js +2 -2
  44. package/lumar/graphql/server/reportTemplates.d.ts +67 -66
  45. package/lumar/graphql/server/reportTemplates.js +1 -1
  46. package/nextAuth/nextAuth.d.ts +3 -3
  47. package/nextJs/nextJs.js +2 -8
  48. package/package.json +1 -1
  49. package/sorting/sorting.d.ts +4 -4
  50. package/sorting/sorting.js +4 -4
  51. package/util/isUndefined.js +2 -2
@@ -24,7 +24,7 @@ export const littleWardenClient = async (key = "default", config, vaultId, itemI
24
24
  littleWardenNamespaces.set(key, namespace);
25
25
  return namespace;
26
26
  };
27
- export const LittleWardenState = {
27
+ export const littleWardenState = {
28
28
  ALL_GOOD: "all_good",
29
29
  DANGER: "danger",
30
30
  WARNING: "warning",
@@ -36,7 +36,7 @@ export const isAllGood = ({ field }) => {
36
36
  let response = false;
37
37
  // Check that the status field exists
38
38
  if (undefined !== field && undefined !== field["status"]) {
39
- response = LittleWardenState.ALL_GOOD === field["status"];
39
+ response = littleWardenState.ALL_GOOD === field["status"];
40
40
  }
41
41
  return response;
42
42
  };
@@ -47,7 +47,7 @@ export const isWarning = ({ field }) => {
47
47
  let response = false;
48
48
  // Check that the status field exists
49
49
  if (undefined !== field && undefined !== field["status"]) {
50
- response = LittleWardenState.WARNING === field["status"];
50
+ response = littleWardenState.WARNING === field["status"];
51
51
  }
52
52
  return response;
53
53
  };
@@ -58,7 +58,7 @@ export const isDanger = ({ field }) => {
58
58
  let response = false;
59
59
  // Check that the status field exists
60
60
  if (undefined !== field && undefined !== field["status"]) {
61
- response = LittleWardenState.DANGER === field["status"];
61
+ response = littleWardenState.DANGER === field["status"];
62
62
  }
63
63
  return response;
64
64
  };
@@ -1,13 +1,13 @@
1
- import { Filter, Order } from "./";
1
+ import { Filter, OrderRow, Report } from "./";
2
2
  export type BuildRequestProps = {
3
3
  crawlId?: number;
4
4
  customPath?: string;
5
5
  filters?: Filter[];
6
6
  limit?: number;
7
- orders?: Order[];
7
+ orders?: OrderRow[];
8
8
  page?: number;
9
9
  projectId?: number;
10
- report?: string;
10
+ report?: Report;
11
11
  subReport?: string;
12
12
  };
13
13
  export declare const buildRequest: (props: BuildRequestProps) => string;
@@ -1,4 +1,4 @@
1
- import { orders, reports } from "./";
1
+ import { order, report } from "./";
2
2
  export const buildRequest = (props) => {
3
3
  let url = `https://api.deepcrawl.com/accounts/37204`;
4
4
  // Limit must be greater than 0 but also less than 200
@@ -15,35 +15,35 @@ export const buildRequest = (props) => {
15
15
  props.limit = 200;
16
16
  }
17
17
  // If a report other than List Crawls is selected, Crawl ID must be defined
18
- if (undefined !== props.report && reports.LIST_CRAWLS !== props.report && undefined == props.crawlId) {
18
+ if (undefined !== props.report && report.LIST_CRAWLS !== props.report && undefined == props.crawlId) {
19
19
  throw `Crawl ID must be defined.`;
20
20
  }
21
21
  switch (props.report) {
22
- case reports.LIST_CRAWLS:
22
+ case report.LIST_CRAWLS:
23
23
  url += `/projects/${props.projectId}/crawls`;
24
24
  break;
25
- case reports.LIST_PROJECTS:
25
+ case report.LIST_PROJECTS:
26
26
  url += `/projects`;
27
27
  break;
28
- case reports.CUSTOM:
28
+ case report.CUSTOM:
29
29
  url += props.customPath;
30
30
  url = url.replace("[PROJECT]", props.projectId.toString());
31
31
  url = url.replace("[CRAWL]", props.crawlId.toString());
32
32
  break;
33
- case reports.CRAWL_STATISTICS:
33
+ case report.CRAWL_STATISTICS:
34
34
  url += `/projects/${props.projectId}/crawls/${props.crawlId}/statistics`;
35
35
  break;
36
- case reports.LIST_REPORTS:
36
+ case report.LIST_REPORTS:
37
37
  url += `/projects/${props.projectId}/crawls/${props.crawlId}/reports`;
38
38
  break;
39
- case reports.REPORT_ROWS:
40
- case reports.REPORT_STATISTICS:
41
- case reports.REPORT_SUMMARY:
39
+ case report.REPORT_ROWS:
40
+ case report.REPORT_STATISTICS:
41
+ case report.REPORT_SUMMARY:
42
42
  url += `/projects/${props.projectId}/crawls/${props.crawlId}/reports/${props.subReport}`;
43
- if (reports.REPORT_ROWS === props.report) {
43
+ if (report.REPORT_ROWS === props.report) {
44
44
  url += `/report_rows`;
45
45
  }
46
- else if (reports.REPORT_STATISTICS === props.report) {
46
+ else if (report.REPORT_STATISTICS === props.report) {
47
47
  url += `/statistics`;
48
48
  }
49
49
  break;
@@ -66,10 +66,10 @@ export const buildRequest = (props) => {
66
66
  // Order the data
67
67
  if (undefined !== props.orders) {
68
68
  url += -1 === url.indexOf("?") ? "?" : "&";
69
- props.orders.map((order, index) => {
69
+ props.orders.map((orderRow, index) => {
70
70
  url += 0 === index ? "sort=" : ",";
71
- url += orders.DESCENDING === order.direction ? "-" : "";
72
- url += order.field;
71
+ url += order.DESCENDING === orderRow.direction ? "-" : "";
72
+ url += orderRow.field;
73
73
  });
74
74
  }
75
75
  return url;
@@ -3,34 +3,34 @@ export type Filter = {
3
3
  operand: string;
4
4
  value: string;
5
5
  };
6
- export declare const operands: {
7
- EQUALS: string;
8
- CONTAINS: string;
9
- LESS_THAN: string;
10
- LESS_THAN_OR_EQUAL: string;
11
- GREATER_THAN: string;
12
- GREATER_THAN_OR_EQUAL: string;
13
- REGEX: string;
14
- NOT_REGEX: string;
6
+ export declare const operand: {
7
+ readonly EQUALS: "eql";
8
+ readonly CONTAINS: "cont";
9
+ readonly LESS_THAN: "lt";
10
+ readonly LESS_THAN_OR_EQUAL: "lte";
11
+ readonly GREATER_THAN: "gt";
12
+ readonly GREATER_THAN_OR_EQUAL: "gte";
13
+ readonly REGEX: "rgx";
14
+ readonly NOT_REGEX: "nrgx";
15
15
  };
16
- export type Order = {
17
- direction: string;
18
- field: string;
16
+ export type Operand = typeof operand[keyof typeof operand];
17
+ export declare const order: {
18
+ readonly ASCENDING: "asc";
19
+ readonly DESCENDING: "desc";
19
20
  };
20
- export declare const orders: {
21
- ASCENDING: string;
22
- DESCENDING: string;
21
+ export type Order = typeof order[keyof typeof order];
22
+ export type OrderRow = {
23
+ direction: Order;
24
+ field: string;
23
25
  };
24
- export declare const reports: {
25
- CRAWL_STATISTICS: string;
26
- CUSTOM: string;
27
- LIST_PROJECTS: string;
28
- LIST_CRAWLS: string;
29
- LIST_REPORTS: string;
30
- REPORT_ROWS: string;
31
- REPORT_STATISTICS: string;
32
- REPORT_SUMMARY: string;
26
+ export declare const report: {
27
+ readonly CRAWL_STATISTICS: "crawl_statistics";
28
+ readonly CUSTOM: "custom";
29
+ readonly LIST_PROJECTS: "list_projects";
30
+ readonly LIST_CRAWLS: "list_crawls";
31
+ readonly LIST_REPORTS: "list_reports";
32
+ readonly REPORT_ROWS: "report_rows";
33
+ readonly REPORT_STATISTICS: "report_statistics";
34
+ readonly REPORT_SUMMARY: "report_summary";
33
35
  };
34
- export * from "./buildRequest";
35
- export * from "./getData";
36
- export * from "./initClient";
36
+ export type Report = typeof report[keyof typeof report];
@@ -1,4 +1,4 @@
1
- export const operands = {
1
+ export const operand = {
2
2
  EQUALS: 'eql',
3
3
  CONTAINS: 'cont',
4
4
  LESS_THAN: 'lt',
@@ -8,11 +8,11 @@ export const operands = {
8
8
  REGEX: 'rgx',
9
9
  NOT_REGEX: 'nrgx',
10
10
  };
11
- export const orders = {
11
+ export const order = {
12
12
  ASCENDING: 'asc',
13
13
  DESCENDING: 'desc',
14
14
  };
15
- export const reports = {
15
+ export const report = {
16
16
  CRAWL_STATISTICS: 'crawl_statistics',
17
17
  CUSTOM: 'custom',
18
18
  LIST_PROJECTS: 'list_projects',
@@ -22,6 +22,3 @@ export const reports = {
22
22
  REPORT_STATISTICS: 'report_statistics',
23
23
  REPORT_SUMMARY: 'report_summary',
24
24
  };
25
- export * from "./buildRequest";
26
- export * from "./getData";
27
- export * from "./initClient";
@@ -1,28 +1,29 @@
1
- export declare const columns: {
2
- CUSTOM_EXTRACTION_1: string;
3
- CUSTOM_EXTRACTION_2: string;
4
- DEEP_RANK: string;
5
- DESCRIPTION: string;
6
- DUPLICATE_PAGE: string;
7
- DUPLICATE_DESCRIPTION_FROM: string;
8
- DUPLICATE_TITLE_FROM: string;
9
- FOUND_AT_URL: string;
10
- FOUND_IN_CRAWL: string;
11
- FOUND_IN_SEARCH_CONSOLE: string;
12
- FOUND_IN_SITEMAP: string;
13
- LEVEL: string;
14
- PAGE_TITLE: string;
15
- PRIMARY_PAGE: string;
16
- PRIMARY_URL_FROM: string;
17
- PRIMARY_URL_FROM_STATUS_CODE: string;
18
- REDIRECTED_TO_URL: string;
19
- REDIRECTED_TO_STATUS_CODE: string;
20
- REDIRECTION_CHAIN: string;
21
- SOURCE_URL: string;
22
- STATUS_CODE: string;
23
- TARGET_STATUS_CODE: string;
24
- URL: string;
25
- URL_COUNT: string;
26
- URL_TO: string;
27
- URL_TO_STATUS_CODE: string;
1
+ export declare const column: {
2
+ readonly CUSTOM_EXTRACTION_1: "customExtraction1";
3
+ readonly CUSTOM_EXTRACTION_2: "customExtraction2";
4
+ readonly DEEP_RANK: "deepRank";
5
+ readonly DESCRIPTION: "description";
6
+ readonly DUPLICATE_PAGE: "duplicatePage";
7
+ readonly DUPLICATE_DESCRIPTION_FROM: "duplicateDescriptionPrimaryUrl";
8
+ readonly DUPLICATE_TITLE_FROM: "duplicateTitlePrimaryUrl";
9
+ readonly FOUND_AT_URL: "foundAtUrl";
10
+ readonly FOUND_IN_CRAWL: "foundInWebCrawl";
11
+ readonly FOUND_IN_SEARCH_CONSOLE: "foundInGoogleSearchConsole";
12
+ readonly FOUND_IN_SITEMAP: "foundInSitemap";
13
+ readonly LEVEL: "level";
14
+ readonly PAGE_TITLE: "pageTitle";
15
+ readonly PRIMARY_PAGE: "primaryPage";
16
+ readonly PRIMARY_URL_FROM: "primaryUrlFrom";
17
+ readonly PRIMARY_URL_FROM_STATUS_CODE: "primaryUrlFromStatusCode";
18
+ readonly REDIRECTED_TO_URL: "redirectedToUrl";
19
+ readonly REDIRECTED_TO_STATUS_CODE: "redirectedToStatusCode";
20
+ readonly REDIRECTION_CHAIN: "redirectionChain";
21
+ readonly SOURCE_URL: "sourceUrl";
22
+ readonly STATUS_CODE: "httpStatusCode";
23
+ readonly TARGET_STATUS_CODE: "targetStatusCode";
24
+ readonly URL: "url";
25
+ readonly URL_COUNT: "urlCount";
26
+ readonly URL_TO: "urlTo";
27
+ readonly URL_TO_STATUS_CODE: "urlToStatusCode";
28
28
  };
29
+ export type Column = typeof column[keyof typeof column];
@@ -1,4 +1,4 @@
1
- export const columns = {
1
+ export const column = {
2
2
  CUSTOM_EXTRACTION_1: 'customExtraction1',
3
3
  CUSTOM_EXTRACTION_2: 'customExtraction2',
4
4
  DEEP_RANK: 'deepRank',
@@ -4,7 +4,7 @@ export const getData = async (query, variables, accessToken) => {
4
4
  queryClean = queryClean.replace(/\n/g, " ");
5
5
  queryClean = queryClean.replace(/\t/g, " ");
6
6
  queryClean = queryClean.replace(/ /g, " ");
7
- const apiResponse = await post("https://api.lumar.io/graphql", {
7
+ return await post("https://api.lumar.io/graphql", {
8
8
  query: queryClean,
9
9
  variables,
10
10
  }, {
@@ -12,5 +12,4 @@ export const getData = async (query, variables, accessToken) => {
12
12
  "x-auth-token": accessToken,
13
13
  },
14
14
  });
15
- return apiResponse;
16
15
  };
@@ -1,29 +1,27 @@
1
- export declare const operands: {
2
- CONTAINS: string;
3
- DOESNT_CONTAIN: string;
4
- DOESNT_MATCH_REGEX: string;
5
- ENDS_WITH: string;
6
- EQUALS: string;
7
- GREATER_THAN: string;
8
- GREATER_THAN_OR_EQUAL: string;
9
- IS_EMPTY: string;
10
- LESS_THAN: string;
11
- LESS_THAN_OR_EQUAL: string;
12
- MATCHES_REGEX: string;
13
- NOT_EQUALS: string;
14
- STARTS_WITH: string;
1
+ export declare const operand: {
2
+ readonly CONTAINS: "contains";
3
+ readonly DOESNT_CONTAIN: "notContains";
4
+ readonly DOESNT_MATCH_REGEX: "notMatchesRegex";
5
+ readonly ENDS_WITH: "endsWith";
6
+ readonly EQUALS: "eq";
7
+ readonly GREATER_THAN: "gt";
8
+ readonly GREATER_THAN_OR_EQUAL: "ge";
9
+ readonly IS_EMPTY: "isEmpty";
10
+ readonly LESS_THAN: "lt";
11
+ readonly LESS_THAN_OR_EQUAL: "le";
12
+ readonly MATCHES_REGEX: "matchesRegex";
13
+ readonly NOT_EQUALS: "ne";
14
+ readonly STARTS_WITH: "beginsWith";
15
15
  };
16
- export declare const reportTypes: {
17
- ADDED: string;
18
- BASIC: string;
19
- MISSING: string;
20
- REMOVED: string;
16
+ export type Operand = typeof operand[keyof typeof operand];
17
+ export declare const reportType: {
18
+ readonly ADDED: "Added";
19
+ readonly BASIC: "Basic";
20
+ readonly MISSING: "Missing";
21
+ readonly REMOVED: "Removed";
21
22
  };
23
+ export type ReportType = typeof reportType[keyof typeof reportType];
22
24
  /**
23
25
  * Shorthand function to return the report key.
24
26
  */
25
27
  export declare const getReportKey: (templateCode: string, typeCode: string) => string;
26
- export { columns } from "./columns";
27
- export { reportTemplates } from "./reportTemplates";
28
- export { getData } from "./getData";
29
- export { initClient } from "./initClient";
@@ -1,4 +1,4 @@
1
- export const operands = {
1
+ export const operand = {
2
2
  CONTAINS: "contains",
3
3
  DOESNT_CONTAIN: "notContains",
4
4
  DOESNT_MATCH_REGEX: "notMatchesRegex",
@@ -13,7 +13,7 @@ export const operands = {
13
13
  NOT_EQUALS: "ne",
14
14
  STARTS_WITH: "beginsWith",
15
15
  };
16
- export const reportTypes = {
16
+ export const reportType = {
17
17
  ADDED: "Added",
18
18
  BASIC: "Basic",
19
19
  MISSING: "Missing",
@@ -25,7 +25,3 @@ export const reportTypes = {
25
25
  export const getReportKey = (templateCode, typeCode) => {
26
26
  return `${templateCode}-${typeCode}`.toLowerCase();
27
27
  };
28
- export { columns } from "./columns";
29
- export { reportTemplates } from "./reportTemplates";
30
- export { getData } from "./getData";
31
- export { initClient } from "./initClient";
@@ -17,7 +17,7 @@ declare const getReportDifferences: ({ crawlId, filter, reportTemplateCode }: Ge
17
17
  input: {
18
18
  crawlId: number;
19
19
  reportTemplateCode: string;
20
- reportTypeCode: string;
20
+ reportTypeCode: "Basic";
21
21
  };
22
22
  };
23
23
  };
@@ -1,4 +1,4 @@
1
- import { reportTypes } from "../";
1
+ import { reportType } from "../";
2
2
  /**
3
3
  * Used to return the number for: Basic, Added, Missing, Removed for a given report.
4
4
  */
@@ -28,7 +28,7 @@ const getReportDifferences = ({ crawlId, filter, reportTemplateCode }) => ({
28
28
  input: {
29
29
  crawlId,
30
30
  reportTemplateCode,
31
- reportTypeCode: reportTypes.BASIC,
31
+ reportTypeCode: reportType.BASIC,
32
32
  },
33
33
  },
34
34
  });
@@ -1,67 +1,68 @@
1
- export declare const reportTemplates: {
2
- "200_PAGES": string;
3
- "301_REDIRECTS": string;
4
- "4XX_ERRORS": string;
5
- "5XX_ERRORS": string;
6
- ALL_PAGES: string;
7
- BROKEN_EXTERNAL_LINKS: string;
8
- BROKEN_INTERNAL_LINKS: string;
9
- BROKEN_SITEMAP_PAGES: string;
10
- CANONICAL_CONFLICTING: string;
11
- CANONICAL_NON_200: string;
12
- CANONICAL_NON_INDEXABLE: string;
13
- CANONICAL_ORPHANED: string;
14
- CUSTOM_EXTRACTION_1: string;
15
- CUSTOM_EXTRACTION_2: string;
16
- DUPLICATE_CONTENT: string;
17
- DUPLICATE_DESCRIPTIONS: string;
18
- DUPLICATE_TITLES: string;
19
- EMPTY_PAGES: string;
20
- INDEXABLE_PAGES: string;
21
- LINKED_DOMAINS: string;
22
- MAX_DESCRIPTIONS: string;
23
- MAX_MOBILE_DESCRIPTIONS: string;
24
- MAX_TITLES: string;
25
- MISSING_DESCRIPTIONS: string;
26
- MISSING_TITLES: string;
27
- NON_301_REDIRECTS: string;
28
- NON_INDEXABLE_PAGES: string;
29
- NON_INDEXABLE_SITEMAP_PAGES: string;
30
- ORPHANED_CANONICAL: string;
31
- ORPHANED_ANALYTICS_PAGES: string;
32
- ORPHANED_SEARCH_CONSOLE_PAGES: string;
33
- ORPHANED_SITEMAP_PAGES: string;
34
- PAGES_WITH_HIGH_EXTERNAL_LINKS: string;
35
- PERFORMANCE_MAX_FETCH_TIME: string;
36
- PERFORMANCE_POOR_CLS: string;
37
- PERFORMANCE_SLOW_DCL: string;
38
- PERFORMANCE_SLOW_FCP: string;
39
- PERFORMANCE_SLOW_LCP: string;
40
- PERFORMANCE_SLOW_TTFB: string;
41
- PERFORMANCE_SLOW_TTI: string;
42
- PRIMARY_PAGES: string;
43
- REDIRECTS_BROKEN: string;
44
- REDIRECTS_CHAIN: string;
45
- REDIRECTS_LOOP: string;
46
- SCHEMA_BREADCRUMB: string;
47
- SCHEMA_EVENT: string;
48
- SCHEMA_FAQ: string;
49
- SCHEMA_HOW_TO: string;
50
- SCHEMA_NEWS_ARTICLE: string;
51
- SCHEMA_PRODUCT: string;
52
- SCHEMA_QA: string;
53
- SCHEMA_RECIPE: string;
54
- SCHEMA_REVIEW: string;
55
- SCHEMA_VIDEO: string;
56
- SHORT_DESCRIPTIONS: string;
57
- SHORT_TITLES: string;
58
- SITEMAP_PAGES: string;
59
- SITEMAPS_NON_INDEXABLE_PAGES: string;
60
- SITEMAPS_ORPHANED_PAGES: string;
61
- SITEMAPS_MISSING_PAGES: string;
62
- THIN_PAGES: string;
63
- TRUE_UNIQUE_PAGES: string;
64
- UNIQUE_EXTERNAL_LINKS: string;
65
- UNIQUE_INTERNAL_LINKS: string;
66
- XML_SITEMAPS: string;
1
+ export declare const reportTemplate: {
2
+ readonly "200_PAGES": "200_pages";
3
+ readonly "301_REDIRECTS": "301_redirects";
4
+ readonly "4XX_ERRORS": "4xx_errors";
5
+ readonly "5XX_ERRORS": "5xx_errors";
6
+ readonly ALL_PAGES: "all_pages";
7
+ readonly BROKEN_EXTERNAL_LINKS: "broken_links_external";
8
+ readonly BROKEN_INTERNAL_LINKS: "all_broken_links";
9
+ readonly BROKEN_SITEMAP_PAGES: "broken_sitemap_links";
10
+ readonly CANONICAL_CONFLICTING: "conflicting_canonical_tags";
11
+ readonly CANONICAL_NON_200: "canonical_to_non_200";
12
+ readonly CANONICAL_NON_INDEXABLE: "non_indexable_canonical_links_in";
13
+ readonly CANONICAL_ORPHANED: "unlinked_canonical_pages";
14
+ readonly CUSTOM_EXTRACTION_1: "custom_extraction_1";
15
+ readonly CUSTOM_EXTRACTION_2: "custom_extraction_2";
16
+ readonly DUPLICATE_CONTENT: "duplicate_body_content";
17
+ readonly DUPLICATE_DESCRIPTIONS: "pages_with_duplicate_descriptions";
18
+ readonly DUPLICATE_TITLES: "pages_with_duplicate_titles";
19
+ readonly EMPTY_PAGES: "empty_pages";
20
+ readonly INDEXABLE_PAGES: "indexable_pages";
21
+ readonly LINKED_DOMAINS: "linked_domains";
22
+ readonly MAX_DESCRIPTIONS: "max_description_length";
23
+ readonly MAX_MOBILE_DESCRIPTIONS: "max_mobile_description_length";
24
+ readonly MAX_TITLES: "max_title_length";
25
+ readonly MISSING_DESCRIPTIONS: "missing_descriptions";
26
+ readonly MISSING_TITLES: "missing_titles";
27
+ readonly NON_301_REDIRECTS: "non_301_redirects";
28
+ readonly NON_INDEXABLE_PAGES: "non_indexable_pages";
29
+ readonly NON_INDEXABLE_SITEMAP_PAGES: "sitemaps_non_indexable_links";
30
+ readonly ORPHANED_CANONICAL: "unlinked_canonical_pages";
31
+ readonly ORPHANED_ANALYTICS_PAGES: "orphaned_organic_landing_pages";
32
+ readonly ORPHANED_SEARCH_CONSOLE_PAGES: "orphaned_google_search_console_pages";
33
+ readonly ORPHANED_SITEMAP_PAGES: "orphaned_sitemaps_pages";
34
+ readonly PAGES_WITH_HIGH_EXTERNAL_LINKS: "max_external_links";
35
+ readonly PERFORMANCE_MAX_FETCH_TIME: "max_load_time";
36
+ readonly PERFORMANCE_POOR_CLS: "poor_cls";
37
+ readonly PERFORMANCE_SLOW_DCL: "slow_dcl";
38
+ readonly PERFORMANCE_SLOW_FCP: "slow_fcp";
39
+ readonly PERFORMANCE_SLOW_LCP: "slow_lcp";
40
+ readonly PERFORMANCE_SLOW_TTFB: "slow_server_response";
41
+ readonly PERFORMANCE_SLOW_TTI: "slow_tti";
42
+ readonly PRIMARY_PAGES: "unique_pages";
43
+ readonly REDIRECTS_BROKEN: "all_broken_redirects";
44
+ readonly REDIRECTS_CHAIN: "redirect_chains";
45
+ readonly REDIRECTS_LOOP: "redirection_loop";
46
+ readonly SCHEMA_BREADCRUMB: "pages_with_breadcrumb_schema";
47
+ readonly SCHEMA_EVENT: "pages_with_event_schema";
48
+ readonly SCHEMA_FAQ: "pages_with_faqpage_schema";
49
+ readonly SCHEMA_HOW_TO: "pages_with_howto_schema";
50
+ readonly SCHEMA_NEWS_ARTICLE: "pages_with_news_article_schema";
51
+ readonly SCHEMA_PRODUCT: "pages_with_product_schema";
52
+ readonly SCHEMA_QA: "pages_with_qapage_schema";
53
+ readonly SCHEMA_RECIPE: "pages_with_recipe_schema";
54
+ readonly SCHEMA_REVIEW: "pages_with_review_schema";
55
+ readonly SCHEMA_VIDEO: "pages_with_videoobject_schema";
56
+ readonly SHORT_DESCRIPTIONS: "short_descriptions";
57
+ readonly SHORT_TITLES: "short_titles";
58
+ readonly SITEMAP_PAGES: "all_sitemaps_links";
59
+ readonly SITEMAPS_NON_INDEXABLE_PAGES: "sitemaps_non_indexable_links";
60
+ readonly SITEMAPS_ORPHANED_PAGES: "orphaned_sitemaps_pages";
61
+ readonly SITEMAPS_MISSING_PAGES: "not_in_sitemaps_primary_indexable";
62
+ readonly THIN_PAGES: "thin_pages";
63
+ readonly TRUE_UNIQUE_PAGES: "true_uniques";
64
+ readonly UNIQUE_EXTERNAL_LINKS: "unique_external_links";
65
+ readonly UNIQUE_INTERNAL_LINKS: "unique_internal_links";
66
+ readonly XML_SITEMAPS: "xml_sitemaps";
67
67
  };
68
+ export type ReportTemplate = typeof reportTemplate[keyof typeof reportTemplate];
@@ -1,4 +1,4 @@
1
- export const reportTemplates = {
1
+ export const reportTemplate = {
2
2
  "200_PAGES": "200_pages",
3
3
  "301_REDIRECTS": "301_redirects",
4
4
  "4XX_ERRORS": "4xx_errors",
@@ -1,7 +1,7 @@
1
1
  export { isSessionReady } from "./isSessionReady";
2
2
  export declare const NextAuthState: {
3
- AUTHENTICATED: string;
4
- PENDING: string;
5
- UNAUTHENTICATED: string;
3
+ readonly AUTHENTICATED: "authenticated";
4
+ readonly PENDING: "loading";
5
+ readonly UNAUTHENTICATED: "unauthenticated";
6
6
  };
7
7
  export type NextAuthState = typeof NextAuthState[keyof typeof NextAuthState];
package/nextJs/nextJs.js CHANGED
@@ -1,14 +1,8 @@
1
1
  /**
2
2
  * Get the user's remote IP Address
3
3
  */
4
- export const getIp = ({ req }) => {
5
- let response = 'unset';
6
- if (undefined !== req.headers['x-real-ip']) {
7
- response = String(req.headers['x-real-ip']);
8
- }
9
- return response;
10
- };
4
+ export const getIp = ({ req }) => String(req.headers?.["x-real-ip"] || "unset");
11
5
  /**
12
6
  * Get the user's User Agent
13
7
  */
14
- export const getUserAgent = ({ req }) => req.headers['user-agent'] || 'unset';
8
+ export const getUserAgent = ({ req }) => String(req.headers["user-agent"] || "unset");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8ms/helpers",
3
3
  "license": "UNLICENSED",
4
- "version": "2.3.2",
4
+ "version": "2.3.4",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"
@@ -1,4 +1,4 @@
1
- export { byNumberAscending } from "./byNumberAscending";
2
- export { byNumberDescending } from "./byNumberDescending";
3
- export { byStringAscending } from "./byStringAscending";
4
- export { byStringDescending } from "./byStringDescending";
1
+ export * from "./byNumberAscending";
2
+ export * from "./byNumberDescending";
3
+ export * from "./byStringAscending";
4
+ export * from "./byStringDescending";
@@ -1,4 +1,4 @@
1
- export { byNumberAscending } from "./byNumberAscending";
2
- export { byNumberDescending } from "./byNumberDescending";
3
- export { byStringAscending } from "./byStringAscending";
4
- export { byStringDescending } from "./byStringDescending";
1
+ export * from "./byNumberAscending";
2
+ export * from "./byNumberDescending";
3
+ export * from "./byStringAscending";
4
+ export * from "./byStringDescending";
@@ -1,5 +1,5 @@
1
- import { defaultTo } from './defaultTo';
2
- const undefinedValue = '__!!UNDEFINED!!__';
1
+ import { defaultTo } from "./defaultTo";
2
+ const undefinedValue = "__!!UNDEFINED!!__";
3
3
  /**
4
4
  * Check to see if a value is undefined.
5
5
  */