@scalar/api-client 2.3.31 → 2.3.33

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 (112) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  3. package/dist/components/CodeInput/CodeInput.vue.js +1 -1
  4. package/dist/components/CodeInput/CodeInput.vue2.js +63 -61
  5. package/dist/components/DataTable/DataTable.vue.js +1 -1
  6. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  7. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +58 -48
  8. package/dist/components/Sidebar/SidebarListElement.vue.d.ts +2 -2
  9. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  10. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +34 -32
  11. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  12. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +6 -6
  13. package/dist/hooks/useClientConfig.d.ts +3 -0
  14. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  15. package/dist/layouts/App/create-api-client-app.d.ts +64 -24
  16. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  17. package/dist/layouts/Modal/create-api-client-modal.d.ts +128 -48
  18. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  19. package/dist/layouts/Web/create-api-client-web.d.ts +64 -24
  20. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  21. package/dist/libs/create-client.d.ts +64 -24
  22. package/dist/libs/create-client.d.ts.map +1 -1
  23. package/dist/libs/index.js +26 -25
  24. package/dist/libs/local-storage.d.ts +8 -0
  25. package/dist/libs/local-storage.d.ts.map +1 -1
  26. package/dist/libs/local-storage.js +28 -24
  27. package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
  28. package/dist/libs/send-request/create-request-operation.js +8 -8
  29. package/dist/libs/send-request/create-request-operation.test.d.ts +2 -2
  30. package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
  31. package/dist/libs/send-request/decode-buffer.js +4 -4
  32. package/dist/store/active-entities.d.ts +2 -2
  33. package/dist/store/active-entities.d.ts.map +1 -1
  34. package/dist/store/request-example.d.ts +22 -22
  35. package/dist/store/request-example.d.ts.map +1 -1
  36. package/dist/store/security-schemes.d.ts +42 -2
  37. package/dist/store/security-schemes.d.ts.map +1 -1
  38. package/dist/store/store.d.ts +64 -24
  39. package/dist/store/store.d.ts.map +1 -1
  40. package/dist/style.css +1 -1
  41. package/dist/views/Collection/CollectionAuthentication.vue.d.ts.map +1 -1
  42. package/dist/views/Collection/CollectionAuthentication.vue.js +1 -1
  43. package/dist/views/Collection/CollectionAuthentication.vue2.js +32 -32
  44. package/dist/views/Collection/CollectionEnvironment.vue.d.ts.map +1 -1
  45. package/dist/views/Collection/CollectionEnvironment.vue.js +3 -2
  46. package/dist/views/Collection/CollectionEnvironment.vue2.js +233 -9
  47. package/dist/views/Collection/CollectionNavigation.vue.js +36 -36
  48. package/dist/views/Collection/CollectionServers.vue.d.ts.map +1 -1
  49. package/dist/views/Collection/CollectionServers.vue2.js +6 -6
  50. package/dist/views/Collection/components/EnvironmentForm.vue.d.ts +13 -0
  51. package/dist/views/Collection/components/EnvironmentForm.vue.d.ts.map +1 -0
  52. package/dist/views/Collection/components/EnvironmentForm.vue.js +7 -0
  53. package/dist/views/Collection/components/EnvironmentForm.vue2.js +274 -0
  54. package/dist/views/Components/CodeSnippet/CodeSnippet.vue.d.ts +2 -0
  55. package/dist/views/Components/CodeSnippet/CodeSnippet.vue.d.ts.map +1 -1
  56. package/dist/views/Components/CodeSnippet/CodeSnippet.vue.js +15 -13
  57. package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.d.ts.map +1 -1
  58. package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.js +35 -34
  59. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts +3 -1
  60. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
  61. package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +74 -31
  62. package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts +3 -1
  63. package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts.map +1 -1
  64. package/dist/views/Components/CodeSnippet/helpers/get-snippet.js +8 -6
  65. package/dist/views/Environment/EnvironmentModal.vue.d.ts.map +1 -1
  66. package/dist/views/Environment/EnvironmentModal.vue.js +32 -28
  67. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +1 -0
  68. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  69. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +67 -65
  70. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
  71. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +94 -97
  72. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +1 -0
  73. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  74. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  75. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +116 -99
  76. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +1 -0
  77. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  78. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
  79. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +27 -25
  80. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts +1 -0
  81. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts.map +1 -1
  82. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +2 -2
  83. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +114 -73
  84. package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts +2 -0
  85. package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts.map +1 -1
  86. package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +2 -2
  87. package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +54 -59
  88. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  89. package/dist/views/Request/RequestSection/RequestSection.vue.js +3 -3
  90. package/dist/views/Request/RequestSection/RequestSection.vue2.js +27 -26
  91. package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts +8 -0
  92. package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts.map +1 -0
  93. package/dist/views/Request/RequestSection/helpers/update-scheme.js +17 -0
  94. package/dist/views/Request/RequestSection/helpers/update-scheme.test.d.ts +2 -0
  95. package/dist/views/Request/RequestSection/helpers/update-scheme.test.d.ts.map +1 -0
  96. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  97. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  98. package/dist/views/Request/RequestSidebar.vue2.js +87 -84
  99. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
  100. package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +21 -21
  101. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts.map +1 -1
  102. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +11 -11
  103. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  104. package/dist/views/Request/consts/index.js +7 -5
  105. package/dist/views/Request/consts/mediaTypes.d.ts +4 -0
  106. package/dist/views/Request/consts/mediaTypes.d.ts.map +1 -1
  107. package/dist/views/Request/consts/mediaTypes.js +22 -4
  108. package/dist/views/Request/consts/mediaTypes.test.d.ts +2 -0
  109. package/dist/views/Request/consts/mediaTypes.test.d.ts.map +1 -0
  110. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  111. package/dist/views/Request/libs/oauth2.js +53 -47
  112. package/package.json +16 -16
@@ -1,70 +1,64 @@
1
- import { defineComponent as H, computed as a, ref as U, createElementBlock as j, openBlock as v, createVNode as i, withCtx as c, createElementVNode as x, createBlock as C, unref as r, toDisplayString as D, createTextVNode as N } from "vue";
2
- import { ScalarCodeBlock as R, ScalarCombobox as T, ScalarButton as W, ScalarIcon as q } from "@scalar/components";
3
- import { snippetz as z } from "@scalar/snippetz";
4
- import I from "../../../components/DataTable/DataTable.vue.js";
5
- import O from "../../../components/DataTable/DataTableRow.vue.js";
1
+ import { defineComponent as H, computed as a, ref as U, createElementBlock as j, openBlock as y, createVNode as i, withCtx as c, createElementVNode as x, createBlock as C, unref as r, toDisplayString as D, createTextVNode as N } from "vue";
2
+ import { ScalarCodeBlock as T, ScalarCombobox as W, ScalarButton as z, ScalarIcon as I } from "@scalar/components";
3
+ import { snippetz as O } from "@scalar/snippetz";
4
+ import R from "../../../components/DataTable/DataTable.vue.js";
5
+ import q from "../../../components/DataTable/DataTableRow.vue.js";
6
6
  import M from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
7
- import { filterSecurityRequirements as P } from "./helpers/filter-security-requirements.js";
8
- import A from "../../Components/CodeSnippet/CodeSnippet.vue.js";
9
- import { useWorkspace as F } from "../../../store/store.js";
10
- const G = { class: "w-full" }, J = { class: "-mx-1 flex flex-1" }, L = { class: "bg-b-1 flex items-center justify-center overflow-hidden border-t" }, ne = /* @__PURE__ */ H({
7
+ import P from "../../Components/CodeSnippet/CodeSnippet.vue.js";
8
+ import { useWorkspace as A } from "../../../store/store.js";
9
+ const F = { class: "w-full" }, G = { class: "-mx-1 flex flex-1" }, J = { class: "bg-b-1 flex items-center justify-center overflow-hidden border-t" }, le = /* @__PURE__ */ H({
11
10
  __name: "RequestCodeExample",
12
11
  props: {
13
12
  collection: {},
14
13
  example: {},
15
14
  operation: {},
16
15
  server: {},
17
- workspace: {}
16
+ workspace: {},
17
+ environment: {}
18
18
  },
19
- setup(n) {
20
- var b, K, S, h;
21
- const { securitySchemes: k, workspaceMutators: w } = F(), f = a(() => {
19
+ setup(o) {
20
+ var b, K, h, S;
21
+ const { securitySchemes: k, workspaceMutators: w } = A(), f = a(() => {
22
22
  var t, e, l;
23
23
  return d.value.targetKey === "custom" && ((t = u.value) == null ? void 0 : t.some(
24
- (o) => o.lang === d.value.clientKey
24
+ (n) => n.lang === d.value.clientKey
25
25
  )) ? d.value : {
26
- targetKey: ((e = n.workspace.selectedHttpClient) == null ? void 0 : e.targetKey) ?? "js",
27
- clientKey: ((l = n.workspace.selectedHttpClient) == null ? void 0 : l.clientKey) ?? "fetch"
26
+ targetKey: ((e = o.workspace.selectedHttpClient) == null ? void 0 : e.targetKey) ?? "js",
27
+ clientKey: ((l = o.workspace.selectedHttpClient) == null ? void 0 : l.clientKey) ?? "fetch"
28
28
  };
29
29
  }), u = a(
30
- () => n.operation["x-codeSamples"] || n.operation["x-code-samples"] || n.operation["x-custom-examples"]
30
+ () => o.operation["x-codeSamples"] || o.operation["x-code-samples"] || o.operation["x-custom-examples"]
31
31
  ), d = U(
32
32
  (b = u.value) != null && b.length ? {
33
33
  targetKey: "custom",
34
34
  clientKey: (K = u.value[0]) == null ? void 0 : K.lang
35
35
  } : {
36
- targetKey: ((S = n.workspace.selectedHttpClient) == null ? void 0 : S.targetKey) ?? "js",
37
- clientKey: ((h = n.workspace.selectedHttpClient) == null ? void 0 : h.clientKey) ?? "fetch"
36
+ targetKey: ((h = o.workspace.selectedHttpClient) == null ? void 0 : h.targetKey) ?? "js",
37
+ clientKey: ((S = o.workspace.selectedHttpClient) == null ? void 0 : S.clientKey) ?? "fetch"
38
38
  }
39
- ), $ = a(
40
- () => P(
41
- n.operation.security || n.collection.security || [],
42
- n.operation.selectedSecuritySchemeUids || n.collection.selectedSecuritySchemeUids,
43
- k
44
- )
45
- ), y = a(() => {
46
- const t = {}, e = z().clients().map((o) => ({
47
- label: o.title,
48
- options: o.clients.map((p) => (t[`${o.key},${p.client}`] = p.title, {
49
- id: `${o.key},${p.client}`,
39
+ ), $ = a(() => (o.operation.selectedSecuritySchemeUids || o.collection.selectedSecuritySchemeUids || []).flat().map((e) => k[e]).filter((e) => !!e)), v = a(() => {
40
+ const t = {}, e = O().clients().map((n) => ({
41
+ label: n.title,
42
+ options: n.clients.map((p) => (t[`${n.key},${p.client}`] = p.title, {
43
+ id: `${n.key},${p.client}`,
50
44
  label: p.title
51
45
  }))
52
- })), l = (n.operation["x-codeSamples"] || n.operation["x-code-samples"] || n.operation["x-custom-examples"] || []).map((o) => ({
53
- id: `custom,${o.lang}`,
54
- label: o.label || o.lang
46
+ })), l = (o.operation["x-codeSamples"] || o.operation["x-code-samples"] || o.operation["x-custom-examples"] || []).map((n) => ({
47
+ id: `custom,${n.lang}`,
48
+ label: n.label || n.lang
55
49
  })), m = l.length > 0 ? [
56
50
  {
57
51
  id: "customExamples",
58
52
  label: "Code Examples",
59
- options: l.map((o) => ({
60
- id: o.id,
61
- label: o.label ?? o.id
53
+ options: l.map((n) => ({
54
+ id: n.id,
55
+ label: n.label ?? n.id
62
56
  }))
63
57
  },
64
58
  ...e
65
59
  ] : e;
66
- return l.forEach((o) => {
67
- t[o.id] = o.label ?? o.id;
60
+ return l.forEach((n) => {
61
+ t[n.id] = n.label ?? n.id;
68
62
  }), {
69
63
  options: m,
70
64
  dict: t
@@ -75,24 +69,24 @@ const G = { class: "w-full" }, J = { class: "-mx-1 flex flex-1" }, L = { class:
75
69
  const l = `custom,${t.clientKey}`;
76
70
  return {
77
71
  id: l,
78
- label: y.value.dict[l] ?? "Unknown"
72
+ label: v.value.dict[l] ?? "Unknown"
79
73
  };
80
74
  }
81
75
  const e = `${t.targetKey},${t.clientKey}`;
82
76
  return {
83
77
  id: e,
84
- label: y.value.dict[e] ?? "Unknown"
78
+ label: v.value.dict[e] ?? "Unknown"
85
79
  };
86
80
  }), E = a(
87
81
  () => f.value.targetKey
88
- ), V = a(
82
+ ), B = a(
89
83
  () => f.value.clientKey
90
- ), B = ({ id: t }) => {
84
+ ), V = ({ id: t }) => {
91
85
  const [e, l] = t.split(",");
92
86
  !e || !l || (d.value = {
93
87
  targetKey: e,
94
88
  clientKey: l
95
- }, e !== "custom" && w.edit(n.workspace.uid, "selectedHttpClient", {
89
+ }, e !== "custom" && w.edit(o.workspace.uid, "selectedHttpClient", {
96
90
  targetKey: e,
97
91
  clientKey: l
98
92
  }));
@@ -103,7 +97,7 @@ const G = { class: "w-full" }, J = { class: "-mx-1 flex flex-1" }, L = { class:
103
97
  const t = s.value.id.split(",")[1], e = (l = u.value) == null ? void 0 : l.find((m) => m.lang === t);
104
98
  return e == null ? void 0 : e.source;
105
99
  });
106
- return (t, e) => (v(), j("div", G, [
100
+ return (t, e) => (y(), j("div", F, [
107
101
  i(M, {
108
102
  class: "group/preview w-full border-b-0",
109
103
  defaultOpen: !1
@@ -112,15 +106,15 @@ const G = { class: "w-full" }, J = { class: "-mx-1 flex flex-1" }, L = { class:
112
106
  N("Code Snippet")
113
107
  ])),
114
108
  actions: c(() => [
115
- x("div", J, [
116
- i(r(T), {
109
+ x("div", G, [
110
+ i(r(W), {
117
111
  modelValue: s.value,
118
- options: y.value.options,
112
+ options: v.value.options,
119
113
  placement: "bottom-end",
120
- "onUpdate:modelValue": B
114
+ "onUpdate:modelValue": V
121
115
  }, {
122
116
  default: c(() => [
123
- i(r(W), {
117
+ i(r(z), {
124
118
  class: "text-c-1 hover:bg-b-3 py-0.75 flex h-full w-fit gap-1.5 px-1.5 font-normal",
125
119
  fullWidth: "",
126
120
  variant: "ghost"
@@ -129,7 +123,7 @@ const G = { class: "w-full" }, J = { class: "-mx-1 flex flex-1" }, L = { class:
129
123
  var l;
130
124
  return [
131
125
  x("span", null, D((l = s.value) == null ? void 0 : l.label), 1),
132
- i(r(q), {
126
+ i(r(I), {
133
127
  icon: "ChevronDown",
134
128
  size: "md"
135
129
  })
@@ -143,29 +137,30 @@ const G = { class: "w-full" }, J = { class: "-mx-1 flex flex-1" }, L = { class:
143
137
  ])
144
138
  ]),
145
139
  default: c(() => [
146
- i(I, {
140
+ i(R, {
147
141
  columns: [""],
148
142
  presentational: ""
149
143
  }, {
150
144
  default: c(() => [
151
- i(O, null, {
145
+ i(q, null, {
152
146
  default: c(() => [
153
- x("div", L, [
154
- g.value ? (v(), C(r(R), {
147
+ x("div", J, [
148
+ g.value ? (y(), C(r(T), {
155
149
  key: 0,
156
150
  class: "px-3 py-1.5",
157
151
  content: g.value,
158
152
  lang: s.value.id.split(",")[1] ?? "plaintext"
159
- }, null, 8, ["content", "lang"])) : (v(), C(r(A), {
153
+ }, null, 8, ["content", "lang"])) : (y(), C(r(P), {
160
154
  key: 1,
161
155
  class: "px-3 py-1.5",
162
- client: V.value,
156
+ client: B.value,
163
157
  example: t.example,
164
158
  operation: t.operation,
165
159
  securitySchemes: $.value,
166
160
  server: t.server,
167
- target: E.value
168
- }, null, 8, ["client", "example", "operation", "securitySchemes", "server", "target"]))
161
+ target: E.value,
162
+ environment: t.environment
163
+ }, null, 8, ["client", "example", "operation", "securitySchemes", "server", "target", "environment"]))
169
164
  ])
170
165
  ]),
171
166
  _: 1
@@ -180,5 +175,5 @@ const G = { class: "w-full" }, J = { class: "-mx-1 flex flex-1" }, L = { class:
180
175
  }
181
176
  });
182
177
  export {
183
- ne as default
178
+ le as default
184
179
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AAgUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AASrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAU1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAoVF,wBAOG"}
1
+ {"version":3,"file":"RequestSection.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Request/RequestSection/RequestSection.vue"],"names":[],"mappings":"AAiUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AASrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAU1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,OAAO,EAAE,cAAc,CAAA;IACvB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAmVF,wBAOG"}
@@ -1,7 +1,7 @@
1
- import e from "./RequestSection.vue2.js";
1
+ import o from "./RequestSection.vue2.js";
2
2
  /* empty css */
3
- import o from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ o(e, [["__scopeId", "data-v-2e516ee8"]]);
3
+ import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b2979639"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -1,11 +1,11 @@
1
- import { defineComponent as H, computed as p, useId as A, ref as N, watch as I, createBlock as d, openBlock as i, withCtx as v, createElementVNode as c, withDirectives as s, createCommentVNode as f, createVNode as t, unref as n, vShow as m, createElementBlock as y, toDisplayString as U } from "vue";
1
+ import { defineComponent as H, computed as p, useId as A, ref as N, watch as I, createBlock as v, openBlock as i, withCtx as d, createElementVNode as c, withDirectives as s, createCommentVNode as f, createVNode as t, unref as n, vShow as m, createElementBlock as h, toDisplayString as U } from "vue";
2
2
  import { ScalarErrorBoundary as D } from "@scalar/components";
3
- import { canMethodHaveBody as h, isDefined as K, REGEX as q } from "@scalar/oas-utils/helpers";
3
+ import { canMethodHaveBody as b, isDefined as K, REGEX as q } from "@scalar/oas-utils/helpers";
4
4
  import Q from "../../../components/SectionFilter.vue.js";
5
5
  import $ from "../../../components/ViewLayout/ViewLayoutSection.vue.js";
6
6
  import { matchesDomain as L } from "../../../libs/send-request/set-request-cookies.js";
7
7
  import j from "./RequestBody.vue.js";
8
- import b from "./RequestParams.vue.js";
8
+ import k from "./RequestParams.vue.js";
9
9
  import F from "./RequestPathParams.vue.js";
10
10
  import M from "./RequestAuth/RequestAuth.vue.js";
11
11
  import T from "./RequestCodeExample.vue.js";
@@ -35,12 +35,12 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
35
35
  "Headers",
36
36
  "Query",
37
37
  "Body"
38
- ], { requestMutators: S, cookies: g, securitySchemes: B } = W(), { layout: u } = z(), k = p(() => {
38
+ ], { requestMutators: S, cookies: g, securitySchemes: B } = W(), { layout: u } = z(), y = p(() => {
39
39
  const e = /* @__PURE__ */ new Set(["All", ...P]);
40
- return l.example.parameters.path.length || e.delete("Variables"), h(l.operation.method ?? "get") || e.delete("Body"), w.value && e.delete("Auth"), [...e];
40
+ return l.example.parameters.path.length || e.delete("Variables"), b(l.operation.method ?? "get") || e.delete("Body"), w.value && e.delete("Auth"), [...e];
41
41
  }), r = p(
42
42
  () => Object.fromEntries(
43
- k.value.map((e) => [e, A()])
43
+ y.value.map((e) => [e, A()])
44
44
  )
45
45
  ), w = p(
46
46
  () => {
@@ -51,7 +51,7 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
51
51
  I(
52
52
  () => l.operation,
53
53
  (e) => {
54
- a.value === "Body" && e && !h(e.method) && (a.value = "All");
54
+ a.value === "Body" && e && !b(e.method) && (a.value = "All");
55
55
  }
56
56
  );
57
57
  const C = (e) => {
@@ -75,42 +75,42 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
75
75
  enabled: !0
76
76
  }))
77
77
  ), E = () => l.operation.summary ? l.operation.summary : l.operation.path.replace(q.PROTOCOL, "") ? l.operation.path.replace(q.PROTOCOL, "") : "Request Name", V = A();
78
- return (e, o) => (i(), d($, {
78
+ return (e, o) => (i(), v($, {
79
79
  "aria-label": `Request: ${e.operation.summary}`
80
80
  }, {
81
- title: v(() => [
81
+ title: d(() => [
82
82
  c("div", G, [
83
- n(u) !== "modal" ? (i(), y("label", {
83
+ n(u) !== "modal" ? (i(), h("label", {
84
84
  key: 0,
85
85
  class: "pointer-events-auto absolute left-0 top-0 h-full w-full cursor-text opacity-0",
86
86
  for: n(V)
87
87
  }, null, 8, X)) : f("", !0),
88
- n(u) !== "modal" ? (i(), y("input", {
88
+ n(u) !== "modal" ? (i(), h("input", {
89
89
  key: 1,
90
90
  id: n(V),
91
91
  class: "text-c-1 group-hover-input pl-1.25 md:-ml-1.25 pointer-events-auto relative z-10 -ml-0.5 h-8 w-full rounded has-[:focus-visible]:outline",
92
92
  placeholder: E(),
93
93
  value: e.operation.summary,
94
94
  onInput: C
95
- }, null, 40, J)) : (i(), y("span", Y, U(e.operation.summary), 1))
95
+ }, null, 40, J)) : (i(), h("span", Y, U(e.operation.summary), 1))
96
96
  ]),
97
97
  t(Q, {
98
98
  modelValue: a.value,
99
99
  "onUpdate:modelValue": o[0] || (o[0] = (O) => a.value = O),
100
100
  filterIds: r.value,
101
- filters: k.value
101
+ filters: y.value
102
102
  }, null, 8, ["modelValue", "filterIds", "filters"])
103
103
  ]),
104
- default: v(() => [
104
+ default: d(() => [
105
105
  c("div", {
106
106
  id: r.value.All,
107
- class: "request-section-content custom-scroll relative flex flex-1 flex-col divide-y",
107
+ class: "request-section-content custom-scroll relative flex flex-1 flex-col",
108
108
  role: a.value === "All" ? "tabpanel" : "none"
109
109
  }, [
110
- e.collection && e.workspace && (n(u) !== "modal" || Object.keys(n(B) ?? {}).length) ? s((i(), d(M, {
110
+ e.collection && e.workspace && (n(u) !== "modal" || Object.keys(n(B) ?? {}).length) ? s((i(), v(M, {
111
111
  key: 0,
112
112
  id: r.value.Auth,
113
- class: "request-section-content-auth border-b-0",
113
+ class: "request-section-content-auth",
114
114
  collection: e.collection,
115
115
  envVariables: e.envVariables,
116
116
  environment: e.environment,
@@ -145,7 +145,7 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
145
145
  (a.value === "All" || a.value === "Variables") && e.example.parameters.path.length
146
146
  ]
147
147
  ]),
148
- s(t(b, {
148
+ s(t(k, {
149
149
  id: r.value.Cookies,
150
150
  class: "request-section-content-cookies",
151
151
  envVariables: e.envVariables,
@@ -162,7 +162,7 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
162
162
  }, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "readOnlyEntries", "role", "workspace"]), [
163
163
  [m, a.value === "All" || a.value === "Cookies"]
164
164
  ]),
165
- s(t(b, {
165
+ s(t(k, {
166
166
  id: r.value.Headers,
167
167
  class: "request-section-content-headers",
168
168
  envVariables: e.envVariables,
@@ -178,7 +178,7 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
178
178
  }, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "role", "workspace"]), [
179
179
  [m, a.value === "All" || a.value === "Headers"]
180
180
  ]),
181
- s(t(b, {
181
+ s(t(k, {
182
182
  id: r.value.Query,
183
183
  class: "request-section-content-query",
184
184
  envVariables: e.envVariables,
@@ -194,7 +194,7 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
194
194
  }, null, 8, ["id", "envVariables", "environment", "example", "invalidParams", "operation", "role", "workspace"]), [
195
195
  [m, a.value === "All" || a.value === "Query"]
196
196
  ]),
197
- e.operation.method && (a.value === "All" || a.value === "Body") && n(h)(e.operation.method) ? (i(), d(j, {
197
+ e.operation.method && (a.value === "All" || a.value === "Body") && n(b)(e.operation.method) ? (i(), v(j, {
198
198
  key: 1,
199
199
  id: r.value.Body,
200
200
  class: "request-section-content-body",
@@ -206,17 +206,18 @@ const G = { class: "group pointer-events-none flex flex-1 items-center gap-1 lg:
206
206
  title: "Body",
207
207
  workspace: e.workspace
208
208
  }, null, 8, ["id", "envVariables", "environment", "example", "operation", "role", "workspace"])) : f("", !0),
209
- o[1] || (o[1] = c("div", { class: "-my-0.25 flex flex-grow" }, null, -1)),
209
+ o[1] || (o[1] = c("div", { class: "flex flex-grow" }, null, -1)),
210
210
  t(n(D), null, {
211
- default: v(() => [
211
+ default: d(() => [
212
212
  t(T, {
213
- class: "request-section-content-code-example",
213
+ class: "request-section-content-code-example -mt-1/2 border-t",
214
214
  collection: e.collection,
215
215
  example: e.example,
216
216
  operation: e.operation,
217
217
  server: e.server,
218
- workspace: e.workspace
219
- }, null, 8, ["collection", "example", "operation", "server", "workspace"])
218
+ workspace: e.workspace,
219
+ environment: e.envVariables
220
+ }, null, 8, ["collection", "example", "operation", "server", "workspace", "environment"])
220
221
  ]),
221
222
  _: 1
222
223
  })
@@ -0,0 +1,8 @@
1
+ import type { SecurityScheme } from '@scalar/oas-utils/entities/spec';
2
+ import type { Path, PathValue } from '@scalar/object-utils/nested';
3
+ import type { WorkspaceStore } from '../../../../store/store';
4
+ /** Shape of the local storage auth object */
5
+ export type Auth<P extends Path<SecurityScheme>> = Record<string, Record<P, NonNullable<PathValue<SecurityScheme, P>>>>;
6
+ /** Update the security scheme with side effects */
7
+ export declare const updateScheme: <U extends SecurityScheme["uid"], P extends Path<SecurityScheme>>(uid: U, path: P, value: NonNullable<PathValue<SecurityScheme, P>>, { securitySchemeMutators, securitySchemes }: WorkspaceStore, persistAuth?: boolean) => void;
8
+ //# sourceMappingURL=update-scheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-scheme.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/helpers/update-scheme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,6CAA6C;AAC7C,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,IAAI,CAAC,cAAc,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAEvH,mDAAmD;AACnD,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,IAAI,CAAC,cAAc,CAAC,OACrF,CAAC,QACA,CAAC,SACA,WAAW,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,+CACH,cAAc,gCAsB5D,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { CLIENT_LS_KEYS as a } from "../../../../libs/local-storage.js";
2
+ const l = (o, r, c, { securitySchemeMutators: m, securitySchemes: s }, S = !1) => {
3
+ var n;
4
+ if (m.edit(o, r, c), !!S)
5
+ try {
6
+ const e = JSON.parse(localStorage.getItem(a.AUTH) ?? "{}"), t = s[o];
7
+ if (e && (t != null && t.nameKey)) {
8
+ const f = e[n = t.nameKey] || (e[n] = {});
9
+ f[r] = c, localStorage.setItem(a.AUTH, JSON.stringify(e));
10
+ }
11
+ } catch (e) {
12
+ console.error(e);
13
+ }
14
+ };
15
+ export {
16
+ l as updateScheme
17
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=update-scheme.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-scheme.test.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/helpers/update-scheme.test.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":";;;cA4jBuC,MAAM;aAAO,MAAM;;;;;cAAnB,MAAM;aAAO,MAAM;;;AAoyB1D,wBAMG"}
1
+ {"version":3,"file":"RequestSidebar.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Request/RequestSidebar.vue"],"names":[],"mappings":";;;cAokBuC,MAAM;aAAO,MAAM;;;;;cAAnB,MAAM;aAAO,MAAM;;;AAuzB1D,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestSidebar.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5a734bd1"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8b424452"]]);
5
5
  export {
6
6
  m as default
7
7
  };