@scalar/api-client 2.37.0 → 2.38.1

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 (46) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/style.css +1 -1
  3. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  4. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +87 -78
  5. package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
  6. package/dist/v2/blocks/operation-block/components/Header.vue2.js +5 -5
  7. package/dist/v2/blocks/operation-block/helpers/response-cache.d.ts +30 -0
  8. package/dist/v2/blocks/operation-block/helpers/response-cache.d.ts.map +1 -0
  9. package/dist/v2/blocks/operation-block/helpers/response-cache.js +12 -0
  10. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  11. package/dist/v2/blocks/request-block/RequestBlock.vue.js +2 -2
  12. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +83 -80
  13. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  14. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +2 -2
  15. package/dist/v2/blocks/request-block/components/RequestBody.vue2.js +65 -61
  16. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts +3 -1
  17. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts.map +1 -1
  18. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js +42 -32
  19. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  20. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts +4 -7
  21. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.d.ts.map +1 -1
  22. package/dist/v2/blocks/request-block/helpers/get-form-body-rows.js +27 -7
  23. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +2 -0
  24. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  25. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +23 -21
  26. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  27. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +19 -14
  28. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -1
  29. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +72 -66
  30. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +4 -4
  31. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -1
  32. package/dist/v2/components/sidebar/SidebarMenu.vue.d.ts.map +1 -1
  33. package/dist/v2/components/sidebar/SidebarMenu.vue.js +24 -22
  34. package/dist/v2/features/app/app-events.js +2 -2
  35. package/dist/v2/features/collection/components/Editor/hooks/use-editor-state.d.ts +1 -1
  36. package/dist/v2/features/collection/components/Editor/hooks/use-editor-state.js +3 -3
  37. package/dist/v2/features/collection/components/Form.vue.d.ts +1 -0
  38. package/dist/v2/features/collection/components/Form.vue.d.ts.map +1 -1
  39. package/dist/v2/features/collection/components/Form.vue.js +23 -23
  40. package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
  41. package/dist/v2/features/collection/components/Servers.vue.js +5 -4
  42. package/dist/v2/features/operation/Operation.vue.js +1 -1
  43. package/dist/v2/features/settings/components/Section.vue.d.ts.map +1 -1
  44. package/dist/v2/features/settings/components/Section.vue.js +10 -10
  45. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  46. package/package.json +11 -11
@@ -1 +1 @@
1
- {"version":3,"file":"OperationBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"names":[],"mappings":"AA6ZA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAErF,OAAO,EAAE,KAAK,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C,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,gCAAgC;IAChC,cAAc,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC,yBAAyB,CAAC,CAAA;IACtE,mDAAmD;IACnD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,sCAAsC;IACtC,UAAU,EAAE,UAAU,CAAA;IACtB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oBAAoB;IACpB,MAAM,CAAC,EAAE,SAAS,GAAG,eAAe,CAAA;IACpC,uBAAuB;IACvB,SAAS,EAAE,eAAe,CAAA;IAC1B,kCAAkC;IAClC,yBAAyB,EAAE,gBAAgB,GAAG,SAAS,CAAA;IACvD,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAA;IAClB,2CAA2C;IAC3C,QAAQ,EAAE,QAAQ,CAAA;IAClB,wCAAwC;IACxC,eAAe,EAAE,qBAAqB,CAAA;IACtC,qBAAqB;IACrB,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,uBAAuB;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,8CAA8C;IAC9C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AACD,QAAA,MAAM,YAAY,kTAoad,CAAC"}
1
+ {"version":3,"file":"OperationBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"names":[],"mappings":"AAubA,OAAO,KAAK,EAAE,UA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foreUnmount as x, watch as K, createElementBlock as V, openBlock as M, createElementVNode as O, createVNode as l, withCtx as q, unref as B } from "vue";
2
- import { AVAILABLE_CLIENTS as P } from "@scalar/types/snippetz";
3
- import { useToasts as w } from "@scalar/use-toasts";
4
- import T from "../../../components/ViewLayout/ViewLayout.vue.js";
5
- import I from "../../../components/ViewLayout/ViewLayoutContent.vue.js";
6
- import { ERRORS as A } from "../../../libs/errors.js";
7
- import { buildRequest as L } from "./helpers/build-request.js";
8
- import { getSecuritySchemes as N } from "./helpers/build-request-security.js";
9
- import { harToFetchRequest as H } from "./helpers/har-to-fetch-request.js";
10
- import { harToFetchResponse as F } from "./helpers/har-to-fetch-response.js";
11
- import { sendRequest as j } from "./helpers/send-request.js";
12
- import { validatePathParameters as D } from "./helpers/validate-path-parameters.js";
13
- import Q from "./components/Header.vue.js";
14
- import { generateClientOptions as $ } from "../operation-code-sample/helpers/generate-client-options.js";
15
- import { getSecurityRequirements as z } from "../../features/operation/helpers/get-security-requirements.js";
16
- import { getSelectedSecurity as G } from "../../features/operation/helpers/get-selected-security.js";
17
- import J from "../request-block/RequestBlock.vue.js";
18
- import W from "../response-block/ResponseBlock.vue.js";
19
- 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 = {
1
+ import { defineComponent as U, computed as s, ref as d, onMounted as V, onBeforeUnmount as x, watch as M, createElementBlock as O, openBlock as w, createElementVNode as P, createVNode as u, withCtx as q, unref as B } from "vue";
2
+ import { AVAILABLE_CLIENTS as T } from "@scalar/types/snippetz";
3
+ import { useToasts as I } 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 H } from "./helpers/build-request.js";
8
+ import { getSecuritySchemes as F } from "./helpers/build-request-security.js";
9
+ import { harToFetchRequest as j } from "./helpers/har-to-fetch-request.js";
10
+ import { harToFetchResponse as D } from "./helpers/har-to-fetch-response.js";
11
+ import { responseCache as R, getOperationExampleKey as C, isStreamingResponse as Q } from "./helpers/response-cache.js";
12
+ import { sendRequest as $ } from "./helpers/send-request.js";
13
+ import { validatePathParameters as z } from "./helpers/validate-path-parameters.js";
14
+ import G from "./components/Header.vue.js";
15
+ import { generateClientOptions as J } from "../operation-code-sample/helpers/generate-client-options.js";
16
+ import { getSecurityRequirements as W } from "../../features/operation/helpers/get-security-requirements.js";
17
+ import { getSelectedSecurity as X } from "../../features/operation/helpers/get-selected-security.js";
18
+ import Y from "../request-block/RequestBlock.vue.js";
19
+ import Z from "../response-block/ResponseBlock.vue.js";
20
+ const p = { class: "bg-b-1 flex h-full flex-col" }, _ = { class: "lg:min-h-header flex w-full flex-wrap items-center justify-center p-2 lg:p-0" }, ee = {
20
21
  name: "OperationBlock"
21
- }, fe = /* @__PURE__ */ b({
22
- ...Z,
22
+ }, qe = /* @__PURE__ */ U({
23
+ ...ee,
23
24
  props: {
24
25
  eventBus: {},
25
26
  documentSecurity: {},
@@ -28,7 +29,7 @@ const X = { class: "bg-b-1 flex h-full flex-col" }, Y = { class: "lg:min-h-heade
28
29
  globalCookies: { default: () => [] },
29
30
  path: {},
30
31
  method: {},
31
- httpClients: { default: () => P },
32
+ httpClients: { default: () => T },
32
33
  history: { default: () => [] },
33
34
  layout: {},
34
35
  server: {},
@@ -51,25 +52,25 @@ const X = { class: "bg-b-1 flex h-full flex-col" }, Y = { class: "lg:min-h-heade
51
52
  proxyUrl: {}
52
53
  },
53
54
  setup(e) {
54
- const R = i(() => $(e.httpClients)), v = i(
55
- () => z(e.documentSecurity, e.operation.security)
56
- ), y = i(
57
- () => G(
55
+ const k = s(() => J(e.httpClients)), v = s(
56
+ () => W(e.documentSecurity, e.operation.security)
57
+ ), y = s(
58
+ () => X(
58
59
  e.documentSelectedSecurity,
59
60
  e.operationSelectedSecurity,
60
61
  v.value
61
62
  )
62
- ), f = i(
63
- () => N(e.securitySchemes, y.value.selectedSchemes)
64
- ), { toast: c } = w(), S = d(null), a = d(null), u = d(null), s = () => S.value?.abort(A.REQUEST_ABORTED), h = async () => {
65
- if (D(
63
+ ), f = s(
64
+ () => F(e.securitySchemes, y.value.selectedSchemes)
65
+ ), { toast: c } = I(), g = d(null), a = d(null), l = d(null), m = () => g.value?.abort(N.REQUEST_ABORTED), h = async () => {
66
+ if (z(
66
67
  e.operation.parameters ?? [],
67
68
  e.exampleKey
68
69
  ).ok === !1) {
69
70
  c("Path parameters must have values.", "error");
70
71
  return;
71
72
  }
72
- const [r, t] = L({
73
+ const [r, n] = H({
73
74
  environment: e.environment,
74
75
  exampleKey: e.exampleKey,
75
76
  globalCookies: e.globalCookies,
@@ -84,71 +85,74 @@ const X = { class: "bg-b-1 flex h-full flex-col" }, Y = { class: "lg:min-h-heade
84
85
  c(r.message, "error");
85
86
  return;
86
87
  }
87
- S.value = t.controller, a.value && "reader" in a.value && a.value.reader.cancel(), e.eventBus.emit("hooks:on:request:sent", {
88
+ g.value = n.controller, a.value && "reader" in a.value && a.value.reader.cancel(), e.eventBus.emit("hooks:on:request:sent", {
88
89
  meta: {
89
90
  method: e.method,
90
91
  path: e.path,
91
92
  exampleKey: e.exampleKey
92
93
  }
93
94
  });
94
- const [m, n] = await j({
95
- isUsingProxy: t.isUsingProxy,
95
+ const [i, t] = await $({
96
+ isUsingProxy: n.isUsingProxy,
96
97
  operation: e.operation,
97
98
  plugins: e.plugins,
98
- request: t.request
99
+ request: n.request
99
100
  });
100
101
  if (e.eventBus.emit("hooks:on:request:complete", {
101
- payload: n ? {
102
- response: n.originalResponse,
103
- request: n.request.clone(),
104
- duration: n.response.duration,
105
- timestamp: n.timestamp
102
+ payload: t ? {
103
+ response: t.originalResponse,
104
+ request: t.request.clone(),
105
+ duration: t.response.duration,
106
+ timestamp: t.timestamp
106
107
  } : void 0,
107
108
  meta: {
108
109
  method: e.method,
109
110
  path: e.path,
110
111
  exampleKey: e.exampleKey
111
112
  }
112
- }), m) {
113
- c(m.message, "error");
113
+ }), i) {
114
+ c(i.message, "error");
114
115
  return;
115
116
  }
116
- a.value = n.response, u.value = n.request;
117
+ a.value = t.response, l.value = t.request, Q(t.response) || R.set(C(e.method, e.path, e.exampleKey), {
118
+ response: t.response,
119
+ request: t.request
120
+ });
117
121
  };
118
- U(() => {
119
- e.eventBus.on("operation:send:request:hotkey", h), e.eventBus.on("operation:cancel:request", s);
122
+ V(() => {
123
+ e.eventBus.on("operation:send:request:hotkey", h), e.eventBus.on("operation:cancel:request", m);
120
124
  }), x(() => {
121
- e.eventBus.off("operation:send:request:hotkey", h), e.eventBus.off("operation:cancel:request", s);
125
+ e.eventBus.off("operation:send:request:hotkey", h), e.eventBus.off("operation:cancel:request", m);
122
126
  });
123
- const g = i(
127
+ const S = s(
124
128
  () => e.history.map((o) => ({
125
129
  method: o.request.method,
126
130
  path: o.request.url,
127
131
  duration: o.time,
128
132
  status: o.response.status
129
133
  })).reverse()
130
- ), C = ({ index: o }) => {
131
- const r = (e.history.length ?? 0) - o - 1, t = e.history[r];
132
- if (!t)
134
+ ), E = ({ index: o }) => {
135
+ const r = (e.history.length ?? 0) - o - 1, n = e.history[r];
136
+ if (!n)
133
137
  return;
134
- const m = () => e.eventBus.emit("ui:navigate", {
138
+ const i = () => e.eventBus.emit("ui:navigate", {
135
139
  page: "example",
136
140
  method: e.method,
137
141
  path: e.path,
138
142
  exampleName: "draft",
139
- callback: (n) => {
140
- if (n !== "success")
143
+ callback: (t) => {
144
+ if (t !== "success")
141
145
  return;
142
- const k = F({
143
- harResponse: t.response,
144
- url: t.request.url,
146
+ const K = D({
147
+ harResponse: n.response,
148
+ url: n.request.url,
145
149
  method: e.method,
146
150
  path: e.path,
147
- duration: t.time
148
- }), E = H({
149
- harRequest: t.request
151
+ duration: n.time
152
+ }), b = j({
153
+ harRequest: n.request
150
154
  });
151
- a.value = k, u.value = E;
155
+ a.value = K, l.value = b;
152
156
  }
153
157
  });
154
158
  e.eventBus.emit("operation:reload:history", {
@@ -157,23 +161,28 @@ const X = { class: "bg-b-1 flex h-full flex-col" }, Y = { class: "lg:min-h-heade
157
161
  method: e.method
158
162
  },
159
163
  index: r,
160
- callback: m
164
+ callback: i
161
165
  });
162
166
  };
163
- return K([() => e.path, () => e.method, () => e.exampleKey], () => {
164
- a.value = null, u.value = null, s();
165
- }), x(() => {
166
- s();
167
- }), (o, r) => (M(), V("div", X, [
168
- O("div", Y, [
169
- l(Q, {
167
+ return M(
168
+ [() => e.path, () => e.method, () => e.exampleKey],
169
+ ([o, r, n]) => {
170
+ const i = C(r, o, n), t = R.get(i);
171
+ t ? (a.value = t.response, l.value = t.request) : (a.value = null, l.value = null), m();
172
+ },
173
+ { immediate: !0 }
174
+ ), x(() => {
175
+ m();
176
+ }), (o, r) => (w(), O("div", p, [
177
+ P("div", _, [
178
+ u(G, {
170
179
  activeEnvironment: e.activeEnvironment,
171
180
  documentUrl: e.documentUrl,
172
181
  environment: e.environment,
173
182
  environments: e.environments,
174
183
  eventBus: e.eventBus,
175
184
  hideClientButton: e.hideClientButton,
176
- history: g.value,
185
+ history: S.value,
177
186
  integration: e.integration,
178
187
  layout: e.layout,
179
188
  method: e.method,
@@ -183,16 +192,16 @@ const X = { class: "bg-b-1 flex h-full flex-col" }, Y = { class: "lg:min-h-heade
183
192
  servers: e.servers,
184
193
  source: e.source,
185
194
  onExecute: h,
186
- "onSelect:history:item": C
195
+ "onSelect:history:item": E
187
196
  }, null, 8, ["activeEnvironment", "documentUrl", "environment", "environments", "eventBus", "hideClientButton", "history", "integration", "layout", "method", "path", "server", "serverMeta", "servers", "source"])
188
197
  ]),
189
- l(T, { class: "border-t" }, {
198
+ u(A, { class: "border-t" }, {
190
199
  default: q(() => [
191
- l(I, { class: "flex-1" }, {
200
+ u(L, { class: "flex-1" }, {
192
201
  default: q(() => [
193
- l(B(J), {
202
+ u(B(Y), {
194
203
  authMeta: e.authMeta,
195
- clientOptions: R.value,
204
+ clientOptions: k.value,
196
205
  environment: e.environment,
197
206
  eventBus: e.eventBus,
198
207
  exampleKey: e.exampleKey,
@@ -210,14 +219,14 @@ const X = { class: "bg-b-1 flex h-full flex-col" }, Y = { class: "lg:min-h-heade
210
219
  selectedSecuritySchemes: f.value,
211
220
  server: e.server
212
221
  }, null, 8, ["authMeta", "clientOptions", "environment", "eventBus", "exampleKey", "globalCookies", "layout", "method", "operation", "path", "plugins", "proxyUrl", "securityRequirements", "securitySchemes", "selectedClient", "selectedSecurity", "selectedSecuritySchemes", "server"]),
213
- l(B(W), {
222
+ u(B(Z), {
214
223
  appVersion: e.appVersion,
215
224
  eventBus: e.eventBus,
216
225
  layout: e.layout,
217
226
  plugins: e.plugins,
218
- request: u.value,
227
+ request: l.value,
219
228
  response: a.value,
220
- totalPerformedRequests: g.value.length
229
+ totalPerformedRequests: S.value.length
221
230
  }, null, 8, ["appVersion", "eventBus", "layout", "plugins", "request", "response", "totalPerformedRequests"])
222
231
  ]),
223
232
  _: 1
@@ -229,5 +238,5 @@ const X = { class: "bg-b-1 flex h-full flex-col" }, Y = { class: "lg:min-h-heade
229
238
  }
230
239
  });
231
240
  export {
232
- fe as default
241
+ qe as default
233
242
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./Header.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-192fe698"]]);
4
+ const d = /* @__PURE__ */ r(o, [["__scopeId", "data-v-0e03d0d8"]]);
5
5
  export {
6
- f as default
6
+ d as default
7
7
  };
@@ -2,8 +2,8 @@ import { defineComponent as g, createElementBlock as s, openBlock as o, createEl
2
2
  import { ScalarIcon as d } from "@scalar/components";
3
3
  import x from "../../scalar-address-bar-block/components/EnvironmentSelector.vue.js";
4
4
  import B from "../../scalar-address-bar-block/components/AddressBar.vue.js";
5
- import k from "../../../../components/OpenApiClientButton.vue.js";
6
- const b = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap items-center justify-center p-2 pt-2 lg:p-1 lg:pt-1" }, h = { class: "mb-2 flex w-1/2 flex-row items-center justify-end gap-2 lg:mb-0 lg:flex-1 lg:px-2.5" }, S = /* @__PURE__ */ g({
5
+ import b from "../../../../components/OpenApiClientButton.vue.js";
6
+ const k = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap items-center justify-center p-2 pt-2 lg:p-1 lg:pt-1" }, h = { class: "mb-2 flex w-1/2 flex-row items-center justify-end gap-2 lg:mb-0 lg:flex-1 lg:px-2.5" }, S = /* @__PURE__ */ g({
7
7
  __name: "Header",
8
8
  props: {
9
9
  path: {},
@@ -27,9 +27,9 @@ const b = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap i
27
27
  const m = c, f = (v) => {
28
28
  e.eventBus.emit("workspace:update:active-environment", v);
29
29
  }, y = () => {
30
- e.eventBus.emit("ui:navigate", { page: "workspace", path: "environment" });
30
+ e.eventBus.emit("ui:navigate", { page: "document", path: "environment" });
31
31
  };
32
- return (v, t) => (o(), s("div", b, [
32
+ return (v, t) => (o(), s("div", k, [
33
33
  t[7] || (t[7] = i("div", { class: "mb-2 flex w-1/2 flex-row items-center gap-1 lg:mb-0 lg:flex-1 lg:px-1" }, [
34
34
  i("div", { class: "size-8" })
35
35
  ], -1)),
@@ -57,7 +57,7 @@ const b = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap i
57
57
  "onAdd:environment": y,
58
58
  "onSelect:environment": f
59
59
  }, null, 8, ["activeEnvironment", "environments"])) : l("", !0),
60
- e.layout === "modal" && e.documentUrl && !e.hideClientButton ? (o(), u(r(k), {
60
+ e.layout === "modal" && e.documentUrl && !e.hideClientButton ? (o(), u(r(b), {
61
61
  key: 1,
62
62
  buttonSource: "modal",
63
63
  class: "!w-fit lg:-mr-1",
@@ -0,0 +1,30 @@
1
+ import type { ResponseInstance } from '@scalar/oas-utils/entities/spec';
2
+ /**
3
+ * In-memory cache of operation example id → { response, request }.
4
+ * Restores the last response when navigating back to an operation until
5
+ * the user refreshes the page or makes a new request.
6
+ */
7
+ export declare const responseCache: Map<string, {
8
+ response: ResponseInstance;
9
+ request: Request;
10
+ }>;
11
+ /**
12
+ * Constructs a unique cache key for a specific operation/example.
13
+ * The key is composed of the HTTP method, request path, and the example key,
14
+ * delimited by "|", e.g. "GET|/pets|123".
15
+ *
16
+ * @param method - HTTP method (e.g., "GET", "POST")
17
+ * @param path - The request path (e.g., "/pets")
18
+ * @param exampleKey - A unique key identifying the example/request variant
19
+ * @returns The constructed cache key string
20
+ */
21
+ export declare function getOperationExampleKey(method: string, path: string, exampleKey: string): string;
22
+ /**
23
+ * Determines if a response is a streaming response (e.g., server-sent events).
24
+ * Assumes streaming responses include a 'reader' property.
25
+ *
26
+ * @param response - The response instance to check
27
+ * @returns True if response is streaming, otherwise false
28
+ */
29
+ export declare function isStreamingResponse(response: ResponseInstance): boolean;
30
+ //# sourceMappingURL=response-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-cache.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/response-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAEvE;;;;GAIG;AACH,eAAO,MAAM,aAAa;cAA+B,gBAAgB;aAAW,OAAO;EAAK,CAAA;AAEhG;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAE/F;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAEvE"}
@@ -0,0 +1,12 @@
1
+ const t = /* @__PURE__ */ new Map();
2
+ function o(e, n, r) {
3
+ return `${e}|${n}|${r}`;
4
+ }
5
+ function a(e) {
6
+ return "reader" in e;
7
+ }
8
+ export {
9
+ o as getOperationExampleKey,
10
+ a as isStreamingResponse,
11
+ t as responseCache
12
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/request-block/RequestBlock.vue"],"names":[],"mappings":"AAsjBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,KAAK,EAEV,QAAQ,EACR,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AAGvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qEAAqE,CAAA;AACxG,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,YAAY,EACb,MAAM,8DAA8D,CAAA;AAKrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAI3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AAU1E,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,wCAAwC,CAAA;AAC/C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAA;AAW7G,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG;IACjD,QAAQ,EAAE,UAAU,GAAG,WAAW,CAAA;CACnC,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,QAAQ,CAAA;IAClB,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC,WAAW,EAAE,kBAAkB,CAAA;IAC/B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,oBAAoB,EAAE,CAAA;IACrC,MAAM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M,mCAAmC,CAAA;AAU1E,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,wCAAwC,CAAA;AAC/C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6DAA6D,CAAA;AAW7G,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG;IACjD,QAAQ,EAAE,UAAU,GAAG,WAAW,CAAA;CACnC,CAAA;AAED,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,QAAQ,CAAA;IAClB,aAAa,EAAE,iBAAiB,EAAE,CAAA;IAClC,WAAW,EAAE,kBAAkB,CAAA;IAC/B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,oBAAoB,EAAE,CAAA;IACrC,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,EAAE,UAAU,CAAA;IAClB,SAAS,EAAE,eAAe,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,oBAAoB,EAAE,eAAe,CAAC,UAAU,CAAC,CAAA;IACjD,eAAe,EAAE,qBAAqB,CAAA;IACtC,cAAc,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC,yBAAyB,CAAC,CAAA;IACtE,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,uBAAuB,EAAE,0BAA0B,EAAE,CAAA;IACrD,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;CAC5B,CAAC;AAmsBF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestBlock.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-22abab53"]]);
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-98af86fe"]]);
5
5
  export {
6
- m as default
6
+ a as default
7
7
  };