@scalar/api-reference 1.25.111 → 1.25.113
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 +29 -0
- package/dist/browser/standalone.js +5991 -6107
- package/dist/browser/webpack-stats.json +1 -1
- package/dist/components/ApiReferenceLayout.vue.d.ts.map +1 -1
- package/dist/components/ApiReferenceLayout.vue.js +2 -2
- package/dist/components/ApiReferenceLayout.vue2.js +103 -104
- package/dist/components/Content/Content.vue.d.ts +1 -3
- package/dist/components/Content/Content.vue.d.ts.map +1 -1
- package/dist/components/Content/Content.vue.js +1 -1
- package/dist/components/Content/Content.vue2.js +53 -55
- package/dist/features/ApiClientModal/ApiClientModal.vue.d.ts.map +1 -1
- package/dist/features/ApiClientModal/ApiClientModal.vue.js +24 -34
- package/dist/features/ApiClientModal/useApiClient.d.ts +60 -80
- package/dist/features/ApiClientModal/useApiClient.d.ts.map +1 -1
- package/dist/features/BaseUrl/BaseUrl.vue.d.ts +1 -16
- package/dist/features/BaseUrl/BaseUrl.vue.d.ts.map +1 -1
- package/dist/features/BaseUrl/BaseUrl.vue.js +36 -29
- package/dist/features/BaseUrl/index.d.ts +0 -1
- package/dist/features/BaseUrl/index.d.ts.map +1 -1
- package/dist/features/Operation/hooks/useRequestExample.d.ts.map +1 -1
- package/dist/features/Operation/hooks/useRequestExample.js +39 -51
- package/dist/index.js +1 -1
- package/dist/legacy/helpers/index.d.ts +0 -1
- package/dist/legacy/helpers/index.d.ts.map +1 -1
- package/dist/legacy/stores/index.d.ts +1 -2
- package/dist/legacy/stores/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +8 -8
- package/dist/features/BaseUrl/ServerForm.vue.d.ts +0 -18
- package/dist/features/BaseUrl/ServerForm.vue.d.ts.map +0 -1
- package/dist/features/BaseUrl/ServerForm.vue.js +0 -7
- package/dist/features/BaseUrl/ServerForm.vue2.js +0 -76
- package/dist/features/BaseUrl/ServerUrl.vue.d.ts +0 -9
- package/dist/features/BaseUrl/ServerUrl.vue.d.ts.map +0 -1
- package/dist/features/BaseUrl/ServerUrl.vue.js +0 -7
- package/dist/features/BaseUrl/ServerUrl.vue2.js +0 -27
- package/dist/features/BaseUrl/ServerUrlSelect.vue.d.ts +0 -28
- package/dist/features/BaseUrl/ServerUrlSelect.vue.d.ts.map +0 -1
- package/dist/features/BaseUrl/ServerUrlSelect.vue.js +0 -7
- package/dist/features/BaseUrl/ServerUrlSelect.vue2.js +0 -61
- package/dist/features/BaseUrl/ServerVariablesForm.vue.d.ts +0 -14
- package/dist/features/BaseUrl/ServerVariablesForm.vue.d.ts.map +0 -1
- package/dist/features/BaseUrl/ServerVariablesForm.vue.js +0 -7
- package/dist/features/BaseUrl/ServerVariablesForm.vue2.js +0 -59
- package/dist/features/BaseUrl/ServerVariablesSelect.vue.d.ts +0 -12
- package/dist/features/BaseUrl/ServerVariablesSelect.vue.d.ts.map +0 -1
- package/dist/features/BaseUrl/ServerVariablesSelect.vue.js +0 -7
- package/dist/features/BaseUrl/ServerVariablesSelect.vue2.js +0 -54
- package/dist/features/BaseUrl/ServerVariablesTextbox.vue.d.ts +0 -11
- package/dist/features/BaseUrl/ServerVariablesTextbox.vue.d.ts.map +0 -1
- package/dist/features/BaseUrl/ServerVariablesTextbox.vue.js +0 -7
- package/dist/features/BaseUrl/ServerVariablesTextbox.vue2.js +0 -29
- package/dist/features/BaseUrl/types.d.ts +0 -9
- package/dist/features/BaseUrl/types.d.ts.map +0 -1
- package/dist/features/BaseUrl/utils/getServers.d.ts +0 -15
- package/dist/features/BaseUrl/utils/getServers.d.ts.map +0 -1
- package/dist/features/BaseUrl/utils/getServers.js +0 -31
- package/dist/legacy/helpers/getUrlFromServerState.d.ts +0 -10
- package/dist/legacy/helpers/getUrlFromServerState.d.ts.map +0 -1
- package/dist/legacy/helpers/getUrlFromServerState.js +0 -18
- package/dist/legacy/stores/useServerStore.d.ts +0 -44
- package/dist/legacy/stores/useServerStore.d.ts.map +0 -1
- package/dist/legacy/stores/useServerStore.js +0 -88
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
|
-
import type { Spec } from '@scalar/types/legacy';
|
|
3
|
-
import { type Ref } from 'vue';
|
|
4
|
-
export type ServerState = {
|
|
5
|
-
selectedServer: null | number;
|
|
6
|
-
description?: string;
|
|
7
|
-
servers?: (OpenAPIV3.ServerObject | OpenAPIV3_1.ServerObject)[];
|
|
8
|
-
variables: {
|
|
9
|
-
[key: string]: string;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
export declare const createEmptyServerState: () => ServerState;
|
|
13
|
-
export declare const useServerStore: ({ specification, defaultServerUrl, servers, }?: {
|
|
14
|
-
specification?: Ref<Spec | undefined>;
|
|
15
|
-
/**
|
|
16
|
-
* The fallback server URL to use if no servers are found in the specification
|
|
17
|
-
*/
|
|
18
|
-
defaultServerUrl?: Ref<string | undefined>;
|
|
19
|
-
/**
|
|
20
|
-
* Overwrite the list of servers
|
|
21
|
-
*/
|
|
22
|
-
servers?: Ref<(OpenAPIV3.ServerObject | OpenAPIV3_1.ServerObject)[] | undefined>;
|
|
23
|
-
}) => {
|
|
24
|
-
server: {
|
|
25
|
-
selectedServer: null | number;
|
|
26
|
-
description?: string | undefined;
|
|
27
|
-
servers?: ({
|
|
28
|
-
url?: string | undefined;
|
|
29
|
-
description?: string | undefined;
|
|
30
|
-
variables?: {
|
|
31
|
-
[variable: string]: OpenAPIV3.ServerVariableObject;
|
|
32
|
-
} | undefined;
|
|
33
|
-
} | {
|
|
34
|
-
url?: string | undefined;
|
|
35
|
-
description?: string | undefined;
|
|
36
|
-
variables?: Record<string, OpenAPIV3_1.ServerVariableObject> | undefined;
|
|
37
|
-
})[] | undefined;
|
|
38
|
-
variables: {
|
|
39
|
-
[key: string]: string;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
setServer: (newState: Partial<ServerState>) => void;
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=useServerStore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useServerStore.d.ts","sourceRoot":"","sources":["../../../src/legacy/stores/useServerStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,KAAK,GAAG,EAAmB,MAAM,KAAK,CAAA;AAK/C,MAAM,MAAM,WAAW,GAAG;IACxB,cAAc,EAAE,IAAI,GAAG,MAAM,CAAA;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,YAAY,GAAG,WAAW,CAAC,YAAY,CAAC,EAAE,CAAA;IAC/D,SAAS,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CACrC,CAAA;AAED,eAAO,MAAM,sBAAsB,QAAO,WAIxC,CAAA;AA+DF,eAAO,MAAM,cAAc,mDAIxB;IACD,aAAa,CAAC,EAAE,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC,CAAA;IACrC;;OAEG;IACH,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC1C;;OAEG;IACH,OAAO,CAAC,EAAE,GAAG,CACX,CAAC,SAAS,CAAC,YAAY,GAAG,WAAW,CAAC,YAAY,CAAC,EAAE,GAAG,SAAS,CAClE,CAAA;CACF;;wBAzFiB,IAAI,GAAG,MAAM;sBACf,MAAM;;;;;;;;;;;;mBAET;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE;;0BAWT,OAAO,CAAC,WAAW,CAAC;CA4HhD,CAAA"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { reactive as l, watch as s } from "vue";
|
|
2
|
-
import { getServers as u } from "../../features/BaseUrl/utils/getServers.js";
|
|
3
|
-
import { createEmptySpecification as v } from "../../helpers/createEmptySpecification.js";
|
|
4
|
-
const j = () => ({
|
|
5
|
-
selectedServer: null,
|
|
6
|
-
servers: [],
|
|
7
|
-
variables: {}
|
|
8
|
-
}), o = l(j()), n = (e) => {
|
|
9
|
-
var b;
|
|
10
|
-
const t = (b = o.servers) == null ? void 0 : b[e.selectedServer ?? o.selectedServer ?? 0], r = t != null && t.variables ? Object.fromEntries(
|
|
11
|
-
Object.entries(t.variables).map(([a, m]) => [
|
|
12
|
-
a,
|
|
13
|
-
m.default ?? ""
|
|
14
|
-
])
|
|
15
|
-
) : {};
|
|
16
|
-
Object.assign(o, {
|
|
17
|
-
...o,
|
|
18
|
-
...e,
|
|
19
|
-
variables: {
|
|
20
|
-
...r,
|
|
21
|
-
...e.variables
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
function O(e) {
|
|
26
|
-
return Object.fromEntries(
|
|
27
|
-
Object.entries(e ?? {}).map(([t, r]) => {
|
|
28
|
-
var b, a, m;
|
|
29
|
-
return [
|
|
30
|
-
t,
|
|
31
|
-
// 1) Default
|
|
32
|
-
((b = r.default) == null ? void 0 : b.toString()) ?? // 2) First enum value
|
|
33
|
-
((m = (a = r.enum) == null ? void 0 : a[0]) == null ? void 0 : m.toString()) ?? // 3) Empty string
|
|
34
|
-
""
|
|
35
|
-
];
|
|
36
|
-
})
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
function g(e, t) {
|
|
40
|
-
return Object.fromEntries(
|
|
41
|
-
Object.entries(e).filter(
|
|
42
|
-
([r]) => r in (t.variables ?? {})
|
|
43
|
-
)
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
const V = ({
|
|
47
|
-
specification: e,
|
|
48
|
-
defaultServerUrl: t,
|
|
49
|
-
servers: r
|
|
50
|
-
} = {}) => ((e == null ? void 0 : e.value) !== void 0 && s(
|
|
51
|
-
() => [e == null ? void 0 : e.value, r == null ? void 0 : r.value, t == null ? void 0 : t.value],
|
|
52
|
-
() => {
|
|
53
|
-
const b = (
|
|
54
|
-
// Use the specification
|
|
55
|
-
(r == null ? void 0 : r.value) === void 0 ? (e == null ? void 0 : e.value) ?? v() : (
|
|
56
|
-
// Or create an empty one with the specified servers list
|
|
57
|
-
v({
|
|
58
|
-
servers: r.value
|
|
59
|
-
})
|
|
60
|
-
)
|
|
61
|
-
), a = u(b, {
|
|
62
|
-
defaultServerUrl: t == null ? void 0 : t.value
|
|
63
|
-
}), m = a == null ? void 0 : a[o.selectedServer ?? 0];
|
|
64
|
-
n({
|
|
65
|
-
servers: a,
|
|
66
|
-
variables: {
|
|
67
|
-
// Set the initial values for the variables
|
|
68
|
-
...O((m == null ? void 0 : m.variables) ?? {}),
|
|
69
|
-
// Don’t overwrite existing values, but filter out non-existing variables
|
|
70
|
-
...g(
|
|
71
|
-
o.variables,
|
|
72
|
-
(a == null ? void 0 : a[o.selectedServer ?? 0]) ?? {}
|
|
73
|
-
)
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
deep: !0,
|
|
79
|
-
immediate: !0
|
|
80
|
-
}
|
|
81
|
-
), {
|
|
82
|
-
server: o,
|
|
83
|
-
setServer: n
|
|
84
|
-
});
|
|
85
|
-
export {
|
|
86
|
-
j as createEmptyServerState,
|
|
87
|
-
V as useServerStore
|
|
88
|
-
};
|