@mintlify/common 1.0.1295 → 1.0.1296

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.
@@ -9,3 +9,8 @@ export type DisplayDomainDeployment = {
9
9
  };
10
10
  };
11
11
  export declare function getDisplayDomain(deployment: DisplayDomainDeployment, isDev?: boolean, appendBasePath?: boolean): string;
12
+ export declare function getMarkdownLinkDomain(deployment: DisplayDomainDeployment & {
13
+ preview?: unknown;
14
+ }, requestedHost?: string, { selfHosted }?: {
15
+ selfHosted?: boolean;
16
+ }): string | undefined;
@@ -39,3 +39,18 @@ export function getDisplayDomain(deployment, isDev = false, appendBasePath = tru
39
39
  const displayDomainBase = (_d = (_c = deployment.customDomains) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : `${subdomain}.${getSubdomain(deployment)}`;
40
40
  return displayDomainBase + (appendBasePath ? deployment.basePath : '');
41
41
  }
42
+ export function getMarkdownLinkDomain(deployment, requestedHost, { selfHosted = false } = {}) {
43
+ var _a, _b;
44
+ if (deployment.preview || selfHosted)
45
+ return undefined;
46
+ const host = requestedHost === null || requestedHost === void 0 ? void 0 : requestedHost.toLowerCase();
47
+ const requestedCustomDomain = host === undefined
48
+ ? undefined
49
+ : (_a = deployment.customDomains) === null || _a === void 0 ? void 0 : _a.find((domain) => domain.toLowerCase() === host);
50
+ if (requestedCustomDomain !== undefined) {
51
+ return requestedCustomDomain + deployment.basePath;
52
+ }
53
+ if (!((_b = deployment.customDomains) === null || _b === void 0 ? void 0 : _b.length) && deployment.basePath)
54
+ return undefined;
55
+ return getDisplayDomain(deployment);
56
+ }