@mintlify/msft-sdk 1.1.66 → 1.1.68

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.
@@ -1,65 +1,73 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { createContext as o } from "react";
3
- import { addApiReferenceDataFromMdxAndDocsConfig as P } from "../api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js";
4
- import { processSecurityOptions as u } from "../api-playground-2/schemaGraph/processSecurityOptions.js";
5
- const a = o({ pageMetadata: {} }), c = o({}), p = o({}), s = o({ apiReferenceData: {} }), C = o({
6
- apiReferenceData2: {}
3
+ import { addApiReferenceDataFromMdxAndDocsConfig as y } from "../api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js";
4
+ import { processSecurityOptions as C } from "../api-playground-2/schemaGraph/processSecurityOptions.js";
5
+ import { NEXT_PUBLIC as a } from "../env.js";
6
+ import { MINTLIFY_FILE_REQUEST_ENDPOINT_URL as x, MINTLIFY_REQUEST_ENDPOINT_URL as g } from "../constants/index.js";
7
+ const p = o({ pageMetadata: {} }), c = o({}), s = o({}), d = o({ apiReferenceData: {} }), A = o({
8
+ apiReferenceData2: {},
9
+ playgroundDisplay: "simple",
10
+ requestEndpointUrl: g,
11
+ fileRequestEndpointUrl: x
7
12
  });
8
- a.displayName = "PageContext";
13
+ p.displayName = "PageContext";
9
14
  c.displayName = "DeploymentMetadataContext";
10
- p.displayName = "DocsConfigContext";
11
- s.displayName = "ApiReferenceContext";
12
- function l({ value: e, children: t }) {
13
- return /* @__PURE__ */ n(a.Provider, { value: e, children: t });
15
+ s.displayName = "DocsConfigContext";
16
+ d.displayName = "ApiReferenceContext";
17
+ function S({ value: e, children: t }) {
18
+ return /* @__PURE__ */ n(p.Provider, { value: e, children: t });
14
19
  }
15
- function A({
20
+ function U({
16
21
  value: e,
17
22
  children: t
18
23
  }) {
19
24
  return /* @__PURE__ */ n(c.Provider, { value: e, children: t });
20
25
  }
21
- function M({
26
+ function F({
22
27
  value: e,
23
28
  children: t
24
29
  }) {
25
- return /* @__PURE__ */ n(p.Provider, { value: e, children: t });
30
+ return /* @__PURE__ */ n(s.Provider, { value: e, children: t });
26
31
  }
27
- function N({
32
+ function L({
28
33
  value: e,
29
34
  children: t
30
35
  }) {
31
- return /* @__PURE__ */ n(s.Provider, { value: e, children: t });
36
+ return /* @__PURE__ */ n(d.Provider, { value: e, children: t });
32
37
  }
33
38
  function O({
34
39
  pageMetadata: e,
35
40
  docsConfig: t,
36
- mdxExtracts: d,
37
- apiReferenceData2: f,
38
- children: m
41
+ mdxExtracts: f,
42
+ apiReferenceData2: m,
43
+ playgroundDisplay: P,
44
+ requestEndpointUrl: u = `${a.BASE_PATH}/_mintlify/api/request`,
45
+ fileRequestEndpointUrl: D = `${a.BASE_PATH}/_mintlify/api/file-request`,
46
+ children: l
39
47
  }) {
40
- const r = P({
41
- apiReferenceData2: f,
42
- mdxExtracts: d,
48
+ const r = y({
49
+ apiReferenceData2: m,
50
+ mdxExtracts: f,
43
51
  docsConfig: t,
44
52
  pageMetadata: e
45
- }), i = u(r);
53
+ }), i = C(r);
46
54
  i.length > 0 && (r.dependencies || (r.dependencies = {
47
55
  servers: {},
48
56
  security: {},
49
57
  processedSecurityOptions: []
50
58
  }), r.dependencies.processedSecurityOptions = i);
51
- const D = r;
52
- return /* @__PURE__ */ n(C.Provider, { value: { apiReferenceData2: D ?? {} }, children: m });
59
+ const R = r;
60
+ return /* @__PURE__ */ n(A.Provider, { value: { apiReferenceData2: R ?? {}, playgroundDisplay: P, requestEndpointUrl: u, fileRequestEndpointUrl: D }, children: l });
53
61
  }
54
62
  export {
55
- s as ApiReferenceContext,
56
- C as ApiReferenceContext2,
57
- N as ApiReferenceProvider,
63
+ d as ApiReferenceContext,
64
+ A as ApiReferenceContext2,
65
+ L as ApiReferenceProvider,
58
66
  O as ApiReferenceProvider2,
59
67
  c as DeploymentMetadataContext,
60
- A as DeploymentMetadataProvider,
61
- p as DocsConfigContext,
62
- M as DocsConfigProvider,
63
- a as PageContext,
64
- l as PageProvider
68
+ U as DeploymentMetadataProvider,
69
+ s as DocsConfigContext,
70
+ F as DocsConfigProvider,
71
+ p as PageContext,
72
+ S as PageProvider
65
73
  };
@@ -1,14 +1,9 @@
1
- import { useContext as n, useMemo as s } from "react";
2
- import { DocsConfigContext as m, PageContext as c, ApiReferenceContext2 as u } from "../contexts/ConfigContext.js";
3
- import { useEndpoint as l } from "./useEndpoint.js";
4
- const x = () => {
5
- const { docsConfig: e } = n(m), { pageMetadata: p } = n(c), o = l(), { apiReferenceData2: r } = n(u);
6
- let t;
7
- return r.operation ? t = r.operation.type : t = o == null ? void 0 : o.type, s(() => {
8
- var a, i;
9
- return (t === "webhook" ? "simple" : p.playground || ((i = (a = e == null ? void 0 : e.api) == null ? void 0 : a.playground) == null ? void 0 : i.display)) ?? "interactive";
10
- }, [e, p, t]);
1
+ import { useContext as e } from "react";
2
+ import { ApiReferenceContext2 as r } from "../contexts/ConfigContext.js";
3
+ const p = () => {
4
+ const { playgroundDisplay: o } = e(r);
5
+ return o;
11
6
  };
12
7
  export {
13
- x as useApiPlaygroundDisplay
8
+ p as useApiPlaygroundDisplay
14
9
  };
@@ -1,16 +1,15 @@
1
1
  import "react";
2
- import "../env.js";
3
- const i = (r, t) => Object.entries(t).reduce((e, [o, n]) => n == null ? e : e.replace(
4
- `{${o}}`,
2
+ const a = (r, t) => Object.entries(t).reduce((e, [c, n]) => n == null ? e : e.replace(
3
+ `{${c}}`,
5
4
  encodeURIComponent(n.toString())
6
- ), r), l = (r, t) => {
5
+ ), r), i = (r, t) => {
7
6
  let e = r;
8
- return Object.entries(t).forEach(([o, n]) => {
9
- n && (e = e.replace(`{${o}}`, n));
7
+ return Object.entries(t).forEach(([c, n]) => {
8
+ n && (e = e.replace(`{${c}}`, n));
10
9
  }), e;
11
- }, s = (r, t) => r.replace(/\/$/, "") + "/" + t.replace(/^\//, "");
10
+ }, l = (r, t) => r.replace(/\/$/, "") + "/" + t.replace(/^\//, "");
12
11
  export {
13
- i as addPathParams,
14
- l as addServerVariables,
15
- s as joinWithSingleSlash
12
+ a as addPathParams,
13
+ i as addServerVariables,
14
+ l as joinWithSingleSlash
16
15
  };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { ApiPlaygroundDisplayType } from '@mintlify/models';
1
2
  import { ApiPlaygroundInputs } from '@mintlify/validation';
2
3
  import { ApiPlaygroundResultType } from '@mintlify/models';
3
4
  import { AsyncAPIDocumentInterface } from '@mintlify/common';
@@ -99,7 +100,7 @@ export declare const ApiFields: NamedExoticComponent< {
99
100
  pageMetadata: PageMetaTags;
100
101
  }>;
101
102
 
102
- export declare function ApiPage({ theme, className, pathname, markdownContent, allPages, baseUrl, LinkComponent, contextMenu, apiReferenceData, pageMetadata }: ApiPageProps): JSX_2.Element;
103
+ export declare function ApiPage({ theme, className, pathname, markdownContent, allPages, baseUrl, LinkComponent, contextMenu, contextMenuEnabled, apiReferenceData, pageMetadata, playgroundDisplay, requestEndpointUrl, fileRequestEndpointUrl, }: ApiPageProps): JSX_2.Element;
103
104
 
104
105
  declare interface ApiPageProps {
105
106
  theme: 'light' | 'dark';
@@ -110,8 +111,12 @@ declare interface ApiPageProps {
110
111
  baseUrl?: string;
111
112
  LinkComponent?: LinkComponent;
112
113
  contextMenu?: PageContextMenuConfig;
114
+ contextMenuEnabled?: boolean;
113
115
  apiReferenceData?: ApiReferenceDataV2;
114
116
  pageMetadata: PageMetaTags;
117
+ playgroundDisplay?: ApiPlaygroundDisplayType;
118
+ requestEndpointUrl?: string;
119
+ fileRequestEndpointUrl?: string;
115
120
  }
116
121
 
117
122
  declare const ApiPlaygroundContext: Context<ApiPlaygroundContextType>;
@@ -134,6 +139,9 @@ export declare const ApiReferenceContext2: Context<ApiReferenceContext2Type>;
134
139
 
135
140
  export declare type ApiReferenceContext2Type = {
136
141
  apiReferenceData2: ApiReferenceDataV2;
142
+ playgroundDisplay: ApiPlaygroundDisplayType;
143
+ requestEndpointUrl: string;
144
+ fileRequestEndpointUrl: string;
137
145
  };
138
146
 
139
147
  export declare type ApiReferenceContextType = {
@@ -177,13 +185,16 @@ export declare function ApiReferenceProvider({ value, children, }: {
177
185
  children: ReactNode;
178
186
  }): JSX_2.Element;
179
187
 
180
- export declare function ApiReferenceProvider2({ pageMetadata, docsConfig, mdxExtracts, apiReferenceData2, children, }: ApiReferenceProvider2Props): JSX_2.Element;
188
+ export declare function ApiReferenceProvider2({ pageMetadata, docsConfig, mdxExtracts, apiReferenceData2, playgroundDisplay, requestEndpointUrl, fileRequestEndpointUrl, children, }: ApiReferenceProvider2Props): JSX_2.Element;
181
189
 
182
190
  export declare type ApiReferenceProvider2Props = {
183
191
  pageMetadata: PageMetaTags;
184
192
  docsConfig: DocsConfig | undefined;
185
193
  mdxExtracts: MdxExtracts_2 | undefined;
186
194
  apiReferenceData2: ApiReferenceDataV2 | undefined;
195
+ playgroundDisplay: ApiPlaygroundDisplayType;
196
+ requestEndpointUrl?: string;
197
+ fileRequestEndpointUrl?: string;
187
198
  children: ReactNode;
188
199
  };
189
200
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintlify/msft-sdk",
3
- "version": "1.1.66",
3
+ "version": "1.1.68",
4
4
  "description": "Lightweight SDK for Microsoft documentation with MDX rendering",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,15 +0,0 @@
1
- import { useMemo as n, useContext as t } from "react";
2
- import { ApiReferenceContext as o } from "../contexts/ConfigContext.js";
3
- const p = () => {
4
- const {
5
- apiReferenceData: { endpoint: e }
6
- } = t(o);
7
- return e;
8
- }, s = () => {
9
- const e = p();
10
- return n(() => e, [e]);
11
- };
12
- export {
13
- s as useEndpoint,
14
- p as useOpenApiEndpoint
15
- };