@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.
- package/dist/api-playground-2/ApiExamples.js +19 -21
- package/dist/api-playground-2/components/Example/GeneratedRequestExample.js +104 -105
- package/dist/api-playground-2/components/Example/RequestExample.js +37 -37
- package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js +98 -98
- package/dist/components/apiPage.js +57 -54
- package/dist/components/docsPage.js +38 -39
- package/dist/constants/index.js +5 -2
- package/dist/contexts/ConfigContext.js +39 -31
- package/dist/hooks/useApiPlaygroundDisplay.js +6 -11
- package/dist/hooks/useSendPlaygroundRequest.js +9 -10
- package/dist/index.d.ts +13 -2
- package/package.json +1 -1
- package/dist/hooks/useEndpoint.js +0 -15
|
@@ -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
|
|
4
|
-
import { processSecurityOptions as
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
13
|
+
p.displayName = "PageContext";
|
|
9
14
|
c.displayName = "DeploymentMetadataContext";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function
|
|
13
|
-
return /* @__PURE__ */ n(
|
|
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
|
|
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
|
|
26
|
+
function F({
|
|
22
27
|
value: e,
|
|
23
28
|
children: t
|
|
24
29
|
}) {
|
|
25
|
-
return /* @__PURE__ */ n(
|
|
30
|
+
return /* @__PURE__ */ n(s.Provider, { value: e, children: t });
|
|
26
31
|
}
|
|
27
|
-
function
|
|
32
|
+
function L({
|
|
28
33
|
value: e,
|
|
29
34
|
children: t
|
|
30
35
|
}) {
|
|
31
|
-
return /* @__PURE__ */ n(
|
|
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:
|
|
37
|
-
apiReferenceData2:
|
|
38
|
-
|
|
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 =
|
|
41
|
-
apiReferenceData2:
|
|
42
|
-
mdxExtracts:
|
|
48
|
+
const r = y({
|
|
49
|
+
apiReferenceData2: m,
|
|
50
|
+
mdxExtracts: f,
|
|
43
51
|
docsConfig: t,
|
|
44
52
|
pageMetadata: e
|
|
45
|
-
}), i =
|
|
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
|
|
52
|
-
return /* @__PURE__ */ n(
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
63
|
+
d as ApiReferenceContext,
|
|
64
|
+
A as ApiReferenceContext2,
|
|
65
|
+
L as ApiReferenceProvider,
|
|
58
66
|
O as ApiReferenceProvider2,
|
|
59
67
|
c as DeploymentMetadataContext,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
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
|
-
|
|
8
|
+
p as useApiPlaygroundDisplay
|
|
14
9
|
};
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import "react";
|
|
2
|
-
|
|
3
|
-
|
|
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),
|
|
5
|
+
), r), i = (r, t) => {
|
|
7
6
|
let e = r;
|
|
8
|
-
return Object.entries(t).forEach(([
|
|
9
|
-
n && (e = e.replace(`{${
|
|
7
|
+
return Object.entries(t).forEach(([c, n]) => {
|
|
8
|
+
n && (e = e.replace(`{${c}}`, n));
|
|
10
9
|
}), e;
|
|
11
|
-
},
|
|
10
|
+
}, l = (r, t) => r.replace(/\/$/, "") + "/" + t.replace(/^\//, "");
|
|
12
11
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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,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
|
-
};
|