seo 0.20.0 → 0.20.1

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/index.d.ts CHANGED
@@ -22191,6 +22191,7 @@ type SubmitAccess = {
22191
22191
  connectIndexMySite: () => Promise<string>;
22192
22192
  indexMySiteConnect: string;
22193
22193
  fetch?: typeof fetch;
22194
+ indexNowBlocked?: string;
22194
22195
  };
22195
22196
  declare const COMMANDS: {
22196
22197
  readonly report: {
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __seoCreateRequire } from 'node:module'; const require = __seoCreateRequire(import.meta.url);
2
- import { n as version, t as load } from "./esm-B6IvIMUU.js";
2
+ import { n as version, t as load } from "./esm-BwG6KnkI.js";
3
3
  import { SEO_PROVIDER_API_VERSION } from "./provider-sdk.js";
4
4
  import crypto$1, { createHash, randomUUID, sign } from "node:crypto";
5
5
  import { z } from "zod";
@@ -11564,6 +11564,7 @@ const PRONOUNS = /\b(it|its|they|them|their|this|these|those)\b/gu;
11564
11564
  const TIME_WORD = /\b(this|these|those) (morning|evening|afternoon|night|day|date|week|weekend|month|year|time)\b/gu;
11565
11565
  const DUMMY_IT = /\b(now|rn|atm|tn|tdy|tmr|tmrw|tonite|yday|currently|to ?n?ight|to day|lastn\S*|(last|past|next|this) \S+|(mon|tues|wednes|thurs|fri|satur|sun)day|outside|dark|sunny|raining|snowing|o'?clock)\b|\bit (take|takes|took)\b.*\b(to|for)\b|\b(far|miles|km) (is|was) it (to|from|around|between)\b|\bis it (\S+ )?(safe|legal|illegal|possible|ok|okay|bad|good|better|best|hard|easy|normal|necessary|true|cheaper|rude|wise) (to|for|if)\b/u;
11566
11566
  const IDENTIFY_IT = /^(what|which)( (kind|type|sort) of)?( \S+){1,2} (is|was) it\b|^(is|was) it (a|an|the) /u;
11567
+ const IT_FIELD = /(?<!\b(do|does|did|will|would|can|could|should|might|may|must|is|was|has|have|make|makes|let|help|helps|get|gets) )\bit (support|helpdesk|help desk|jobs?|careers?|manager|managers|director|department|dept|services?|company|companies|consultants?|consultancy|consulting|technicians?|admins?|administrators?|security|professionals?|industry|sector|salary|salaries|team|apprenticeships?|courses?|certifications?|contractors?|specialists?|analysts?|infrastructure|systems|budget|outsourcing|staff|roles?|skills|training|recruitment|recruiters?|engineers?|projects?|graduate|degree|asset|equipment|policy|procurement)\b|\b(work|working|works|jobs?|careers?|degree|degrees|experience|qualifications?|apprenticeships?|get|getting|break|switch|move) in(to)? it\b|\b(head|director|manager|vp|department) of it\b/gu;
11567
11568
  const CLASS_WORD = /\b(name|surname|names|word|thing|one|company|brand|product|place|site|website|app|scam|service)\b/u;
11568
11569
  const PRONOUN_WORDS = 10;
11569
11570
  const DAYS$1 = [
@@ -11575,7 +11576,7 @@ const DAYS$1 = [
11575
11576
  function pointsBack(text) {
11576
11577
  const tokens = text.split(/\s+/u);
11577
11578
  if (tokens.length >= PRONOUN_WORDS) return false;
11578
- const found = text.replace(TIME_WORD, " ").replace(/(?<!^)\bits\b/gu, " ").match(PRONOUNS) ?? [];
11579
+ const found = text.replace(TIME_WORD, " ").replace(IT_FIELD, " ").replace(/(?<!^)\bits\b/gu, " ").match(PRONOUNS) ?? [];
11579
11580
  if (!found.length) return false;
11580
11581
  if (!found.every((word) => word === "it" || word === "its")) return true;
11581
11582
  return !(DUMMY_IT.test(text) || IDENTIFY_IT.test(text) && !CLASS_WORD.test(text) || tokens.some((token) => token.length >= 4 && DAYS$1.some((day) => editsWithin(token, day, day.length >= 8 ? 2 : 1))));
@@ -30766,8 +30767,9 @@ var IndexMySite = class {
30766
30767
  if (init.body !== void 0) headers["content-type"] = "application/json";
30767
30768
  if (init.idempotencyKey) headers["idempotency-key"] = init.idempotencyKey;
30768
30769
  let response;
30770
+ const fetcher = this.fetcher;
30769
30771
  try {
30770
- response = await this.fetcher(new URL(path, this.base), {
30772
+ response = await fetcher(new URL(path, this.base), {
30771
30773
  method: init.method ?? "GET",
30772
30774
  headers,
30773
30775
  body: init.body === void 0 ? void 0 : JSON.stringify(init.body),
@@ -40389,7 +40391,7 @@ async function indexNowKey(input, submit, call) {
40389
40391
  if (key !== saved) await submit.saveIndexNowKey(host, key);
40390
40392
  const check = await checkKeyFile(host, key, submit.fetch);
40391
40393
  return {
40392
- text: check.live ? `IndexNow key for ${host} is live: ${check.url} returns the key. Send pages with ${call("submit", { action: "indexnow" })}.` : `IndexNow key for ${host}: ${key}${saved && key === saved ? " (saved earlier)" : " (saved now)"}. Not live yet: ${check.url} ${check.problem}.\n${setupSteps(host, key, call)}`,
40394
+ text: check.live ? `IndexNow key for ${host} is live: ${check.url} returns the key. ${submit.indexNowBlocked ? sendElsewhere(submit.indexNowBlocked, [], call) : `Send pages with ${call("submit", { action: "indexnow" })}.`}` : `IndexNow key for ${host}: ${key}${saved && key === saved ? " (saved earlier)" : " (saved now)"}. Not live yet: ${check.url} ${check.problem}.\n${setupSteps(host, key, call)}`,
40393
40395
  data: {
40394
40396
  action: "indexnow_key",
40395
40397
  host,
@@ -40402,6 +40404,12 @@ async function indexNowKey(input, submit, call) {
40402
40404
  }
40403
40405
  };
40404
40406
  }
40407
+ function sendElsewhere(reason, urls, call) {
40408
+ return `${reason}. Send pages to IndexNow from your own machine with the seo CLI, free: ${!urls.length ? "seo submit <url...>" : urls.length <= 3 ? `seo submit ${urls.join(" ")}` : `seo submit --file urls.txt, with the ${n(urls.length)} URLs one per line`}. Or send them with Index My Site's Bing option, which reaches Google and Bing for 2 credits a URL: ${call("submit", {
40409
+ action: "indexmysite",
40410
+ bing: "true"
40411
+ })}.`;
40412
+ }
40405
40413
  async function indexNow(input, submit, call) {
40406
40414
  const urls = cleanUrls(input.urls, INDEXNOW_MAX_URLS);
40407
40415
  const hosts = [...new Set(urls.map((url) => new URL(url).hostname))];
@@ -40417,6 +40425,7 @@ async function indexNow(input, submit, call) {
40417
40425
  const check = await checkKeyFile(host, key, submit.fetch);
40418
40426
  if (!check.live) throw new CommandError("INVALID_INPUT", `Nothing was sent: the IndexNow key file ${check.url} is not live: it ${check.problem}. Search engines reject URLs until it is.\n${setupSteps(host, key, call)}`);
40419
40427
  if (given && given !== await submit.indexNowKey(host)) await submit.saveIndexNowKey(host, given);
40428
+ if (submit.indexNowBlocked) throw new CommandError("NO_ACCESS", `Nothing was sent. ${sendElsewhere(submit.indexNowBlocked, urls, call)}`);
40420
40429
  const result = await submitIndexNow({
40421
40430
  host,
40422
40431
  key,