@mintlify/msft-sdk 1.1.61 → 1.1.63
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/DownloadFileButton.js +6 -5
- package/dist/api-playground/ApiPlayground/Response/ResponseBody/CodeResponseContent.js +13 -12
- package/dist/api-playground/ApiPlayground/Response/ResponsePlaceholder.js +8 -7
- package/dist/api-playground/ApiPlayground/Response/ResponseTable.js +3 -2
- package/dist/api-playground/ApiPlayground/Response/ResponseTopbar.js +9 -8
- package/dist/api-playground/ApiPlayground/Response/index.js +4 -3
- package/dist/api-playground/ApiPlayground/components/AdditionalPropertyButton.js +42 -21
- package/dist/api-playground/ApiPlayground/components/ParamFieldWrapper.js +13 -9
- package/dist/api-playground/ApiPlayground/components/PlaygroundModalWrapper.js +6 -5
- package/dist/api-playground/ApiPlayground/components/SendPill.js +3 -2
- package/dist/api-playground/ApiPlayground/components/TypeDropdown.js +6 -5
- package/dist/api-playground/EndpointFields/ParamFields/ExampleDescription.js +3 -2
- package/dist/api-playground/EndpointFields/components/Description.js +6 -5
- package/dist/api-playground/EndpointFields/components/OptionDropdown.js +9 -8
- package/dist/api-playground/EndpointFields/components/SectionHeading.js +8 -7
- package/dist/api-playground-2/ApiExamples.js +19 -20
- package/dist/api-playground-2/ApiFields.js +20 -247
- package/dist/api-playground-2/EndpointHeader.js +59 -47
- package/dist/api-playground-2/OperationPage.js +70 -66
- package/dist/api-playground-2/Playground.js +67 -83
- package/dist/api-playground-2/SchemaPage.js +22 -9
- package/dist/api-playground-2/components/EndpointFields/Body.js +40 -0
- package/dist/api-playground-2/components/EndpointFields/Parameters.js +90 -0
- package/dist/api-playground-2/components/EndpointFields/Response.js +146 -0
- package/dist/api-playground-2/components/EndpointFields/Security.js +88 -0
- package/dist/api-playground-2/components/EndpointFields/fields/ArrayParamField.js +93 -0
- package/dist/api-playground-2/components/EndpointFields/fields/Enum.js +29 -11
- package/dist/api-playground-2/components/EndpointFields/fields/ObjectParamField.js +145 -0
- package/dist/api-playground-2/components/EndpointFields/fields/PrimitiveParamField.js +60 -48
- package/dist/api-playground-2/components/EndpointFields/fields/SchemaField.js +230 -0
- package/dist/api-playground-2/components/Example/GeneratedRequestExample.js +93 -89
- package/dist/api-playground-2/components/Example/GeneratedResponseExample.js +18 -17
- package/dist/api-playground-2/components/Example/RequestExample.js +92 -93
- package/dist/api-playground-2/components/Example/ResponseExample.js +19 -15
- package/dist/api-playground-2/components/Request/ParameterSection.js +20 -18
- package/dist/api-playground-2/components/Request/SecuritySection.js +53 -43
- package/dist/api-playground-2/components/Request/inputs/ArrayInput.js +89 -40
- package/dist/api-playground-2/components/Request/inputs/DifferentiatedInput.js +12 -12
- package/dist/api-playground-2/components/Request/inputs/FileInput.js +16 -15
- package/dist/api-playground-2/components/Request/inputs/InputContainer.js +76 -57
- package/dist/api-playground-2/components/Request/inputs/NumberInput.js +10 -9
- package/dist/api-playground-2/components/Request/inputs/ObjectInput.js +98 -80
- package/dist/api-playground-2/components/Request/inputs/OneOfInput.js +55 -47
- package/dist/api-playground-2/components/Request/inputs/SelectInput.js +18 -17
- package/dist/api-playground-2/components/Request/inputs/StringInput.js +19 -18
- package/dist/api-playground-2/components/Request/inputs/TextInput.js +12 -11
- package/dist/api-playground-2/components/SendPillWrapper.js +35 -0
- package/dist/api-playground-2/contexts/ApiPlaygroundContext.js +3 -5
- package/dist/api-playground-2/generators/createCookies.js +23 -0
- package/dist/api-playground-2/generators/createHeaders.js +53 -36
- package/dist/api-playground-2/generators/createQueryString.js +30 -0
- package/dist/api-playground-2/generators/generateAuthPlaceholder.js +14 -0
- package/dist/api-playground-2/generators/generateInteractiveCodeSample.js +27 -25
- package/dist/api-playground-2/generators/generateRequest.js +47 -51
- package/dist/api-playground-2/generators/generateResponseExampleMap.js +15 -11
- package/dist/api-playground-2/generators/generateSnippet.js +1 -1
- package/dist/api-playground-2/generators/generateSnippetMap.js +13 -11
- package/dist/api-playground-2/hooks/useCopyPathWithInputs.js +11 -11
- package/dist/api-playground-2/hooks/useInitializeInputs.js +185 -88
- package/dist/api-playground-2/hooks/usePlaygroundInputsStore.js +70 -25
- package/dist/api-playground-2/hooks/useSelectedBaseUrl.js +13 -0
- package/dist/api-playground-2/hooks/useSelectedExample.js +10 -0
- package/dist/api-playground-2/hooks/useSelectedRequestBodyContentType.js +12 -0
- package/dist/api-playground-2/hooks/useSelectedResponseContentType.js +12 -0
- package/dist/api-playground-2/hooks/useSelectedSecurityOption.js +31 -0
- package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js +114 -101
- package/dist/api-playground-2/schemaGraph/addApiReferenceDataFromMdxAndDocsConfig.js +23 -32
- package/dist/api-playground-2/schemaGraph/addTypeLabelsToSchema.js +50 -0
- package/dist/api-playground-2/schemaGraph/addUniqueKeysToSchema.js +40 -24
- package/dist/api-playground-2/schemaGraph/getExampleBodyInputs.js +94 -0
- package/dist/api-playground-2/schemaGraph/getSchemaGraphOperationData.js +56 -50
- package/dist/api-playground-2/schemaGraph/processExamples.js +117 -52
- package/dist/api-playground-2/schemaGraph/processSchema.js +10 -0
- package/dist/api-playground-2/schemaGraph/processSecurityOptions.js +58 -28
- package/dist/api-playground-2/schemaGraph/reduceCompositions.js +220 -181
- package/dist/api-playground-2/schemaGraph/resolveOperationWithDependencies.js +128 -89
- package/dist/api-playground-2/schemaGraph/resolveSchemaWithDependencies.js +15 -16
- package/dist/api-playground-2/schemaGraph/sortSchemaByRequired.js +14 -12
- package/dist/api-playground-2/schemaGraph/utils.js +185 -147
- package/dist/common/guards.js +11 -19
- package/dist/components/Api/Expandable.js +10 -9
- package/dist/components/Api/Param.js +11 -13
- package/dist/components/Api/dropdown-menu.js +10 -9
- package/dist/components/content-components/code-group.js +4 -4
- package/dist/contexts/EndpointLocationContext.js +3 -3
- package/dist/hooks/useApiParamFieldOption.js +10 -0
- package/dist/hooks/useEndpoint.js +3 -3
- package/dist/hooks/useKeyboardShortcut.js +13 -13
- package/dist/hooks/useSendPlaygroundRequest.js +14 -146
- package/dist/httpsnippet/src/helpers/code-builder.js +27 -0
- package/dist/httpsnippet/src/helpers/escape.js +11 -0
- package/dist/httpsnippet/src/helpers/headers.js +13 -0
- package/dist/httpsnippet/src/helpers/reducer.js +7 -0
- package/dist/httpsnippet/src/helpers/shell.js +5 -0
- package/dist/httpsnippet/src/helpers/url-format.js +35 -0
- package/dist/httpsnippet/src/helpers/url-parse.js +76 -0
- package/dist/httpsnippet/src/index.js +157 -0
- package/dist/httpsnippet/src/targets/c/libcurl/client.js +22 -0
- package/dist/httpsnippet/src/targets/c/target.js +15 -0
- package/dist/httpsnippet/src/targets/clojure/clj_http/client.js +120 -0
- package/dist/httpsnippet/src/targets/clojure/target.js +14 -0
- package/dist/httpsnippet/src/targets/csharp/httpclient/client.js +76 -0
- package/dist/httpsnippet/src/targets/csharp/restsharp/client.js +63 -0
- package/dist/httpsnippet/src/targets/csharp/target.js +17 -0
- package/dist/httpsnippet/src/targets/go/native/client.js +24 -0
- package/dist/httpsnippet/src/targets/go/target.js +15 -0
- package/dist/httpsnippet/src/targets/http/http1.1/client.js +34 -0
- package/dist/httpsnippet/src/targets/http/target.js +14 -0
- package/dist/httpsnippet/src/targets/index.js +43 -0
- package/dist/httpsnippet/src/targets/java/asynchttp/client.js +23 -0
- package/dist/httpsnippet/src/targets/java/nethttp/client.js +28 -0
- package/dist/httpsnippet/src/targets/java/okhttp/client.js +23 -0
- package/dist/httpsnippet/src/targets/java/target.js +20 -0
- package/dist/httpsnippet/src/targets/java/unirest/client.js +23 -0
- package/dist/httpsnippet/src/targets/javascript/axios/client.js +50 -0
- package/dist/httpsnippet/src/targets/javascript/fetch/client.js +61 -0
- package/dist/httpsnippet/src/targets/javascript/jquery/client.js +51 -0
- package/dist/httpsnippet/src/targets/javascript/target.js +20 -0
- package/dist/httpsnippet/src/targets/javascript/xhr/client.js +49 -0
- package/dist/httpsnippet/src/targets/json/native/client.js +39 -0
- package/dist/httpsnippet/src/targets/json/target.js +14 -0
- package/dist/httpsnippet/src/targets/kotlin/okhttp/client.js +23 -0
- package/dist/httpsnippet/src/targets/kotlin/target.js +14 -0
- package/dist/httpsnippet/src/targets/node/axios/client.js +40 -0
- package/dist/httpsnippet/src/targets/node/fetch/client.js +68 -0
- package/dist/httpsnippet/src/targets/node/native/client.js +45 -0
- package/dist/httpsnippet/src/targets/node/target.js +19 -0
- package/dist/httpsnippet/src/targets/objc/helpers.js +27 -0
- package/dist/httpsnippet/src/targets/objc/nsurlsession/client.js +63 -0
- package/dist/httpsnippet/src/targets/objc/target.js +14 -0
- package/dist/httpsnippet/src/targets/ocaml/cohttp/client.js +32 -0
- package/dist/httpsnippet/src/targets/ocaml/target.js +14 -0
- package/dist/httpsnippet/src/targets/php/curl/client.js +85 -0
- package/dist/httpsnippet/src/targets/php/guzzle/client.js +57 -0
- package/dist/httpsnippet/src/targets/php/helpers.js +65 -0
- package/dist/httpsnippet/src/targets/php/http1/client.js +28 -0
- package/dist/httpsnippet/src/targets/php/http2/client.js +55 -0
- package/dist/httpsnippet/src/targets/php/target.js +21 -0
- package/dist/httpsnippet/src/targets/powershell/common.js +19 -0
- package/dist/httpsnippet/src/targets/powershell/restmethod/client.js +14 -0
- package/dist/httpsnippet/src/targets/powershell/target.js +16 -0
- package/dist/httpsnippet/src/targets/powershell/webrequest/client.js +14 -0
- package/dist/httpsnippet/src/targets/python/helpers.js +33 -0
- package/dist/httpsnippet/src/targets/python/requests/client.js +74 -0
- package/dist/httpsnippet/src/targets/python/target.js +15 -0
- package/dist/httpsnippet/src/targets/r/httr/client.js +46 -0
- package/dist/httpsnippet/src/targets/r/target.js +14 -0
- package/dist/httpsnippet/src/targets/ruby/native/client.js +37 -0
- package/dist/httpsnippet/src/targets/ruby/target.js +14 -0
- package/dist/httpsnippet/src/targets/shell/curl/client.js +92 -0
- package/dist/httpsnippet/src/targets/shell/httpie/client.js +56 -0
- package/dist/httpsnippet/src/targets/shell/target.js +19 -0
- package/dist/httpsnippet/src/targets/shell/wget/client.js +30 -0
- package/dist/httpsnippet/src/targets/swift/helpers.js +38 -0
- package/dist/httpsnippet/src/targets/swift/target.js +14 -0
- package/dist/httpsnippet/src/targets/swift/urlsession/client.js +59 -0
- package/dist/index.d.ts +65 -58
- package/dist/index.js +109 -111
- package/dist/openapi/generateTypeStringFromSchema.js +2 -31
- package/dist/styles.css +1 -1
- package/package.json +17 -4
- package/dist/api-playground/ApiPlayground/Request/BodySection.js +0 -64
- package/dist/api-playground/ApiPlayground/Request/ParameterSection.js +0 -32
- package/dist/api-playground/ApiPlayground/Request/PlaygroundModal.js +0 -201
- package/dist/api-playground/ApiPlayground/Request/SecuritySection.js +0 -146
- package/dist/api-playground/ApiPlayground/Request/ServerSection.js +0 -30
- package/dist/api-playground/ApiPlayground/Request/index.js +0 -43
- package/dist/api-playground/ApiPlayground/Request/inputs/ArrayInput.js +0 -93
- package/dist/api-playground/ApiPlayground/Request/inputs/DifferentiatedInput.js +0 -90
- package/dist/api-playground/ApiPlayground/Request/inputs/FileInput.js +0 -62
- package/dist/api-playground/ApiPlayground/Request/inputs/NullInput.js +0 -33
- package/dist/api-playground/ApiPlayground/Request/inputs/NumberInput.js +0 -61
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectChildren.js +0 -109
- package/dist/api-playground/ApiPlayground/Request/inputs/ObjectInput.js +0 -87
- package/dist/api-playground/ApiPlayground/Request/inputs/RecursiveInput.js +0 -61
- package/dist/api-playground/ApiPlayground/Request/inputs/SelectInput.js +0 -54
- package/dist/api-playground/ApiPlayground/Request/inputs/StringInput.js +0 -67
- package/dist/api-playground/ApiPlayground/Request/inputs/TextInput.js +0 -44
- package/dist/api-playground/ApiPlayground/components/EndpointsMenu.js +0 -42
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuLink.js +0 -43
- package/dist/api-playground/ApiPlayground/components/EndpointsMenuSearch.js +0 -38
- package/dist/api-playground/ApiPlayground/components/InputContainer.js +0 -128
- package/dist/api-playground/ApiPlayground/components/InputSectionContainer.js +0 -59
- package/dist/api-playground/ApiPlayground/components/PathHeader.js +0 -162
- package/dist/api-playground/ApiPlayground/components/TrashButton.js +0 -26
- package/dist/api-playground/ApiPlayground/index.js +0 -67
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/Enum.js +0 -19
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/NumberMetadata.js +0 -18
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/StringMetadata.js +0 -28
- package/dist/api-playground/EndpointFields/ParamFields/PrimitiveParamField/index.js +0 -5
- package/dist/api-playground/EndpointFields/ParamFields/RecursiveParamField.js +0 -13
- package/dist/api-playground/EndpointFields/index.js +0 -7
- package/dist/api-playground-2/components/EndpointFields/EndpointSecurity.js +0 -87
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleArrayParamField.js +0 -89
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleObjectParamField.js +0 -121
- package/dist/api-playground-2/components/EndpointFields/fields/SimplePrimitiveParamField.js +0 -74
- package/dist/api-playground-2/components/EndpointFields/fields/SimpleSchemaField.js +0 -252
- package/dist/common/potentiallyParseOpenApiString.js +0 -24
- package/dist/common/replaceSlashIndex.js +0 -6
- package/dist/common/slugToTitle.js +0 -10
- package/dist/constants/prism-languages.js +0 -19
- package/dist/contexts/ApiPlaygroundInputsContext.js +0 -17
- package/dist/contexts/MDXContentContext.js +0 -17
- package/dist/hooks/useApiPlaygroundInputs.js +0 -6
- package/dist/hooks/useApiPlaygroundPrefillExamples.js +0 -39
- package/dist/hooks/useBaseUrlOptions.js +0 -18
- package/dist/hooks/useComponentSchemas.js +0 -9
- package/dist/hooks/useGenerateNextAdditionalProperties.js +0 -11
- package/dist/hooks/useGenerateNextItems.js +0 -11
- package/dist/hooks/useGenerateNextProperties.js +0 -11
- package/dist/hooks/useMDXContent.js +0 -6
- package/dist/hooks/useMDXContentController/useApiPlaygroundInputs.js +0 -9
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiBaseIndexCallback.js +0 -15
- package/dist/hooks/useMDXContentController/useMDXContentCallbacks/useSetApiPlaygroundInputsCallback.js +0 -15
- package/dist/hooks/usePlaygroundSchemaOptions.js +0 -42
- package/dist/hooks/usePrefilledInputs/index.js +0 -65
- package/dist/hooks/usePrefilledInputs/storedServerVariables.js +0 -29
- package/dist/hooks/useSecurityOption.js +0 -10
- package/dist/hooks/useSetDefaultValue.js +0 -63
- package/dist/openapi/filterEnums.js +0 -20
- package/dist/openapi/generateNextAdditionalProperties.js +0 -7
- package/dist/openapi/generateNextItems.js +0 -7
- package/dist/openapi/generateNextProperties.js +0 -23
- package/dist/openapi/generateOptionLabels.js +0 -20
- package/dist/openapi/generateSimpleLabels.js +0 -4
- package/dist/openapi/getAuthFilteredSchemaArray.js +0 -18
- package/dist/paths/isEqualIgnoringLeadingSlash.js +0 -21
- package/dist/paths/optionallyRemoveLeadingSlash.js +0 -6
- package/dist/paths/optionallyRemoveTrailingSlash.js +0 -6
- package/dist/utils/api-playground/defaults.js +0 -15
- package/dist/utils/api-playground/paramFieldDefaults.js +0 -10
- package/dist/utils/api-reference/getFilteredSecurityOptions.js +0 -4
- package/dist/utils/api-reference/getNextPropertiesByType.js +0 -5
- package/dist/utils/flattenObject.js +0 -10
|
@@ -1,148 +1,187 @@
|
|
|
1
|
-
import { CIRCULAR_REF_KEY as
|
|
2
|
-
import { reduceExpandedSchema as
|
|
3
|
-
import { sortSchemaByRequired as
|
|
4
|
-
import { flattenSingleOneOf as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { resolveGraphNode as
|
|
8
|
-
const
|
|
9
|
-
|
|
1
|
+
import { CIRCULAR_REF_KEY as d } from "../constants/index.js";
|
|
2
|
+
import { reduceExpandedSchema as u } from "./reduceCompositions.js";
|
|
3
|
+
import { sortSchemaByRequired as w } from "./sortSchemaByRequired.js";
|
|
4
|
+
import { flattenSingleOneOf as y, isSchemaObject as v, isCircularRef as C } from "./utils.js";
|
|
5
|
+
import { generateExamplesFromSchema as b } from "./processExamples.js";
|
|
6
|
+
import { processSchema as E } from "./processSchema.js";
|
|
7
|
+
import { resolveGraphNode as g, deeplyResolveGraphNode as p } from "./resolveGraphNode.js";
|
|
8
|
+
const z = ({
|
|
9
|
+
pathUuid: c,
|
|
10
|
+
operationId: i,
|
|
10
11
|
uuidObjectHashMap: o,
|
|
11
|
-
hashedNodeMap:
|
|
12
|
+
hashedNodeMap: e
|
|
12
13
|
}) => {
|
|
13
|
-
const
|
|
14
|
+
const t = g({
|
|
14
15
|
uuidObjectHashMap: o,
|
|
15
|
-
hashedNodeMap:
|
|
16
|
-
id:
|
|
16
|
+
hashedNodeMap: e,
|
|
17
|
+
id: i
|
|
17
18
|
});
|
|
18
|
-
if (!
|
|
19
|
+
if (!t)
|
|
19
20
|
return;
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
if (typeof
|
|
23
|
-
const
|
|
24
|
-
|
|
21
|
+
const r = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), m = t.parameters;
|
|
22
|
+
if (m == null || m.forEach((s) => {
|
|
23
|
+
if (typeof s != "string") return;
|
|
24
|
+
const n = j(s, o, e);
|
|
25
|
+
n && "name" in n && "in" in n && r.set(s, n);
|
|
26
|
+
}), c) {
|
|
27
|
+
const s = g({
|
|
28
|
+
uuidObjectHashMap: o,
|
|
29
|
+
hashedNodeMap: e,
|
|
30
|
+
id: c
|
|
31
|
+
});
|
|
32
|
+
s && s.parameters && s.parameters.forEach((n) => {
|
|
33
|
+
if (typeof n != "string") return;
|
|
34
|
+
const h = j(n, o, e);
|
|
35
|
+
h && "name" in h && "in" in h && r.set(n, h);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
const S = t.security;
|
|
39
|
+
S == null || S.forEach((s) => {
|
|
40
|
+
if (typeof s != "string") return;
|
|
41
|
+
const n = G(s, o, e);
|
|
42
|
+
n && l.set(s, n);
|
|
25
43
|
});
|
|
26
|
-
let
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
44
|
+
let a;
|
|
45
|
+
const q = t.requestBody;
|
|
46
|
+
if (q && typeof q == "string" && (a = A(q, o, e), a)) {
|
|
47
|
+
const { content: s, exampleType: n } = b(a.content);
|
|
48
|
+
a.content = s, a.exampleType = n;
|
|
49
|
+
}
|
|
50
|
+
const O = t.responses;
|
|
51
|
+
O && Object.values(O).forEach((s) => {
|
|
52
|
+
if (typeof s != "string") return;
|
|
53
|
+
const n = F(s, o, e);
|
|
54
|
+
if (n && n.content) {
|
|
55
|
+
const { content: h, exampleType: B } = b(n.content);
|
|
56
|
+
n.content = h, n.exampleType = B;
|
|
57
|
+
}
|
|
58
|
+
n && f.set(s, n);
|
|
34
59
|
});
|
|
35
|
-
const
|
|
36
|
-
operation:
|
|
37
|
-
parameters: Object.fromEntries(
|
|
38
|
-
requestBody:
|
|
39
|
-
responses: Object.fromEntries(
|
|
40
|
-
|
|
60
|
+
const x = {
|
|
61
|
+
operation: t,
|
|
62
|
+
parameters: Object.fromEntries(r),
|
|
63
|
+
requestBody: a,
|
|
64
|
+
responses: Object.fromEntries(f),
|
|
65
|
+
security: Object.fromEntries(l)
|
|
66
|
+
}, R = _(x, o, e);
|
|
41
67
|
return {
|
|
42
|
-
operation:
|
|
68
|
+
operation: t,
|
|
43
69
|
dependencies: {
|
|
44
|
-
parameters: Object.fromEntries(
|
|
45
|
-
requestBody:
|
|
46
|
-
responses: Object.fromEntries(
|
|
70
|
+
parameters: Object.fromEntries(r),
|
|
71
|
+
requestBody: a,
|
|
72
|
+
responses: Object.fromEntries(f),
|
|
73
|
+
security: Object.fromEntries(l)
|
|
47
74
|
},
|
|
48
|
-
schemas: Object.keys(
|
|
75
|
+
schemas: Object.keys(R).length > 0 ? R : void 0
|
|
49
76
|
};
|
|
50
77
|
};
|
|
51
|
-
function
|
|
52
|
-
let e =
|
|
53
|
-
uuidObjectHashMap:
|
|
54
|
-
hashedNodeMap:
|
|
55
|
-
id:
|
|
78
|
+
function A(c, i, o) {
|
|
79
|
+
let e = p({
|
|
80
|
+
uuidObjectHashMap: i,
|
|
81
|
+
hashedNodeMap: o,
|
|
82
|
+
id: c
|
|
56
83
|
});
|
|
57
84
|
if (e)
|
|
58
|
-
return e =
|
|
59
|
-
if (t.schema &&
|
|
60
|
-
let r =
|
|
85
|
+
return e = y(e), Object.values(e.content).forEach((t) => {
|
|
86
|
+
if (t.schema && v(t.schema)) {
|
|
87
|
+
let r = u({
|
|
61
88
|
schema: t.schema,
|
|
62
89
|
depth: 0,
|
|
63
90
|
location: "request"
|
|
64
91
|
});
|
|
65
|
-
r =
|
|
92
|
+
r = E(r), t.schema = r;
|
|
66
93
|
}
|
|
67
94
|
}), e;
|
|
68
95
|
}
|
|
69
|
-
function
|
|
70
|
-
let e =
|
|
71
|
-
uuidObjectHashMap:
|
|
72
|
-
hashedNodeMap:
|
|
73
|
-
id:
|
|
96
|
+
function F(c, i, o) {
|
|
97
|
+
let e = p({
|
|
98
|
+
uuidObjectHashMap: i,
|
|
99
|
+
hashedNodeMap: o,
|
|
100
|
+
id: c
|
|
74
101
|
});
|
|
75
102
|
if (e)
|
|
76
|
-
return e =
|
|
77
|
-
if (t.schema &&
|
|
78
|
-
let r =
|
|
103
|
+
return e = y(e), e.content && Object.values(e.content).forEach((t) => {
|
|
104
|
+
if (t.schema && v(t.schema)) {
|
|
105
|
+
let r = u({
|
|
79
106
|
schema: t.schema,
|
|
80
107
|
depth: 0,
|
|
81
108
|
location: "response"
|
|
82
109
|
});
|
|
83
|
-
r =
|
|
110
|
+
r = E(r), t.schema = r;
|
|
84
111
|
}
|
|
85
112
|
}), e;
|
|
86
113
|
}
|
|
87
|
-
function
|
|
88
|
-
let e =
|
|
89
|
-
uuidObjectHashMap:
|
|
90
|
-
hashedNodeMap:
|
|
91
|
-
id:
|
|
114
|
+
function j(c, i, o) {
|
|
115
|
+
let e = p({
|
|
116
|
+
uuidObjectHashMap: i,
|
|
117
|
+
hashedNodeMap: o,
|
|
118
|
+
id: c
|
|
92
119
|
});
|
|
93
120
|
if (e) {
|
|
94
|
-
if (e =
|
|
95
|
-
let t =
|
|
121
|
+
if (e = y(e), "schema" in e && e.schema && v(e.schema)) {
|
|
122
|
+
let t = u({
|
|
96
123
|
schema: e.schema,
|
|
97
124
|
depth: 0,
|
|
98
125
|
location: "request"
|
|
99
126
|
});
|
|
100
|
-
t =
|
|
127
|
+
t = {
|
|
128
|
+
...t,
|
|
129
|
+
isRequired: e.required
|
|
130
|
+
}, t = E(t), e.schema = t;
|
|
101
131
|
}
|
|
102
132
|
return "content" in e && e.content && Object.values(e.content).forEach((t) => {
|
|
103
|
-
if (t.schema &&
|
|
104
|
-
let r =
|
|
133
|
+
if (t.schema && v(t.schema)) {
|
|
134
|
+
let r = u({
|
|
105
135
|
schema: t.schema,
|
|
106
136
|
depth: 0,
|
|
107
137
|
location: "request"
|
|
108
138
|
});
|
|
109
|
-
r =
|
|
139
|
+
r = E(r), t.schema = r;
|
|
110
140
|
}
|
|
111
141
|
}), e;
|
|
112
142
|
}
|
|
113
143
|
}
|
|
114
|
-
function
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
144
|
+
function G(c, i, o) {
|
|
145
|
+
let e = p({
|
|
146
|
+
uuidObjectHashMap: i,
|
|
147
|
+
hashedNodeMap: o,
|
|
148
|
+
id: c
|
|
149
|
+
});
|
|
150
|
+
if (e)
|
|
151
|
+
return e = y(e), e;
|
|
152
|
+
}
|
|
153
|
+
function _(c, i, o, e = /* @__PURE__ */ new Set()) {
|
|
154
|
+
const t = {}, r = (f) => {
|
|
155
|
+
if (f != null) {
|
|
156
|
+
if (C(f)) {
|
|
157
|
+
const l = f[d];
|
|
158
|
+
if (!e.has(l)) {
|
|
159
|
+
e.add(l);
|
|
160
|
+
let m = p({
|
|
161
|
+
uuidObjectHashMap: i,
|
|
162
|
+
hashedNodeMap: o,
|
|
163
|
+
id: l
|
|
125
164
|
});
|
|
126
|
-
if (!
|
|
127
|
-
|
|
128
|
-
schema:
|
|
165
|
+
if (!m) return;
|
|
166
|
+
m = u({
|
|
167
|
+
schema: m,
|
|
129
168
|
depth: 0,
|
|
130
169
|
location: "request"
|
|
131
|
-
}),
|
|
170
|
+
}), m = w(m), t[l] = m, r(m);
|
|
132
171
|
}
|
|
133
172
|
return;
|
|
134
173
|
}
|
|
135
|
-
if (Array.isArray(
|
|
136
|
-
|
|
174
|
+
if (Array.isArray(f)) {
|
|
175
|
+
f.forEach(r);
|
|
137
176
|
return;
|
|
138
177
|
}
|
|
139
|
-
if (typeof
|
|
140
|
-
for (const
|
|
141
|
-
r(
|
|
178
|
+
if (typeof f == "object")
|
|
179
|
+
for (const l of Object.values(f))
|
|
180
|
+
r(l);
|
|
142
181
|
}
|
|
143
182
|
};
|
|
144
|
-
return r(
|
|
183
|
+
return r(c), t;
|
|
145
184
|
}
|
|
146
185
|
export {
|
|
147
|
-
|
|
186
|
+
z as resolveOperationWithDependencies
|
|
148
187
|
};
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return d;
|
|
1
|
+
import { reduceExpandedSchema as d } from "./reduceCompositions.js";
|
|
2
|
+
import { deeplyResolveGraphNode as i } from "./resolveGraphNode.js";
|
|
3
|
+
import { processSchema as t } from "./processSchema.js";
|
|
4
|
+
function c(o, r) {
|
|
5
|
+
const n = r.spec.refUuidMap[o];
|
|
6
|
+
if (n)
|
|
7
|
+
return n;
|
|
9
8
|
}
|
|
10
|
-
function
|
|
9
|
+
function u({
|
|
11
10
|
schemaPath: o,
|
|
12
11
|
schemaGraphData: r
|
|
13
12
|
}) {
|
|
14
|
-
const
|
|
15
|
-
if (!
|
|
13
|
+
const n = c(o, r);
|
|
14
|
+
if (!n)
|
|
16
15
|
throw new Error(`no matching OpenAPI schema found with path "${o}"`);
|
|
17
|
-
let e =
|
|
16
|
+
let e = i({
|
|
18
17
|
uuidObjectHashMap: r.spec.uuidObjectHashMap,
|
|
19
18
|
hashedNodeMap: r.spec.hashedNodeMap,
|
|
20
|
-
id:
|
|
19
|
+
id: n
|
|
21
20
|
});
|
|
22
21
|
if (!e)
|
|
23
22
|
throw new Error(`no matching OpenAPI schema found with id "${o}"`);
|
|
24
|
-
return e =
|
|
23
|
+
return e = d({
|
|
25
24
|
schema: e,
|
|
26
25
|
depth: 0,
|
|
27
26
|
location: "request"
|
|
28
|
-
}), e =
|
|
27
|
+
}), e = t(e), e;
|
|
29
28
|
}
|
|
30
29
|
export {
|
|
31
|
-
|
|
30
|
+
u as resolveSchemaWithDependencies
|
|
32
31
|
};
|
|
@@ -2,26 +2,28 @@ import { isSchemaObject as o } from "./utils.js";
|
|
|
2
2
|
const u = (r) => {
|
|
3
3
|
if (!o(r))
|
|
4
4
|
return r;
|
|
5
|
-
if (r.oneOf && Array.isArray(r.oneOf))
|
|
5
|
+
if (r.oneOf && Array.isArray(r.oneOf) && r.oneOf.length > 0)
|
|
6
6
|
return {
|
|
7
7
|
...r,
|
|
8
8
|
oneOf: r.oneOf.map(
|
|
9
|
-
(
|
|
9
|
+
(e) => r.isRequired ? { ...e, isRequired: !0 } : e
|
|
10
|
+
).map(
|
|
11
|
+
(e) => o(e) ? u(e) : e
|
|
10
12
|
)
|
|
11
13
|
};
|
|
12
14
|
if (r.type === "object" && r.properties) {
|
|
13
|
-
const
|
|
14
|
-
(
|
|
15
|
-
).sort(([
|
|
16
|
-
const
|
|
17
|
-
return
|
|
18
|
-
}),
|
|
19
|
-
return
|
|
20
|
-
const
|
|
21
|
-
|
|
15
|
+
const e = new Set(r.required || []), f = Object.entries(r.properties).filter(
|
|
16
|
+
(t) => o(t[1])
|
|
17
|
+
).sort(([t], [n]) => {
|
|
18
|
+
const s = e.has(t), i = e.has(n);
|
|
19
|
+
return s === i ? 0 : s ? -1 : 1;
|
|
20
|
+
}), d = {};
|
|
21
|
+
return f.forEach(([t, n]) => {
|
|
22
|
+
const i = e.has(t) ? { ...n, isRequired: !0 } : n, p = o(i) ? u(i) : i;
|
|
23
|
+
d[t] = p;
|
|
22
24
|
}), {
|
|
23
25
|
...r,
|
|
24
|
-
properties:
|
|
26
|
+
properties: d
|
|
25
27
|
};
|
|
26
28
|
}
|
|
27
29
|
return r.type === "array" && o(r.items) ? {
|