@stainless-api/docs-ui 0.1.0-beta.72 → 0.1.0-beta.74
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/{chunk-BN_g-Awi.js → chunk-BYypO7fO.js} +3 -3
- package/dist/components/MaskedInput.d.ts +1 -1
- package/dist/components/MaskedInput.js +1 -1
- package/dist/components/breadcrumbs.d.ts +24 -1
- package/dist/components/breadcrumbs.js +62 -7
- package/dist/components/icons.d.ts +12 -12
- package/dist/components/icons.js +883 -1
- package/dist/components/index.d.ts +16 -14
- package/dist/components/index.js +72 -18
- package/dist/components/method.d.ts +58 -1
- package/dist/components/method.js +95 -8
- package/dist/components/overview.d.ts +38 -1
- package/dist/components/overview.js +137 -9
- package/dist/components/primitives.d.ts +104 -1
- package/dist/components/primitives.js +250 -6
- package/dist/components/properties.d.ts +53 -1
- package/dist/components/properties.js +138 -7
- package/dist/components/sdk-sidebar.d.ts +14 -1
- package/dist/components/sdk-sidebar.js +50 -8
- package/dist/components/sdk.d.ts +121 -1
- package/dist/components/sdk.js +404 -8
- package/dist/components/snippets.d.ts +70 -13
- package/dist/components/snippets.js +182 -7
- package/dist/components/stl-sidebar.d.ts +57 -1
- package/dist/components/stl-sidebar.js +105 -3
- package/dist/contexts/component-generics.d.ts +29 -1
- package/dist/contexts/component-generics.js +31 -1
- package/dist/contexts/component-types.d.ts +4 -15
- package/dist/contexts/component.d.ts +7 -17
- package/dist/contexts/component.js +22 -28
- package/dist/contexts/docs.d.ts +61 -1
- package/dist/contexts/docs.js +89 -1
- package/dist/contexts/index.d.ts +13 -14
- package/dist/contexts/index.js +44 -6
- package/dist/contexts/markdown.d.ts +21 -1
- package/dist/contexts/markdown.js +47 -2
- package/dist/contexts/navigation.d.ts +28 -1
- package/dist/contexts/navigation.js +22 -1
- package/dist/contexts/use-components.d.ts +1 -13
- package/dist/contexts/use-components.js +6 -2
- package/dist/{index-W4Td2Hl7.d.ts → index-PdnFhQF9.d.ts} +1 -1
- package/dist/index.d.ts +4 -14
- package/dist/index.js +7 -30
- package/dist/languages/cli.d.ts +38 -14
- package/dist/languages/cli.js +166 -20
- package/dist/languages/csharp.d.ts +42 -14
- package/dist/languages/csharp.js +283 -8
- package/dist/languages/go.d.ts +40 -14
- package/dist/languages/go.js +303 -8
- package/dist/languages/http.d.ts +46 -14
- package/dist/languages/http.js +390 -19
- package/dist/languages/index.d.ts +50 -14
- package/dist/languages/index.js +30 -28
- package/dist/languages/java.d.ts +43 -14
- package/dist/languages/java.js +403 -8
- package/dist/languages/python.d.ts +40 -14
- package/dist/languages/python.js +269 -8
- package/dist/languages/ruby.d.ts +40 -14
- package/dist/languages/ruby.js +387 -8
- package/dist/languages/terraform.d.ts +48 -14
- package/dist/languages/terraform.js +243 -8
- package/dist/languages/typescript.d.ts +40 -14
- package/dist/languages/typescript.js +449 -8
- package/dist/markdown/index.d.ts +1 -2
- package/dist/markdown/index.js +1 -28
- package/dist/markdown/printer.d.ts +2 -2
- package/dist/markdown/printer.js +6 -30
- package/dist/markdown/utils.d.ts +3 -3
- package/dist/routing.d.ts +61 -2
- package/dist/routing.js +204 -2
- package/dist/spec.d.ts +4 -4
- package/dist/spec.js +2 -2
- package/dist/style.js +176 -1
- package/dist/use-strict-context-L0c8JKg4.js +16 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +53 -2
- package/package.json +3 -3
- package/dist/breadcrumbs-46Qjx1Pd.d.ts +0 -25
- package/dist/breadcrumbs-BZ4wBC9-.d.ts +0 -25
- package/dist/breadcrumbs-BiBfNqBI.js +0 -63
- package/dist/cli-hduQ5XS1.js +0 -166
- package/dist/component-BU8BTbqz.js +0 -23
- package/dist/component-generics-Bw4ZOyEG.d.ts +0 -30
- package/dist/component-generics-D-WarFUb.d.ts +0 -30
- package/dist/component-generics-POFirVVb.js +0 -45
- package/dist/components-9NMl1791.js +0 -72
- package/dist/contexts-_NNW5yqC.js +0 -44
- package/dist/csharp-sn5CJu9t.js +0 -283
- package/dist/docs-Cu9Yl6-y.d.ts +0 -66
- package/dist/docs-YgoQ3bzY.js +0 -81
- package/dist/docs-xb5wYGjM.d.ts +0 -66
- package/dist/go-BoaAVmP0.js +0 -303
- package/dist/http-B3qTyMc3.js +0 -389
- package/dist/icons-BYKn5X8E.js +0 -885
- package/dist/index-BOmn7DHa.d.ts +0 -428
- package/dist/index-BvcPmB0r.d.ts +0 -428
- package/dist/java-BiLRuLuD.js +0 -403
- package/dist/languages-vUhD5Hu_.js +0 -30
- package/dist/markdown-BszOPZhh.d.ts +0 -22
- package/dist/markdown-Cq3XEhrR.js +0 -49
- package/dist/markdown-plMAoN22.d.ts +0 -22
- package/dist/method-C4PgTWAu.d.ts +0 -59
- package/dist/method-D6R_farj.d.ts +0 -59
- package/dist/method-DjzVBzZe.js +0 -96
- package/dist/navigation-HiZWRl34.d.ts +0 -29
- package/dist/navigation-MrP4Ubbg.d.ts +0 -29
- package/dist/navigation-aoYZ_tl4.js +0 -24
- package/dist/overview-CTeKhpQq.d.ts +0 -39
- package/dist/overview-Yf1PTJNi.d.ts +0 -39
- package/dist/overview-ocTARt-j.js +0 -138
- package/dist/primitives-CNG-fEhQ.js +0 -250
- package/dist/primitives-K7NijV36.d.ts +0 -105
- package/dist/primitives-WGxdBJDS.d.ts +0 -105
- package/dist/properties-Bu4nW9JD.d.ts +0 -54
- package/dist/properties-Bynmj9_H.d.ts +0 -54
- package/dist/properties-DQU0NBzb.js +0 -138
- package/dist/python-nqOBH7GS.js +0 -269
- package/dist/routing-C64k4fmX.js +0 -205
- package/dist/routing-pAL4V4hv.d.ts +0 -61
- package/dist/ruby-BBc8HdIt.js +0 -387
- package/dist/sdk-BSdgEEJw.js +0 -405
- package/dist/sdk-BVCk1ox2.d.ts +0 -122
- package/dist/sdk-Dm0S-XQE.d.ts +0 -122
- package/dist/sdk-sidebar-B1ehT_xI.d.ts +0 -15
- package/dist/sdk-sidebar-BDn8S1xS.js +0 -50
- package/dist/sdk-sidebar-Dqeu7C1-.d.ts +0 -15
- package/dist/snippets-CLpNVNlA.js +0 -181
- package/dist/stl-sidebar-BTTErIJs.d.ts +0 -58
- package/dist/stl-sidebar-C7GNALtk.d.ts +0 -58
- package/dist/stl-sidebar-DC5UOJiT.js +0 -106
- package/dist/style-DJIYkFhO.js +0 -178
- package/dist/terraform-DVx2ea2h.js +0 -243
- package/dist/typescript-Cmk-jBBw.js +0 -449
- package/dist/use-components-BUz3GbO4.js +0 -7
- package/dist/utils-DPbkW1Tz.js +0 -54
package/dist/utils-DPbkW1Tz.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./chunk-BN_g-Awi.js";
|
|
2
|
-
import { p as parseStainlessPath } from "./routing-C64k4fmX.js";
|
|
3
|
-
|
|
4
|
-
//#region src/utils.ts
|
|
5
|
-
var utils_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
-
flatResources: () => flatResources,
|
|
7
|
-
getBodyParams: () => getBodyParams,
|
|
8
|
-
getResourceFromSpec: () => getResourceFromSpec,
|
|
9
|
-
isResourceEmpty: () => isResourceEmpty
|
|
10
|
-
});
|
|
11
|
-
function flatResources(resources, parents) {
|
|
12
|
-
return Object.keys(resources ?? {}).flatMap((key) => {
|
|
13
|
-
const resource = resources[key];
|
|
14
|
-
return [{
|
|
15
|
-
resource,
|
|
16
|
-
parents
|
|
17
|
-
}, ...resource.subresources ? flatResources(resource.subresources, [...parents, resource]) : []];
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
function getResourceFromSpec(stainlessPath, spec) {
|
|
21
|
-
if (typeof stainlessPath === "string") {
|
|
22
|
-
const parsed = parseStainlessPath(stainlessPath);
|
|
23
|
-
if (!parsed?.resource) return null;
|
|
24
|
-
stainlessPath = parsed.resource;
|
|
25
|
-
}
|
|
26
|
-
return stainlessPath.slice(1).reduce((acc, cur) => acc?.subresources?.[cur], spec.resources[stainlessPath[0]]) ?? null;
|
|
27
|
-
}
|
|
28
|
-
function isResourceEmpty(resource) {
|
|
29
|
-
return !(Object.values(resource.methods).length > 0 || Object.values(resource.models).length > 0 || Object.values(resource.subresources).length > 0);
|
|
30
|
-
}
|
|
31
|
-
function getBodyParams(decl) {
|
|
32
|
-
if (!decl.bodyParamsChildren) return null;
|
|
33
|
-
const keys = Object.keys(decl.bodyParamsChildren);
|
|
34
|
-
if (keys.length > 1) console.warn("multiple bodyParams content types in " + decl.stainlessPath + ":", keys);
|
|
35
|
-
const jsonKey = keys.find((e) => /[/+]json(;|$)/.test(e));
|
|
36
|
-
if (jsonKey) return {
|
|
37
|
-
params: decl.bodyParamsChildren[jsonKey],
|
|
38
|
-
encoding: "json"
|
|
39
|
-
};
|
|
40
|
-
const formDataKey = keys.find((e) => /^multipart\/form-data(;|$)/.test(e));
|
|
41
|
-
if (formDataKey) return {
|
|
42
|
-
params: decl.bodyParamsChildren[formDataKey],
|
|
43
|
-
encoding: "form-data"
|
|
44
|
-
};
|
|
45
|
-
const firstKey = keys[0];
|
|
46
|
-
if (firstKey) return {
|
|
47
|
-
params: decl.bodyParamsChildren[firstKey],
|
|
48
|
-
encoding: "unknown"
|
|
49
|
-
};
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
//#endregion
|
|
54
|
-
export { utils_exports as a, isResourceEmpty as i, getBodyParams as n, getResourceFromSpec as r, flatResources as t };
|