@mintlify/validation 0.1.906 → 0.1.908

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.
@@ -13,6 +13,14 @@ const DASHBOARD_ALLOWED_NEXT_PATH_PREFIXES = ['/api/slack/connect'];
13
13
  const SAFE_PATH_SEGMENT = /^[A-Za-z0-9_-]+$/;
14
14
  const PROJECT_NEXT_PATH_PATTERN = /^\/[^/?#]+\/[^/?#]+(?:\/~(?:\/[^?#]+)?|\/editor(?:\/[^/?#]+(?:\/~(?:\/[^?#]+)?)?)?|\/activity)?$/;
15
15
  const MAX_NEXT_DEPTH = 4;
16
+ const PROJECT_SECTION_NEXT_PATHS = ['settings', 'analytics', 'products'];
17
+ function isProjectSectionNextPath(pathname) {
18
+ const [org, project, section, ...rest] = pathname.split('/').slice(1);
19
+ if (!org || !project || !section || org === 'api')
20
+ return false;
21
+ return (PROJECT_SECTION_NEXT_PATHS.includes(section) &&
22
+ rest.every((segment) => SAFE_PATH_SEGMENT.test(segment)));
23
+ }
16
24
  export const validateDashboardRedirect = (next) => {
17
25
  try {
18
26
  const baseUrl = 'https://example.com';
@@ -25,7 +33,8 @@ export const validateDashboardRedirect = (next) => {
25
33
  SAFE_PATH_SEGMENT.test(url.pathname.slice(prefix.length + 1)));
26
34
  if (!DASHBOARD_ALLOWED_NEXT_PATHS.includes(url.pathname) &&
27
35
  !hasAllowedChild &&
28
- !PROJECT_NEXT_PATH_PATTERN.test(url.pathname))
36
+ !PROJECT_NEXT_PATH_PATTERN.test(url.pathname) &&
37
+ !isProjectSectionNextPath(url.pathname))
29
38
  return false;
30
39
  if (url.pathname !== '/onboarding')
31
40
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/validation",
3
- "version": "0.1.906",
3
+ "version": "0.1.908",
4
4
  "description": "Validates mint.json files",
5
5
  "author": "Mintlify, Inc.",
6
6
  "bugs": {
@@ -67,5 +67,5 @@
67
67
  "typescript": "5.5.3",
68
68
  "vitest": "2.1.9"
69
69
  },
70
- "gitHead": "8042c866870011e49ee01f15b970df6c066e37e8"
70
+ "gitHead": "9add025b49af08530fbe17dbe32b067a896ba559"
71
71
  }