@contentrain/types 1.63.0 → 1.63.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.mts CHANGED
@@ -2570,7 +2570,7 @@ interface ProjectPlan {
2570
2570
  decisions?: PlanDecisionRecord[];
2571
2571
  }
2572
2572
  interface PlanSource {
2573
- /** The WordPress origin, `https://example.com`. */
2573
+ /** The WordPress origin, `https://example.com`, or a sub-directory install's, `https://example.com/blog` (no trailing slash). */
2574
2574
  origin: string;
2575
2575
  builder: 'gutenberg' | 'elementor' | 'divi' | 'classic';
2576
2576
  /** Hash of the fact pack the plan was made from; a plan is only valid for those facts. */
package/dist/index.mjs CHANGED
@@ -1332,7 +1332,7 @@ function validateProjectPlan(plan) {
1332
1332
  const errors = [];
1333
1333
  const warnings = [];
1334
1334
  if (plan.format !== "contentrain-project-plan@1") errors.push(`format is not ${PROJECT_PLAN_FORMAT}`);
1335
- if (!/^https?:\/\/[^/]+$/.test(plan.source?.origin ?? "")) errors.push("source.origin is not an http(s) origin without a path");
1335
+ if (!/^https?:\/\/[^/?#\s]+(?:\/[^/?#\s]+)*$/.test(plan.source?.origin ?? "")) errors.push("source.origin is not an http(s) origin (a sub-directory is allowed; no trailing slash, query or fragment)");
1336
1336
  const site = plan.site;
1337
1337
  for (const [key, value] of Object.entries(site?.permalinks ?? {})) {
1338
1338
  if (!PERMALINK.test(value)) errors.push(`site.permalinks.${key} must start and end with "/" (${value})`);