@mintlify/msft-sdk 1.1.70 → 1.1.72
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/ApiPlayground/Response/index.js +29 -28
- package/dist/api-playground-2/OperationPage.js +47 -45
- package/dist/api-playground-2/generators/generateSnippet.js +29 -27
- package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js +23 -22
- package/dist/api-playground-2/schemaGraph/utils.js +64 -63
- package/dist/components/apiPage.js +23 -23
- package/dist/components/docsPage.js +1 -1
- package/dist/httpsnippet/src/targets/http/http1.1/client.js +11 -11
- package/dist/index.d.ts +11 -0
- package/dist/styles.css +1 -1
- package/dist/utils/base64.js +23 -0
- package/package.json +1 -1
- package/dist/utils/request/isValidUrl.js +0 -10
|
@@ -2,11 +2,12 @@ import "@mintlify/validation";
|
|
|
2
2
|
import q from "@sindresorhus/slugify";
|
|
3
3
|
import { apiPlaygroundInputKeys as a, CIRCULAR_REF_KEY as A, stringFileFormats as h, combinationKeys as m, MAX_SCHEMA_COMBINATION_SIZE as $ } from "../constants/index.js";
|
|
4
4
|
import { getExampleBodyInputs as k } from "./getExampleBodyInputs.js";
|
|
5
|
-
|
|
5
|
+
import { stringToBase64 as E } from "../../utils/base64.js";
|
|
6
|
+
function z(e) {
|
|
6
7
|
return typeof e == "object" && e !== null && A in e && typeof e[A] == "string";
|
|
7
8
|
}
|
|
8
|
-
const
|
|
9
|
-
function
|
|
9
|
+
const N = () => ({ oneOf: [] }), F = () => ({ oneOf: [{}] }), b = (e) => typeof e == "object" && e !== null && !Array.isArray(e), w = (e) => c(e) && Array.isArray(e.oneOf), c = (e) => b(e) ? "type" in e || "properties" in e || "oneOf" in e || "anyOf" in e || "allOf" in e || "items" in e || "additionalProperties" in e || "enum" in e || "const" in e || "format" in e || "pattern" in e || "minimum" in e || "maximum" in e || "minLength" in e || "maxLength" in e || "minItems" in e || "maxItems" in e || "minProperties" in e || "maxProperties" in e || "required" in e || "nullable" in e || "description" in e : !1, x = (e) => c(e) && e.type === "array", M = (e) => x(e) && c(e.items) && e.items.type === "object";
|
|
10
|
+
function _(e) {
|
|
10
11
|
const t = Array.isArray(e.oneOf) ? e.oneOf.length : 1, n = Array.isArray(e.anyOf) ? e.anyOf.length : 1, i = Array.isArray(e.allOf) ? e.allOf.length : 1, r = [t, n, i];
|
|
11
12
|
return m.forEach((s) => {
|
|
12
13
|
if (e[s]) {
|
|
@@ -25,7 +26,7 @@ function w(e) {
|
|
|
25
26
|
}
|
|
26
27
|
}), r.reduce((s, f) => s * f, 1) > $;
|
|
27
28
|
}
|
|
28
|
-
const
|
|
29
|
+
const V = (e, t, n) => t[n] ?? e[n], U = (e, t, n, i) => e[n] !== void 0 && t[n] !== void 0 ? i(e[n], t[n]) : e[n] ?? t[n], X = (e) => e.oneOf && e.oneOf.length === 1 ? e.oneOf[0] : e, l = (e) => {
|
|
29
30
|
let t = { ...e };
|
|
30
31
|
if (t.properties && typeof t.properties == "object") {
|
|
31
32
|
const n = {};
|
|
@@ -43,7 +44,7 @@ const M = (e, t, n) => t[n] ?? e[n], _ = (e, t, n, i) => e[n] !== void 0 && t[n]
|
|
|
43
44
|
return t = { ...t, ...n }, delete t.oneOf, l(t);
|
|
44
45
|
}
|
|
45
46
|
return t;
|
|
46
|
-
},
|
|
47
|
+
}, H = (e) => {
|
|
47
48
|
if (e.oneOf)
|
|
48
49
|
return "oneOf";
|
|
49
50
|
if (e.enum)
|
|
@@ -58,7 +59,7 @@ const M = (e, t, n) => t[n] ?? e[n], _ = (e, t, n, i) => e[n] !== void 0 && t[n]
|
|
|
58
59
|
return e.type;
|
|
59
60
|
}
|
|
60
61
|
return e.format && h.includes(e.format) ? "file" : e.type;
|
|
61
|
-
},
|
|
62
|
+
}, W = (e) => "enum" in e && e.enum !== void 0, Y = (e) => "placeholder" in e && typeof e.placeholder == "string" ? e.placeholder : void 0, Z = (e) => e.type === "string", G = (e) => e.type === "number" || e.type === "integer", J = (e) => {
|
|
62
63
|
var n;
|
|
63
64
|
const t = {};
|
|
64
65
|
return Object.entries(((n = e.operation) == null ? void 0 : n.responses) ?? {}).forEach(([i, r]) => {
|
|
@@ -66,7 +67,7 @@ const M = (e, t, n) => t[n] ?? e[n], _ = (e, t, n, i) => e[n] !== void 0 && t[n]
|
|
|
66
67
|
const o = (f = (s = e.dependencies) == null ? void 0 : s.responses) == null ? void 0 : f[r];
|
|
67
68
|
o && o.content && (t[i] = o.content);
|
|
68
69
|
}), t;
|
|
69
|
-
},
|
|
70
|
+
}, Q = (e) => {
|
|
70
71
|
var u, p;
|
|
71
72
|
const t = (p = (u = e.dependencies) == null ? void 0 : u.requestBody) == null ? void 0 : p.content;
|
|
72
73
|
if (t === void 0)
|
|
@@ -90,7 +91,7 @@ const M = (e, t, n) => t[n] ?? e[n], _ = (e, t, n, i) => e[n] !== void 0 && t[n]
|
|
|
90
91
|
f.push(g);
|
|
91
92
|
}
|
|
92
93
|
return f;
|
|
93
|
-
},
|
|
94
|
+
}, ee = (e) => {
|
|
94
95
|
var n;
|
|
95
96
|
const t = (n = e.dependencies) == null ? void 0 : n.parameters;
|
|
96
97
|
if (t) {
|
|
@@ -105,11 +106,11 @@ const M = (e, t, n) => t[n] ?? e[n], _ = (e, t, n, i) => e[n] !== void 0 && t[n]
|
|
|
105
106
|
};
|
|
106
107
|
}
|
|
107
108
|
return { header: [], path: [], query: [], cookie: [] };
|
|
108
|
-
},
|
|
109
|
+
}, C = (e) => {
|
|
109
110
|
let t;
|
|
110
111
|
if (e)
|
|
111
112
|
return typeof e == "object" && "default" in e && (t = e.default), typeof e == "object" && "x-default" in e && (t = e["x-default"]), t;
|
|
112
|
-
},
|
|
113
|
+
}, te = () => ({
|
|
113
114
|
oneOf: [
|
|
114
115
|
{
|
|
115
116
|
type: "string"
|
|
@@ -141,11 +142,11 @@ const M = (e, t, n) => t[n] ?? e[n], _ = (e, t, n, i) => e[n] !== void 0 && t[n]
|
|
|
141
142
|
type: "null"
|
|
142
143
|
}
|
|
143
144
|
]
|
|
144
|
-
}),
|
|
145
|
+
}), ne = (e, t) => {
|
|
145
146
|
var r, o;
|
|
146
147
|
const n = (o = (r = e.dependencies) == null ? void 0 : r.requestBody) == null ? void 0 : o.content;
|
|
147
148
|
return n === void 0 ? void 0 : Object.keys(n)[t];
|
|
148
|
-
},
|
|
149
|
+
}, B = (e) => e.replace(/\./g, "\\."), I = (e) => {
|
|
149
150
|
switch (e) {
|
|
150
151
|
case "header":
|
|
151
152
|
return a.header;
|
|
@@ -158,7 +159,7 @@ const M = (e, t, n) => t[n] ?? e[n], _ = (e, t, n, i) => e[n] !== void 0 && t[n]
|
|
|
158
159
|
default:
|
|
159
160
|
return a.header;
|
|
160
161
|
}
|
|
161
|
-
},
|
|
162
|
+
}, re = (e) => {
|
|
162
163
|
const t = {
|
|
163
164
|
server: {},
|
|
164
165
|
header: {},
|
|
@@ -176,13 +177,13 @@ const M = (e, t, n) => t[n] ?? e[n], _ = (e, t, n, i) => e[n] !== void 0 && t[n]
|
|
|
176
177
|
return;
|
|
177
178
|
}
|
|
178
179
|
const [o, ...s] = r, f = Object.values(a);
|
|
179
|
-
!o || !f.includes(o) || (o !== a.body ?
|
|
180
|
+
!o || !f.includes(o) || (o !== a.body ? P(
|
|
180
181
|
t[o],
|
|
181
182
|
[...s],
|
|
182
183
|
i
|
|
183
|
-
) : [...s].length === 0 ? t.body = i : ((t.body === void 0 || typeof t.body != "object") && (t.body = {}),
|
|
184
|
+
) : [...s].length === 0 ? t.body = i : ((t.body === void 0 || typeof t.body != "object") && (t.body = {}), P(t.body, s, i)));
|
|
184
185
|
}), O(t);
|
|
185
|
-
},
|
|
186
|
+
}, T = (e) => {
|
|
186
187
|
if (!b(e))
|
|
187
188
|
return !1;
|
|
188
189
|
const t = Object.keys(e);
|
|
@@ -193,7 +194,7 @@ const M = (e, t, n) => t[n] ?? e[n], _ = (e, t, n, i) => e[n] !== void 0 && t[n]
|
|
|
193
194
|
if (Array.isArray(e))
|
|
194
195
|
return e.map(O);
|
|
195
196
|
if (b(e)) {
|
|
196
|
-
if (
|
|
197
|
+
if (T(e))
|
|
197
198
|
return Object.keys(e).sort((r, o) => Number(r) - Number(o)).map((r) => e[r]).map(O);
|
|
198
199
|
const t = {};
|
|
199
200
|
for (const [n, i] of Object.entries(e))
|
|
@@ -201,7 +202,7 @@ const M = (e, t, n) => t[n] ?? e[n], _ = (e, t, n, i) => e[n] !== void 0 && t[n]
|
|
|
201
202
|
return t;
|
|
202
203
|
}
|
|
203
204
|
return e;
|
|
204
|
-
},
|
|
205
|
+
}, P = (e, t, n) => {
|
|
205
206
|
const i = [];
|
|
206
207
|
for (let o = 0; o < t.length; o++) {
|
|
207
208
|
const s = t[o];
|
|
@@ -216,10 +217,10 @@ const M = (e, t, n) => t[n] ?? e[n], _ = (e, t, n, i) => e[n] !== void 0 && t[n]
|
|
|
216
217
|
const s = i[o];
|
|
217
218
|
o === i.length - 1 ? s && (r[s] = n) : (s && (!r[s] || typeof r[s] != "object") && (r[s] = {}), s && (r = r[s]));
|
|
218
219
|
}
|
|
219
|
-
},
|
|
220
|
+
}, ie = (e) => e.filter((n) => "enum" in n && n.enum && "const" in n ? n.enum.includes(n.const) : !0), d = (e) => {
|
|
220
221
|
const t = {};
|
|
221
222
|
if ("uniqueKey" in e && e.uniqueKey !== void 0) {
|
|
222
|
-
const n =
|
|
223
|
+
const n = C(e);
|
|
223
224
|
if (n !== void 0) {
|
|
224
225
|
let i = `${a.body}.${e.uniqueKey}`;
|
|
225
226
|
i = i.replace(/\[INDEX\]/g, "0"), t[i] = n;
|
|
@@ -244,68 +245,68 @@ const M = (e, t, n) => t[n] ?? e[n], _ = (e, t, n, i) => e[n] !== void 0 && t[n]
|
|
|
244
245
|
Object.assign(t, n);
|
|
245
246
|
}
|
|
246
247
|
return t;
|
|
247
|
-
},
|
|
248
|
+
}, oe = (e) => {
|
|
248
249
|
var r;
|
|
249
250
|
const t = "schemes" in e ? (r = e.schemes[0]) == null ? void 0 : r.scheme : e.scheme;
|
|
250
251
|
if (!t) return "header.Authorization";
|
|
251
|
-
const n = "in" in t ? t.in : "header", i = "name" in t ? t.name :
|
|
252
|
-
return `${
|
|
253
|
-
},
|
|
252
|
+
const n = "in" in t ? t.in : "header", i = "name" in t ? t.name : j(t);
|
|
253
|
+
return `${I(n)}.${B(i)}`;
|
|
254
|
+
}, se = (e) => e && "type" in e && e.type === "http" && e.scheme === "basic", j = (e) => e && "type" in e && e.type === "apiKey" ? e.name : "Authorization", ue = (e, t) => E(`${e ?? ""}:${t ?? ""}`), S = (e) => {
|
|
254
255
|
const t = e.typeLabel, n = "type" in e && typeof e.type == "string" ? e.type : void 0;
|
|
255
256
|
return t ?? n ?? "unknown";
|
|
256
|
-
},
|
|
257
|
+
}, fe = (e) => {
|
|
257
258
|
if (e.length <= 1)
|
|
258
|
-
return e.map((r) =>
|
|
259
|
-
const t = e.every((r) => r.type === "object"), n = e.map((r) =>
|
|
259
|
+
return e.map((r) => S(r));
|
|
260
|
+
const t = e.every((r) => r.type === "object"), n = e.map((r) => S(r));
|
|
260
261
|
return t ? e.map((r, o) => r.title ?? `Option ${o + 1}`) : new Set(n).size === n.length ? n : n.map(
|
|
261
262
|
(r, o) => {
|
|
262
263
|
var s;
|
|
263
264
|
return (((s = e[o]) == null ? void 0 : s.title) ?? `Option ${o + 1}`) + " · " + r;
|
|
264
265
|
}
|
|
265
266
|
);
|
|
266
|
-
},
|
|
267
|
+
}, ce = (e, t, n, i) => q(
|
|
267
268
|
`${e ? `${e}-` : ""}${n ? `${n}-` : ""}${t || ""}-`,
|
|
268
269
|
{
|
|
269
270
|
decamelize: !0
|
|
270
271
|
}
|
|
271
|
-
),
|
|
272
|
+
), ae = (e, t) => e ? `${t ? `${t}` : ""}${e}.` : "", pe = (e, t) => e ? t ? `${t}${e}][` : `${e}[` : "";
|
|
272
273
|
export {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
274
|
+
ce as buildRecursiveParamFieldId,
|
|
275
|
+
U as combine,
|
|
276
|
+
te as convertAnySchemaToOneOfs,
|
|
277
|
+
N as createEmptyReducedSchema,
|
|
278
|
+
F as createUnknownReducedSchema,
|
|
279
|
+
ue as encodeBasicAuth,
|
|
280
|
+
B as escapeDots,
|
|
281
|
+
ie as filterSchemasWithConsts,
|
|
281
282
|
l as flattenSchemaOneOfs,
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
283
|
+
X as flattenSingleOneOf,
|
|
284
|
+
fe as generateSchemaOptionLabels,
|
|
285
|
+
S as generateSimpleSchemaLabel,
|
|
285
286
|
d as getBodyDefaultsFromSchema,
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
287
|
+
pe as getDeepObjectParentName,
|
|
288
|
+
H as getDifferentiatedType,
|
|
289
|
+
ee as getParametersPerSection,
|
|
290
|
+
Q as getPrefillRequestExamples,
|
|
291
|
+
ae as getRecursiveParentName,
|
|
292
|
+
ne as getRequestBodyContentType,
|
|
293
|
+
C as getSchemaDefault,
|
|
294
|
+
Y as getSchemaPlaceholder,
|
|
295
|
+
oe as getSecurityOptionInputKeyPrefix,
|
|
296
|
+
j as getSecuritySchemeName,
|
|
297
|
+
x as isArrayObject,
|
|
298
|
+
se as isBasicAuth,
|
|
299
|
+
z as isCircularRef,
|
|
300
|
+
W as isEnum,
|
|
301
|
+
G as isNumberSchema,
|
|
302
|
+
M as isObjectArray,
|
|
302
303
|
b as isPlainRecord,
|
|
303
|
-
|
|
304
|
+
w as isReducedSchema,
|
|
304
305
|
c as isSchemaObject,
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
306
|
+
Z as isStringSchema,
|
|
307
|
+
I as mapParamInToPlaygroundInputKey,
|
|
308
|
+
J as mapResponseExamples,
|
|
309
|
+
_ as shouldTruncateForSize,
|
|
310
|
+
V as takeLast,
|
|
311
|
+
re as unflattenInputs
|
|
311
312
|
};
|
|
@@ -10,28 +10,28 @@ import { Api as S } from "../api-playground-2/Api.js";
|
|
|
10
10
|
import { PageProvider as A, ApiReferenceProvider2 as B } from "../contexts/ConfigContext.js";
|
|
11
11
|
import { MINTLIFY_FILE_REQUEST_ENDPOINT_URL as U, MINTLIFY_REQUEST_ENDPOINT_URL as j } from "../constants/index.js";
|
|
12
12
|
function $({
|
|
13
|
-
theme:
|
|
14
|
-
className:
|
|
13
|
+
theme: f,
|
|
14
|
+
className: h = "",
|
|
15
15
|
pathname: r,
|
|
16
|
-
markdownContent:
|
|
17
|
-
allPages:
|
|
18
|
-
baseUrl:
|
|
16
|
+
markdownContent: b,
|
|
17
|
+
allPages: p,
|
|
18
|
+
baseUrl: w,
|
|
19
19
|
LinkComponent: g,
|
|
20
20
|
contextMenu: i,
|
|
21
|
-
contextMenuEnabled:
|
|
21
|
+
contextMenuEnabled: x = !0,
|
|
22
22
|
apiReferenceData: l,
|
|
23
23
|
pageMetadata: n,
|
|
24
|
-
playgroundDisplay:
|
|
25
|
-
requestEndpointUrl:
|
|
24
|
+
playgroundDisplay: s = "simple",
|
|
25
|
+
requestEndpointUrl: u = j,
|
|
26
26
|
fileRequestEndpointUrl: v = U
|
|
27
27
|
}) {
|
|
28
28
|
return P(() => {
|
|
29
|
-
const { hash:
|
|
30
|
-
if (!
|
|
29
|
+
const { hash: c } = window.location;
|
|
30
|
+
if (!c) return;
|
|
31
31
|
const k = setTimeout(() => {
|
|
32
|
-
const N =
|
|
33
|
-
if (e &&
|
|
34
|
-
const
|
|
32
|
+
const N = c.substring(1), e = document.getElementById("main-content"), d = document.getElementById(N);
|
|
33
|
+
if (e && d) {
|
|
34
|
+
const a = window.getComputedStyle(document.documentElement), E = parseFloat(a.getPropertyValue("--scroll-mt") || "0"), T = parseFloat(a.fontSize), I = E * T, y = e.getBoundingClientRect(), C = d.getBoundingClientRect().top - y.top + e.scrollTop - I;
|
|
35
35
|
e.scrollTo({
|
|
36
36
|
top: C,
|
|
37
37
|
behavior: "instant"
|
|
@@ -44,8 +44,8 @@ function $({
|
|
|
44
44
|
{
|
|
45
45
|
className: o(
|
|
46
46
|
"mintlify-docs",
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
f === "dark" && "dark",
|
|
48
|
+
h,
|
|
49
49
|
"mint:flex mint:flex-col mint:flex-1 mint:min-h-0 mint:h-full mint:overflow-hidden"
|
|
50
50
|
),
|
|
51
51
|
children: /* @__PURE__ */ t(
|
|
@@ -71,12 +71,12 @@ function $({
|
|
|
71
71
|
}, children: /* @__PURE__ */ t(
|
|
72
72
|
B,
|
|
73
73
|
{
|
|
74
|
-
playgroundDisplay:
|
|
74
|
+
playgroundDisplay: s,
|
|
75
75
|
pageMetadata: n,
|
|
76
76
|
docsConfig: void 0,
|
|
77
77
|
mdxExtracts: void 0,
|
|
78
78
|
apiReferenceData2: l,
|
|
79
|
-
requestEndpointUrl:
|
|
79
|
+
requestEndpointUrl: u,
|
|
80
80
|
fileRequestEndpointUrl: v,
|
|
81
81
|
children: /* @__PURE__ */ m(
|
|
82
82
|
"div",
|
|
@@ -87,8 +87,8 @@ function $({
|
|
|
87
87
|
(l == null ? void 0 : l.operation) && /* @__PURE__ */ t(
|
|
88
88
|
"div",
|
|
89
89
|
{
|
|
90
|
-
className: "mint:self-start mint:sticky mint:flex-col mint:w-[448px] mint:top-4 mint:gap-6 mint:hidden mint:
|
|
91
|
-
children: /* @__PURE__ */ t(_, { noInputs:
|
|
90
|
+
className: "mint:self-start mint:sticky mint:flex-col mint:w-[448px] mint:top-4 mint:gap-6 mint:hidden mint:xl:flex",
|
|
91
|
+
children: /* @__PURE__ */ t(_, { noInputs: s === "simple" })
|
|
92
92
|
}
|
|
93
93
|
),
|
|
94
94
|
/* @__PURE__ */ m(
|
|
@@ -103,14 +103,14 @@ function $({
|
|
|
103
103
|
/* @__PURE__ */ t("h1", { className: "mint:text-[1.875rem] mint:font-bold mint:text-[#141414] mint:dark:text-white mint:m-0 mint:leading-[1.2] mint:pt-3", children: n.title }),
|
|
104
104
|
n.description && /* @__PURE__ */ t("p", { className: "mint:text-lg mint:text-[#4b5563] mint:dark:text-[#d1d5db] mint:m-0", children: n.description })
|
|
105
105
|
] }),
|
|
106
|
-
r &&
|
|
106
|
+
r && x && /* @__PURE__ */ t(
|
|
107
107
|
L,
|
|
108
108
|
{
|
|
109
109
|
className: "mint:shrink-0",
|
|
110
110
|
pathname: r,
|
|
111
|
-
markdownContent:
|
|
112
|
-
allPages:
|
|
113
|
-
baseUrl:
|
|
111
|
+
markdownContent: b,
|
|
112
|
+
allPages: p,
|
|
113
|
+
baseUrl: w,
|
|
114
114
|
onCopyMarkdown: i == null ? void 0 : i.onCopyMarkdown,
|
|
115
115
|
onViewMarkdown: i == null ? void 0 : i.onViewMarkdown
|
|
116
116
|
}
|
|
@@ -85,7 +85,7 @@ function dt({
|
|
|
85
85
|
className: "mint:flex mint:flex-row-reverse mint:gap-12 mint:justify-center mint:mx-auto mint:w-full",
|
|
86
86
|
id: "content-layout-container",
|
|
87
87
|
children: [
|
|
88
|
-
r != null && r.operation ? /* @__PURE__ */ t("aside", { className: "mint:w-[448px] mint:shrink-0 mint:ml-8 mint:hidden mint:
|
|
88
|
+
r != null && r.operation ? /* @__PURE__ */ t("aside", { className: "mint:w-[448px] mint:shrink-0 mint:ml-8 mint:hidden mint:xl:block", children: /* @__PURE__ */ t("div", { className: "mint:sticky mint:top-4 mint:flex mint:flex-col mint:gap-6", children: /* @__PURE__ */ t(
|
|
89
89
|
Z,
|
|
90
90
|
{
|
|
91
91
|
pageMetadata: { title: i.title, description: i.description },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CodeBuilder as m } from "../../../helpers/code-builder.js";
|
|
2
2
|
const i = `\r
|
|
3
|
-
`,
|
|
3
|
+
`, L = {
|
|
4
4
|
info: {
|
|
5
5
|
key: "http1.1",
|
|
6
6
|
title: "HTTP/1.1",
|
|
@@ -8,27 +8,27 @@ const i = `\r
|
|
|
8
8
|
description: "HTTP/1.1 request string in accordance with RFC 7230",
|
|
9
9
|
extname: null
|
|
10
10
|
},
|
|
11
|
-
convert: ({ method: h, fullUrl:
|
|
11
|
+
convert: ({ method: h, fullUrl: l, uriObj: c, httpVersion: a, allHeaders: r, postData: n }, u) => {
|
|
12
12
|
const o = {
|
|
13
13
|
absoluteURI: !1,
|
|
14
14
|
autoContentLength: !0,
|
|
15
15
|
autoHost: !0,
|
|
16
16
|
...u
|
|
17
|
-
}, { blank:
|
|
18
|
-
t(`${h} ${
|
|
17
|
+
}, { blank: d, push: t, join: g } = new m({ indent: "", join: i }), p = o.absoluteURI ? l : c.path;
|
|
18
|
+
t(`${h} ${p} ${a}`);
|
|
19
19
|
const s = Object.keys(r);
|
|
20
20
|
if (s.forEach((e) => {
|
|
21
|
-
const
|
|
22
|
-
t(`${
|
|
21
|
+
const f = e.toLowerCase().replace(/(^|-)(\w)/g, (x) => x.toUpperCase());
|
|
22
|
+
t(`${f}: ${r[e]}`);
|
|
23
23
|
}), o.autoHost && !s.includes("host") && t(`Host: ${c.host}`), o.autoContentLength && n.text && !s.includes("content-length")) {
|
|
24
|
-
const e =
|
|
24
|
+
const e = new TextEncoder().encode(n.text).length.toString();
|
|
25
25
|
t(`Content-Length: ${e}`);
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
return `${
|
|
27
|
+
d();
|
|
28
|
+
const $ = g(), C = n.text || "";
|
|
29
|
+
return `${$}${i}${C}`;
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
L as http11
|
|
34
34
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { Element as Element_2 } from 'hast';
|
|
|
16
16
|
import { Endpoint } from '@mintlify/validation';
|
|
17
17
|
import { GitSource } from '@mintlify/validation';
|
|
18
18
|
import { Handle } from 'hast-util-to-mdast';
|
|
19
|
+
import { HttpMethod } from '@mintlify/validation';
|
|
19
20
|
import { IncrementalDataSchemaArray } from '@mintlify/validation';
|
|
20
21
|
import { InkeepType } from '@mintlify/models';
|
|
21
22
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
@@ -937,6 +938,16 @@ export declare function remarkHeadingIds(): (tree: Root) => void;
|
|
|
937
938
|
|
|
938
939
|
export declare function removeHtmlComments(root: Root_2): void;
|
|
939
940
|
|
|
941
|
+
declare type RequestInfo_2 = {
|
|
942
|
+
method: HttpMethod;
|
|
943
|
+
url: string;
|
|
944
|
+
header: Record<string, unknown>;
|
|
945
|
+
query: Record<string, unknown>;
|
|
946
|
+
cookie: Record<string, unknown>;
|
|
947
|
+
body: unknown;
|
|
948
|
+
};
|
|
949
|
+
export { RequestInfo_2 as RequestInfo }
|
|
950
|
+
|
|
940
951
|
declare type ResolvedRequestBody = RequestBodyObject & {
|
|
941
952
|
exampleType?: 'generated' | 'examples';
|
|
942
953
|
};
|