@scalar/api-client 2.17.3 → 2.17.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 +40 -0
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +15 -10
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +70 -55
- package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-body.js +12 -8
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +3 -5
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request-security.js +31 -31
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +4 -6
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request.js +20 -21
- package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/helpers/get-example.js +22 -16
- package/dist/v2/blocks/operation-block/helpers/send-request.js +26 -26
- package/dist/v2/blocks/operation-block/index.d.ts +1 -0
- package/dist/v2/blocks/operation-block/index.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/index.js +4 -2
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +9 -4
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +81 -88
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +4 -4
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +1 -1
- package/dist/v2/blocks/operation-code-sample/index.d.ts +1 -0
- package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/index.js +11 -9
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +3 -2
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.js +2 -2
- package/dist/v2/blocks/request-block/RequestBlock.vue2.js +59 -63
- package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
- package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +78 -74
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +3 -3
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +43 -42
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +96 -86
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.d.ts +8 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.js +33 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.d.ts +7 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.js +13 -0
- package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts +3 -0
- package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/index.js +8 -2
- package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
- package/dist/v2/components/data-table/DataTableInput.vue.js +2 -2
- package/dist/v2/components/data-table/DataTableInput.vue2.js +25 -24
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +34 -33
- package/dist/v2/features/app/helpers/routes.d.ts +2 -0
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts.map +1 -1
- package/dist/v2/features/app/hooks/use-workspace-client-app-events.js +29 -29
- package/dist/v2/features/collection/DocumentCollection.vue.js +4 -3
- package/dist/v2/features/collection/WorkspaceCollection.vue.js +8 -7
- package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
- package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
- package/dist/v2/features/collection/components/Authentication.vue2.js +7 -6
- package/dist/v2/features/collection/components/Cookies.vue.js +1 -0
- package/dist/v2/features/collection/components/Environment.vue.js +1 -0
- package/dist/v2/features/collection/components/Overview.vue2.js +8 -7
- package/dist/v2/features/collection/components/Servers.vue.js +25 -24
- package/dist/v2/features/collection/components/Settings.vue.js +8 -7
- package/dist/v2/features/modal/Modal.vue.d.ts +6 -0
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +2 -2
- package/dist/v2/features/modal/Modal.vue2.js +66 -62
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +16 -16
- package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
- package/dist/v2/features/modal/helpers/create-api-client-modal.js +36 -29
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +1 -1
- package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +25 -12
- package/dist/v2/features/modal/index.d.ts +2 -1
- package/dist/v2/features/modal/index.d.ts.map +1 -1
- package/dist/v2/features/modal/index.js +3 -1
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +54 -62
- package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +1 -1
- package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +1 -1
- package/dist/v2/features/operation/helpers/get-security-requirements.js +2 -2
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts +5 -2
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -1
- package/dist/v2/features/operation/helpers/get-selected-security.js +11 -11
- package/dist/v2/features/operation/helpers/get-selected-server.d.ts +10 -0
- package/dist/v2/features/operation/helpers/get-selected-server.d.ts.map +1 -0
- package/dist/v2/features/operation/helpers/get-selected-server.js +4 -0
- package/dist/v2/features/operation/index.d.ts +3 -0
- package/dist/v2/features/operation/index.d.ts.map +1 -1
- package/dist/v2/features/operation/index.js +8 -2
- package/dist/v2/helpers/index.d.ts +3 -0
- package/dist/v2/helpers/index.d.ts.map +1 -0
- package/dist/v2/helpers/index.js +4 -0
- package/dist/v2/helpers/plugins.d.ts +7 -1
- package/dist/v2/helpers/plugins.d.ts.map +1 -1
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +22 -17
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { httpStatusCodes as S } from "@scalar/helpers/http/http-status-codes";
|
|
2
|
-
import { normalizeError as b, ERRORS as
|
|
3
|
-
import { normalizeHeaders as
|
|
2
|
+
import { normalizeError as b, ERRORS as q } from "../../../../libs/errors.js";
|
|
3
|
+
import { normalizeHeaders as x } from "../../../../libs/normalize-headers.js";
|
|
4
4
|
import { executeHook as f } from "../../../helpers/plugins.js";
|
|
5
|
-
import { decodeBuffer as
|
|
5
|
+
import { decodeBuffer as D } from "./decode-buffer.js";
|
|
6
6
|
import { getCookieHeaderKeys as T } from "./get-cookie-header-keys.js";
|
|
7
|
-
const
|
|
7
|
+
const E = [204, 205, 304], v = async ({
|
|
8
8
|
isUsingProxy: t,
|
|
9
|
-
operation:
|
|
9
|
+
operation: r,
|
|
10
10
|
request: i,
|
|
11
11
|
plugins: n
|
|
12
12
|
}) => {
|
|
13
13
|
try {
|
|
14
|
-
const s = await f(i, "beforeRequest", n), m = Date.now(), e = await fetch(s), a = Date.now(), c = a - m, d = e.headers.get("content-type"),
|
|
15
|
-
return d?.startsWith("text/event-stream") && e.body ?
|
|
14
|
+
const { request: s } = await f({ request: i }, "beforeRequest", n), m = Date.now(), e = await fetch(s), a = Date.now(), c = a - m, d = e.headers.get("content-type"), o = x(e.headers, t), u = new URL(e.url), h = u.pathname + u.search, p = e.statusText || S[e.status]?.name || "", l = s.method, y = E.includes(e.status);
|
|
15
|
+
return d?.startsWith("text/event-stream") && e.body ? H({
|
|
16
16
|
response: e,
|
|
17
17
|
modifiedRequest: s,
|
|
18
|
-
operation:
|
|
18
|
+
operation: r,
|
|
19
19
|
plugins: n,
|
|
20
20
|
endTime: a,
|
|
21
21
|
duration: c,
|
|
22
|
-
responseHeaders:
|
|
22
|
+
responseHeaders: o,
|
|
23
23
|
statusText: p,
|
|
24
24
|
method: l,
|
|
25
25
|
fullPath: h
|
|
26
|
-
}) :
|
|
26
|
+
}) : k({
|
|
27
27
|
response: e,
|
|
28
28
|
modifiedRequest: s,
|
|
29
|
-
operation:
|
|
29
|
+
operation: r,
|
|
30
30
|
plugins: n,
|
|
31
31
|
endTime: a,
|
|
32
32
|
duration: c,
|
|
33
|
-
responseHeaders:
|
|
33
|
+
responseHeaders: o,
|
|
34
34
|
statusText: p,
|
|
35
35
|
method: l,
|
|
36
36
|
fullPath: h,
|
|
@@ -38,11 +38,11 @@ const H = [204, 205, 304], v = async ({
|
|
|
38
38
|
shouldSkipBody: y
|
|
39
39
|
});
|
|
40
40
|
} catch (s) {
|
|
41
|
-
return [b(s,
|
|
41
|
+
return [b(s, q.REQUEST_FAILED), null];
|
|
42
42
|
}
|
|
43
|
-
},
|
|
43
|
+
}, H = async ({
|
|
44
44
|
response: t,
|
|
45
|
-
modifiedRequest:
|
|
45
|
+
modifiedRequest: r,
|
|
46
46
|
operation: i,
|
|
47
47
|
plugins: n,
|
|
48
48
|
endTime: s,
|
|
@@ -52,20 +52,20 @@ const H = [204, 205, 304], v = async ({
|
|
|
52
52
|
method: c,
|
|
53
53
|
fullPath: d
|
|
54
54
|
}) => {
|
|
55
|
-
const
|
|
55
|
+
const o = new Response(null, {
|
|
56
56
|
status: t.status,
|
|
57
57
|
statusText: a,
|
|
58
58
|
headers: t.headers
|
|
59
59
|
});
|
|
60
|
-
await f({ response:
|
|
61
|
-
const u = T(
|
|
60
|
+
await f({ response: o, request: r, operation: i }, "responseReceived", n);
|
|
61
|
+
const u = T(o.headers);
|
|
62
62
|
return [
|
|
63
63
|
null,
|
|
64
64
|
{
|
|
65
65
|
timestamp: s,
|
|
66
|
-
request:
|
|
66
|
+
request: r,
|
|
67
67
|
response: {
|
|
68
|
-
...
|
|
68
|
+
...o,
|
|
69
69
|
headers: e,
|
|
70
70
|
cookieHeaderKeys: u,
|
|
71
71
|
reader: t.body.getReader(),
|
|
@@ -75,9 +75,9 @@ const H = [204, 205, 304], v = async ({
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
];
|
|
78
|
-
},
|
|
78
|
+
}, k = async ({
|
|
79
79
|
response: t,
|
|
80
|
-
modifiedRequest:
|
|
80
|
+
modifiedRequest: r,
|
|
81
81
|
operation: i,
|
|
82
82
|
plugins: n,
|
|
83
83
|
endTime: s,
|
|
@@ -86,21 +86,21 @@ const H = [204, 205, 304], v = async ({
|
|
|
86
86
|
statusText: a,
|
|
87
87
|
method: c,
|
|
88
88
|
fullPath: d,
|
|
89
|
-
contentType:
|
|
89
|
+
contentType: o,
|
|
90
90
|
shouldSkipBody: u
|
|
91
91
|
}) => {
|
|
92
|
-
const p = await t.clone().arrayBuffer(), y =
|
|
92
|
+
const p = await t.clone().arrayBuffer(), y = D(p, o ?? "text/plain;charset=UTF-8"), R = new Response(u ? null : p, {
|
|
93
93
|
status: t.status,
|
|
94
94
|
statusText: a,
|
|
95
95
|
headers: t.headers
|
|
96
96
|
});
|
|
97
|
-
await f({ response: R, request:
|
|
97
|
+
await f({ response: R, request: r, operation: i }, "responseReceived", n);
|
|
98
98
|
const w = T(R.headers);
|
|
99
99
|
return [
|
|
100
100
|
null,
|
|
101
101
|
{
|
|
102
102
|
timestamp: s,
|
|
103
|
-
request:
|
|
103
|
+
request: r,
|
|
104
104
|
response: {
|
|
105
105
|
...R,
|
|
106
106
|
headers: e,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AACrE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getSecuritySchemes as r } from "./helpers/build-request-security.js";
|
|
2
|
+
import { default as a } from "./OperationBlock.vue.js";
|
|
2
3
|
export {
|
|
3
|
-
|
|
4
|
+
a as OperationBlock,
|
|
5
|
+
r as getSecuritySchemes
|
|
4
6
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods';
|
|
2
2
|
import { type AvailableClients } from '@scalar/snippetz';
|
|
3
|
+
import { type WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
3
4
|
import type { OperationObject, SecuritySchemeObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
4
5
|
import type { ClientOptionGroup } from '../../../../v2/blocks/operation-code-sample/types';
|
|
5
6
|
export type OperationCodeSampleProps = {
|
|
@@ -16,7 +17,7 @@ export type OperationCodeSampleProps = {
|
|
|
16
17
|
/**
|
|
17
18
|
* Which server from the spec to use for the code example
|
|
18
19
|
*/
|
|
19
|
-
selectedServer?: ServerObject |
|
|
20
|
+
selectedServer?: ServerObject | null;
|
|
20
21
|
/**
|
|
21
22
|
* The selected content type from the requestBody.content, this will determine which examples are available
|
|
22
23
|
* as well as the content type of the code example
|
|
@@ -53,10 +54,14 @@ export type OperationCodeSampleProps = {
|
|
|
53
54
|
* ```
|
|
54
55
|
*/
|
|
55
56
|
selectedExample?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Event bus
|
|
59
|
+
*/
|
|
60
|
+
eventBus: WorkspaceEventBus;
|
|
56
61
|
/**
|
|
57
62
|
* The security schemes which are applicable to this operation
|
|
58
63
|
*/
|
|
59
|
-
securitySchemes
|
|
64
|
+
securitySchemes: SecuritySchemeObject[];
|
|
60
65
|
/**
|
|
61
66
|
* HTTP method of the operation
|
|
62
67
|
*/
|
|
@@ -88,8 +93,8 @@ export type OperationCodeSampleProps = {
|
|
|
88
93
|
* The core component for rendering a request example block,
|
|
89
94
|
* this component does not have much of its own state but operates on props and custom events
|
|
90
95
|
*
|
|
91
|
-
* @event
|
|
92
|
-
* @event scalar-update-selected-example -
|
|
96
|
+
* @event workspace:update:selected-client - Emitted when the selected client changes
|
|
97
|
+
* @event scalar-update-selected-example - removed for now, we can bring it back when we need it
|
|
93
98
|
*/
|
|
94
99
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<OperationCodeSampleProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OperationCodeSampleProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
95
100
|
header: () => unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationCodeSample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/components/OperationCodeSample.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OperationCodeSample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/components/OperationCodeSample.vue"],"names":[],"mappings":"AA0bA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAErF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACb,MAAM,8DAA8D,CAAA;AASrE,OAAO,KAAK,EAEV,iBAAiB,EAElB,MAAM,yCAAyC,CAAA;AAMhD,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC;;;;OAIG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACzC;;OAEG;IACH,cAAc,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IACpC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;OAEG;IACH,QAAQ,EAAE,iBAAiB,CAAA;IAC3B;;OAEG;IACH,eAAe,EAAE,oBAAoB,EAAE,CAAA;IACvC;;OAEG;IACH,MAAM,EAAE,cAAc,CAAA;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,SAAS,EAAE,eAAe,CAAA;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,MAAM,CAAA;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;;;;;;;GAQG;;YAmBO,MAAM,OAAO;YACb,MAAM,OAAO;;AAnBvB,wBAufC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./OperationCodeSample.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a3bf456d"]]);
|
|
5
5
|
export {
|
|
6
6
|
e as default
|
|
7
7
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarCard as
|
|
3
|
-
import { freezeElement as
|
|
4
|
-
import { ScalarIconCaretDown as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import q from "
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
const le = ["innerHTML"], oe = ["id"], ae = {
|
|
1
|
+
import { defineComponent as $, computed as a, ref as b, watch as D, useId as I, createBlock as c, createCommentVNode as d, openBlock as s, unref as o, withCtx as n, createVNode as r, createSlots as N, createElementVNode as C, createElementBlock as S, renderSlot as v, createTextVNode as W, toDisplayString as R } from "vue";
|
|
2
|
+
import { ScalarCard as x, ScalarCardHeader as z, ScalarCombobox as U, ScalarButton as A, ScalarCardSection as T, ScalarCodeBlock as F, ScalarVirtualText as M, ScalarCardFooter as K } from "@scalar/components";
|
|
3
|
+
import { freezeElement as Z } from "@scalar/helpers/dom/freeze-element";
|
|
4
|
+
import { ScalarIconCaretDown as G } from "@scalar/icons";
|
|
5
|
+
import { getResolvedRef as J } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
6
|
+
import { operationToHar as P } from "../helpers/operation-to-har/operation-to-har.js";
|
|
7
|
+
import V from "./HttpMethod.vue.js";
|
|
8
|
+
import { findClient as q } from "../helpers/find-client.js";
|
|
9
|
+
import { getClients as Q } from "../helpers/get-clients.js";
|
|
10
|
+
import { getCustomCodeSamples as X } from "../helpers/get-custom-code-samples.js";
|
|
11
|
+
import { getSecrets as Y } from "../helpers/get-secrets.js";
|
|
12
|
+
import { generateCodeSnippet as _ } from "../helpers/generate-code-snippet.js";
|
|
13
|
+
import ee from "./ExamplePicker.vue.js";
|
|
14
|
+
const te = ["innerHTML"], le = ["id"], oe = {
|
|
16
15
|
key: 0,
|
|
17
16
|
class: "request-card-footer-addon"
|
|
18
|
-
},
|
|
19
|
-
...
|
|
17
|
+
}, ae = { class: "request-header" }, ne = {}, be = /* @__PURE__ */ $({
|
|
18
|
+
...ne,
|
|
20
19
|
__name: "OperationCodeSample",
|
|
21
20
|
props: {
|
|
22
21
|
clientOptions: {},
|
|
23
22
|
selectedClient: {},
|
|
24
|
-
selectedServer: { default:
|
|
23
|
+
selectedServer: { default: null },
|
|
25
24
|
selectedContentType: {},
|
|
26
25
|
selectedExample: {},
|
|
26
|
+
eventBus: {},
|
|
27
27
|
securitySchemes: { default: () => [] },
|
|
28
28
|
method: {},
|
|
29
29
|
path: {},
|
|
@@ -33,36 +33,36 @@ const le = ["innerHTML"], oe = ["id"], ae = {
|
|
|
33
33
|
isWebhook: { type: Boolean }
|
|
34
34
|
},
|
|
35
35
|
setup(t) {
|
|
36
|
-
const
|
|
37
|
-
const e =
|
|
36
|
+
const i = a(() => {
|
|
37
|
+
const e = J(t.operation.requestBody)?.content ?? {}, l = t.selectedContentType || Object.keys(e)[0];
|
|
38
38
|
return l ? e[l]?.examples ?? {} : {};
|
|
39
|
-
}),
|
|
40
|
-
t.selectedExample ?? Object.keys(
|
|
41
|
-
), g = a(() =>
|
|
42
|
-
() =>
|
|
43
|
-
), u =
|
|
44
|
-
|
|
39
|
+
}), m = b(
|
|
40
|
+
t.selectedExample ?? Object.keys(i.value)[0] ?? ""
|
|
41
|
+
), g = a(() => X(t.operation)), f = a(
|
|
42
|
+
() => Q(g.value, t.clientOptions)
|
|
43
|
+
), u = b(
|
|
44
|
+
q(f.value, t.selectedClient)
|
|
45
45
|
);
|
|
46
|
-
|
|
46
|
+
D(
|
|
47
47
|
() => t.selectedClient,
|
|
48
48
|
(e) => {
|
|
49
|
-
const l =
|
|
49
|
+
const l = q(f.value, e);
|
|
50
50
|
l && (u.value = l);
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
|
-
const
|
|
53
|
+
const y = a(() => {
|
|
54
54
|
if (!t.isWebhook) return null;
|
|
55
55
|
try {
|
|
56
|
-
return
|
|
56
|
+
return P({
|
|
57
57
|
operation: t.operation,
|
|
58
58
|
method: t.method,
|
|
59
59
|
path: t.path,
|
|
60
|
-
example:
|
|
60
|
+
example: m.value
|
|
61
61
|
});
|
|
62
62
|
} catch (e) {
|
|
63
63
|
return console.error("[webhookHar]", e), null;
|
|
64
64
|
}
|
|
65
|
-
}),
|
|
65
|
+
}), h = a(() => t.isWebhook ? y.value?.postData?.text ?? "" : _({
|
|
66
66
|
clientId: u.value?.id,
|
|
67
67
|
customCodeSamples: g.value,
|
|
68
68
|
operation: t.operation,
|
|
@@ -71,65 +71,65 @@ const le = ["innerHTML"], oe = ["id"], ae = {
|
|
|
71
71
|
contentType: t.selectedContentType,
|
|
72
72
|
server: t.selectedServer,
|
|
73
73
|
securitySchemes: t.securitySchemes,
|
|
74
|
-
example:
|
|
75
|
-
})), B = a(() => t.isWebhook ?
|
|
76
|
-
if (!
|
|
77
|
-
const e =
|
|
74
|
+
example: m.value
|
|
75
|
+
})), B = a(() => t.isWebhook ? w.value : u.value?.lang), w = a(() => {
|
|
76
|
+
if (!y.value?.postData) return "json";
|
|
77
|
+
const e = y.value.postData.mimeType;
|
|
78
78
|
return e?.includes("json") ? "json" : e?.includes("xml") ? "xml" : e?.includes("yaml") || e?.includes("yml") ? "yaml" : e?.includes("text/plain") ? "text" : "json";
|
|
79
|
-
}), O = a(() =>
|
|
80
|
-
if (
|
|
81
|
-
const l =
|
|
79
|
+
}), O = a(() => Y(t.securitySchemes)), k = b(null), j = (e) => {
|
|
80
|
+
if (k.value) {
|
|
81
|
+
const l = Z(k.value.$el);
|
|
82
82
|
setTimeout(() => {
|
|
83
83
|
l();
|
|
84
84
|
}, 300);
|
|
85
85
|
}
|
|
86
|
-
u.value = e, e.id.startsWith("custom")
|
|
87
|
-
},
|
|
88
|
-
() => (
|
|
89
|
-
), L =
|
|
90
|
-
return (e, l) =>
|
|
86
|
+
u.value = e, e && !e.id.startsWith("custom") && t.eventBus.emit("workspace:update:selected-client", e.id);
|
|
87
|
+
}, E = 2e4, H = a(
|
|
88
|
+
() => (h.value.length ?? 0) > E
|
|
89
|
+
), L = I();
|
|
90
|
+
return (e, l) => h.value ? (s(), c(o(x), {
|
|
91
91
|
key: 0,
|
|
92
92
|
ref_key: "elem",
|
|
93
|
-
ref:
|
|
93
|
+
ref: k,
|
|
94
94
|
class: "request-card dark-mode"
|
|
95
95
|
}, {
|
|
96
96
|
default: n(() => [
|
|
97
|
-
r(o(
|
|
97
|
+
r(o(z), { class: "pr-2.5" }, N({
|
|
98
98
|
default: n(() => [
|
|
99
|
-
l[
|
|
100
|
-
r(
|
|
99
|
+
l[2] || (l[2] = C("span", { class: "sr-only" }, "Request Example for", -1)),
|
|
100
|
+
r(V, {
|
|
101
101
|
as: "span",
|
|
102
102
|
class: "request-method",
|
|
103
103
|
method: e.method
|
|
104
104
|
}, null, 8, ["method"]),
|
|
105
|
-
e.generateLabel ? (s(),
|
|
105
|
+
e.generateLabel ? (s(), S("span", {
|
|
106
106
|
key: 0,
|
|
107
107
|
innerHTML: e.generateLabel()
|
|
108
|
-
}, null, 8,
|
|
109
|
-
|
|
108
|
+
}, null, 8, te)) : d("", !0),
|
|
109
|
+
v(e.$slots, "header", {}, void 0, !0)
|
|
110
110
|
]),
|
|
111
111
|
_: 2
|
|
112
112
|
}, [
|
|
113
|
-
!e.isWebhook &&
|
|
113
|
+
!e.isWebhook && f.value.length ? {
|
|
114
114
|
name: "actions",
|
|
115
115
|
fn: n(() => [
|
|
116
|
-
r(o(
|
|
116
|
+
r(o(U), {
|
|
117
117
|
class: "max-h-80",
|
|
118
118
|
modelValue: u.value,
|
|
119
|
-
options:
|
|
119
|
+
options: f.value,
|
|
120
120
|
placement: "bottom-end",
|
|
121
121
|
teleport: "",
|
|
122
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
122
|
+
"onUpdate:modelValue": l[0] || (l[0] = (p) => j(p))
|
|
123
123
|
}, {
|
|
124
124
|
default: n(() => [
|
|
125
|
-
r(o(
|
|
125
|
+
r(o(A), {
|
|
126
126
|
class: "text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-0.5 py-0 text-base font-normal",
|
|
127
127
|
"data-testid": "client-picker",
|
|
128
128
|
variant: "ghost"
|
|
129
129
|
}, {
|
|
130
130
|
default: n(() => [
|
|
131
|
-
R(
|
|
132
|
-
r(o(
|
|
131
|
+
W(R(u.value?.title) + " ", 1),
|
|
132
|
+
r(o(G), {
|
|
133
133
|
class: "ui-open:rotate-180 mt-0.25 size-3 transition-transform duration-100",
|
|
134
134
|
weight: "bold"
|
|
135
135
|
})
|
|
@@ -145,78 +145,71 @@ const le = ["innerHTML"], oe = ["id"], ae = {
|
|
|
145
145
|
]), 1024),
|
|
146
146
|
r(o(T), { class: "request-editor-section custom-scroll p-0" }, {
|
|
147
147
|
default: n(() => [
|
|
148
|
-
|
|
148
|
+
C("div", {
|
|
149
149
|
id: `${o(L)}-example`,
|
|
150
150
|
class: "code-snippet"
|
|
151
151
|
}, [
|
|
152
|
-
H.value ? (s(),
|
|
152
|
+
H.value ? (s(), c(o(M), {
|
|
153
153
|
key: 1,
|
|
154
154
|
containerClass: "custom-scroll scalar-code-block border rounded-b flex flex-1 max-h-screen",
|
|
155
155
|
contentClass: "language-plaintext whitespace-pre font-code text-base",
|
|
156
156
|
lineHeight: 20,
|
|
157
|
-
text:
|
|
158
|
-
}, null, 8, ["text"])) : (s(),
|
|
157
|
+
text: h.value
|
|
158
|
+
}, null, 8, ["text"])) : (s(), c(o(F), {
|
|
159
159
|
key: 0,
|
|
160
160
|
class: "bg-b-2 !min-h-full -outline-offset-2",
|
|
161
|
-
content:
|
|
161
|
+
content: h.value,
|
|
162
162
|
hideCredentials: O.value,
|
|
163
163
|
lang: B.value,
|
|
164
164
|
lineNumbers: ""
|
|
165
165
|
}, null, 8, ["content", "hideCredentials", "lang"]))
|
|
166
|
-
], 8,
|
|
166
|
+
], 8, le)
|
|
167
167
|
]),
|
|
168
168
|
_: 1
|
|
169
169
|
}),
|
|
170
|
-
Object.keys(
|
|
170
|
+
Object.keys(i.value).length > 1 || e.$slots.footer ? (s(), c(o(K), {
|
|
171
171
|
key: 0,
|
|
172
172
|
class: "request-card-footer bg-b-3"
|
|
173
173
|
}, {
|
|
174
174
|
default: n(() => [
|
|
175
|
-
Object.keys(
|
|
176
|
-
Object.keys(
|
|
175
|
+
Object.keys(i.value).length > 1 ? (s(), S("div", oe, [
|
|
176
|
+
Object.keys(i.value).length ? (s(), c(ee, {
|
|
177
177
|
key: 0,
|
|
178
|
-
modelValue:
|
|
179
|
-
"onUpdate:modelValue": [
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
c
|
|
185
|
-
))
|
|
186
|
-
],
|
|
187
|
-
examples: d.value
|
|
188
|
-
}, null, 8, ["modelValue", "examples"])) : f("", !0)
|
|
189
|
-
])) : f("", !0),
|
|
190
|
-
y(e.$slots, "footer", {}, void 0, !0)
|
|
178
|
+
modelValue: m.value,
|
|
179
|
+
"onUpdate:modelValue": l[1] || (l[1] = (p) => m.value = p),
|
|
180
|
+
examples: i.value
|
|
181
|
+
}, null, 8, ["modelValue", "examples"])) : d("", !0)
|
|
182
|
+
])) : d("", !0),
|
|
183
|
+
v(e.$slots, "footer", {}, void 0, !0)
|
|
191
184
|
]),
|
|
192
185
|
_: 3
|
|
193
|
-
})) :
|
|
186
|
+
})) : d("", !0)
|
|
194
187
|
]),
|
|
195
188
|
_: 3
|
|
196
|
-
}, 512)) : e.fallback ? (s(),
|
|
189
|
+
}, 512)) : e.fallback ? (s(), c(o(x), {
|
|
197
190
|
key: 1,
|
|
198
191
|
class: "request-card dark-mode"
|
|
199
192
|
}, {
|
|
200
193
|
default: n(() => [
|
|
201
194
|
r(o(T), { class: "request-card-simple" }, {
|
|
202
195
|
default: n(() => [
|
|
203
|
-
|
|
204
|
-
r(
|
|
196
|
+
C("div", ae, [
|
|
197
|
+
r(V, {
|
|
205
198
|
as: "span",
|
|
206
199
|
class: "request-method",
|
|
207
200
|
method: e.method
|
|
208
201
|
}, null, 8, ["method"]),
|
|
209
|
-
|
|
202
|
+
v(e.$slots, "header", {}, void 0, !0)
|
|
210
203
|
]),
|
|
211
|
-
|
|
204
|
+
v(e.$slots, "footer", {}, void 0, !0)
|
|
212
205
|
]),
|
|
213
206
|
_: 3
|
|
214
207
|
})
|
|
215
208
|
]),
|
|
216
209
|
_: 3
|
|
217
|
-
})) :
|
|
210
|
+
})) : d("", !0);
|
|
218
211
|
}
|
|
219
212
|
});
|
|
220
213
|
export {
|
|
221
|
-
|
|
214
|
+
be as default
|
|
222
215
|
};
|
|
@@ -7,11 +7,11 @@ export type GenerateCodeSnippetProps = {
|
|
|
7
7
|
/** The selected client/language for code generation (e.g., 'node/fetch') or a custom code sample ID. */
|
|
8
8
|
clientId: AvailableClient | CustomCodeSampleId | undefined;
|
|
9
9
|
/** The Content-Type header value for the request body (e.g., 'application/json'). */
|
|
10
|
-
contentType
|
|
10
|
+
contentType: string | undefined;
|
|
11
11
|
/** Array of custom code samples defined in the OpenAPI x-codeSamples extension. */
|
|
12
12
|
customCodeSamples: XCodeSample[];
|
|
13
13
|
/** The specific example value to use when generating the code snippet. */
|
|
14
|
-
example
|
|
14
|
+
example: string | undefined;
|
|
15
15
|
/** The HTTP method for the operation (e.g., GET, POST, PUT). */
|
|
16
16
|
method: HttpMethod;
|
|
17
17
|
/** The OpenAPI operation object containing request/response details. */
|
|
@@ -19,9 +19,9 @@ export type GenerateCodeSnippetProps = {
|
|
|
19
19
|
/** The API endpoint path (e.g., '/users/{id}'). */
|
|
20
20
|
path: string;
|
|
21
21
|
/** Array of security schemes to apply to the request (e.g., API keys, OAuth). */
|
|
22
|
-
securitySchemes
|
|
22
|
+
securitySchemes: SecuritySchemeObject[];
|
|
23
23
|
/** The server object defining the base URL for the API request. */
|
|
24
|
-
server
|
|
24
|
+
server: ServerObject | null;
|
|
25
25
|
};
|
|
26
26
|
/** Generate the code snippet for the selected example OR operation */
|
|
27
27
|
export declare const generateCodeSnippet: ({ clientId, customCodeSamples, operation, method, path, example, contentType, server, securitySchemes, }: GenerateCodeSnippetProps) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-code-snippet.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/generate-code-snippet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAsB,MAAM,kBAAkB,CAAA;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAA;AACvF,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAKrE,OAAO,EAAE,KAAK,kBAAkB,EAAoB,MAAM,2BAA2B,CAAA;AAErF,MAAM,MAAM,wBAAwB,GAAG;IACrC,wGAAwG;IACxG,QAAQ,EAAE,eAAe,GAAG,kBAAkB,GAAG,SAAS,CAAA;IAC1D,qFAAqF;IACrF,WAAW,
|
|
1
|
+
{"version":3,"file":"generate-code-snippet.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/generate-code-snippet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAsB,MAAM,kBAAkB,CAAA;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAA;AACvF,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAKrE,OAAO,EAAE,KAAK,kBAAkB,EAAoB,MAAM,2BAA2B,CAAA;AAErF,MAAM,MAAM,wBAAwB,GAAG;IACrC,wGAAwG;IACxG,QAAQ,EAAE,eAAe,GAAG,kBAAkB,GAAG,SAAS,CAAA;IAC1D,qFAAqF;IACrF,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,mFAAmF;IACnF,iBAAiB,EAAE,WAAW,EAAE,CAAA;IAChC,0EAA0E;IAC1E,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,gEAAgE;IAChE,MAAM,EAAE,UAAU,CAAA;IAClB,wEAAwE;IACxE,SAAS,EAAE,eAAe,CAAA;IAC1B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAA;IACZ,iFAAiF;IACjF,eAAe,EAAE,oBAAoB,EAAE,CAAA;IACvC,mEAAmE;IACnE,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;CAC5B,CAAA;AAED,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,GAAI,0GAUjC,wBAAwB,KAAG,MAqC7B,CAAA"}
|
|
@@ -22,7 +22,7 @@ export type OperationToHarProps = {
|
|
|
22
22
|
*/
|
|
23
23
|
contentType?: string;
|
|
24
24
|
/** OpenAPI Server object */
|
|
25
|
-
server?: ServerObject |
|
|
25
|
+
server?: ServerObject | null;
|
|
26
26
|
/** OpenAPI SecurityScheme objects which are applicable to the operation */
|
|
27
27
|
securitySchemes?: SecuritySchemeObject[];
|
|
28
28
|
};
|
package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-to-har.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACb,MAAM,8DAA8D,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAOvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,+BAA+B;IAC/B,SAAS,EAAE,eAAe,CAAA;IAC1B,mCAAmC;IACnC,MAAM,EAAE,UAAU,CAAA;IAClB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"operation-to-har.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACb,MAAM,8DAA8D,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAOvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,+BAA+B;IAC/B,SAAS,EAAE,eAAe,CAAA;IAC1B,mCAAmC;IACnC,MAAM,EAAE,UAAU,CAAA;IAClB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,YAAY,GAAG,IAAI,CAAA;IAC5B,2EAA2E;IAC3E,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAA;CACzC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc,GAAI,6EAQ5B,mBAAmB,KAAG,UAgFxB,CAAA"}
|
|
@@ -39,7 +39,7 @@ const b = ({
|
|
|
39
39
|
const o = e.headers.find(
|
|
40
40
|
(s) => s.name.toLowerCase() === "content-type"
|
|
41
41
|
);
|
|
42
|
-
o && !o.value ? o.value = r.mimeType : e.headers.push({
|
|
42
|
+
o && !o.value ? o.value = r.mimeType : o || e.headers.push({
|
|
43
43
|
name: "Content-Type",
|
|
44
44
|
value: r.mimeType
|
|
45
45
|
});
|
|
@@ -3,5 +3,6 @@ export { default as OperationCodeSample } from './components/OperationCodeSample
|
|
|
3
3
|
export { DEFAULT_CLIENT, findClient, isClient } from './helpers/find-client.js';
|
|
4
4
|
export { generateClientOptions } from './helpers/generate-client-options.js';
|
|
5
5
|
export { getExampleFromSchema } from './helpers/get-example-from-schema.js';
|
|
6
|
+
export { getResolvedRefDeep } from './helpers/get-resolved-ref-deep.js';
|
|
6
7
|
export type { ClientOption, ClientOptionGroup, CustomClientOption, CustomClientOptionGroup } from './types';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-code-sample/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,sCAAsC,CAAA;AACrF,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-code-sample/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,sCAAsC,CAAA;AACrF,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AACpE,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { default as r } from "./components/ExamplePicker.vue.js";
|
|
2
|
-
import { default as
|
|
3
|
-
import { DEFAULT_CLIENT as
|
|
4
|
-
import { generateClientOptions as
|
|
5
|
-
import { getExampleFromSchema as
|
|
2
|
+
import { default as p } from "./components/OperationCodeSample.vue.js";
|
|
3
|
+
import { DEFAULT_CLIENT as a, findClient as f, isClient as l } from "./helpers/find-client.js";
|
|
4
|
+
import { generateClientOptions as x } from "./helpers/generate-client-options.js";
|
|
5
|
+
import { getExampleFromSchema as d } from "./helpers/get-example-from-schema.js";
|
|
6
|
+
import { getResolvedRefDeep as C } from "./helpers/get-resolved-ref-deep.js";
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
+
a as DEFAULT_CLIENT,
|
|
8
9
|
r as ExamplePicker,
|
|
9
|
-
|
|
10
|
+
p as OperationCodeSample,
|
|
10
11
|
f as findClient,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
x as generateClientOptions,
|
|
13
|
+
d as getExampleFromSchema,
|
|
14
|
+
C as getResolvedRefDeep,
|
|
15
|
+
l as isClient
|
|
14
16
|
};
|
|
@@ -3,11 +3,12 @@ import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
|
3
3
|
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
4
4
|
import type { AuthMeta } from '@scalar/workspace-store/mutators';
|
|
5
5
|
import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
|
|
6
|
-
import type { OpenApiDocument, OperationObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
6
|
+
import type { OpenApiDocument, OperationObject, SecuritySchemeObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
7
7
|
import type { ClientLayout } from '../../../hooks/index.js';
|
|
8
8
|
import type { ClientOptionGroup } from '../../../v2/blocks/operation-code-sample/index.js';
|
|
9
9
|
import type { ClientPlugin } from '../../../v2/helpers/plugins.js';
|
|
10
10
|
type __VLS_Props = {
|
|
11
|
+
selectedSecurity: OpenApiDocument['x-scalar-selected-security'];
|
|
11
12
|
authMeta: AuthMeta;
|
|
12
13
|
clientOptions: ClientOptionGroup[];
|
|
13
14
|
environment: XScalarEnvironment;
|
|
@@ -22,7 +23,7 @@ type __VLS_Props = {
|
|
|
22
23
|
securityRequirements: OpenApiDocument['security'];
|
|
23
24
|
securitySchemes: NonNullable<OpenApiDocument['components']>['securitySchemes'];
|
|
24
25
|
selectedClient: WorkspaceStore['workspace']['x-scalar-default-client'];
|
|
25
|
-
|
|
26
|
+
selectedSecuritySchemes: SecuritySchemeObject[];
|
|
26
27
|
server: ServerObject | null;
|
|
27
28
|
};
|
|
28
29
|
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, {}, any>;
|