@consilioweb/payload-seo-analyzer 1.17.0 → 1.17.2
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/dist/client.cjs +6 -2
- package/dist/client.js +6 -2
- package/dist/index.cjs +12 -12
- package/dist/index.js +12 -12
- package/package.json +5 -1
package/dist/client.cjs
CHANGED
|
@@ -17135,6 +17135,10 @@ function GscPanel({ locale }) {
|
|
|
17135
17135
|
setError(null);
|
|
17136
17136
|
try {
|
|
17137
17137
|
const res = await fetch("/api/seo-plugin/gsc/status", { credentials: "include" });
|
|
17138
|
+
if (res.status === 404) {
|
|
17139
|
+
setStatus({ configured: false, connected: false, connectedEmail: null, connectedAt: null, propertyUrl: null, redirectUri: null });
|
|
17140
|
+
return;
|
|
17141
|
+
}
|
|
17138
17142
|
const json = await res.json();
|
|
17139
17143
|
if (!res.ok) setError(json.error || `Error ${res.status}`);
|
|
17140
17144
|
else setStatus(json);
|
|
@@ -17340,7 +17344,7 @@ function RankTrackingPanel({ locale }) {
|
|
|
17340
17344
|
setError(null);
|
|
17341
17345
|
try {
|
|
17342
17346
|
const res = await fetch("/api/seo-plugin/rank-history", { credentials: "include", cache: "no-store" });
|
|
17343
|
-
if (res.status === 403 || res.status === 409) {
|
|
17347
|
+
if (res.status === 404 || res.status === 403 || res.status === 409) {
|
|
17344
17348
|
setNotConnected(true);
|
|
17345
17349
|
setMovers(null);
|
|
17346
17350
|
return;
|
|
@@ -17517,7 +17521,7 @@ function CtrOpportunitiesPanel({ locale }) {
|
|
|
17517
17521
|
setError(null);
|
|
17518
17522
|
try {
|
|
17519
17523
|
const res = await fetch("/api/seo-plugin/ctr-opportunities", { credentials: "include", cache: "no-store" });
|
|
17520
|
-
if (res.status === 403 || res.status === 409 || res.status === 400) {
|
|
17524
|
+
if (res.status === 404 || res.status === 403 || res.status === 409 || res.status === 400) {
|
|
17521
17525
|
setNotConnected(true);
|
|
17522
17526
|
return;
|
|
17523
17527
|
}
|
package/dist/client.js
CHANGED
|
@@ -17129,6 +17129,10 @@ function GscPanel({ locale }) {
|
|
|
17129
17129
|
setError(null);
|
|
17130
17130
|
try {
|
|
17131
17131
|
const res = await fetch("/api/seo-plugin/gsc/status", { credentials: "include" });
|
|
17132
|
+
if (res.status === 404) {
|
|
17133
|
+
setStatus({ configured: false, connected: false, connectedEmail: null, connectedAt: null, propertyUrl: null, redirectUri: null });
|
|
17134
|
+
return;
|
|
17135
|
+
}
|
|
17132
17136
|
const json = await res.json();
|
|
17133
17137
|
if (!res.ok) setError(json.error || `Error ${res.status}`);
|
|
17134
17138
|
else setStatus(json);
|
|
@@ -17334,7 +17338,7 @@ function RankTrackingPanel({ locale }) {
|
|
|
17334
17338
|
setError(null);
|
|
17335
17339
|
try {
|
|
17336
17340
|
const res = await fetch("/api/seo-plugin/rank-history", { credentials: "include", cache: "no-store" });
|
|
17337
|
-
if (res.status === 403 || res.status === 409) {
|
|
17341
|
+
if (res.status === 404 || res.status === 403 || res.status === 409) {
|
|
17338
17342
|
setNotConnected(true);
|
|
17339
17343
|
setMovers(null);
|
|
17340
17344
|
return;
|
|
@@ -17511,7 +17515,7 @@ function CtrOpportunitiesPanel({ locale }) {
|
|
|
17511
17515
|
setError(null);
|
|
17512
17516
|
try {
|
|
17513
17517
|
const res = await fetch("/api/seo-plugin/ctr-opportunities", { credentials: "include", cache: "no-store" });
|
|
17514
|
-
if (res.status === 403 || res.status === 409 || res.status === 400) {
|
|
17518
|
+
if (res.status === 404 || res.status === 403 || res.status === 409 || res.status === 400) {
|
|
17515
17519
|
setNotConnected(true);
|
|
17516
17520
|
return;
|
|
17517
17521
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -2365,7 +2365,7 @@ function isAdmin(user) {
|
|
|
2365
2365
|
if (!user) return false;
|
|
2366
2366
|
if (user.role === "admin") return true;
|
|
2367
2367
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
2368
|
-
return
|
|
2368
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
2369
2369
|
}
|
|
2370
2370
|
function createSettingsHandler() {
|
|
2371
2371
|
return async (req) => {
|
|
@@ -2526,7 +2526,7 @@ function isAdmin2(user) {
|
|
|
2526
2526
|
if (!user) return false;
|
|
2527
2527
|
if (user.role === "admin") return true;
|
|
2528
2528
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
2529
|
-
return
|
|
2529
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
2530
2530
|
}
|
|
2531
2531
|
function createRedirectHandler(redirectsCollection) {
|
|
2532
2532
|
return async (req) => {
|
|
@@ -2621,7 +2621,7 @@ function isAdmin3(user) {
|
|
|
2621
2621
|
if (!user) return false;
|
|
2622
2622
|
if (user.role === "admin") return true;
|
|
2623
2623
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
2624
|
-
return
|
|
2624
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
2625
2625
|
}
|
|
2626
2626
|
function createRedirectsHandler(redirectsCollection) {
|
|
2627
2627
|
return async (req) => {
|
|
@@ -3196,7 +3196,7 @@ function isGscAdmin(user) {
|
|
|
3196
3196
|
if (!user) return false;
|
|
3197
3197
|
if (user.role === "admin") return true;
|
|
3198
3198
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
3199
|
-
return
|
|
3199
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
3200
3200
|
}
|
|
3201
3201
|
function resolveGscSiteUrl(seoConfig) {
|
|
3202
3202
|
return (seoConfig?.siteUrl || process.env.NEXT_PUBLIC_SERVER_URL || process.env.PAYLOAD_PUBLIC_SERVER_URL || void 0)?.replace(/\/$/, "");
|
|
@@ -3275,7 +3275,7 @@ function isAdmin4(user) {
|
|
|
3275
3275
|
if (!user) return false;
|
|
3276
3276
|
if (user.role === "admin") return true;
|
|
3277
3277
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
3278
|
-
return
|
|
3278
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
3279
3279
|
}
|
|
3280
3280
|
function resolveImageUrl(media, siteUrl) {
|
|
3281
3281
|
const raw = typeof media.url === "string" && media.url || (typeof media.filename === "string" ? `/media/${media.filename}` : "");
|
|
@@ -3599,7 +3599,7 @@ function isAdmin5(user) {
|
|
|
3599
3599
|
if (!user) return false;
|
|
3600
3600
|
if (user.role === "admin") return true;
|
|
3601
3601
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
3602
|
-
return
|
|
3602
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
3603
3603
|
}
|
|
3604
3604
|
function createAiOptimizeBulkHandler(targetCollections, seoConfig, localeMapping) {
|
|
3605
3605
|
return async (req) => {
|
|
@@ -4350,7 +4350,7 @@ function isAdmin6(user) {
|
|
|
4350
4350
|
if (!user) return false;
|
|
4351
4351
|
if (user.role === "admin") return true;
|
|
4352
4352
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
4353
|
-
return
|
|
4353
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
4354
4354
|
}
|
|
4355
4355
|
function createPerformanceHandler() {
|
|
4356
4356
|
return async (req) => {
|
|
@@ -6169,7 +6169,7 @@ function isAdmin7(user) {
|
|
|
6169
6169
|
if (!user) return false;
|
|
6170
6170
|
if (user.role === "admin") return true;
|
|
6171
6171
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
6172
|
-
return
|
|
6172
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
6173
6173
|
}
|
|
6174
6174
|
function createRobotsHandler(targetCollections) {
|
|
6175
6175
|
return async (req) => {
|
|
@@ -7533,7 +7533,7 @@ function isAdmin8(user) {
|
|
|
7533
7533
|
if (!user) return false;
|
|
7534
7534
|
if (user.role === "admin") return true;
|
|
7535
7535
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
7536
|
-
return
|
|
7536
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
7537
7537
|
}
|
|
7538
7538
|
function createSeoHealthHandler(basePath, seoConfig) {
|
|
7539
7539
|
return async (req) => {
|
|
@@ -7605,7 +7605,7 @@ function isAdmin9(user) {
|
|
|
7605
7605
|
if (!user) return false;
|
|
7606
7606
|
if (user.role === "admin") return true;
|
|
7607
7607
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
7608
|
-
return
|
|
7608
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
7609
7609
|
}
|
|
7610
7610
|
function docToUrl(slug, siteUrl) {
|
|
7611
7611
|
const base = siteUrl.replace(/\/$/, "");
|
|
@@ -7747,7 +7747,7 @@ function isAdmin10(user) {
|
|
|
7747
7747
|
if (!user) return false;
|
|
7748
7748
|
if (user.role === "admin") return true;
|
|
7749
7749
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
7750
|
-
return
|
|
7750
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
7751
7751
|
}
|
|
7752
7752
|
function createSeoLogsHandler(seoLogsSecret) {
|
|
7753
7753
|
const postLimiter = createRateLimiter(30, 6e4);
|
|
@@ -8086,7 +8086,7 @@ function isAdmin11(user) {
|
|
|
8086
8086
|
if (!user) return false;
|
|
8087
8087
|
if (user.role === "admin") return true;
|
|
8088
8088
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
8089
|
-
return
|
|
8089
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
8090
8090
|
}
|
|
8091
8091
|
function getAlertConfig() {
|
|
8092
8092
|
return {
|
package/dist/index.js
CHANGED
|
@@ -2363,7 +2363,7 @@ function isAdmin(user) {
|
|
|
2363
2363
|
if (!user) return false;
|
|
2364
2364
|
if (user.role === "admin") return true;
|
|
2365
2365
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
2366
|
-
return
|
|
2366
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
2367
2367
|
}
|
|
2368
2368
|
function createSettingsHandler() {
|
|
2369
2369
|
return async (req) => {
|
|
@@ -2524,7 +2524,7 @@ function isAdmin2(user) {
|
|
|
2524
2524
|
if (!user) return false;
|
|
2525
2525
|
if (user.role === "admin") return true;
|
|
2526
2526
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
2527
|
-
return
|
|
2527
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
2528
2528
|
}
|
|
2529
2529
|
function createRedirectHandler(redirectsCollection) {
|
|
2530
2530
|
return async (req) => {
|
|
@@ -2619,7 +2619,7 @@ function isAdmin3(user) {
|
|
|
2619
2619
|
if (!user) return false;
|
|
2620
2620
|
if (user.role === "admin") return true;
|
|
2621
2621
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
2622
|
-
return
|
|
2622
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
2623
2623
|
}
|
|
2624
2624
|
function createRedirectsHandler(redirectsCollection) {
|
|
2625
2625
|
return async (req) => {
|
|
@@ -3194,7 +3194,7 @@ function isGscAdmin(user) {
|
|
|
3194
3194
|
if (!user) return false;
|
|
3195
3195
|
if (user.role === "admin") return true;
|
|
3196
3196
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
3197
|
-
return
|
|
3197
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
3198
3198
|
}
|
|
3199
3199
|
function resolveGscSiteUrl(seoConfig) {
|
|
3200
3200
|
return (seoConfig?.siteUrl || process.env.NEXT_PUBLIC_SERVER_URL || process.env.PAYLOAD_PUBLIC_SERVER_URL || void 0)?.replace(/\/$/, "");
|
|
@@ -3273,7 +3273,7 @@ function isAdmin4(user) {
|
|
|
3273
3273
|
if (!user) return false;
|
|
3274
3274
|
if (user.role === "admin") return true;
|
|
3275
3275
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
3276
|
-
return
|
|
3276
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
3277
3277
|
}
|
|
3278
3278
|
function resolveImageUrl(media, siteUrl) {
|
|
3279
3279
|
const raw = typeof media.url === "string" && media.url || (typeof media.filename === "string" ? `/media/${media.filename}` : "");
|
|
@@ -3597,7 +3597,7 @@ function isAdmin5(user) {
|
|
|
3597
3597
|
if (!user) return false;
|
|
3598
3598
|
if (user.role === "admin") return true;
|
|
3599
3599
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
3600
|
-
return
|
|
3600
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
3601
3601
|
}
|
|
3602
3602
|
function createAiOptimizeBulkHandler(targetCollections, seoConfig, localeMapping) {
|
|
3603
3603
|
return async (req) => {
|
|
@@ -4348,7 +4348,7 @@ function isAdmin6(user) {
|
|
|
4348
4348
|
if (!user) return false;
|
|
4349
4349
|
if (user.role === "admin") return true;
|
|
4350
4350
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
4351
|
-
return
|
|
4351
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
4352
4352
|
}
|
|
4353
4353
|
function createPerformanceHandler() {
|
|
4354
4354
|
return async (req) => {
|
|
@@ -6167,7 +6167,7 @@ function isAdmin7(user) {
|
|
|
6167
6167
|
if (!user) return false;
|
|
6168
6168
|
if (user.role === "admin") return true;
|
|
6169
6169
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
6170
|
-
return
|
|
6170
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
6171
6171
|
}
|
|
6172
6172
|
function createRobotsHandler(targetCollections) {
|
|
6173
6173
|
return async (req) => {
|
|
@@ -7531,7 +7531,7 @@ function isAdmin8(user) {
|
|
|
7531
7531
|
if (!user) return false;
|
|
7532
7532
|
if (user.role === "admin") return true;
|
|
7533
7533
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
7534
|
-
return
|
|
7534
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
7535
7535
|
}
|
|
7536
7536
|
function createSeoHealthHandler(basePath, seoConfig) {
|
|
7537
7537
|
return async (req) => {
|
|
@@ -7603,7 +7603,7 @@ function isAdmin9(user) {
|
|
|
7603
7603
|
if (!user) return false;
|
|
7604
7604
|
if (user.role === "admin") return true;
|
|
7605
7605
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
7606
|
-
return
|
|
7606
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
7607
7607
|
}
|
|
7608
7608
|
function docToUrl(slug, siteUrl) {
|
|
7609
7609
|
const base = siteUrl.replace(/\/$/, "");
|
|
@@ -7745,7 +7745,7 @@ function isAdmin10(user) {
|
|
|
7745
7745
|
if (!user) return false;
|
|
7746
7746
|
if (user.role === "admin") return true;
|
|
7747
7747
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
7748
|
-
return
|
|
7748
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
7749
7749
|
}
|
|
7750
7750
|
function createSeoLogsHandler(seoLogsSecret) {
|
|
7751
7751
|
const postLimiter = createRateLimiter(30, 6e4);
|
|
@@ -8084,7 +8084,7 @@ function isAdmin11(user) {
|
|
|
8084
8084
|
if (!user) return false;
|
|
8085
8085
|
if (user.role === "admin") return true;
|
|
8086
8086
|
if (Array.isArray(user.roles) && user.roles.includes("admin")) return true;
|
|
8087
|
-
return
|
|
8087
|
+
return typeof user.role !== "string" && !Array.isArray(user.roles);
|
|
8088
8088
|
}
|
|
8089
8089
|
function getAlertConfig() {
|
|
8090
8090
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@consilioweb/payload-seo-analyzer",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.2",
|
|
4
4
|
"description": "Payload CMS SEO plugin — 50+ checks, dashboard, Lexical JSON support, Flesch FR/EN readability, i18n",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -114,7 +114,11 @@
|
|
|
114
114
|
"node": ">=18"
|
|
115
115
|
},
|
|
116
116
|
"devDependencies": {
|
|
117
|
+
"@testing-library/react": "^16.3.2",
|
|
117
118
|
"@types/react": "^19.0.0",
|
|
119
|
+
"jsdom": "^29.1.1",
|
|
120
|
+
"react": "^19.2.7",
|
|
121
|
+
"react-dom": "^19.2.7",
|
|
118
122
|
"tsup": "^8.0.0",
|
|
119
123
|
"typescript": "^5.5.0",
|
|
120
124
|
"vitest": "^2.0.0"
|