@scalar/api-client 2.22.3 → 2.23.2
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 +49 -0
- package/dist/style.css +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +13 -3
- package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/OperationBlock.vue.js +68 -68
- package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +5 -3
- 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 +1 -1
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +3 -2
- package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/index.d.ts +2 -1
- package/dist/v2/blocks/operation-block/index.d.ts.map +1 -1
- package/dist/v2/blocks/operation-block/index.js +7 -4
- package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +3 -2
- 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 +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +3 -2
- package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts.map +1 -1
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +3 -2
- 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/process-security-schemes.d.ts +2 -2
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +8 -5
- 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 +4 -4
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
- package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +49 -45
- package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +4 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +18 -181
- 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 +118 -107
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +3 -2
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +30 -33
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +11 -178
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +107 -110
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js +5 -29
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts +6 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +85 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +9 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +15 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +3 -2
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +23 -0
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -0
- package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts +2 -2
- package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts.map +1 -1
- package/dist/v2/blocks/scalar-auth-selector-block/index.js +4 -6
- package/dist/v2/features/app/App.vue.d.ts.map +1 -1
- package/dist/v2/features/app/App.vue.js +127 -92
- package/dist/v2/features/app/app-state.d.ts +1 -1
- package/dist/v2/features/app/app-state.d.ts.map +1 -1
- package/dist/v2/features/app/app-state.js +145 -142
- package/dist/v2/features/app/helpers/routes.d.ts +1 -1
- package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
- package/dist/v2/features/app/helpers/routes.js +31 -25
- 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 +14 -11
- package/dist/v2/features/import-listener/ImportListener.vue.d.ts +52 -0
- package/dist/v2/features/import-listener/ImportListener.vue.d.ts.map +1 -0
- package/dist/v2/features/import-listener/ImportListener.vue.js +91 -0
- package/dist/v2/features/import-listener/ImportListener.vue2.js +4 -0
- package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts +7 -0
- package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts.map +1 -0
- package/dist/v2/features/import-listener/components/DropEventListener.vue.js +81 -0
- package/dist/v2/features/import-listener/components/DropEventListener.vue2.js +4 -0
- package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts +40 -0
- package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts.map +1 -0
- package/dist/v2/features/import-listener/components/ImportModal.vue.js +170 -0
- package/dist/v2/features/import-listener/components/ImportModal.vue3.js +5 -0
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts +29 -0
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts.map +1 -0
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.js +83 -0
- package/dist/v2/features/import-listener/components/WorkspaceSelector.vue2.js +4 -0
- package/dist/v2/features/import-listener/helpers/generate-unique-slug.d.ts +16 -0
- package/dist/v2/features/import-listener/helpers/generate-unique-slug.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/generate-unique-slug.js +11 -0
- package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts +8 -0
- package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/get-url-query-parameter.js +4 -0
- package/dist/v2/features/import-listener/helpers/import-document-to-workspace.d.ts +30 -0
- package/dist/v2/features/import-listener/helpers/import-document-to-workspace.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/import-document-to-workspace.js +33 -0
- package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts +15 -0
- package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/load-document-from-source.js +28 -0
- package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts +15 -0
- package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts.map +1 -0
- package/dist/v2/features/import-listener/helpers/wait-for-condition.js +16 -0
- package/dist/v2/features/import-listener/index.d.ts +2 -0
- package/dist/v2/features/import-listener/index.d.ts.map +1 -0
- package/dist/v2/features/import-listener/index.js +4 -0
- package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
- package/dist/v2/features/modal/Modal.vue.js +1 -1
- package/dist/v2/features/modal/Modal.vue2.js +14 -12
- package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
- package/dist/v2/features/operation/Operation.vue.js +44 -35
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts +3 -5
- package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -1
- package/dist/v2/workspace-events.d.ts.map +1 -1
- package/dist/v2/workspace-events.js +116 -109
- package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
- package/package.json +19 -14
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.bench.d.ts +0 -2
- package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.bench.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.d.ts +0 -8
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.js +0 -33
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.d.ts +0 -7
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.d.ts.map +0 -1
- package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.js +0 -13
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-methods';
|
|
2
2
|
import { type AvailableClients } from '@scalar/types/snippetz';
|
|
3
3
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
4
|
+
import type { SelectedSecurity } from '@scalar/workspace-store/entities/auth';
|
|
5
|
+
import type { HistoryEntry } from '@scalar/workspace-store/entities/history/schema';
|
|
4
6
|
import type { AuthMeta, WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
5
7
|
import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
|
|
6
8
|
import type { OpenApiDocument, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
7
9
|
import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation';
|
|
8
10
|
import type { ClientLayout } from '../../../hooks/index.js';
|
|
9
11
|
import type { ExtendedScalarCookie } from '../../../v2/blocks/request-block/RequestBlock.vue.js';
|
|
10
|
-
import type { MergedSecuritySchemes } from '../../../v2/blocks/scalar-auth-selector-block/helpers/merge-
|
|
12
|
+
import type { MergedSecuritySchemes } from '../../../v2/blocks/scalar-auth-selector-block/helpers/merge-security.js';
|
|
11
13
|
import { type ClientPlugin } from '../../../v2/helpers/plugins.js';
|
|
12
14
|
/**
|
|
13
15
|
* OperationBlock
|
|
@@ -28,7 +30,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
28
30
|
/** Document defined security */
|
|
29
31
|
documentSecurity: OpenApiDocument["security"];
|
|
30
32
|
/** Document selected security */
|
|
31
|
-
documentSelectedSecurity:
|
|
33
|
+
documentSelectedSecurity: SelectedSecurity | undefined;
|
|
32
34
|
/** Application version */
|
|
33
35
|
appVersion: string;
|
|
34
36
|
/** Workspace/document cookies */
|
|
@@ -39,6 +41,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
39
41
|
method: HttpMethodType;
|
|
40
42
|
/** HTTP clients */
|
|
41
43
|
httpClients: AvailableClients;
|
|
44
|
+
/** The history for the operation */
|
|
45
|
+
history?: HistoryEntry[];
|
|
42
46
|
/** Client layout */
|
|
43
47
|
layout: ClientLayout;
|
|
44
48
|
/** Currently selected server */
|
|
@@ -57,6 +61,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
57
61
|
source?: "gitbook" | "api-reference";
|
|
58
62
|
/** Operation object */
|
|
59
63
|
operation: OperationObject;
|
|
64
|
+
/** Operation selected security */
|
|
65
|
+
operationSelectedSecurity: SelectedSecurity | undefined;
|
|
60
66
|
/** Whether to set security at the operation level */
|
|
61
67
|
setOperationSecurity: boolean;
|
|
62
68
|
/** Currently selected example key for the current operation */
|
|
@@ -79,7 +85,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
79
85
|
/** Document defined security */
|
|
80
86
|
documentSecurity: OpenApiDocument["security"];
|
|
81
87
|
/** Document selected security */
|
|
82
|
-
documentSelectedSecurity:
|
|
88
|
+
documentSelectedSecurity: SelectedSecurity | undefined;
|
|
83
89
|
/** Application version */
|
|
84
90
|
appVersion: string;
|
|
85
91
|
/** Workspace/document cookies */
|
|
@@ -90,6 +96,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
90
96
|
method: HttpMethodType;
|
|
91
97
|
/** HTTP clients */
|
|
92
98
|
httpClients: AvailableClients;
|
|
99
|
+
/** The history for the operation */
|
|
100
|
+
history?: HistoryEntry[];
|
|
93
101
|
/** Client layout */
|
|
94
102
|
layout: ClientLayout;
|
|
95
103
|
/** Currently selected server */
|
|
@@ -108,6 +116,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
108
116
|
source?: "gitbook" | "api-reference";
|
|
109
117
|
/** Operation object */
|
|
110
118
|
operation: OperationObject;
|
|
119
|
+
/** Operation selected security */
|
|
120
|
+
operationSelectedSecurity: SelectedSecurity | undefined;
|
|
111
121
|
/** Whether to set security at the operation level */
|
|
112
122
|
setOperationSecurity: boolean;
|
|
113
123
|
/** Currently selected example key for the current operation */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OperationBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"names":[],"mappings":"AAsYA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAErF,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAA;AACnF,OAAO,KAAK,EACV,QAAQ,EACR,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,MAAM,8DAA8D,CAAA;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAK5F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAS3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAA;AAGtF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAA;AAK1G,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKxD;;;;;;;;;;;;GAYG;;IAGD,gBAAgB;cACN,iBAAiB;IAC3B,gCAAgC;sBACd,eAAe,CAAC,UAAU,CAAC;IAC7C,iCAAiC;8BACP,gBAAgB,GAAG,SAAS;IACtD,0BAA0B;gBACd,MAAM;IAClB,iCAAiC;mBAClB,oBAAoB,EAAE;IACrC,2BAA2B;UACrB,MAAM;IACZ,6BAA6B;YACrB,cAAc;IACtB,mBAAmB;iBACN,gBAAgB;IAC7B,oCAAoC;cAC1B,YAAY,EAAE;IACxB,oBAAoB;YACZ,YAAY;IACpB,gCAAgC;YACxB,YAAY,GAAG,IAAI;IAC3B,gCAAgC;oBAChB,cAAc,CAAC,WAAW,CAAC,CAAC,yBAAyB,CAAC;IACtE,mDAAmD;aAC1C,YAAY,EAAE;IACvB,4CAA4C;uBACzB,OAAO;IAC1B,0BAA0B;kBACZ,MAAM,GAAG,IAAI;IAC3B,mEAAmE;kBACrD,MAAM;IACpB,oBAAoB;aACX,SAAS,GAAG,eAAe;IACpC,uBAAuB;eACZ,eAAe;IAC1B,kCAAkC;+BACP,gBAAgB,GAAG,SAAS;IACvD,qDAAqD;0BAC/B,OAAO;IAC7B,+DAA+D;gBACnD,MAAM;IAClB,2CAA2C;cACjC,QAAQ;IAClB,wCAAwC;qBACvB,qBAAqB;IACtC,qBAAqB;aACZ,YAAY,EAAE;IACvB,8CAA8C;iBACjC,kBAAkB;IAC/B,yCAAyC;cAC/B,MAAM;;;;IAnDhB,gBAAgB;cACN,iBAAiB;IAC3B,gCAAgC;sBACd,eAAe,CAAC,UAAU,CAAC;IAC7C,iCAAiC;8BACP,gBAAgB,GAAG,SAAS;IACtD,0BAA0B;gBACd,MAAM;IAClB,iCAAiC;mBAClB,oBAAoB,EAAE;IACrC,2BAA2B;UACrB,MAAM;IACZ,6BAA6B;YACrB,cAAc;IACtB,mBAAmB;iBACN,gBAAgB;IAC7B,oCAAoC;cAC1B,YAAY,EAAE;IACxB,oBAAoB;YACZ,YAAY;IACpB,gCAAgC;YACxB,YAAY,GAAG,IAAI;IAC3B,gCAAgC;oBAChB,cAAc,CAAC,WAAW,CAAC,CAAC,yBAAyB,CAAC;IACtE,mDAAmD;aAC1C,YAAY,EAAE;IACvB,4CAA4C;uBACzB,OAAO;IAC1B,0BAA0B;kBACZ,MAAM,GAAG,IAAI;IAC3B,mEAAmE;kBACrD,MAAM;IACpB,oBAAoB;aACX,SAAS,GAAG,eAAe;IACpC,uBAAuB;eACZ,eAAe;IAC1B,kCAAkC;+BACP,gBAAgB,GAAG,SAAS;IACvD,qDAAqD;0BAC/B,OAAO;IAC7B,+DAA+D;gBACnD,MAAM;IAClB,2CAA2C;cACjC,QAAQ;IAClB,wCAAwC;qBACvB,qBAAqB;IACtC,qBAAqB;aACZ,YAAY,EAAE;IACvB,8CAA8C;iBACjC,kBAAkB;IAC/B,yCAAyC;cAC/B,MAAM;;;;AArDlB,wBA4dC"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { AVAILABLE_CLIENTS as
|
|
3
|
-
import { useToasts as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { ERRORS as
|
|
7
|
-
import { buildRequest as
|
|
8
|
-
import { getSecuritySchemes as
|
|
9
|
-
import { harToFetchRequest as
|
|
10
|
-
import { harToFetchResponse as
|
|
11
|
-
import { sendRequest as
|
|
12
|
-
import
|
|
13
|
-
import { generateClientOptions as
|
|
14
|
-
import { getSecurityRequirements as
|
|
15
|
-
import { getSelectedSecurity as
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
const
|
|
1
|
+
import { defineComponent as E, computed as u, ref as m, onMounted as K, onBeforeUnmount as g, watch as O, createElementBlock as V, openBlock as w, createElementVNode as T, createVNode as a, withCtx as x, unref as B } from "vue";
|
|
2
|
+
import { AVAILABLE_CLIENTS as I } from "@scalar/types/snippetz";
|
|
3
|
+
import { useToasts as M } from "@scalar/use-toasts";
|
|
4
|
+
import A from "../../../components/ViewLayout/ViewLayout.vue.js";
|
|
5
|
+
import L from "../../../components/ViewLayout/ViewLayoutContent.vue.js";
|
|
6
|
+
import { ERRORS as N } from "../../../libs/errors.js";
|
|
7
|
+
import { buildRequest as P } from "./helpers/build-request.js";
|
|
8
|
+
import { getSecuritySchemes as H } from "./helpers/build-request-security.js";
|
|
9
|
+
import { harToFetchRequest as F } from "./helpers/har-to-fetch-request.js";
|
|
10
|
+
import { harToFetchResponse as $ } from "./helpers/har-to-fetch-response.js";
|
|
11
|
+
import { sendRequest as j } from "./helpers/send-request.js";
|
|
12
|
+
import D from "./components/Header.vue.js";
|
|
13
|
+
import { generateClientOptions as Q } from "../operation-code-sample/helpers/generate-client-options.js";
|
|
14
|
+
import { getSecurityRequirements as z } from "../../features/operation/helpers/get-security-requirements.js";
|
|
15
|
+
import { getSelectedSecurity as G } from "../../features/operation/helpers/get-selected-security.js";
|
|
16
|
+
import J from "../request-block/RequestBlock.vue.js";
|
|
17
|
+
import W from "../response-block/ResponseBlock.vue.js";
|
|
18
|
+
const X = { class: "bg-b-1 flex h-full flex-col" }, Y = { class: "lg:min-h-header flex w-full flex-wrap items-center justify-center p-2 lg:p-0" }, Z = {
|
|
19
19
|
name: "OperationBlock"
|
|
20
|
-
},
|
|
21
|
-
...
|
|
20
|
+
}, ve = /* @__PURE__ */ E({
|
|
21
|
+
...Z,
|
|
22
22
|
props: {
|
|
23
23
|
eventBus: {},
|
|
24
24
|
documentSecurity: {},
|
|
@@ -27,7 +27,8 @@ const Y = { class: "bg-b-1 flex h-full flex-col" }, Z = { class: "lg:min-h-heade
|
|
|
27
27
|
globalCookies: { default: () => [] },
|
|
28
28
|
path: {},
|
|
29
29
|
method: {},
|
|
30
|
-
httpClients: { default: () =>
|
|
30
|
+
httpClients: { default: () => I },
|
|
31
|
+
history: { default: () => [] },
|
|
31
32
|
layout: {},
|
|
32
33
|
server: {},
|
|
33
34
|
selectedClient: {},
|
|
@@ -37,6 +38,7 @@ const Y = { class: "bg-b-1 flex h-full flex-col" }, Z = { class: "lg:min-h-heade
|
|
|
37
38
|
documentUrl: {},
|
|
38
39
|
source: {},
|
|
39
40
|
operation: {},
|
|
41
|
+
operationSelectedSecurity: {},
|
|
40
42
|
setOperationSecurity: { type: Boolean },
|
|
41
43
|
exampleKey: {},
|
|
42
44
|
authMeta: {},
|
|
@@ -47,41 +49,41 @@ const Y = { class: "bg-b-1 flex h-full flex-col" }, Z = { class: "lg:min-h-heade
|
|
|
47
49
|
},
|
|
48
50
|
emits: ["update:servers"],
|
|
49
51
|
setup(e, { emit: q }) {
|
|
50
|
-
const R = q, C =
|
|
51
|
-
() =>
|
|
52
|
-
), h =
|
|
53
|
-
() =>
|
|
52
|
+
const R = q, C = u(() => Q(e.httpClients)), d = u(
|
|
53
|
+
() => z(e.documentSecurity, e.operation.security)
|
|
54
|
+
), h = u(
|
|
55
|
+
() => G(
|
|
54
56
|
e.documentSelectedSecurity,
|
|
55
|
-
e.
|
|
57
|
+
e.operationSelectedSecurity,
|
|
56
58
|
d.value,
|
|
57
59
|
e.setOperationSecurity
|
|
58
60
|
)
|
|
59
|
-
),
|
|
60
|
-
() =>
|
|
61
|
-
), { toast:
|
|
62
|
-
const [t, n] =
|
|
61
|
+
), y = u(
|
|
62
|
+
() => H(e.securitySchemes, h.value.selectedSchemes)
|
|
63
|
+
), { toast: v } = M(), f = m(null), l = m(null), i = m(null), s = () => f.value?.abort(N.REQUEST_ABORTED), c = async () => {
|
|
64
|
+
const [t, n] = P({
|
|
63
65
|
environment: e.environment,
|
|
64
66
|
exampleKey: e.exampleKey,
|
|
65
67
|
globalCookies: e.globalCookies,
|
|
66
68
|
method: e.method,
|
|
67
69
|
operation: e.operation,
|
|
68
70
|
path: e.path,
|
|
69
|
-
selectedSecuritySchemes:
|
|
71
|
+
selectedSecuritySchemes: y.value,
|
|
70
72
|
server: e.server,
|
|
71
73
|
proxyUrl: e.proxyUrl
|
|
72
74
|
});
|
|
73
75
|
if (t) {
|
|
74
|
-
|
|
76
|
+
v(t.message, "error");
|
|
75
77
|
return;
|
|
76
78
|
}
|
|
77
|
-
f.value = n.controller,
|
|
79
|
+
f.value = n.controller, l.value && "reader" in l.value && l.value.reader.cancel(), e.eventBus.emit("hooks:on:request:sent", {
|
|
78
80
|
meta: {
|
|
79
81
|
method: e.method,
|
|
80
82
|
path: e.path,
|
|
81
83
|
exampleKey: e.exampleKey
|
|
82
84
|
}
|
|
83
85
|
});
|
|
84
|
-
const [o, r] = await
|
|
86
|
+
const [o, r] = await j({
|
|
85
87
|
isUsingProxy: n.isUsingProxy,
|
|
86
88
|
operation: e.operation,
|
|
87
89
|
plugins: e.plugins,
|
|
@@ -100,42 +102,40 @@ const Y = { class: "bg-b-1 flex h-full flex-col" }, Z = { class: "lg:min-h-heade
|
|
|
100
102
|
exampleKey: e.exampleKey
|
|
101
103
|
}
|
|
102
104
|
}), o) {
|
|
103
|
-
|
|
105
|
+
v(o.message, "error");
|
|
104
106
|
return;
|
|
105
107
|
}
|
|
106
|
-
|
|
108
|
+
l.value = r.response, i.value = r.request;
|
|
107
109
|
};
|
|
108
|
-
|
|
109
|
-
e.eventBus.on("operation:send:request:hotkey", c), e.eventBus.on("operation:cancel:request",
|
|
110
|
-
}),
|
|
111
|
-
e.eventBus.off("operation:send:request:hotkey", c), e.eventBus.off("operation:cancel:request",
|
|
110
|
+
K(() => {
|
|
111
|
+
e.eventBus.on("operation:send:request:hotkey", c), e.eventBus.on("operation:cancel:request", s);
|
|
112
|
+
}), g(() => {
|
|
113
|
+
e.eventBus.off("operation:send:request:hotkey", c), e.eventBus.off("operation:cancel:request", s);
|
|
112
114
|
});
|
|
113
|
-
const
|
|
114
|
-
() =>
|
|
115
|
+
const S = u(
|
|
116
|
+
() => e.history.map((t) => ({
|
|
115
117
|
method: t.request.method,
|
|
116
118
|
path: t.request.url,
|
|
117
119
|
duration: t.time,
|
|
118
120
|
status: t.response.status
|
|
119
121
|
})).reverse()
|
|
120
122
|
), k = ({ index: t }) => {
|
|
121
|
-
const n = (e.
|
|
123
|
+
const n = (e.history.length ?? 0) - t - 1, o = e.history[n];
|
|
122
124
|
if (!o)
|
|
123
125
|
return;
|
|
124
126
|
const r = () => e.eventBus.emit("ui:route:example", {
|
|
125
127
|
exampleName: "draft",
|
|
126
|
-
callback: async (
|
|
127
|
-
|
|
128
|
-
return;
|
|
129
|
-
const b = j({
|
|
128
|
+
callback: async () => {
|
|
129
|
+
const U = $({
|
|
130
130
|
harResponse: o.response,
|
|
131
131
|
url: o.request.url,
|
|
132
132
|
method: e.method,
|
|
133
133
|
path: e.path,
|
|
134
134
|
duration: o.time
|
|
135
|
-
}),
|
|
135
|
+
}), b = F({
|
|
136
136
|
harRequest: o.request
|
|
137
137
|
});
|
|
138
|
-
|
|
138
|
+
l.value = U, i.value = b;
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
141
|
e.eventBus.emit("operation:reload:history", {
|
|
@@ -147,18 +147,18 @@ const Y = { class: "bg-b-1 flex h-full flex-col" }, Z = { class: "lg:min-h-heade
|
|
|
147
147
|
callback: r
|
|
148
148
|
});
|
|
149
149
|
};
|
|
150
|
-
return
|
|
151
|
-
|
|
152
|
-
}),
|
|
153
|
-
|
|
154
|
-
}), (t, n) => (
|
|
155
|
-
|
|
156
|
-
|
|
150
|
+
return O([() => e.path, () => e.method, () => e.exampleKey], () => {
|
|
151
|
+
l.value = null, i.value = null, s();
|
|
152
|
+
}), g(() => {
|
|
153
|
+
s();
|
|
154
|
+
}), (t, n) => (w(), V("div", X, [
|
|
155
|
+
T("div", Y, [
|
|
156
|
+
a(D, {
|
|
157
157
|
documentUrl: e.documentUrl,
|
|
158
158
|
environment: e.environment,
|
|
159
159
|
eventBus: e.eventBus,
|
|
160
160
|
hideClientButton: e.hideClientButton,
|
|
161
|
-
history:
|
|
161
|
+
history: S.value,
|
|
162
162
|
integration: e.integration,
|
|
163
163
|
layout: e.layout,
|
|
164
164
|
method: e.method,
|
|
@@ -171,11 +171,11 @@ const Y = { class: "bg-b-1 flex h-full flex-col" }, Z = { class: "lg:min-h-heade
|
|
|
171
171
|
"onUpdate:servers": n[0] || (n[0] = (o) => R("update:servers"))
|
|
172
172
|
}, null, 8, ["documentUrl", "environment", "eventBus", "hideClientButton", "history", "integration", "layout", "method", "path", "server", "servers", "source"])
|
|
173
173
|
]),
|
|
174
|
-
|
|
175
|
-
default:
|
|
176
|
-
|
|
177
|
-
default:
|
|
178
|
-
|
|
174
|
+
a(A, { class: "border-t" }, {
|
|
175
|
+
default: x(() => [
|
|
176
|
+
a(L, { class: "flex-1" }, {
|
|
177
|
+
default: x(() => [
|
|
178
|
+
a(B(J), {
|
|
179
179
|
authMeta: e.authMeta,
|
|
180
180
|
clientOptions: C.value,
|
|
181
181
|
environment: e.environment,
|
|
@@ -192,17 +192,17 @@ const Y = { class: "bg-b-1 flex h-full flex-col" }, Z = { class: "lg:min-h-heade
|
|
|
192
192
|
securitySchemes: e.securitySchemes,
|
|
193
193
|
selectedClient: e.selectedClient,
|
|
194
194
|
selectedSecurity: h.value,
|
|
195
|
-
selectedSecuritySchemes:
|
|
195
|
+
selectedSecuritySchemes: y.value,
|
|
196
196
|
server: e.server
|
|
197
197
|
}, null, 8, ["authMeta", "clientOptions", "environment", "eventBus", "exampleKey", "globalCookies", "layout", "method", "operation", "path", "plugins", "proxyUrl", "securityRequirements", "securitySchemes", "selectedClient", "selectedSecurity", "selectedSecuritySchemes", "server"]),
|
|
198
|
-
|
|
198
|
+
a(B(W), {
|
|
199
199
|
appVersion: e.appVersion,
|
|
200
200
|
eventBus: e.eventBus,
|
|
201
201
|
layout: e.layout,
|
|
202
202
|
plugins: e.plugins,
|
|
203
|
-
request:
|
|
204
|
-
response:
|
|
205
|
-
totalPerformedRequests:
|
|
203
|
+
request: i.value,
|
|
204
|
+
response: l.value,
|
|
205
|
+
totalPerformedRequests: S.value.length
|
|
206
206
|
}, null, 8, ["appVersion", "eventBus", "layout", "plugins", "request", "response", "totalPerformedRequests"])
|
|
207
207
|
]),
|
|
208
208
|
_: 1
|
|
@@ -214,5 +214,5 @@ const Y = { class: "bg-b-1 flex h-full flex-col" }, Z = { class: "lg:min-h-heade
|
|
|
214
214
|
}
|
|
215
215
|
});
|
|
216
216
|
export {
|
|
217
|
-
|
|
217
|
+
ve as default
|
|
218
218
|
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { type XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SecurityRequirementObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
3
|
+
import type { MergedSecuritySchemes } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/merge-security.js';
|
|
4
|
+
import type { SecuritySchemeObjectSecret } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/secret-types';
|
|
3
5
|
/**
|
|
4
6
|
* Get the selected security schemes from security requirements.
|
|
5
7
|
* Takes security requirement objects and resolves them to actual security scheme objects.
|
|
6
8
|
*/
|
|
7
|
-
export declare const getSecuritySchemes: (securitySchemes:
|
|
9
|
+
export declare const getSecuritySchemes: (securitySchemes: MergedSecuritySchemes, selectedSecurity: SecurityRequirementObject[]) => SecuritySchemeObjectSecret[];
|
|
8
10
|
/**
|
|
9
11
|
* Generates the headers, cookies and query params for selected security schemes
|
|
10
12
|
* In the future we can add customization for where the security is applied
|
|
11
13
|
*/
|
|
12
14
|
export declare const buildRequestSecurity: (
|
|
13
15
|
/** Currently selected security for the current operation */
|
|
14
|
-
selectedSecuritySchemes:
|
|
16
|
+
selectedSecuritySchemes: SecuritySchemeObjectSecret[],
|
|
15
17
|
/** Environment variables flattened into a key-value object */
|
|
16
18
|
env?: Record<string, string>,
|
|
17
19
|
/** Include this parameter to set the placeholder for empty tokens */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-request-security.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request-security.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,qEAAqE,CAAA;AAE5E,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"build-request-security.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request-security.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,qEAAqE,CAAA;AAE5E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8DAA8D,CAAA;AAG7G,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+DAA+D,CAAA;AAC1G,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAA;AAE7G;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAC7B,iBAAiB,qBAAqB,EACtC,kBAAkB,yBAAyB,EAAE,KAC5C,0BAA0B,EAUpB,CAAA;AAET;;;GAGG;AACH,eAAO,MAAM,oBAAoB;AAC/B,4DAA4D;AAC5D,yBAAyB,0BAA0B,EAAE;AACrD,8DAA8D;AAC9D,MAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;AAChC,qEAAqE;AACrE,8BAA0B,KACzB;IAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,OAAO,EAAE,aAAa,EAAE,CAAC;IAAC,SAAS,EAAE,eAAe,CAAA;CAuDzF,CAAA"}
|
|
@@ -32,7 +32,7 @@ const A = (f, o) => o.flatMap(
|
|
|
32
32
|
a.Authorization = `Bearer ${t || i}`;
|
|
33
33
|
}
|
|
34
34
|
if (r.type === "oauth2") {
|
|
35
|
-
const t = Object.values(r
|
|
35
|
+
const t = Object.values(r?.flows ?? {}), e = s(
|
|
36
36
|
t.filter(p).find((c) => c["x-scalar-secret-token"])?.["x-scalar-secret-token"] ?? "",
|
|
37
37
|
o
|
|
38
38
|
);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
2
2
|
import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
|
|
3
3
|
import type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
|
|
4
|
-
import type {
|
|
4
|
+
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
5
5
|
import type { OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/operation';
|
|
6
6
|
import { type ErrorResponse } from '../../../../libs/errors.js';
|
|
7
|
+
import type { SecuritySchemeObjectSecret } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/secret-types';
|
|
7
8
|
/**
|
|
8
9
|
* Builds a fully configured Request object ready for execution.
|
|
9
10
|
*
|
|
@@ -34,7 +35,7 @@ export declare const buildRequest: ({ environment, exampleKey, globalCookies, me
|
|
|
34
35
|
/** The server object */
|
|
35
36
|
server: ServerObject | null;
|
|
36
37
|
/** The selected security schemes for the current operation */
|
|
37
|
-
selectedSecuritySchemes:
|
|
38
|
+
selectedSecuritySchemes: SecuritySchemeObjectSecret[];
|
|
38
39
|
}) => ErrorResponse<{
|
|
39
40
|
controller: AbortController;
|
|
40
41
|
request: Request;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-request.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAGnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"build-request.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/build-request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAGnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAChG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAG5F,OAAO,EAAU,KAAK,aAAa,EAAkB,MAAM,eAAe,CAAA;AAI1E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAA;AAO7G;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,GAAI,iHAU1B;IACD,8CAA8C;IAC9C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,mCAAmC;IACnC,aAAa,EAAE,aAAa,EAAE,CAAA;IAC9B,uCAAuC;IACvC,MAAM,EAAE,UAAU,CAAA;IAClB,2BAA2B;IAC3B,SAAS,EAAE,eAAe,CAAA;IAC1B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAA;IAChB,wBAAwB;IACxB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,8DAA8D;IAC9D,uBAAuB,EAAE,0BAA0B,EAAE,CAAA;CACtD,KAAG,aAAa,CAAC;IAChB,UAAU,EAAE,eAAe,CAAA;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,OAAO,CAAA;CACtB,CA2FA,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { getSecuritySchemes } from './helpers/build-request-security.js';
|
|
1
|
+
export { buildRequestSecurity, getSecuritySchemes } from './helpers/build-request-security.js';
|
|
2
2
|
export { getExample } from './helpers/get-example.js';
|
|
3
|
+
export { getResolvedUrl } from './helpers/get-resolved-url.js';
|
|
3
4
|
export { default as OperationBlock } from './OperationBlock.vue.js';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { getSecuritySchemes as
|
|
1
|
+
import { buildRequestSecurity as t, getSecuritySchemes as o } from "./helpers/build-request-security.js";
|
|
2
2
|
import { getExample as m } from "./helpers/get-example.js";
|
|
3
|
-
import {
|
|
3
|
+
import { getResolvedUrl as f } from "./helpers/get-resolved-url.js";
|
|
4
|
+
import { default as x } from "./OperationBlock.vue.js";
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
+
x as OperationBlock,
|
|
7
|
+
t as buildRequestSecurity,
|
|
6
8
|
m as getExample,
|
|
7
|
-
|
|
9
|
+
f as getResolvedUrl,
|
|
10
|
+
o as getSecuritySchemes
|
|
8
11
|
};
|
|
@@ -2,8 +2,9 @@ import type { HttpMethod as HttpMethodType } from '@scalar/helpers/http/http-met
|
|
|
2
2
|
import { type AvailableClients } from '@scalar/snippetz';
|
|
3
3
|
import { type WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
4
4
|
import type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
|
|
5
|
-
import type { OperationObject,
|
|
5
|
+
import type { OperationObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
6
6
|
import type { ClientOptionGroup } from '../../../../v2/blocks/operation-code-sample/types';
|
|
7
|
+
import type { SecuritySchemeObjectSecret } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/secret-types';
|
|
7
8
|
export type OperationCodeSampleProps = {
|
|
8
9
|
/**
|
|
9
10
|
* Integration type: determines if the code sample is displayed in a client environment
|
|
@@ -67,7 +68,7 @@ export type OperationCodeSampleProps = {
|
|
|
67
68
|
/**
|
|
68
69
|
* The security schemes which are applicable to this operation
|
|
69
70
|
*/
|
|
70
|
-
securitySchemes:
|
|
71
|
+
securitySchemes: SecuritySchemeObjectSecret[];
|
|
71
72
|
/**
|
|
72
73
|
* HTTP method of the operation
|
|
73
74
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OperationCodeSample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/components/OperationCodeSample.vue"],"names":[],"mappings":"AAycA,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,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EACV,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"OperationCodeSample.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/components/OperationCodeSample.vue"],"names":[],"mappings":"AAycA,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,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,MAAM,8DAA8D,CAAA;AASrE,OAAO,KAAK,EAEV,iBAAiB,EAElB,MAAM,yCAAyC,CAAA;AAChD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAA;AAM7G,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;OAGG;IACH,WAAW,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAA;IACpC;;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,0BAA0B,EAAE,CAAA;IAC7C;;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;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,EAAE,CAAA;CAChC,CAAA;AAED;;;;;;;;GAQG;;YAqBO,MAAM,OAAO;YACb,MAAM,OAAO;;AArBvB,wBA2fC;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
|
|
4
|
+
const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8dad5801"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -2,7 +2,8 @@ import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
|
2
2
|
import type { AvailableClient } from '@scalar/snippetz';
|
|
3
3
|
import type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
|
|
4
4
|
import type { XCodeSample } from '@scalar/workspace-store/schemas/extensions/operation';
|
|
5
|
-
import type { OperationObject,
|
|
5
|
+
import type { OperationObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
6
|
+
import type { SecuritySchemeObjectSecret } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/secret-types';
|
|
6
7
|
import { type CustomCodeSampleId } from './generate-client-options.js';
|
|
7
8
|
type GenerateCodeSnippetProps = {
|
|
8
9
|
/** The selected client/language for code generation (e.g., 'node/fetch') or a custom code sample ID. */
|
|
@@ -20,7 +21,7 @@ type GenerateCodeSnippetProps = {
|
|
|
20
21
|
/** The API endpoint path (e.g., '/users/{id}'). */
|
|
21
22
|
path: string;
|
|
22
23
|
/** Array of security schemes to apply to the request (e.g., API keys, OAuth). */
|
|
23
|
-
securitySchemes:
|
|
24
|
+
securitySchemes: SecuritySchemeObjectSecret[];
|
|
24
25
|
/** The server object defining the base URL for the API request. */
|
|
25
26
|
server: ServerObject | null;
|
|
26
27
|
/** Workspace + document cookies */
|
|
@@ -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,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAA;AACvF,OAAO,KAAK,
|
|
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,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAA;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGjH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAA;AAG7G,OAAO,EAAE,KAAK,kBAAkB,EAAoB,MAAM,2BAA2B,CAAA;AAErF,KAAK,wBAAwB,GAAG;IAC9B,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,0BAA0B,EAAE,CAAA;IAC7C,mEAAmE;IACnE,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,mCAAmC;IACnC,aAAa,CAAC,EAAE,aAAa,EAAE,CAAA;IAC/B,qFAAqF;IACrF,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AAED,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,GAAI,gJAYjC,wBAAwB,KAAG,MAuC7B,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SecuritySchemeObjectSecret } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/secret-types';
|
|
2
2
|
/** Extract secrets from security schemes */
|
|
3
|
-
export declare const getSecrets: (securitySchemes:
|
|
3
|
+
export declare const getSecrets: (securitySchemes: SecuritySchemeObjectSecret[]) => string[];
|
|
4
4
|
//# sourceMappingURL=get-secrets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-secrets.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/get-secrets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-secrets.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/get-secrets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAA;AAE7G,4CAA4C;AAC5C,eAAO,MAAM,UAAU,GAAI,iBAAiB,0BAA0B,EAAE,KAAG,MAAM,EAqB7D,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
2
2
|
import type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
|
|
3
|
-
import type { OperationObject,
|
|
3
|
+
import type { OperationObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
4
4
|
import type { Request as HarRequest } from 'har-format';
|
|
5
|
+
import type { SecuritySchemeObjectSecret } from '../../../../../v2/blocks/scalar-auth-selector-block/helpers/secret-types';
|
|
5
6
|
export type OperationToHarProps = {
|
|
6
7
|
/** OpenAPI Operation object */
|
|
7
8
|
operation: OperationObject;
|
|
@@ -25,7 +26,7 @@ export type OperationToHarProps = {
|
|
|
25
26
|
/** OpenAPI Server object */
|
|
26
27
|
server?: ServerObject | null;
|
|
27
28
|
/** OpenAPI SecurityScheme objects which are applicable to the operation */
|
|
28
|
-
securitySchemes?:
|
|
29
|
+
securitySchemes?: SecuritySchemeObjectSecret[];
|
|
29
30
|
/** Workspace + document cookies */
|
|
30
31
|
globalCookies?: XScalarCookie[];
|
|
31
32
|
/**
|
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,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,
|
|
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,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AACjH,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAIvD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAA;AAO7G,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,0BAA0B,EAAE,CAAA;IAC9C,mCAAmC;IACnC,aAAa,CAAC,EAAE,aAAa,EAAE,CAAA;IAC/B;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc,GAAI,mHAU5B,mBAAmB,KAAG,UA+FxB,CAAA"}
|
package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SecuritySchemeObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
1
|
import type { Request as HarRequest } from 'har-format';
|
|
2
|
+
import type { SecuritySchemeObjectSecret } from '../../../../../v2/blocks/scalar-auth-selector-block/helpers/secret-types';
|
|
3
3
|
type ProcessedSecuritySchemesReturn = {
|
|
4
4
|
headers: HarRequest['headers'];
|
|
5
5
|
queryString: HarRequest['queryString'];
|
|
@@ -10,6 +10,6 @@ type ProcessedSecuritySchemesReturn = {
|
|
|
10
10
|
*
|
|
11
11
|
* TODO: we probably want to be able to disable YOUR_SECRET_TOKEN placeholder text + or allow it to be customzied
|
|
12
12
|
*/
|
|
13
|
-
export declare const processSecuritySchemes: (securitySchemes:
|
|
13
|
+
export declare const processSecuritySchemes: (securitySchemes: SecuritySchemeObjectSecret[]) => ProcessedSecuritySchemesReturn;
|
|
14
14
|
export {};
|
|
15
15
|
//# sourceMappingURL=process-security-schemes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-security-schemes.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"process-security-schemes.d.ts","sourceRoot":"","sources":["../../../../../../src/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,YAAY,CAAA;AAGvD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAA;AAE7G,KAAK,8BAA8B,GAAG;IACpC,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;IAC9B,WAAW,EAAE,UAAU,CAAC,aAAa,CAAC,CAAA;IACtC,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;CAC/B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,iBAAiB,0BAA0B,EAAE,KAC5C,8BAuEF,CAAA"}
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import type { HttpMethod } from '@scalar/helpers/http/http-methods';
|
|
2
2
|
import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
3
|
+
import type { SelectedSecurity } from '@scalar/workspace-store/entities/auth';
|
|
3
4
|
import type { AuthMeta, WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
4
5
|
import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
|
|
5
6
|
import type { XScalarCookie } from '@scalar/workspace-store/schemas/extensions/general/x-scalar-cookies';
|
|
6
|
-
import type { OpenApiDocument, OperationObject,
|
|
7
|
+
import type { OpenApiDocument, OperationObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
7
8
|
import type { ClientLayout } from '../../../hooks/index.js';
|
|
8
9
|
import type { ClientOptionGroup } from '../../../v2/blocks/operation-code-sample/index.js';
|
|
10
|
+
import { type MergedSecuritySchemes } from '../../../v2/blocks/scalar-auth-selector-block/index.js';
|
|
11
|
+
import type { SecuritySchemeObjectSecret } from '../../../v2/blocks/scalar-auth-selector-block/helpers/secret-types';
|
|
9
12
|
import type { ClientPlugin } from '../../../v2/helpers/plugins.js';
|
|
10
13
|
export type ExtendedScalarCookie = XScalarCookie & {
|
|
11
14
|
location: 'document' | 'workspace';
|
|
12
15
|
};
|
|
13
16
|
type __VLS_Props = {
|
|
14
|
-
selectedSecurity: OpenApiDocument['x-scalar-selected-security'];
|
|
15
17
|
authMeta: AuthMeta;
|
|
16
18
|
clientOptions: ClientOptionGroup[];
|
|
17
19
|
environment: XScalarEnvironment;
|
|
18
20
|
eventBus: WorkspaceEventBus;
|
|
19
21
|
exampleKey: string;
|
|
22
|
+
globalCookies: ExtendedScalarCookie[];
|
|
20
23
|
layout: ClientLayout;
|
|
21
24
|
method: HttpMethod;
|
|
22
25
|
operation: OperationObject;
|
|
@@ -24,11 +27,11 @@ type __VLS_Props = {
|
|
|
24
27
|
plugins: ClientPlugin[];
|
|
25
28
|
proxyUrl: string;
|
|
26
29
|
securityRequirements: OpenApiDocument['security'];
|
|
27
|
-
securitySchemes:
|
|
30
|
+
securitySchemes: MergedSecuritySchemes;
|
|
28
31
|
selectedClient: WorkspaceStore['workspace']['x-scalar-default-client'];
|
|
29
|
-
|
|
32
|
+
selectedSecurity: SelectedSecurity;
|
|
33
|
+
selectedSecuritySchemes: SecuritySchemeObjectSecret[];
|
|
30
34
|
server: ServerObject | null;
|
|
31
|
-
globalCookies: ExtendedScalarCookie[];
|
|
32
35
|
};
|
|
33
36
|
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>;
|
|
34
37
|
export default _default;
|