@scalar/api-reference 1.32.0 → 1.32.4
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/CHANGELOG.md +83 -0
- package/README.md +1 -1
- package/dist/browser/standalone.js +15732 -15435
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +1 -1
- package/dist/components/ApiReferenceLayout.vue2.js +163 -158
- package/dist/components/Badge/Badge.vue.d.ts.map +1 -1
- package/dist/components/Badge/Badge.vue.js +1 -1
- package/dist/components/Card/CardHeader.vue.d.ts.map +1 -1
- package/dist/components/Card/CardHeader.vue.js +2 -2
- package/dist/components/Card/CardTab.vue.d.ts.map +1 -1
- package/dist/components/Card/CardTab.vue.js +3 -3
- package/dist/components/Card/CardTabHeader.vue.d.ts.map +1 -1
- package/dist/components/Card/CardTabHeader.vue.js +2 -2
- package/dist/components/Content/ClientLibraries/ClientLibraries.vue.js +1 -1
- package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +1 -1
- package/dist/components/Content/Introduction/Introduction.vue.js +2 -2
- package/dist/components/Content/Lazy/Loading.vue.d.ts +1 -3
- package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
- package/dist/components/Content/Lazy/Loading.vue.js +92 -91
- package/dist/components/Content/Models/Models.vue.d.ts.map +1 -1
- package/dist/components/Content/Models/Models.vue.js +2 -2
- package/dist/components/Content/Models/Models.vue2.js +59 -56
- package/dist/components/Content/Schema/RenderString.vue.d.ts +6 -0
- package/dist/components/Content/Schema/RenderString.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/RenderString.vue.js +14 -0
- package/dist/components/Content/Schema/RenderString.vue2.js +4 -0
- package/dist/components/Content/Schema/Schema.vue.d.ts +1 -1
- package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/Schema.vue.js +2 -2
- package/dist/components/Content/Schema/Schema.vue2.js +76 -75
- package/dist/components/Content/Schema/SchemaComposition.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaComposition.vue.js +58 -66
- package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts +19 -0
- package/dist/components/Content/Schema/SchemaEnumValues.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaEnumValues.vue.js +7 -0
- package/dist/components/Content/Schema/SchemaEnumValues.vue2.js +125 -0
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +2 -2
- package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaProperty.vue2.js +96 -170
- package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts +18 -0
- package/dist/components/Content/Schema/SchemaPropertyDescription.vue.d.ts.map +1 -0
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.d.ts.map +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue.js +1 -1
- package/dist/components/Content/Schema/SchemaPropertyHeading.vue2.js +155 -160
- package/dist/components/Content/Schema/helpers/get-schema-type.d.ts +6 -0
- package/dist/components/Content/Schema/helpers/get-schema-type.d.ts.map +1 -0
- package/dist/components/Content/Schema/helpers/get-schema-type.js +20 -0
- package/dist/components/Content/Schema/helpers/merge-all-of-schemas.js +1 -1
- package/dist/components/Content/Schema/helpers/optimizeValueForDisplay.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.d.ts.map +1 -1
- package/dist/components/Content/Schema/helpers/schema-name.js +20 -46
- package/dist/features/Operation/components/ParameterListItem.vue.js +3 -3
- package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
- package/dist/features/Operation/layouts/ModernLayout.vue.js +2 -2
- package/dist/features/Operation/layouts/ModernLayout.vue2.js +13 -13
- package/dist/features/Search/SearchButton.vue.d.ts +1 -0
- package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchButton.vue.js +36 -34
- package/dist/features/Search/SearchModal.vue.d.ts +1 -0
- package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
- package/dist/features/Search/SearchModal.vue.js +1 -1
- package/dist/features/Search/SearchModal.vue2.js +112 -112
- package/dist/features/Search/useSearchIndex.d.ts +4 -3
- package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
- package/dist/features/Search/useSearchIndex.js +119 -82
- package/dist/features/api-client-modal/ApiClientModal.vue.d.ts +2 -2
- package/dist/features/api-client-modal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/api-client-modal/ApiClientModal.vue.js +47 -38
- package/dist/features/api-client-modal/useApiClient.d.ts +334 -334
- package/dist/features/api-client-modal/useApiClient.d.ts.map +1 -1
- package/dist/features/base-url/BaseUrl.vue.js +1 -1
- package/dist/features/example-responses/ExampleResponse.vue.js +3 -3
- package/dist/features/example-responses/ExampleResponse.vue2.js +7 -7
- package/dist/features/example-responses/ExampleResponses.vue.d.ts +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.d.ts.map +1 -1
- package/dist/features/example-responses/ExampleResponses.vue.js +2 -2
- package/dist/features/sidebar/components/SidebarElement.vue.d.ts.map +1 -1
- package/dist/features/sidebar/components/SidebarElement.vue.js +1 -1
- package/dist/features/sidebar/components/SidebarElement.vue2.js +23 -21
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.d.ts.map +1 -1
- package/dist/features/sidebar/components/SidebarHttpBadge.vue.js +2 -2
- package/dist/features/sidebar/components/SidebarHttpBadge.vue2.js +5 -6
- package/dist/features/test-request-button/TestRequestButton.vue.js +2 -2
- package/dist/features/traverse-schema/helpers/traverse-tags.js +26 -26
- package/dist/features/traverse-schema/index.d.ts +1 -1
- package/dist/features/traverse-schema/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/libs/openapi.d.ts +15 -1
- package/dist/libs/openapi.d.ts.map +1 -1
- package/dist/libs/openapi.js +66 -47
- package/dist/standalone/lib/html-api.d.ts.map +1 -1
- package/dist/stores/useHttpClientStore.js +2 -2
- package/dist/style.css +1 -1
- package/dist/types.d.ts +3 -3
- package/dist/v2/blocks/scalar-request-example-block/components/RequestExample.vue.d.ts +2 -2
- package/package.json +18 -18
- package/dist/hooks/useOperation.d.ts +0 -16
- package/dist/hooks/useOperation.d.ts.map +0 -1
- package/dist/hooks/useOperation.js +0 -27
|
@@ -1,133 +1,170 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { useNavState as W } from "../../hooks/useNavState.js";
|
|
2
|
+
import { getHeadingsFromMarkdown as _ } from "../../libs/markdown.js";
|
|
3
|
+
import { createParameterMap as k, extractRequestBody as A, getModels as B } from "../../libs/openapi.js";
|
|
4
|
+
import { isHttpMethod as U } from "@scalar/helpers/http/is-http-method";
|
|
5
|
+
import X from "fuse.js";
|
|
6
|
+
import { ref as f, watch as H, computed as j } from "vue";
|
|
7
|
+
const q = 25;
|
|
8
|
+
function Z({
|
|
9
|
+
specification: C,
|
|
10
|
+
hideModels: L = !1
|
|
11
11
|
}) {
|
|
12
|
-
const { getHeadingId:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const { getHeadingId: O, getModelId: T, getTagId: F } = W(), a = f([]), u = f([]), s = f(), n = f(""), v = new X(a.value, {
|
|
13
|
+
// Define searchable fields with weights to prioritize more important matches
|
|
14
|
+
keys: [
|
|
15
|
+
// Highest weight - titles are most descriptive
|
|
16
|
+
{ name: "title", weight: 0.7 },
|
|
17
|
+
// Medium weight - helpful but often verbose
|
|
18
|
+
{ name: "description", weight: 0.3 },
|
|
19
|
+
// Lowest weight - can be very long and noisy
|
|
20
|
+
{ name: "body", weight: 0.2 },
|
|
21
|
+
// High weight - unique identifiers for operations
|
|
22
|
+
{ name: "operationId", weight: 0.6 },
|
|
23
|
+
// Good weight - endpoint paths are searchable
|
|
24
|
+
{ name: "path", weight: 0.5 },
|
|
25
|
+
// Medium-high weight - helps with categorization
|
|
26
|
+
{ name: "tag", weight: 0.4 },
|
|
27
|
+
// Medium weight - useful for filtering by method
|
|
28
|
+
{ name: "httpVerb", weight: 0.3 }
|
|
29
|
+
],
|
|
30
|
+
// Threshold controls how strict the matching is (0.0 = perfect match, 1.0 = very loose)
|
|
31
|
+
// 0.3 allows for some typos and partial matches while maintaining relevance
|
|
32
|
+
threshold: 0.3,
|
|
33
|
+
// Maximum distance between characters that can be matched
|
|
34
|
+
// Higher values allow matches even when characters are far apart in long text
|
|
35
|
+
distance: 100,
|
|
36
|
+
// Include the match score in results for debugging and potential UI enhancements
|
|
37
|
+
includeScore: !0,
|
|
38
|
+
// Include detailed match information showing which parts of the text matched
|
|
39
|
+
includeMatches: !0,
|
|
40
|
+
// Minimum number of characters that must match to be considered a result
|
|
41
|
+
// Prevents single-character matches that are usually noise
|
|
42
|
+
minMatchCharLength: 2,
|
|
43
|
+
// Don't require matches to be at the beginning of strings
|
|
44
|
+
// Makes search more flexible and user-friendly
|
|
45
|
+
ignoreLocation: !0,
|
|
46
|
+
// Enable advanced search syntax like 'exact' for exact matches or !exclude for exclusions
|
|
47
|
+
useExtendedSearch: !0,
|
|
48
|
+
// Find all possible matches in each item, not just the first one
|
|
49
|
+
// Ensures comprehensive search results
|
|
50
|
+
findAllMatches: !0
|
|
51
|
+
}), y = () => {
|
|
52
|
+
s.value = 0, u.value = v.search(n.value);
|
|
16
53
|
};
|
|
17
|
-
|
|
18
|
-
e.length ?
|
|
54
|
+
H(n, (e) => {
|
|
55
|
+
e.length ? y() : u.value = [];
|
|
19
56
|
});
|
|
20
57
|
function N() {
|
|
21
|
-
|
|
58
|
+
n.value = "", s.value = void 0, u.value = [];
|
|
22
59
|
}
|
|
23
|
-
const
|
|
24
|
-
item:
|
|
25
|
-
})) :
|
|
26
|
-
() => typeof
|
|
60
|
+
const b = j(() => n.value.length === 0 ? a.value.slice(0, q).map((e) => ({
|
|
61
|
+
item: e
|
|
62
|
+
})) : u.value.slice(0, q)), P = j(
|
|
63
|
+
() => typeof s.value == "number" ? b.value[s.value] : void 0
|
|
27
64
|
);
|
|
28
|
-
return
|
|
29
|
-
|
|
65
|
+
return H(
|
|
66
|
+
C,
|
|
30
67
|
(e) => {
|
|
31
|
-
var
|
|
68
|
+
var $, x, R;
|
|
32
69
|
a.value = [];
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
|
|
70
|
+
const g = [], M = _((($ = e == null ? void 0 : e.info) == null ? void 0 : $.description) ?? "");
|
|
71
|
+
if (M.length && (M.forEach((t) => {
|
|
72
|
+
g.push({
|
|
36
73
|
type: "heading",
|
|
37
|
-
title:
|
|
38
|
-
description: "",
|
|
39
|
-
href: `#${
|
|
74
|
+
title: t.value,
|
|
75
|
+
description: "Introduction",
|
|
76
|
+
href: `#${O(t)}`,
|
|
40
77
|
tag: t.slug,
|
|
41
78
|
body: ""
|
|
42
79
|
});
|
|
43
|
-
}), a.value = a.value.concat(
|
|
44
|
-
(
|
|
45
|
-
const
|
|
80
|
+
}), a.value = a.value.concat(g)), (x = e == null ? void 0 : e.tags) != null && x.length)
|
|
81
|
+
(R = e == null ? void 0 : e.tags) == null || R.forEach((t) => {
|
|
82
|
+
const d = {
|
|
46
83
|
title: t["x-displayName"] ?? t.name,
|
|
47
|
-
href: `#${
|
|
84
|
+
href: `#${F(t)}`,
|
|
48
85
|
description: t.description,
|
|
49
86
|
type: "tag",
|
|
50
87
|
tag: t.name,
|
|
51
88
|
body: ""
|
|
52
89
|
};
|
|
53
|
-
a.value.push(
|
|
54
|
-
var
|
|
55
|
-
const
|
|
56
|
-
let
|
|
57
|
-
typeof
|
|
90
|
+
a.value.push(d), t.operations && t.operations.forEach((o) => {
|
|
91
|
+
var h;
|
|
92
|
+
const r = k(o.information), l = A(o.information) || r;
|
|
93
|
+
let i = null;
|
|
94
|
+
typeof l != "boolean" && (i = l);
|
|
58
95
|
const c = {
|
|
59
96
|
type: "req",
|
|
60
|
-
title:
|
|
61
|
-
href: `#${
|
|
62
|
-
operationId: (
|
|
63
|
-
description:
|
|
64
|
-
httpVerb:
|
|
65
|
-
path:
|
|
97
|
+
title: o.name ?? o.path,
|
|
98
|
+
href: `#${o.id}`,
|
|
99
|
+
operationId: (h = o.information) == null ? void 0 : h.operationId,
|
|
100
|
+
description: o.description ?? "",
|
|
101
|
+
httpVerb: o.httpVerb,
|
|
102
|
+
path: o.path,
|
|
66
103
|
tag: t.name,
|
|
67
|
-
operation:
|
|
104
|
+
operation: o
|
|
68
105
|
};
|
|
69
|
-
|
|
106
|
+
i && (c.body = i), a.value.push(c);
|
|
70
107
|
});
|
|
71
108
|
});
|
|
72
109
|
else if (e != null && e.paths) {
|
|
73
110
|
const t = e.paths;
|
|
74
|
-
Object.keys(t ?? {}).forEach((
|
|
75
|
-
Object.keys((t == null ? void 0 : t[
|
|
76
|
-
var
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
const
|
|
111
|
+
Object.keys(t ?? {}).forEach((d) => {
|
|
112
|
+
Object.keys((t == null ? void 0 : t[d]) ?? {}).forEach((o) => {
|
|
113
|
+
var l, i;
|
|
114
|
+
const r = (l = t == null ? void 0 : t[d]) == null ? void 0 : l[o];
|
|
115
|
+
if (U(o) && r) {
|
|
116
|
+
const c = k(r), h = A(r) || c;
|
|
80
117
|
let p = null;
|
|
81
|
-
typeof
|
|
82
|
-
const
|
|
118
|
+
typeof h != "boolean" && (p = h);
|
|
119
|
+
const V = {
|
|
83
120
|
type: "req",
|
|
84
|
-
title:
|
|
85
|
-
href: `#${
|
|
86
|
-
operationId: (
|
|
87
|
-
description:
|
|
88
|
-
httpVerb:
|
|
89
|
-
path:
|
|
90
|
-
operation:
|
|
121
|
+
title: r.name ?? r.path,
|
|
122
|
+
href: `#${r.id}`,
|
|
123
|
+
operationId: (i = r.information) == null ? void 0 : i.operationId,
|
|
124
|
+
description: r.description ?? "",
|
|
125
|
+
httpVerb: r.httpVerb,
|
|
126
|
+
path: r.path,
|
|
127
|
+
operation: r
|
|
91
128
|
};
|
|
92
|
-
p && (
|
|
129
|
+
p && (V.body = p), a.value.push(V);
|
|
93
130
|
}
|
|
94
131
|
});
|
|
95
132
|
});
|
|
96
133
|
}
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
134
|
+
const I = e == null ? void 0 : e.webhooks, E = [];
|
|
135
|
+
I && I.forEach((t) => {
|
|
136
|
+
E.push({
|
|
100
137
|
type: "webhook",
|
|
101
|
-
title:
|
|
138
|
+
title: `${t.name}`,
|
|
102
139
|
href: `#${t.id}`,
|
|
103
|
-
description:
|
|
140
|
+
description: "Webhook",
|
|
104
141
|
httpVerb: t.httpVerb,
|
|
105
142
|
tag: t.name,
|
|
106
143
|
body: ""
|
|
107
|
-
}), a.value = a.value.concat(
|
|
144
|
+
}), a.value = a.value.concat(E);
|
|
108
145
|
});
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
146
|
+
const m = L ? {} : B(e), D = [];
|
|
147
|
+
m && (Object.keys(m).forEach((t) => {
|
|
148
|
+
D.push({
|
|
112
149
|
type: "model",
|
|
113
|
-
title:
|
|
114
|
-
href: `#${
|
|
115
|
-
description:
|
|
150
|
+
title: `${m[t].title ?? t}`,
|
|
151
|
+
href: `#${T({ name: t })}`,
|
|
152
|
+
description: "Model",
|
|
116
153
|
tag: t,
|
|
117
154
|
body: ""
|
|
118
155
|
});
|
|
119
|
-
}), a.value = a.value.concat(
|
|
156
|
+
}), a.value = a.value.concat(D)), v.setCollection(a.value);
|
|
120
157
|
},
|
|
121
158
|
{ immediate: !0 }
|
|
122
159
|
), {
|
|
123
160
|
resetSearch: N,
|
|
124
|
-
fuseSearch:
|
|
125
|
-
selectedSearchIndex:
|
|
126
|
-
selectedSearchResult:
|
|
127
|
-
searchResultsWithPlaceholderResults:
|
|
128
|
-
searchText:
|
|
161
|
+
fuseSearch: y,
|
|
162
|
+
selectedSearchIndex: s,
|
|
163
|
+
selectedSearchResult: P,
|
|
164
|
+
searchResultsWithPlaceholderResults: b,
|
|
165
|
+
searchText: n
|
|
129
166
|
};
|
|
130
167
|
}
|
|
131
168
|
export {
|
|
132
|
-
|
|
169
|
+
Z as useSearchIndex
|
|
133
170
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
|
-
import type { ApiClientConfiguration } from '@scalar/types/api-reference';
|
|
2
|
+
import type { ApiClientConfiguration, ApiReferenceConfiguration } from '@scalar/types/api-reference';
|
|
3
3
|
type __VLS_Props = {
|
|
4
|
-
configuration: Partial<Omit<ApiClientConfiguration, 'plugins'
|
|
4
|
+
configuration: Partial<Omit<ApiClientConfiguration, 'plugins'>> & Pick<ApiReferenceConfiguration, 'onBeforeRequest'>;
|
|
5
5
|
dereferencedDocument: OpenAPIV3_1.Document;
|
|
6
6
|
};
|
|
7
7
|
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/api-client-modal/ApiClientModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiClientModal.vue.d.ts","sourceRoot":"","sources":["../../../src/features/api-client-modal/ApiClientModal.vue"],"names":[],"mappings":"AAiLA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EACV,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,6BAA6B,CAAA;AAYpC,KAAK,WAAW,GAAG;IAEjB,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC,GAC7D,IAAI,CAAC,yBAAyB,EAAE,iBAAiB,CAAC,CAAA;IACpD,oBAAoB,EAAE,WAAW,CAAC,QAAQ,CAAA;CAC3C,CAAC;;AAkMF,wBAOG"}
|
|
@@ -1,79 +1,88 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useActiveEntities as
|
|
3
|
-
import { mutateSecuritySchemeDiff as
|
|
4
|
-
import { getServersFromOpenApiDocument as
|
|
1
|
+
import { defineComponent as S, ref as g, onMounted as E, watch as B, onBeforeUnmount as b, createElementBlock as D, openBlock as R } from "vue";
|
|
2
|
+
import { useActiveEntities as k, useWorkspace as q } from "@scalar/api-client/store";
|
|
3
|
+
import { mutateSecuritySchemeDiff as x } from "@scalar/api-client/views/Request/libs";
|
|
4
|
+
import { getServersFromOpenApiDocument as M } from "@scalar/oas-utils/transforms";
|
|
5
5
|
import { watchDebounced as d } from "@vueuse/core";
|
|
6
|
-
import
|
|
7
|
-
import { useNavState as
|
|
8
|
-
import { useApiClient as
|
|
9
|
-
import { useExampleStore as
|
|
10
|
-
const z = /* @__PURE__ */
|
|
6
|
+
import U from "microdiff";
|
|
7
|
+
import { useNavState as A } from "../../hooks/useNavState.js";
|
|
8
|
+
import { useApiClient as C } from "./useApiClient.js";
|
|
9
|
+
import { useExampleStore as y } from "../../legacy/stores/useExampleStore.js";
|
|
10
|
+
const z = /* @__PURE__ */ S({
|
|
11
11
|
__name: "ApiClientModal",
|
|
12
12
|
props: {
|
|
13
13
|
configuration: {},
|
|
14
14
|
dereferencedDocument: {}
|
|
15
15
|
},
|
|
16
|
-
setup(
|
|
17
|
-
const a =
|
|
16
|
+
setup(o) {
|
|
17
|
+
const a = g(null), { client: i, init: v } = C(), { selectedExampleKey: p, operationId: s } = y(), c = k(), u = q(), { isIntersectionEnabled: f } = A(), h = () => ({
|
|
18
|
+
name: "on-before-request",
|
|
19
|
+
hooks: {
|
|
20
|
+
onBeforeRequest: o.configuration.onBeforeRequest
|
|
21
|
+
}
|
|
22
|
+
});
|
|
18
23
|
return E(() => {
|
|
19
24
|
a.value && v({
|
|
20
25
|
el: a.value,
|
|
21
|
-
configuration:
|
|
22
|
-
|
|
26
|
+
configuration: {
|
|
27
|
+
...o.configuration,
|
|
28
|
+
// If the onBeforeRequest hook is configured, we add the plugin to the API client.
|
|
29
|
+
plugins: o.configuration.onBeforeRequest ? [h] : []
|
|
30
|
+
},
|
|
31
|
+
store: u
|
|
23
32
|
});
|
|
24
33
|
}), d(
|
|
25
|
-
() =>
|
|
34
|
+
() => o.dereferencedDocument,
|
|
26
35
|
(e) => {
|
|
27
|
-
var r,
|
|
28
|
-
e && (
|
|
36
|
+
var r, n;
|
|
37
|
+
e && (c.activeCollection.value && ((r = i.value) == null || r.resetStore()), u.importSpecFile(void 0, "default", {
|
|
29
38
|
dereferencedDocument: e,
|
|
30
39
|
shouldLoad: !1,
|
|
31
|
-
documentUrl: (
|
|
40
|
+
documentUrl: (n = o.configuration) == null ? void 0 : n.url,
|
|
32
41
|
useCollectionSecurity: !0,
|
|
33
|
-
...
|
|
42
|
+
...o.configuration
|
|
34
43
|
}));
|
|
35
44
|
}
|
|
36
45
|
), d(
|
|
37
|
-
() =>
|
|
46
|
+
() => o.configuration,
|
|
38
47
|
(e, r) => {
|
|
39
|
-
if (!r || !
|
|
48
|
+
if (!r || !c.activeCollection.value)
|
|
40
49
|
return;
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
50
|
+
const n = c.activeCollection.value, m = U(r, e);
|
|
51
|
+
if (!m.some(
|
|
43
52
|
(t) => t.path[0] === "url" || t.path[0] === "content" || t.path[1] === "url" || t.path[1] === "content"
|
|
44
53
|
)) {
|
|
45
|
-
if (
|
|
46
|
-
t.path[0] === "authentication" &&
|
|
54
|
+
if (m.forEach((t) => {
|
|
55
|
+
t.path[0] === "authentication" && x(t, c, u);
|
|
47
56
|
}), e.servers || r.servers) {
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
n.servers.forEach((l) => {
|
|
58
|
+
u.serverMutators.delete(l, n.uid);
|
|
50
59
|
});
|
|
51
|
-
const t =
|
|
52
|
-
e.servers ??
|
|
60
|
+
const t = M(
|
|
61
|
+
e.servers ?? o.dereferencedDocument.servers,
|
|
53
62
|
{
|
|
54
63
|
baseServerURL: e.baseServerURL
|
|
55
64
|
}
|
|
56
65
|
);
|
|
57
66
|
t.forEach((l) => {
|
|
58
|
-
|
|
59
|
-
}), t.length &&
|
|
60
|
-
|
|
67
|
+
u.serverMutators.add(l, n.uid);
|
|
68
|
+
}), t.length && u.collectionMutators.edit(
|
|
69
|
+
n.uid,
|
|
61
70
|
"selectedServerUid",
|
|
62
71
|
t[t.length - 1].uid
|
|
63
72
|
);
|
|
64
73
|
}
|
|
65
74
|
}
|
|
66
|
-
|
|
67
|
-
|
|
75
|
+
f.value = !1, setTimeout(() => {
|
|
76
|
+
f.value = !0;
|
|
68
77
|
}, 1e3);
|
|
69
78
|
},
|
|
70
79
|
{ deep: !0, debounce: 300 }
|
|
71
|
-
),
|
|
72
|
-
|
|
73
|
-
}),
|
|
80
|
+
), B(p, (e) => {
|
|
81
|
+
i.value && e && s.value && i.value.updateExample(e, s.value);
|
|
82
|
+
}), b(() => {
|
|
74
83
|
var e;
|
|
75
|
-
return (e =
|
|
76
|
-
}), (e, r) => (
|
|
84
|
+
return (e = i.value) == null ? void 0 : e.app.unmount();
|
|
85
|
+
}), (e, r) => (R(), D("div", {
|
|
77
86
|
ref_key: "el",
|
|
78
87
|
ref: a
|
|
79
88
|
}, null, 512));
|