@scalar/api-client 2.34.1 → 2.36.0

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 (52) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  3. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +1 -1
  4. package/dist/style.css +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +88 -80
  7. package/dist/v2/blocks/operation-block/helpers/de-serialize-parameter.js +6 -4
  8. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts +16 -0
  9. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.d.ts.map +1 -0
  10. package/dist/v2/blocks/operation-block/helpers/validate-path-parameters.js +17 -0
  11. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
  12. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +90 -84
  13. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  14. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -1
  15. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +76 -50
  16. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  17. package/dist/v2/components/sidebar/Sidebar.vue.js +25 -23
  18. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  19. package/dist/v2/features/app/App.vue.js +41 -35
  20. package/dist/v2/features/app/app-events.d.ts +5 -2
  21. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  22. package/dist/v2/features/app/app-events.js +58 -44
  23. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  24. package/dist/v2/features/app/app-state.js +82 -80
  25. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  26. package/dist/v2/features/app/components/AppSidebar.vue.js +2 -2
  27. package/dist/v2/features/app/components/AppSidebar.vue2.js +78 -76
  28. package/dist/v2/features/app/components/SidebarItemMenu.vue.d.ts.map +1 -1
  29. package/dist/v2/features/app/components/SidebarItemMenu.vue.js +73 -45
  30. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  31. package/dist/v2/features/collection/DocumentCollection.vue.js +20 -20
  32. package/dist/v2/features/collection/OperationCollection.vue.d.ts.map +1 -1
  33. package/dist/v2/features/collection/OperationCollection.vue.js +7 -7
  34. package/dist/v2/features/collection/WorkspaceCollection.vue.d.ts.map +1 -1
  35. package/dist/v2/features/collection/WorkspaceCollection.vue.js +5 -4
  36. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  37. package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
  38. package/dist/v2/features/collection/components/Authentication.vue2.js +84 -66
  39. package/dist/v2/features/collection/components/LabelInput.vue.d.ts.map +1 -1
  40. package/dist/v2/features/collection/components/LabelInput.vue.js +2 -2
  41. package/dist/v2/features/collection/components/LabelInput.vue2.js +1 -1
  42. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +5 -0
  43. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -1
  44. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +131 -96
  45. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +25 -0
  46. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -1
  47. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +42 -36
  48. package/dist/v2/features/operation/Operation.vue.js +1 -1
  49. package/dist/v2/workspace-events.d.ts.map +1 -1
  50. package/dist/v2/workspace-events.js +8 -5
  51. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  52. package/package.json +18 -18
@@ -1 +1 @@
1
- {"version":3,"file":"OperationBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-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EAAE,MAAM,CAAA;CACjB,CAAA;AACD,QAAA,MAAM,YAAY,kTAoad,CAAC"}
@@ -1,24 +1,25 @@
1
- import { defineComponent as b, computed as i, ref as m, onMounted as U, onBeforeUnmount as g, watch as K, createElementBlock as M, openBlock as V, createElementVNode as O, createVNode as l, withCtx as x, unref as q } from "vue";
2
- import { AVAILABLE_CLIENTS as w } from "@scalar/types/snippetz";
3
- import { useToasts as T } from "@scalar/use-toasts";
4
- import I from "../../../components/ViewLayout/ViewLayout.vue.js";
5
- import A from "../../../components/ViewLayout/ViewLayoutContent.vue.js";
6
- import { ERRORS as L } from "../../../libs/errors.js";
7
- import { buildRequest as N } from "./helpers/build-request.js";
8
- import { getSecuritySchemes as P } from "./helpers/build-request-security.js";
1
+ import { defineComponent as b, computed as i, ref as d, onMounted as U, onBeforeUnmount 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
9
  import { harToFetchRequest as H } from "./helpers/har-to-fetch-request.js";
10
10
  import { harToFetchResponse as F } from "./helpers/har-to-fetch-response.js";
11
11
  import { sendRequest as j } from "./helpers/send-request.js";
12
- import D from "./components/Header.vue.js";
13
- import { generateClientOptions as Q } from "../operation-code-sample/helpers/generate-client-options.js";
14
- import { getSecurityRequirements as $ } from "../../features/operation/helpers/get-security-requirements.js";
15
- import { getSelectedSecurity as z } from "../../features/operation/helpers/get-selected-security.js";
16
- import G from "../request-block/RequestBlock.vue.js";
17
- import J from "../response-block/ResponseBlock.vue.js";
18
- const W = { class: "bg-b-1 flex h-full flex-col" }, X = { class: "lg:min-h-header flex w-full flex-wrap items-center justify-center p-2 lg:p-0" }, Y = {
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 = {
19
20
  name: "OperationBlock"
20
- }, ve = /* @__PURE__ */ b({
21
- ...Y,
21
+ }, fe = /* @__PURE__ */ b({
22
+ ...Z,
22
23
  props: {
23
24
  eventBus: {},
24
25
  documentSecurity: {},
@@ -27,7 +28,7 @@ const W = { class: "bg-b-1 flex h-full flex-col" }, X = { class: "lg:min-h-heade
27
28
  globalCookies: { default: () => [] },
28
29
  path: {},
29
30
  method: {},
30
- httpClients: { default: () => w },
31
+ httpClients: { default: () => P },
31
32
  history: { default: () => [] },
32
33
  layout: {},
33
34
  server: {},
@@ -50,44 +51,51 @@ const W = { class: "bg-b-1 flex h-full flex-col" }, X = { class: "lg:min-h-heade
50
51
  proxyUrl: {}
51
52
  },
52
53
  setup(e) {
53
- const B = i(() => Q(e.httpClients)), h = i(
54
- () => $(e.documentSecurity, e.operation.security)
55
- ), d = i(
56
- () => z(
54
+ const R = i(() => $(e.httpClients)), v = i(
55
+ () => z(e.documentSecurity, e.operation.security)
56
+ ), y = i(
57
+ () => G(
57
58
  e.documentSelectedSecurity,
58
59
  e.operationSelectedSecurity,
59
- h.value
60
+ v.value
60
61
  )
61
- ), v = i(
62
- () => P(e.securitySchemes, d.value.selectedSchemes)
63
- ), { toast: y } = T(), f = m(null), r = m(null), u = m(null), s = () => f.value?.abort(L.REQUEST_ABORTED), c = async () => {
64
- const [t, a] = N({
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(
66
+ e.operation.parameters ?? [],
67
+ e.exampleKey
68
+ ).ok === !1) {
69
+ c("Path parameters must have values.", "error");
70
+ return;
71
+ }
72
+ const [r, t] = L({
65
73
  environment: e.environment,
66
74
  exampleKey: e.exampleKey,
67
75
  globalCookies: e.globalCookies,
68
76
  method: e.method,
69
77
  operation: e.operation,
70
78
  path: e.path,
71
- selectedSecuritySchemes: v.value,
79
+ selectedSecuritySchemes: f.value,
72
80
  server: e.server,
73
81
  proxyUrl: e.proxyUrl
74
82
  });
75
- if (t) {
76
- y(t.message, "error");
83
+ if (r) {
84
+ c(r.message, "error");
77
85
  return;
78
86
  }
79
- f.value = a.controller, r.value && "reader" in r.value && r.value.reader.cancel(), e.eventBus.emit("hooks:on:request:sent", {
87
+ S.value = t.controller, a.value && "reader" in a.value && a.value.reader.cancel(), e.eventBus.emit("hooks:on:request:sent", {
80
88
  meta: {
81
89
  method: e.method,
82
90
  path: e.path,
83
91
  exampleKey: e.exampleKey
84
92
  }
85
93
  });
86
- const [o, n] = await j({
87
- isUsingProxy: a.isUsingProxy,
94
+ const [m, n] = await j({
95
+ isUsingProxy: t.isUsingProxy,
88
96
  operation: e.operation,
89
97
  plugins: e.plugins,
90
- request: a.request
98
+ request: t.request
91
99
  });
92
100
  if (e.eventBus.emit("hooks:on:request:complete", {
93
101
  payload: n ? {
@@ -101,46 +109,46 @@ const W = { class: "bg-b-1 flex h-full flex-col" }, X = { class: "lg:min-h-heade
101
109
  path: e.path,
102
110
  exampleKey: e.exampleKey
103
111
  }
104
- }), o) {
105
- y(o.message, "error");
112
+ }), m) {
113
+ c(m.message, "error");
106
114
  return;
107
115
  }
108
- r.value = n.response, u.value = n.request;
116
+ a.value = n.response, u.value = n.request;
109
117
  };
110
118
  U(() => {
111
- e.eventBus.on("operation:send:request:hotkey", c), e.eventBus.on("operation:cancel:request", s);
112
- }), g(() => {
113
- e.eventBus.off("operation:send:request:hotkey", c), e.eventBus.off("operation:cancel:request", s);
119
+ e.eventBus.on("operation:send:request:hotkey", h), e.eventBus.on("operation:cancel:request", s);
120
+ }), x(() => {
121
+ e.eventBus.off("operation:send:request:hotkey", h), e.eventBus.off("operation:cancel:request", s);
114
122
  });
115
- const S = i(
116
- () => e.history.map((t) => ({
117
- method: t.request.method,
118
- path: t.request.url,
119
- duration: t.time,
120
- status: t.response.status
123
+ const g = i(
124
+ () => e.history.map((o) => ({
125
+ method: o.request.method,
126
+ path: o.request.url,
127
+ duration: o.time,
128
+ status: o.response.status
121
129
  })).reverse()
122
- ), R = ({ index: t }) => {
123
- const a = (e.history.length ?? 0) - t - 1, o = e.history[a];
124
- if (!o)
130
+ ), C = ({ index: o }) => {
131
+ const r = (e.history.length ?? 0) - o - 1, t = e.history[r];
132
+ if (!t)
125
133
  return;
126
- const n = () => e.eventBus.emit("ui:navigate", {
134
+ const m = () => e.eventBus.emit("ui:navigate", {
127
135
  page: "example",
128
136
  method: e.method,
129
137
  path: e.path,
130
138
  exampleName: "draft",
131
- callback: (C) => {
132
- if (C !== "success")
139
+ callback: (n) => {
140
+ if (n !== "success")
133
141
  return;
134
142
  const k = F({
135
- harResponse: o.response,
136
- url: o.request.url,
143
+ harResponse: t.response,
144
+ url: t.request.url,
137
145
  method: e.method,
138
146
  path: e.path,
139
- duration: o.time
147
+ duration: t.time
140
148
  }), E = H({
141
- harRequest: o.request
149
+ harRequest: t.request
142
150
  });
143
- r.value = k, u.value = E;
151
+ a.value = k, u.value = E;
144
152
  }
145
153
  });
146
154
  e.eventBus.emit("operation:reload:history", {
@@ -148,24 +156,24 @@ const W = { class: "bg-b-1 flex h-full flex-col" }, X = { class: "lg:min-h-heade
148
156
  path: e.path,
149
157
  method: e.method
150
158
  },
151
- index: a,
152
- callback: n
159
+ index: r,
160
+ callback: m
153
161
  });
154
162
  };
155
163
  return K([() => e.path, () => e.method, () => e.exampleKey], () => {
156
- r.value = null, u.value = null, s();
157
- }), g(() => {
164
+ a.value = null, u.value = null, s();
165
+ }), x(() => {
158
166
  s();
159
- }), (t, a) => (V(), M("div", W, [
160
- O("div", X, [
161
- l(D, {
167
+ }), (o, r) => (M(), V("div", X, [
168
+ O("div", Y, [
169
+ l(Q, {
162
170
  activeEnvironment: e.activeEnvironment,
163
171
  documentUrl: e.documentUrl,
164
172
  environment: e.environment,
165
173
  environments: e.environments,
166
174
  eventBus: e.eventBus,
167
175
  hideClientButton: e.hideClientButton,
168
- history: S.value,
176
+ history: g.value,
169
177
  integration: e.integration,
170
178
  layout: e.layout,
171
179
  method: e.method,
@@ -174,17 +182,17 @@ const W = { class: "bg-b-1 flex h-full flex-col" }, X = { class: "lg:min-h-heade
174
182
  serverMeta: e.serverMeta,
175
183
  servers: e.servers,
176
184
  source: e.source,
177
- onExecute: c,
178
- "onSelect:history:item": R
185
+ onExecute: h,
186
+ "onSelect:history:item": C
179
187
  }, null, 8, ["activeEnvironment", "documentUrl", "environment", "environments", "eventBus", "hideClientButton", "history", "integration", "layout", "method", "path", "server", "serverMeta", "servers", "source"])
180
188
  ]),
181
- l(I, { class: "border-t" }, {
182
- default: x(() => [
183
- l(A, { class: "flex-1" }, {
184
- default: x(() => [
185
- l(q(G), {
189
+ l(T, { class: "border-t" }, {
190
+ default: q(() => [
191
+ l(I, { class: "flex-1" }, {
192
+ default: q(() => [
193
+ l(B(J), {
186
194
  authMeta: e.authMeta,
187
- clientOptions: B.value,
195
+ clientOptions: R.value,
188
196
  environment: e.environment,
189
197
  eventBus: e.eventBus,
190
198
  exampleKey: e.exampleKey,
@@ -195,21 +203,21 @@ const W = { class: "bg-b-1 flex h-full flex-col" }, X = { class: "lg:min-h-heade
195
203
  path: e.path,
196
204
  plugins: e.plugins,
197
205
  proxyUrl: e.proxyUrl,
198
- securityRequirements: h.value,
206
+ securityRequirements: v.value,
199
207
  securitySchemes: e.securitySchemes,
200
208
  selectedClient: e.selectedClient,
201
- selectedSecurity: d.value,
202
- selectedSecuritySchemes: v.value,
209
+ selectedSecurity: y.value,
210
+ selectedSecuritySchemes: f.value,
203
211
  server: e.server
204
212
  }, null, 8, ["authMeta", "clientOptions", "environment", "eventBus", "exampleKey", "globalCookies", "layout", "method", "operation", "path", "plugins", "proxyUrl", "securityRequirements", "securitySchemes", "selectedClient", "selectedSecurity", "selectedSecuritySchemes", "server"]),
205
- l(q(J), {
213
+ l(B(W), {
206
214
  appVersion: e.appVersion,
207
215
  eventBus: e.eventBus,
208
216
  layout: e.layout,
209
217
  plugins: e.plugins,
210
218
  request: u.value,
211
- response: r.value,
212
- totalPerformedRequests: S.value.length
219
+ response: a.value,
220
+ totalPerformedRequests: g.value.length
213
221
  }, null, 8, ["appVersion", "eventBus", "layout", "plugins", "request", "response", "totalPerformedRequests"])
214
222
  ]),
215
223
  _: 1
@@ -221,5 +229,5 @@ const W = { class: "bg-b-1 flex h-full flex-col" }, X = { class: "lg:min-h-heade
221
229
  }
222
230
  });
223
231
  export {
224
- ve as default
232
+ fe as default
225
233
  };
@@ -1,23 +1,25 @@
1
1
  import { getResolvedRef as s } from "@scalar/workspace-store/helpers/get-resolved-ref";
2
- const a = (e, t) => "content" in t ? i(e, Object.keys(t.content ?? {})[0] ?? "") : "schema" in t ? c(e, t.schema) : e, i = (e, t) => {
2
+ const f = (e, t) => "content" in t ? o(e, Object.keys(t.content ?? {})[0] ?? "") : "schema" in t ? y(e, t.schema) : e, o = (e, t) => {
3
3
  if (typeof e == "string" && t.includes("json"))
4
4
  try {
5
5
  return JSON.parse(e);
6
6
  } catch {
7
7
  }
8
8
  return e;
9
- }, o = /* @__PURE__ */ new Set(["array", "object", "boolean", "number", "integer", "null"]), c = (e, t) => {
9
+ }, c = /* @__PURE__ */ new Set(["array", "object", "boolean", "number", "integer", "null"]), y = (e, t) => {
10
10
  const r = s(t);
11
11
  if (typeof e == "string" && r && "type" in r) {
12
12
  const n = Array.isArray(r.type) ? r.type[0] : r.type;
13
- if (n && o.has(n))
13
+ if (n && c.has(n))
14
14
  try {
15
15
  return JSON.parse(e);
16
16
  } catch {
17
+ if (n === "array")
18
+ return e.split(/,\s?/).filter((i) => i !== "");
17
19
  }
18
20
  }
19
21
  return e;
20
22
  };
21
23
  export {
22
- a as deSerializeParameter
24
+ f as deSerializeParameter
23
25
  };
@@ -0,0 +1,16 @@
1
+ import type { ParameterObject, ReferenceType } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
+ type ValidatePathParametersResult = {
3
+ ok: true;
4
+ } | {
5
+ ok: false;
6
+ invalidParams: string[];
7
+ };
8
+ /**
9
+ * Validates that all required path parameters have non-empty values.
10
+ *
11
+ * Path parameters are always required per the OpenAPI specification.
12
+ * Returns the names of any path parameters that are missing values.
13
+ */
14
+ export declare const validatePathParameters: (parameters?: ReferenceType<ParameterObject>[], exampleKey?: string) => ValidatePathParametersResult;
15
+ export {};
16
+ //# sourceMappingURL=validate-path-parameters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-path-parameters.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/helpers/validate-path-parameters.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAA;AAMlH,KAAK,4BAA4B,GAAG;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAazF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GACjC,aAAY,aAAa,CAAC,eAAe,CAAC,EAAO,EACjD,aAAY,MAAkB,KAC7B,4BAoBF,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { getResolvedRef as n } from "@scalar/workspace-store/helpers/get-resolved-ref";
2
+ import { isParamDisabled as m } from "../../request-block/helpers/is-param-disabled.js";
3
+ import { getExample as f } from "./get-example.js";
4
+ const s = (e) => e == null ? !0 : typeof e == "string" ? e.trim() === "" : !1, c = (e = [], o = "default") => {
5
+ const r = [];
6
+ for (const i of e) {
7
+ const t = n(i);
8
+ if (t.in !== "path")
9
+ continue;
10
+ const a = f(t, o, void 0);
11
+ m(t, a) || s(a?.value) && r.push(t.name);
12
+ }
13
+ return r.length > 0 ? { ok: !1, invalidParams: r } : { ok: !0 };
14
+ };
15
+ export {
16
+ c as validatePathParameters
17
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"get-example-from-schema.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/get-example-from-schema.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AA6bhG,KAAK,2BAA2B,GAAG;IACjC,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACvB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,qDAAqD;IACrD,8BAA8B,CAAC,EAAE,OAAO,CAAA;CACzC,CAAA;AAYD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,YAAY,EACpB,UAAU,2BAA2B,EACrC,uCAKG,OAAO,CAAC;IACT,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,YAAY,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;CACtB,CAAM,KACN,OAuJF,CAAA"}
1
+ {"version":3,"file":"get-example-from-schema.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-code-sample/helpers/get-example-from-schema.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AA2dhG,KAAK,2BAA2B,GAAG;IACjC,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACvB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,qDAAqD;IACrD,8BAA8B,CAAC,EAAE,OAAO,CAAA;CACzC,CAAA;AAYD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,YAAY,EACpB,UAAU,2BAA2B,EACrC,uCAKG,OAAO,CAAC;IACT,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,YAAY,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;CACtB,CAAM,KACN,OAuJF,CAAA"}