@8ms/helpers 2.3.2 → 2.3.3
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.
- package/.yarn/install-state.gz +0 -0
- package/api/ApiResponseClass.js +12 -12
- package/api/api.d.ts +2 -2
- package/api/api.js +2 -2
- package/api/functions.js +7 -7
- package/brightData/serpApi/server/brightDataSerpApi.d.ts +2 -2
- package/brightData/serpApi/server/brightDataSerpApi.js +1 -1
- package/brightData/serpApi/server/getAsyncRequestId.js +2 -2
- package/brightData/webScraperIde/server/getRealtime.js +5 -5
- package/crud/crud.d.ts +2 -2
- package/crud/crud.js +1 -1
- package/date/calculation.d.ts +3 -0
- package/date/calculation.js +3 -0
- package/date/date.d.ts +2 -2
- package/date/date.js +1 -1
- package/date/financialYear.d.ts +1 -1
- package/date/financialYear.js +1 -1
- package/environment/environment.d.ts +4 -4
- package/environment/environment.js +9 -9
- package/file/getFileKey.js +2 -2
- package/googleAds/keywordPlanner/server/googleAdsKeywordPlanner.d.ts +2 -2
- package/googleAds/keywordPlanner/server/googleAdsKeywordPlanner.js +2 -2
- package/googleAds/server/GoogleAdsNamespace.js +1 -2
- package/googlePageSpeed/server/GooglePageSpeedNamespace.d.ts +1 -1
- package/googlePageSpeed/server/GooglePageSpeedNamespace.js +3 -3
- package/googlePageSpeed/server/googlePageSpeed.d.ts +4 -4
- package/googlePageSpeed/server/googlePageSpeed.js +2 -2
- package/inngest/inngest.d.ts +2 -2
- package/inngest/inngest.js +1 -1
- package/littleWarden/server/littleWarden.d.ts +2 -2
- package/littleWarden/server/littleWarden.js +4 -4
- package/lumar/api/server/buildRequest.d.ts +3 -3
- package/lumar/api/server/buildRequest.js +15 -15
- package/lumar/api/server/lumarApi.d.ts +27 -27
- package/lumar/api/server/lumarApi.js +3 -6
- package/lumar/graphql/server/columns.d.ts +28 -27
- package/lumar/graphql/server/columns.js +1 -1
- package/lumar/graphql/server/getData.js +1 -2
- package/lumar/graphql/server/lumarGraphql.d.ts +21 -23
- package/lumar/graphql/server/lumarGraphql.js +2 -6
- package/lumar/graphql/server/queries/getReportDifferences.d.ts +1 -1
- package/lumar/graphql/server/queries/getReportDifferences.js +2 -2
- package/lumar/graphql/server/reportTemplates.d.ts +67 -66
- package/lumar/graphql/server/reportTemplates.js +1 -1
- package/nextAuth/nextAuth.d.ts +3 -3
- package/nextJs/nextJs.js +2 -8
- package/package.json +1 -1
- package/sorting/sorting.d.ts +4 -4
- package/sorting/sorting.js +4 -4
- package/util/isUndefined.js +2 -2
package/.yarn/install-state.gz
CHANGED
|
Binary file
|
package/api/ApiResponseClass.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { defaultTo } from "../util";
|
|
2
|
-
import {
|
|
2
|
+
import { apiState } from "./api";
|
|
3
3
|
/**
|
|
4
4
|
* Class version of the API to enable quicker instances.
|
|
5
5
|
*/
|
|
6
6
|
export class ApiResponseClass {
|
|
7
|
-
state =
|
|
7
|
+
state = apiState.IDLE;
|
|
8
8
|
body = null;
|
|
9
9
|
error = null;
|
|
10
10
|
constructor({ body, error, state } = {}) {
|
|
11
11
|
this.body = body || null;
|
|
12
12
|
this.error = error || null;
|
|
13
|
-
this.state = state ||
|
|
13
|
+
this.state = state || apiState.IDLE;
|
|
14
14
|
return this;
|
|
15
15
|
}
|
|
16
16
|
fromJson = (input) => {
|
|
@@ -39,34 +39,34 @@ export class ApiResponseClass {
|
|
|
39
39
|
return this.state;
|
|
40
40
|
};
|
|
41
41
|
isError = () => {
|
|
42
|
-
return this.state ===
|
|
42
|
+
return this.state === apiState.ERROR;
|
|
43
43
|
};
|
|
44
44
|
isIdle = () => {
|
|
45
|
-
return this.state ===
|
|
45
|
+
return this.state === apiState.IDLE;
|
|
46
46
|
};
|
|
47
47
|
isPending = () => {
|
|
48
|
-
return this.state ===
|
|
48
|
+
return this.state === apiState.PENDING;
|
|
49
49
|
};
|
|
50
50
|
isSuccess = () => {
|
|
51
|
-
return this.state ===
|
|
51
|
+
return this.state === apiState.SUCCESS;
|
|
52
52
|
};
|
|
53
53
|
setToIdle = () => {
|
|
54
|
-
this.state =
|
|
54
|
+
this.state = apiState.IDLE;
|
|
55
55
|
return this;
|
|
56
56
|
};
|
|
57
57
|
setToPending = () => {
|
|
58
|
-
this.state =
|
|
58
|
+
this.state = apiState.PENDING;
|
|
59
59
|
return this;
|
|
60
60
|
};
|
|
61
61
|
setToError = (error, body) => {
|
|
62
62
|
this.body = body || null;
|
|
63
63
|
this.error = error;
|
|
64
|
-
this.state =
|
|
64
|
+
this.state = apiState.ERROR;
|
|
65
65
|
return this;
|
|
66
66
|
};
|
|
67
67
|
setToSuccess = (body) => {
|
|
68
68
|
this.body = body;
|
|
69
|
-
this.state =
|
|
69
|
+
this.state = apiState.SUCCESS;
|
|
70
70
|
return this;
|
|
71
71
|
};
|
|
72
72
|
setBody = (body) => {
|
|
@@ -87,7 +87,7 @@ export class ApiResponseClass {
|
|
|
87
87
|
return new ApiResponseClass({ body: validatedBody, state: this.state });
|
|
88
88
|
}
|
|
89
89
|
catch (error) {
|
|
90
|
-
return new ApiResponseClass({ error, state:
|
|
90
|
+
return new ApiResponseClass({ error, state: apiState.ERROR });
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
93
|
}
|
package/api/api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ApiResponseClass } from "./ApiResponseClass";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const apiState: {
|
|
3
3
|
readonly CANCELLED: "CANCELLED";
|
|
4
4
|
readonly ERROR: "ERROR";
|
|
5
5
|
readonly IDLE: "IDLE";
|
|
@@ -7,7 +7,7 @@ export declare const ApiState: {
|
|
|
7
7
|
readonly SUCCESS: "SUCCESS";
|
|
8
8
|
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
9
9
|
};
|
|
10
|
-
export type ApiState = typeof
|
|
10
|
+
export type ApiState = typeof apiState[keyof typeof apiState];
|
|
11
11
|
export type ApiResponse<T = any, E = any> = {
|
|
12
12
|
body: T | null;
|
|
13
13
|
error: E | null;
|
package/api/api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ApiResponseClass } from "./ApiResponseClass";
|
|
2
|
-
export const
|
|
2
|
+
export const apiState = {
|
|
3
3
|
CANCELLED: "CANCELLED",
|
|
4
4
|
ERROR: "ERROR",
|
|
5
5
|
IDLE: "IDLE",
|
|
@@ -10,6 +10,6 @@ export const ApiState = {
|
|
|
10
10
|
export const defaultResponse = {
|
|
11
11
|
body: null,
|
|
12
12
|
error: null,
|
|
13
|
-
state:
|
|
13
|
+
state: apiState.IDLE,
|
|
14
14
|
};
|
|
15
15
|
export const unexpectedError = "An unexpected error occurred, please try again.";
|
package/api/functions.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { apiState } from "./api";
|
|
2
2
|
export const isCancelled = (apiResponse) => {
|
|
3
|
-
return
|
|
3
|
+
return apiState.CANCELLED === apiResponse.state;
|
|
4
4
|
};
|
|
5
5
|
export const isError = (apiResponse) => {
|
|
6
|
-
return
|
|
6
|
+
return apiState.ERROR === apiResponse.state;
|
|
7
7
|
};
|
|
8
8
|
export const isIdle = (apiResponse) => {
|
|
9
|
-
return
|
|
9
|
+
return apiState.IDLE === apiResponse.state;
|
|
10
10
|
};
|
|
11
11
|
export const isPending = (apiResponse) => {
|
|
12
|
-
return
|
|
12
|
+
return apiState.PENDING === apiResponse.state;
|
|
13
13
|
};
|
|
14
14
|
export const isSuccess = (apiResponse) => {
|
|
15
|
-
return
|
|
15
|
+
return apiState.SUCCESS === apiResponse.state;
|
|
16
16
|
};
|
|
17
17
|
export const isValidationError = (apiResponse) => {
|
|
18
|
-
return
|
|
18
|
+
return apiState.VALIDATION_ERROR === apiResponse.state;
|
|
19
19
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const brightDataSerpApiType: {
|
|
2
2
|
readonly GOOGLE_FLIGHTS: "GOOGLE_FLIGHTS";
|
|
3
3
|
readonly GOOGLE_HOTELS: "GOOGLE_HOTELS";
|
|
4
4
|
readonly GOOGLE_LENS: "GOOGLE_LENS";
|
|
@@ -7,4 +7,4 @@ export declare const BrightDataSerpApiType: {
|
|
|
7
7
|
readonly GOOGLE_SEARCH: "GOOGLE_SEARCH";
|
|
8
8
|
readonly GOOGLE_TRENDS: "GOOGLE_TRENDS";
|
|
9
9
|
};
|
|
10
|
-
export type BrightDataSerpApiType = typeof
|
|
10
|
+
export type BrightDataSerpApiType = typeof brightDataSerpApiType[keyof typeof brightDataSerpApiType];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { post } from "../../../axios";
|
|
2
2
|
import { getCustomerId, getZone } from "../../server";
|
|
3
|
-
import {
|
|
3
|
+
import { brightDataSerpApiType } from "../server";
|
|
4
4
|
/**
|
|
5
5
|
* Make an async request to the SERP API using the Bright Data proxy.
|
|
6
6
|
* Returns a request ID used with getAsyncResults
|
|
@@ -14,7 +14,7 @@ export const getAsyncRequestId = async (auth, data = {}, type) => {
|
|
|
14
14
|
const customerId = getCustomerId(auth);
|
|
15
15
|
const zone = getZone(auth);
|
|
16
16
|
switch (type) {
|
|
17
|
-
case
|
|
17
|
+
case brightDataSerpApiType.GOOGLE_TRENDS:
|
|
18
18
|
url = `https://api.brightdata.com/serp/trends?customer=${customerId}&zone=${zone}`;
|
|
19
19
|
break;
|
|
20
20
|
default:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { get, post } from "../../../axios";
|
|
2
|
-
import {
|
|
2
|
+
import { apiState } from "../../../api";
|
|
3
3
|
import { sleep } from "../../../util";
|
|
4
4
|
/**
|
|
5
5
|
* Depends on the Scraper setup!
|
|
@@ -17,8 +17,8 @@ export const getRealtime = async (auth, scraperId, data = {}) => {
|
|
|
17
17
|
if (requestResponse.isSuccess()) {
|
|
18
18
|
const responseId = requestResponse.getBodyDefaultTo(["response_id"], "");
|
|
19
19
|
if ("" !== responseId) {
|
|
20
|
-
let state =
|
|
21
|
-
while (
|
|
20
|
+
let state = apiState.PENDING;
|
|
21
|
+
while (apiState.PENDING === state) {
|
|
22
22
|
const resultUrl = `https://api.brightdata.com/dca/get_result?response_id=${responseId}`;
|
|
23
23
|
// Use fetch with the agent option to make an HTTP request through the proxy
|
|
24
24
|
// Replace <target_url> with the URL you want to request
|
|
@@ -30,10 +30,10 @@ export const getRealtime = async (auth, scraperId, data = {}) => {
|
|
|
30
30
|
if (resultResponse.isSuccess()) {
|
|
31
31
|
if (undefined !== resultResponse.body.pending &&
|
|
32
32
|
true === resultResponse.body.pending) {
|
|
33
|
-
state =
|
|
33
|
+
state = apiState.PENDING;
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
|
-
state =
|
|
36
|
+
state = apiState.SUCCESS;
|
|
37
37
|
response = resultResponse.getBody();
|
|
38
38
|
}
|
|
39
39
|
}
|
package/crud/crud.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const crudState: {
|
|
2
2
|
readonly CREATE: "CREATE";
|
|
3
3
|
readonly READ: "READ";
|
|
4
4
|
readonly UPDATE: "UPDATE";
|
|
5
5
|
readonly DELETE: "DELETE";
|
|
6
6
|
};
|
|
7
|
-
export type CrudState = typeof
|
|
7
|
+
export type CrudState = typeof crudState[keyof typeof crudState];
|
package/crud/crud.js
CHANGED
package/date/calculation.d.ts
CHANGED
package/date/calculation.js
CHANGED
package/date/date.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare const defaultDateTime: "1901-01-01 00:00:00";
|
|
|
19
19
|
/**
|
|
20
20
|
* Used by Google Ads API.
|
|
21
21
|
*/
|
|
22
|
-
export declare const
|
|
22
|
+
export declare const month: {
|
|
23
23
|
readonly JANUARY: "JANUARY";
|
|
24
24
|
readonly FEBRUARY: "FEBRUARY";
|
|
25
25
|
readonly MARCH: "MARCH";
|
|
@@ -33,4 +33,4 @@ export declare const Month: {
|
|
|
33
33
|
readonly NOVEMBER: "NOVEMBER";
|
|
34
34
|
readonly DECEMBER: "DECEMBER";
|
|
35
35
|
};
|
|
36
|
-
export type Month = typeof
|
|
36
|
+
export type Month = typeof month[keyof typeof month];
|
package/date/date.js
CHANGED
package/date/financialYear.d.ts
CHANGED
package/date/financialYear.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getLuxonDate, getToday, getYesterday } from "./calculation";
|
|
2
2
|
import { Interval } from "luxon";
|
|
3
3
|
/**
|
|
4
|
-
* Get the
|
|
4
|
+
* Get the financial year based on an optional year.
|
|
5
5
|
*/
|
|
6
6
|
export const getFinancialYear = (year) => {
|
|
7
7
|
// Either use the current year or a specified year
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const environment: {
|
|
2
2
|
readonly DEVELOPMENT: "development";
|
|
3
3
|
readonly STAGING: "staging";
|
|
4
4
|
readonly PRODUCTION: "production";
|
|
5
5
|
};
|
|
6
|
-
export type Environment = typeof
|
|
7
|
-
export declare const
|
|
6
|
+
export type Environment = typeof environment[keyof typeof environment];
|
|
7
|
+
export declare const platform: {
|
|
8
8
|
readonly AWS: "AWS";
|
|
9
9
|
readonly VERCEL: "VERCEL";
|
|
10
10
|
};
|
|
11
|
-
export type Platform = typeof
|
|
11
|
+
export type Platform = typeof platform[keyof typeof platform];
|
|
12
12
|
/**
|
|
13
13
|
* Determine the environment we're using.
|
|
14
14
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const environment = {
|
|
2
2
|
DEVELOPMENT: "development",
|
|
3
3
|
STAGING: "staging",
|
|
4
4
|
PRODUCTION: "production",
|
|
5
5
|
};
|
|
6
|
-
export const
|
|
6
|
+
export const platform = {
|
|
7
7
|
AWS: "AWS",
|
|
8
8
|
VERCEL: "VERCEL",
|
|
9
9
|
};
|
|
@@ -34,22 +34,22 @@ export const getEnvironment = () => {
|
|
|
34
34
|
.trim();
|
|
35
35
|
switch (platformEnvironmentClean) {
|
|
36
36
|
case "production":
|
|
37
|
-
response =
|
|
37
|
+
response = environment.PRODUCTION;
|
|
38
38
|
break;
|
|
39
39
|
case "demo":
|
|
40
40
|
case "preview":
|
|
41
41
|
case "staging":
|
|
42
|
-
response =
|
|
42
|
+
response = environment.STAGING;
|
|
43
43
|
break;
|
|
44
44
|
default:
|
|
45
|
-
response =
|
|
45
|
+
response = environment.DEVELOPMENT;
|
|
46
46
|
}
|
|
47
47
|
return response;
|
|
48
48
|
};
|
|
49
49
|
/**
|
|
50
50
|
* Check to see if we are working on AWS Lambda.
|
|
51
51
|
*/
|
|
52
|
-
export const isAws = () =>
|
|
52
|
+
export const isAws = () => platform.AWS === process.env["EMS_PLATFORM"];
|
|
53
53
|
export const isVercel = () => undefined !== process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_REF;
|
|
54
54
|
/**
|
|
55
55
|
* Some code should only run on the server side to protect the data.
|
|
@@ -58,9 +58,9 @@ export const isServer = typeof window === "undefined";
|
|
|
58
58
|
/**
|
|
59
59
|
* Check the environment currently running.
|
|
60
60
|
*/
|
|
61
|
-
export const isDevelopment = () =>
|
|
62
|
-
export const isStaging = () =>
|
|
63
|
-
export const isProduction = () =>
|
|
61
|
+
export const isDevelopment = () => environment.DEVELOPMENT === getEnvironment();
|
|
62
|
+
export const isStaging = () => environment.STAGING === getEnvironment();
|
|
63
|
+
export const isProduction = () => environment.PRODUCTION === getEnvironment();
|
|
64
64
|
/**
|
|
65
65
|
* Check to see if we are developing locally or on the hosted platform.
|
|
66
66
|
*/
|
package/file/getFileKey.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DateTime } from "luxon";
|
|
2
|
-
import {
|
|
2
|
+
import { getYmdString } from "../date";
|
|
3
3
|
/**
|
|
4
4
|
* Create a file key from the inputs so it can handle objects/number/etc.
|
|
5
5
|
*/
|
|
@@ -13,7 +13,7 @@ export const getFileKey = (inputs) => {
|
|
|
13
13
|
response += inputs[i];
|
|
14
14
|
}
|
|
15
15
|
else if (inputs[i] instanceof Date || inputs[i] instanceof DateTime) {
|
|
16
|
-
response +=
|
|
16
|
+
response += getYmdString(inputs[i]);
|
|
17
17
|
}
|
|
18
18
|
else {
|
|
19
19
|
response += JSON.stringify(inputs[i]);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const network: {
|
|
3
3
|
readonly GOOGLE_SEARCH_ONLY: 2;
|
|
4
4
|
readonly GOOGLE_SEARCH_AND_PARTNERS: 3;
|
|
5
5
|
};
|
|
6
|
-
export type Network = typeof
|
|
6
|
+
export type Network = typeof network[keyof typeof network];
|
|
7
7
|
export declare const requestSchema: z.ZodObject<{
|
|
8
8
|
countries: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
9
9
|
customerId: z.ZodOptional<z.ZodString>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
|
-
export const
|
|
2
|
+
export const network = {
|
|
3
3
|
GOOGLE_SEARCH_ONLY: 2,
|
|
4
4
|
GOOGLE_SEARCH_AND_PARTNERS: 3,
|
|
5
5
|
};
|
|
@@ -31,7 +31,7 @@ export const defaultRequest = {
|
|
|
31
31
|
customerId: "",
|
|
32
32
|
historicalMetricsOptions: null,
|
|
33
33
|
includeAdultKeywords: false,
|
|
34
|
-
keywordPlanNetwork:
|
|
34
|
+
keywordPlanNetwork: network.GOOGLE_SEARCH_ONLY,
|
|
35
35
|
queries: [],
|
|
36
36
|
language: null,
|
|
37
37
|
};
|
|
@@ -21,11 +21,10 @@ export class GoogleAdsNamespace extends BaseNamespace {
|
|
|
21
21
|
};
|
|
22
22
|
getCustomer = async (customerId) => {
|
|
23
23
|
await this.ensureInit();
|
|
24
|
-
|
|
24
|
+
return this.client.Customer({
|
|
25
25
|
customer_id: customerId,
|
|
26
26
|
login_customer_id: this.mccAccountId,
|
|
27
27
|
refresh_token: this.refreshToken,
|
|
28
28
|
});
|
|
29
|
-
return customer;
|
|
30
29
|
};
|
|
31
30
|
}
|
|
@@ -7,5 +7,5 @@ export declare class GooglePageSpeedNamespace extends BaseNamespace {
|
|
|
7
7
|
client: boolean;
|
|
8
8
|
config: GooglePageSpeedConfig;
|
|
9
9
|
ensureInit: () => Promise<void>;
|
|
10
|
-
getReport: (url: string,
|
|
10
|
+
getReport: (url: string, inputCategory?: Category, inputStrategy?: Strategy) => Promise<any>;
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseNamespace } from "../../_class";
|
|
2
|
-
import {
|
|
2
|
+
import { category, strategy } from "./";
|
|
3
3
|
import { get } from "../../axios";
|
|
4
4
|
/**
|
|
5
5
|
* Based on https://developers.google.com/speed/docs/insights/rest/v5/pagespeedapi/runpagespeed
|
|
@@ -16,8 +16,8 @@ export class GooglePageSpeedNamespace extends BaseNamespace {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
getReport = async (url,
|
|
20
|
-
const requestUrl = `https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=${url}&strategy=${
|
|
19
|
+
getReport = async (url, inputCategory = category.PERFORMANCE, inputStrategy = strategy.MOBILE) => {
|
|
20
|
+
const requestUrl = `https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=${url}&strategy=${inputStrategy}&category=${inputCategory}&key=${this.config.apiKey}`;
|
|
21
21
|
const apiResponse = await get(requestUrl);
|
|
22
22
|
if (apiResponse.isSuccess()) {
|
|
23
23
|
return apiResponse.getBody();
|
|
@@ -3,17 +3,17 @@ export type GooglePageSpeedConfig = {
|
|
|
3
3
|
apiKey: string;
|
|
4
4
|
};
|
|
5
5
|
export declare const googlePageSpeedClient: (key?: string, config?: GooglePageSpeedConfig, vaultId?: string, itemId?: string) => Promise<GooglePageSpeedNamespace>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const category: {
|
|
7
7
|
readonly CATEGORY_UNSPECIFIED: "CATEGORY_UNSPECIFIED";
|
|
8
8
|
readonly ACCESSIBILITY: "ACCESSIBILITY";
|
|
9
9
|
readonly BEST_PRACTICES: "BEST_PRACTICES";
|
|
10
10
|
readonly PERFORMANCE: "PERFORMANCE";
|
|
11
11
|
readonly SEO: "SEO";
|
|
12
12
|
};
|
|
13
|
-
export type Category = typeof
|
|
14
|
-
export declare const
|
|
13
|
+
export type Category = typeof category[keyof typeof category];
|
|
14
|
+
export declare const strategy: {
|
|
15
15
|
readonly STRATEGY_UNSPECIFIED: "STRATEGY_UNSPECIFIED";
|
|
16
16
|
readonly DESKTOP: "DESKTOP";
|
|
17
17
|
readonly MOBILE: "MOBILE";
|
|
18
18
|
};
|
|
19
|
-
export type Strategy = typeof
|
|
19
|
+
export type Strategy = typeof strategy[keyof typeof strategy];
|
|
@@ -24,14 +24,14 @@ export const googlePageSpeedClient = async (key = "default", config, vaultId, it
|
|
|
24
24
|
googlePageSpeedNamespaces.set(key, namespace);
|
|
25
25
|
return namespace;
|
|
26
26
|
};
|
|
27
|
-
export const
|
|
27
|
+
export const category = {
|
|
28
28
|
CATEGORY_UNSPECIFIED: "CATEGORY_UNSPECIFIED",
|
|
29
29
|
ACCESSIBILITY: "ACCESSIBILITY",
|
|
30
30
|
BEST_PRACTICES: "BEST_PRACTICES",
|
|
31
31
|
PERFORMANCE: "PERFORMANCE",
|
|
32
32
|
SEO: "SEO",
|
|
33
33
|
};
|
|
34
|
-
export const
|
|
34
|
+
export const strategy = {
|
|
35
35
|
STRATEGY_UNSPECIFIED: "STRATEGY_UNSPECIFIED",
|
|
36
36
|
DESKTOP: "DESKTOP",
|
|
37
37
|
MOBILE: "MOBILE",
|
package/inngest/inngest.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const inngestState: {
|
|
2
2
|
RUNNING: string;
|
|
3
3
|
COMPLETED: string;
|
|
4
4
|
FAILED: string;
|
|
5
5
|
CANCELLED: string;
|
|
6
6
|
};
|
|
7
|
-
export type InngestState = typeof
|
|
7
|
+
export type InngestState = typeof inngestState[keyof typeof inngestState];
|
package/inngest/inngest.js
CHANGED
|
@@ -3,12 +3,12 @@ export type LittleWardenConfig = {
|
|
|
3
3
|
apiKey: string;
|
|
4
4
|
};
|
|
5
5
|
export declare const littleWardenClient: (key?: string, config?: LittleWardenConfig, vaultId?: string, itemId?: string) => Promise<LittleWardenNamespace>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const littleWardenState: {
|
|
7
7
|
readonly ALL_GOOD: "all_good";
|
|
8
8
|
readonly DANGER: "danger";
|
|
9
9
|
readonly WARNING: "warning";
|
|
10
10
|
};
|
|
11
|
-
export type LittleWardenState = typeof
|
|
11
|
+
export type LittleWardenState = typeof littleWardenState[keyof typeof littleWardenState];
|
|
12
12
|
/**
|
|
13
13
|
* Check if the field is All Good.
|
|
14
14
|
*/
|
|
@@ -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
|
|
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 =
|
|
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 =
|
|
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 =
|
|
61
|
+
response = littleWardenState.DANGER === field["status"];
|
|
62
62
|
}
|
|
63
63
|
return response;
|
|
64
64
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Filter,
|
|
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?:
|
|
7
|
+
orders?: OrderRow[];
|
|
8
8
|
page?: number;
|
|
9
9
|
projectId?: number;
|
|
10
|
-
report?:
|
|
10
|
+
report?: Report;
|
|
11
11
|
subReport?: string;
|
|
12
12
|
};
|
|
13
13
|
export declare const buildRequest: (props: BuildRequestProps) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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 &&
|
|
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
|
|
22
|
+
case report.LIST_CRAWLS:
|
|
23
23
|
url += `/projects/${props.projectId}/crawls`;
|
|
24
24
|
break;
|
|
25
|
-
case
|
|
25
|
+
case report.LIST_PROJECTS:
|
|
26
26
|
url += `/projects`;
|
|
27
27
|
break;
|
|
28
|
-
case
|
|
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
|
|
33
|
+
case report.CRAWL_STATISTICS:
|
|
34
34
|
url += `/projects/${props.projectId}/crawls/${props.crawlId}/statistics`;
|
|
35
35
|
break;
|
|
36
|
-
case
|
|
36
|
+
case report.LIST_REPORTS:
|
|
37
37
|
url += `/projects/${props.projectId}/crawls/${props.crawlId}/reports`;
|
|
38
38
|
break;
|
|
39
|
-
case
|
|
40
|
-
case
|
|
41
|
-
case
|
|
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 (
|
|
43
|
+
if (report.REPORT_ROWS === props.report) {
|
|
44
44
|
url += `/report_rows`;
|
|
45
45
|
}
|
|
46
|
-
else if (
|
|
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((
|
|
69
|
+
props.orders.map((orderRow, index) => {
|
|
70
70
|
url += 0 === index ? "sort=" : ",";
|
|
71
|
-
url +=
|
|
72
|
-
url +=
|
|
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
|
|
7
|
-
EQUALS:
|
|
8
|
-
CONTAINS:
|
|
9
|
-
LESS_THAN:
|
|
10
|
-
LESS_THAN_OR_EQUAL:
|
|
11
|
-
GREATER_THAN:
|
|
12
|
-
GREATER_THAN_OR_EQUAL:
|
|
13
|
-
REGEX:
|
|
14
|
-
NOT_REGEX:
|
|
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
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
21
|
-
|
|
22
|
-
|
|
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
|
|
25
|
-
CRAWL_STATISTICS:
|
|
26
|
-
CUSTOM:
|
|
27
|
-
LIST_PROJECTS:
|
|
28
|
-
LIST_CRAWLS:
|
|
29
|
-
LIST_REPORTS:
|
|
30
|
-
REPORT_ROWS:
|
|
31
|
-
REPORT_STATISTICS:
|
|
32
|
-
REPORT_SUMMARY:
|
|
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
|
|
35
|
-
export * from "./getData";
|
|
36
|
-
export * from "./initClient";
|
|
36
|
+
export type Report = typeof report[keyof typeof report];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const
|
|
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
|
|
11
|
+
export const order = {
|
|
12
12
|
ASCENDING: 'asc',
|
|
13
13
|
DESCENDING: 'desc',
|
|
14
14
|
};
|
|
15
|
-
export const
|
|
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
|
|
2
|
-
CUSTOM_EXTRACTION_1:
|
|
3
|
-
CUSTOM_EXTRACTION_2:
|
|
4
|
-
DEEP_RANK:
|
|
5
|
-
DESCRIPTION:
|
|
6
|
-
DUPLICATE_PAGE:
|
|
7
|
-
DUPLICATE_DESCRIPTION_FROM:
|
|
8
|
-
DUPLICATE_TITLE_FROM:
|
|
9
|
-
FOUND_AT_URL:
|
|
10
|
-
FOUND_IN_CRAWL:
|
|
11
|
-
FOUND_IN_SEARCH_CONSOLE:
|
|
12
|
-
FOUND_IN_SITEMAP:
|
|
13
|
-
LEVEL:
|
|
14
|
-
PAGE_TITLE:
|
|
15
|
-
PRIMARY_PAGE:
|
|
16
|
-
PRIMARY_URL_FROM:
|
|
17
|
-
PRIMARY_URL_FROM_STATUS_CODE:
|
|
18
|
-
REDIRECTED_TO_URL:
|
|
19
|
-
REDIRECTED_TO_STATUS_CODE:
|
|
20
|
-
REDIRECTION_CHAIN:
|
|
21
|
-
SOURCE_URL:
|
|
22
|
-
STATUS_CODE:
|
|
23
|
-
TARGET_STATUS_CODE:
|
|
24
|
-
URL:
|
|
25
|
-
URL_COUNT:
|
|
26
|
-
URL_TO:
|
|
27
|
-
URL_TO_STATUS_CODE:
|
|
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];
|
|
@@ -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
|
-
|
|
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
|
|
2
|
-
CONTAINS:
|
|
3
|
-
DOESNT_CONTAIN:
|
|
4
|
-
DOESNT_MATCH_REGEX:
|
|
5
|
-
ENDS_WITH:
|
|
6
|
-
EQUALS:
|
|
7
|
-
GREATER_THAN:
|
|
8
|
-
GREATER_THAN_OR_EQUAL:
|
|
9
|
-
IS_EMPTY:
|
|
10
|
-
LESS_THAN:
|
|
11
|
-
LESS_THAN_OR_EQUAL:
|
|
12
|
-
MATCHES_REGEX:
|
|
13
|
-
NOT_EQUALS:
|
|
14
|
-
STARTS_WITH:
|
|
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
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
|
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
|
|
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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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:
|
|
31
|
+
reportTypeCode: reportType.BASIC,
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
34
|
});
|
|
@@ -1,67 +1,68 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
"200_PAGES":
|
|
3
|
-
"301_REDIRECTS":
|
|
4
|
-
"4XX_ERRORS":
|
|
5
|
-
"5XX_ERRORS":
|
|
6
|
-
ALL_PAGES:
|
|
7
|
-
BROKEN_EXTERNAL_LINKS:
|
|
8
|
-
BROKEN_INTERNAL_LINKS:
|
|
9
|
-
BROKEN_SITEMAP_PAGES:
|
|
10
|
-
CANONICAL_CONFLICTING:
|
|
11
|
-
CANONICAL_NON_200:
|
|
12
|
-
CANONICAL_NON_INDEXABLE:
|
|
13
|
-
CANONICAL_ORPHANED:
|
|
14
|
-
CUSTOM_EXTRACTION_1:
|
|
15
|
-
CUSTOM_EXTRACTION_2:
|
|
16
|
-
DUPLICATE_CONTENT:
|
|
17
|
-
DUPLICATE_DESCRIPTIONS:
|
|
18
|
-
DUPLICATE_TITLES:
|
|
19
|
-
EMPTY_PAGES:
|
|
20
|
-
INDEXABLE_PAGES:
|
|
21
|
-
LINKED_DOMAINS:
|
|
22
|
-
MAX_DESCRIPTIONS:
|
|
23
|
-
MAX_MOBILE_DESCRIPTIONS:
|
|
24
|
-
MAX_TITLES:
|
|
25
|
-
MISSING_DESCRIPTIONS:
|
|
26
|
-
MISSING_TITLES:
|
|
27
|
-
NON_301_REDIRECTS:
|
|
28
|
-
NON_INDEXABLE_PAGES:
|
|
29
|
-
NON_INDEXABLE_SITEMAP_PAGES:
|
|
30
|
-
ORPHANED_CANONICAL:
|
|
31
|
-
ORPHANED_ANALYTICS_PAGES:
|
|
32
|
-
ORPHANED_SEARCH_CONSOLE_PAGES:
|
|
33
|
-
ORPHANED_SITEMAP_PAGES:
|
|
34
|
-
PAGES_WITH_HIGH_EXTERNAL_LINKS:
|
|
35
|
-
PERFORMANCE_MAX_FETCH_TIME:
|
|
36
|
-
PERFORMANCE_POOR_CLS:
|
|
37
|
-
PERFORMANCE_SLOW_DCL:
|
|
38
|
-
PERFORMANCE_SLOW_FCP:
|
|
39
|
-
PERFORMANCE_SLOW_LCP:
|
|
40
|
-
PERFORMANCE_SLOW_TTFB:
|
|
41
|
-
PERFORMANCE_SLOW_TTI:
|
|
42
|
-
PRIMARY_PAGES:
|
|
43
|
-
REDIRECTS_BROKEN:
|
|
44
|
-
REDIRECTS_CHAIN:
|
|
45
|
-
REDIRECTS_LOOP:
|
|
46
|
-
SCHEMA_BREADCRUMB:
|
|
47
|
-
SCHEMA_EVENT:
|
|
48
|
-
SCHEMA_FAQ:
|
|
49
|
-
SCHEMA_HOW_TO:
|
|
50
|
-
SCHEMA_NEWS_ARTICLE:
|
|
51
|
-
SCHEMA_PRODUCT:
|
|
52
|
-
SCHEMA_QA:
|
|
53
|
-
SCHEMA_RECIPE:
|
|
54
|
-
SCHEMA_REVIEW:
|
|
55
|
-
SCHEMA_VIDEO:
|
|
56
|
-
SHORT_DESCRIPTIONS:
|
|
57
|
-
SHORT_TITLES:
|
|
58
|
-
SITEMAP_PAGES:
|
|
59
|
-
SITEMAPS_NON_INDEXABLE_PAGES:
|
|
60
|
-
SITEMAPS_ORPHANED_PAGES:
|
|
61
|
-
SITEMAPS_MISSING_PAGES:
|
|
62
|
-
THIN_PAGES:
|
|
63
|
-
TRUE_UNIQUE_PAGES:
|
|
64
|
-
UNIQUE_EXTERNAL_LINKS:
|
|
65
|
-
UNIQUE_INTERNAL_LINKS:
|
|
66
|
-
XML_SITEMAPS:
|
|
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];
|
package/nextAuth/nextAuth.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { isSessionReady } from "./isSessionReady";
|
|
2
2
|
export declare const NextAuthState: {
|
|
3
|
-
AUTHENTICATED:
|
|
4
|
-
PENDING:
|
|
5
|
-
UNAUTHENTICATED:
|
|
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[
|
|
8
|
+
export const getUserAgent = ({ req }) => String(req.headers["user-agent"] || "unset");
|
package/package.json
CHANGED
package/sorting/sorting.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
1
|
+
export * from "./byNumberAscending";
|
|
2
|
+
export * from "./byNumberDescending";
|
|
3
|
+
export * from "./byStringAscending";
|
|
4
|
+
export * from "./byStringDescending";
|
package/sorting/sorting.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
1
|
+
export * from "./byNumberAscending";
|
|
2
|
+
export * from "./byNumberDescending";
|
|
3
|
+
export * from "./byStringAscending";
|
|
4
|
+
export * from "./byStringDescending";
|
package/util/isUndefined.js
CHANGED