@scalar/api-client 2.17.2 → 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.
Files changed (104) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/dist/style.css +1 -1
  3. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +15 -10
  4. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +70 -55
  6. package/dist/v2/blocks/operation-block/helpers/build-request-body.d.ts.map +1 -1
  7. package/dist/v2/blocks/operation-block/helpers/build-request-body.js +12 -8
  8. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +3 -5
  9. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +1 -1
  10. package/dist/v2/blocks/operation-block/helpers/build-request-security.js +31 -31
  11. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +4 -6
  12. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
  13. package/dist/v2/blocks/operation-block/helpers/build-request.js +20 -21
  14. package/dist/v2/blocks/operation-block/helpers/get-example.d.ts.map +1 -1
  15. package/dist/v2/blocks/operation-block/helpers/get-example.js +22 -16
  16. package/dist/v2/blocks/operation-block/helpers/send-request.js +26 -26
  17. package/dist/v2/blocks/operation-block/index.d.ts +1 -0
  18. package/dist/v2/blocks/operation-block/index.d.ts.map +1 -1
  19. package/dist/v2/blocks/operation-block/index.js +4 -2
  20. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +9 -4
  21. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  22. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +1 -1
  23. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue2.js +81 -88
  24. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +4 -4
  25. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
  26. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +1 -1
  27. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  28. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.js +1 -1
  29. package/dist/v2/blocks/operation-code-sample/index.d.ts +1 -0
  30. package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
  31. package/dist/v2/blocks/operation-code-sample/index.js +11 -9
  32. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +3 -2
  33. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  34. package/dist/v2/blocks/request-block/RequestBlock.vue.js +2 -2
  35. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +59 -63
  36. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  37. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
  38. package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +78 -74
  39. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +3 -3
  40. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  41. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +43 -42
  42. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  43. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +96 -86
  44. package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.d.ts +8 -0
  45. package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.d.ts.map +1 -0
  46. package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.js +33 -0
  47. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.d.ts +7 -0
  48. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.d.ts.map +1 -0
  49. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.js +13 -0
  50. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts +3 -0
  51. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts.map +1 -1
  52. package/dist/v2/blocks/scalar-auth-selector-block/index.js +8 -2
  53. package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
  54. package/dist/v2/components/data-table/DataTableInput.vue.js +2 -2
  55. package/dist/v2/components/data-table/DataTableInput.vue2.js +25 -24
  56. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  57. package/dist/v2/features/app/App.vue.js +34 -33
  58. package/dist/v2/features/app/helpers/routes.d.ts +2 -0
  59. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  60. package/dist/v2/features/app/hooks/use-workspace-client-app-events.d.ts.map +1 -1
  61. package/dist/v2/features/app/hooks/use-workspace-client-app-events.js +29 -29
  62. package/dist/v2/features/collection/DocumentCollection.vue.js +4 -3
  63. package/dist/v2/features/collection/WorkspaceCollection.vue.js +8 -7
  64. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  65. package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
  66. package/dist/v2/features/collection/components/Authentication.vue2.js +7 -6
  67. package/dist/v2/features/collection/components/Cookies.vue.js +1 -0
  68. package/dist/v2/features/collection/components/Environment.vue.js +1 -0
  69. package/dist/v2/features/collection/components/Overview.vue2.js +8 -7
  70. package/dist/v2/features/collection/components/Servers.vue.js +25 -24
  71. package/dist/v2/features/collection/components/Settings.vue.js +8 -7
  72. package/dist/v2/features/modal/Modal.vue.d.ts +6 -0
  73. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  74. package/dist/v2/features/modal/Modal.vue.js +2 -2
  75. package/dist/v2/features/modal/Modal.vue2.js +66 -62
  76. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts +16 -16
  77. package/dist/v2/features/modal/helpers/create-api-client-modal.d.ts.map +1 -1
  78. package/dist/v2/features/modal/helpers/create-api-client-modal.js +36 -29
  79. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.d.ts.map +1 -1
  80. package/dist/v2/features/modal/hooks/use-workspace-client-modal-events.js +25 -12
  81. package/dist/v2/features/modal/index.d.ts +2 -1
  82. package/dist/v2/features/modal/index.d.ts.map +1 -1
  83. package/dist/v2/features/modal/index.js +3 -1
  84. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  85. package/dist/v2/features/operation/Operation.vue.js +54 -62
  86. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts +1 -1
  87. package/dist/v2/features/operation/helpers/get-security-requirements.d.ts.map +1 -1
  88. package/dist/v2/features/operation/helpers/get-security-requirements.js +2 -2
  89. package/dist/v2/features/operation/helpers/get-selected-security.d.ts +5 -2
  90. package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -1
  91. package/dist/v2/features/operation/helpers/get-selected-security.js +11 -11
  92. package/dist/v2/features/operation/helpers/get-selected-server.d.ts +10 -0
  93. package/dist/v2/features/operation/helpers/get-selected-server.d.ts.map +1 -0
  94. package/dist/v2/features/operation/helpers/get-selected-server.js +4 -0
  95. package/dist/v2/features/operation/index.d.ts +3 -0
  96. package/dist/v2/features/operation/index.d.ts.map +1 -1
  97. package/dist/v2/features/operation/index.js +8 -2
  98. package/dist/v2/helpers/index.d.ts +3 -0
  99. package/dist/v2/helpers/index.d.ts.map +1 -0
  100. package/dist/v2/helpers/index.js +4 -0
  101. package/dist/v2/helpers/plugins.d.ts +7 -1
  102. package/dist/v2/helpers/plugins.d.ts.map +1 -1
  103. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  104. 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 x } from "../../../../libs/errors.js";
3
- import { normalizeHeaders as D } from "../../../../libs/normalize-headers.js";
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 E } from "./decode-buffer.js";
5
+ import { decodeBuffer as D } from "./decode-buffer.js";
6
6
  import { getCookieHeaderKeys as T } from "./get-cookie-header-keys.js";
7
- const H = [204, 205, 304], v = async ({
7
+ const E = [204, 205, 304], v = async ({
8
8
  isUsingProxy: t,
9
- operation: o,
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"), r = D(e.headers, t), u = new URL(e.url), h = u.pathname + u.search, p = e.statusText || S[e.status]?.name || "", l = s.method, y = H.includes(e.status);
15
- return d?.startsWith("text/event-stream") && e.body ? k({
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: o,
18
+ operation: r,
19
19
  plugins: n,
20
20
  endTime: a,
21
21
  duration: c,
22
- responseHeaders: r,
22
+ responseHeaders: o,
23
23
  statusText: p,
24
24
  method: l,
25
25
  fullPath: h
26
- }) : q({
26
+ }) : k({
27
27
  response: e,
28
28
  modifiedRequest: s,
29
- operation: o,
29
+ operation: r,
30
30
  plugins: n,
31
31
  endTime: a,
32
32
  duration: c,
33
- responseHeaders: r,
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, x.REQUEST_FAILED), null];
41
+ return [b(s, q.REQUEST_FAILED), null];
42
42
  }
43
- }, k = async ({
43
+ }, H = async ({
44
44
  response: t,
45
- modifiedRequest: o,
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 r = new Response(null, {
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: r, request: o, operation: i }, "responseReceived", n);
61
- const u = T(r.headers);
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: o,
66
+ request: r,
67
67
  response: {
68
- ...r,
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
- }, q = async ({
78
+ }, k = async ({
79
79
  response: t,
80
- modifiedRequest: o,
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: r,
89
+ contentType: o,
90
90
  shouldSkipBody: u
91
91
  }) => {
92
- const p = await t.clone().arrayBuffer(), y = E(p, r ?? "text/plain;charset=UTF-8"), R = new Response(u ? null : p, {
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: o, operation: i }, "responseReceived", n);
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: o,
103
+ request: r,
104
104
  response: {
105
105
  ...R,
106
106
  headers: e,
@@ -1,2 +1,3 @@
1
+ export { getSecuritySchemes } from './helpers/build-request-security.js';
1
2
  export { default as OperationBlock } from './OperationBlock.vue.js';
2
3
  //# 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,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 { default as e } from "./OperationBlock.vue.js";
1
+ import { getSecuritySchemes as r } from "./helpers/build-request-security.js";
2
+ import { default as a } from "./OperationBlock.vue.js";
2
3
  export {
3
- e as OperationBlock
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 | undefined;
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?: SecuritySchemeObject[];
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 scalar-update-selected-client - Emitted when the selected client changes
92
- * @event scalar-update-selected-example - Emitted when the selected example changes
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":"AA4bA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAErF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAGxD,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,SAAS,CAAA;IACzC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;OAEG;IACH,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAA;IACxC;;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;;YAkBO,MAAM,OAAO;YACb,MAAM,OAAO;;AAlBvB,wBA2gBC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
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-6c4b269b"]]);
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 D, computed as a, ref as C, watch as I, useId as N, createBlock as i, createCommentVNode as f, openBlock as s, unref as o, withCtx as n, createVNode as r, createSlots as W, createElementVNode as b, createElementBlock as x, renderSlot as y, createTextVNode as R, toDisplayString as z } from "vue";
2
- import { ScalarCard as S, ScalarCardHeader as U, ScalarCombobox as A, ScalarButton as F, ScalarCardSection as T, ScalarCodeBlock as M, ScalarVirtualText as K, ScalarCardFooter as Z } from "@scalar/components";
3
- import { freezeElement as G } from "@scalar/helpers/dom/freeze-element";
4
- import { ScalarIconCaretDown as J } from "@scalar/icons";
5
- import { emitCustomEvent as V } from "@scalar/workspace-store/events";
6
- import { getResolvedRef as P } from "@scalar/workspace-store/helpers/get-resolved-ref";
7
- import { operationToHar as Q } from "../helpers/operation-to-har/operation-to-har.js";
8
- import q from "./HttpMethod.vue.js";
9
- import { findClient as $ } from "../helpers/find-client.js";
10
- import { getClients as X } from "../helpers/get-clients.js";
11
- import { getCustomCodeSamples as Y } from "../helpers/get-custom-code-samples.js";
12
- import { getSecrets as _ } from "../helpers/get-secrets.js";
13
- import { generateCodeSnippet as ee } from "../helpers/generate-code-snippet.js";
14
- import te from "./ExamplePicker.vue.js";
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
- }, ne = { class: "request-header" }, se = {}, ge = /* @__PURE__ */ D({
19
- ...se,
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: () => ({ url: "/" }) },
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 d = a(() => {
37
- const e = P(t.operation.requestBody)?.content ?? {}, l = t.selectedContentType || Object.keys(e)[0];
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
- }), p = C(
40
- t.selectedExample ?? Object.keys(d.value)[0] ?? ""
41
- ), g = a(() => Y(t.operation)), h = a(
42
- () => X(g.value, t.clientOptions)
43
- ), u = C(
44
- $(h.value, t.selectedClient)
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
- I(
46
+ D(
47
47
  () => t.selectedClient,
48
48
  (e) => {
49
- const l = $(h.value, e);
49
+ const l = q(f.value, e);
50
50
  l && (u.value = l);
51
51
  }
52
52
  );
53
- const k = a(() => {
53
+ const y = a(() => {
54
54
  if (!t.isWebhook) return null;
55
55
  try {
56
- return Q({
56
+ return P({
57
57
  operation: t.operation,
58
58
  method: t.method,
59
59
  path: t.path,
60
- example: p.value
60
+ example: m.value
61
61
  });
62
62
  } catch (e) {
63
63
  return console.error("[webhookHar]", e), null;
64
64
  }
65
- }), v = a(() => t.isWebhook ? k.value?.postData?.text ?? "" : ee({
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: p.value
75
- })), B = a(() => t.isWebhook ? E.value : u.value?.lang), E = a(() => {
76
- if (!k.value?.postData) return "json";
77
- const e = k.value.postData.mimeType;
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(() => _(t.securitySchemes)), m = C(null), j = (e) => {
80
- if (m.value) {
81
- const l = G(m.value.$el);
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") || V(m.value?.$el, "scalar-update-selected-client", e.id);
87
- }, w = 2e4, H = a(
88
- () => (v.value.length ?? 0) > w
89
- ), L = N();
90
- return (e, l) => v.value ? (s(), i(o(S), {
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: m,
93
+ ref: k,
94
94
  class: "request-card dark-mode"
95
95
  }, {
96
96
  default: n(() => [
97
- r(o(U), { class: "pr-2.5" }, W({
97
+ r(o(z), { class: "pr-2.5" }, N({
98
98
  default: n(() => [
99
- l[3] || (l[3] = b("span", { class: "sr-only" }, "Request Example for", -1)),
100
- r(q, {
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(), x("span", {
105
+ e.generateLabel ? (s(), S("span", {
106
106
  key: 0,
107
107
  innerHTML: e.generateLabel()
108
- }, null, 8, le)) : f("", !0),
109
- y(e.$slots, "header", {}, void 0, !0)
108
+ }, null, 8, te)) : d("", !0),
109
+ v(e.$slots, "header", {}, void 0, !0)
110
110
  ]),
111
111
  _: 2
112
112
  }, [
113
- !e.isWebhook && h.value.length ? {
113
+ !e.isWebhook && f.value.length ? {
114
114
  name: "actions",
115
115
  fn: n(() => [
116
- r(o(A), {
116
+ r(o(U), {
117
117
  class: "max-h-80",
118
118
  modelValue: u.value,
119
- options: h.value,
119
+ options: f.value,
120
120
  placement: "bottom-end",
121
121
  teleport: "",
122
- "onUpdate:modelValue": l[0] || (l[0] = (c) => j(c))
122
+ "onUpdate:modelValue": l[0] || (l[0] = (p) => j(p))
123
123
  }, {
124
124
  default: n(() => [
125
- r(o(F), {
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(z(u.value?.title) + " ", 1),
132
- r(o(J), {
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
- b("div", {
148
+ C("div", {
149
149
  id: `${o(L)}-example`,
150
150
  class: "code-snippet"
151
151
  }, [
152
- H.value ? (s(), i(o(K), {
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: v.value
158
- }, null, 8, ["text"])) : (s(), i(o(M), {
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: v.value,
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, oe)
166
+ ], 8, le)
167
167
  ]),
168
168
  _: 1
169
169
  }),
170
- Object.keys(d.value).length > 1 || e.$slots.footer ? (s(), i(o(Z), {
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(d.value).length > 1 ? (s(), x("div", ae, [
176
- Object.keys(d.value).length ? (s(), i(te, {
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: p.value,
179
- "onUpdate:modelValue": [
180
- l[1] || (l[1] = (c) => p.value = c),
181
- l[2] || (l[2] = (c) => o(V)(
182
- m.value?.$el,
183
- "scalar-update-selected-example",
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
- })) : f("", !0)
186
+ })) : d("", !0)
194
187
  ]),
195
188
  _: 3
196
- }, 512)) : e.fallback ? (s(), i(o(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
- b("div", ne, [
204
- r(q, {
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
- y(e.$slots, "header", {}, void 0, !0)
202
+ v(e.$slots, "header", {}, void 0, !0)
210
203
  ]),
211
- y(e.$slots, "footer", {}, void 0, !0)
204
+ v(e.$slots, "footer", {}, void 0, !0)
212
205
  ]),
213
206
  _: 3
214
207
  })
215
208
  ]),
216
209
  _: 3
217
- })) : f("", !0);
210
+ })) : d("", !0);
218
211
  }
219
212
  });
220
213
  export {
221
- ge as default
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?: string | undefined;
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?: string | undefined;
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?: SecuritySchemeObject[] | undefined;
22
+ securitySchemes: SecuritySchemeObject[];
23
23
  /** The server object defining the base URL for the API request. */
24
- server?: ServerObject | undefined;
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,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,mFAAmF;IACnF,iBAAiB,EAAE,WAAW,EAAE,CAAA;IAChC,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,gEAAgE;IAChE,MAAM,EAAE,UAAU,CAAA;IAClB,wEAAwE;IACxE,SAAS,EAAE,eAAe,CAAA;IAC1B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAA;IACZ,iFAAiF;IACjF,eAAe,CAAC,EAAE,oBAAoB,EAAE,GAAG,SAAS,CAAA;IACpD,mEAAmE;IACnE,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;CAClC,CAAA;AAED,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,GAAI,0GAUjC,wBAAwB,KAAG,MAqC7B,CAAA"}
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 | undefined;
25
+ server?: ServerObject | null;
26
26
  /** OpenAPI SecurityScheme objects which are applicable to the operation */
27
27
  securitySchemes?: SecuritySchemeObject[];
28
28
  };
@@ -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,SAAS,CAAA;IACjC,2EAA2E;IAC3E,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAA;CACzC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc,GAAI,6EAQ5B,mBAAmB,KAAG,UAgFxB,CAAA"}
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 a } from "./components/OperationCodeSample.vue.js";
3
- import { DEFAULT_CLIENT as p, findClient as f, isClient as i } from "./helpers/find-client.js";
4
- import { generateClientOptions as n } from "./helpers/generate-client-options.js";
5
- import { getExampleFromSchema as C } from "./helpers/get-example-from-schema.js";
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
- p as DEFAULT_CLIENT,
8
+ a as DEFAULT_CLIENT,
8
9
  r as ExamplePicker,
9
- a as OperationCodeSample,
10
+ p as OperationCodeSample,
10
11
  f as findClient,
11
- n as generateClientOptions,
12
- C as getExampleFromSchema,
13
- i as isClient
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
- selectedSecurity: OpenApiDocument['x-scalar-selected-security'];
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>;