@scalar/api-client 2.23.0 → 2.23.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/style.css +1 -1
  3. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +13 -3
  4. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +68 -68
  6. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +5 -3
  7. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +1 -1
  8. package/dist/v2/blocks/operation-block/helpers/build-request-security.js +1 -1
  9. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +3 -2
  10. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
  11. package/dist/v2/blocks/operation-block/index.d.ts +2 -1
  12. package/dist/v2/blocks/operation-block/index.d.ts.map +1 -1
  13. package/dist/v2/blocks/operation-block/index.js +7 -4
  14. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +3 -2
  15. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  16. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +2 -2
  17. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +3 -2
  18. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
  19. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts +2 -2
  20. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts.map +1 -1
  21. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +3 -2
  22. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  23. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts +2 -2
  24. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts.map +1 -1
  25. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +8 -5
  26. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  27. package/dist/v2/blocks/request-block/RequestBlock.vue.js +2 -2
  28. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +4 -4
  29. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  30. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +49 -45
  31. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  32. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +4 -2
  33. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  34. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +18 -181
  35. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  36. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +118 -107
  37. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +3 -2
  38. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  39. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +30 -33
  40. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +11 -178
  41. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  42. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +107 -110
  43. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.d.ts.map +1 -1
  44. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js +5 -29
  45. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts +6 -0
  46. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -0
  47. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +85 -0
  48. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +9 -0
  49. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +1 -0
  50. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +15 -0
  51. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +3 -2
  52. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  53. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +23 -0
  54. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -0
  55. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts +2 -2
  56. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts.map +1 -1
  57. package/dist/v2/blocks/scalar-auth-selector-block/index.js +4 -6
  58. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  59. package/dist/v2/features/app/App.vue.js +51 -42
  60. package/dist/v2/features/app/app-state.d.ts +1 -1
  61. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  62. package/dist/v2/features/app/app-state.js +40 -38
  63. package/dist/v2/features/app/helpers/routes.d.ts +1 -1
  64. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  65. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  66. package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
  67. package/dist/v2/features/collection/components/Authentication.vue2.js +14 -11
  68. package/dist/v2/features/import-listener/helpers/import-document-to-workspace.d.ts.map +1 -1
  69. package/dist/v2/features/import-listener/helpers/import-document-to-workspace.js +3 -1
  70. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  71. package/dist/v2/features/modal/Modal.vue.js +1 -1
  72. package/dist/v2/features/modal/Modal.vue2.js +14 -12
  73. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  74. package/dist/v2/features/operation/Operation.vue.js +44 -35
  75. package/dist/v2/features/operation/helpers/get-selected-security.d.ts +3 -5
  76. package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -1
  77. package/dist/v2/workspace-events.d.ts.map +1 -1
  78. package/dist/v2/workspace-events.js +116 -109
  79. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  80. package/package.json +14 -14
  81. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.bench.d.ts +0 -2
  82. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.bench.d.ts.map +0 -1
  83. package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.d.ts +0 -8
  84. package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.d.ts.map +0 -1
  85. package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.js +0 -33
  86. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.d.ts +0 -7
  87. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.d.ts.map +0 -1
  88. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.js +0 -13
@@ -15,9 +15,9 @@ import { getTabDetails as ae } from "../../helpers/get-tab-details.js";
15
15
  import { slugify as te } from "../../helpers/slugify.js";
16
16
  import { workspaceStorage as ne } from "../../helpers/storage.js";
17
17
  import { initializeAppEventHandlers as re } from "./app-events.js";
18
- const oe = 1e3, h = J({
18
+ const oe = 1e3, w = J({
19
19
  debug: !1
20
- }), v = p(void 0), k = p(void 0), w = p(void 0), B = p(void 0), O = p(void 0), $ = p(void 0), f = p(!1), l = E(null);
20
+ }), v = p(void 0), k = p(void 0), x = p(void 0), B = p(void 0), O = p(void 0), L = p(void 0), h = p(!1), l = E(null);
21
21
  Z(l, (e) => {
22
22
  e && e.afterEach((a) => ge(a));
23
23
  });
@@ -27,10 +27,10 @@ function c(e, a) {
27
27
  if (typeof t == "string")
28
28
  return e === "method" ? t && Y(t) ? t : void 0 : decodeURIComponent(t);
29
29
  }
30
- const W = E(null), I = p([]), o = E(null), T = i(() => o.value?.workspace.documents[w.value ?? ""] || null), se = i(() => ee(o.value, T.value)), { workspace: x } = await G(), g = (e, a) => `${e}/${a}`;
31
- I.value = await x.getAll().then(
30
+ const W = E(null), I = p([]), o = E(null), T = i(() => o.value?.workspace.documents[x.value ?? ""] || null), se = i(() => ee(o.value, T.value)), { workspace: g } = await G(), f = (e, a) => `${e}/${a}`;
31
+ I.value = await g.getAll().then(
32
32
  (e) => e.map(({ teamUid: a, namespace: t, slug: n, name: u }) => ({
33
- id: g(t, n),
33
+ id: f(t, n),
34
34
  teamUid: a,
35
35
  namespace: t,
36
36
  slug: n,
@@ -38,15 +38,17 @@ I.value = await x.getAll().then(
38
38
  }))
39
39
  );
40
40
  const ce = async ({ namespace: e, slug: a }) => C({
41
- plugins: [await Q({ workspaceId: `${e}-${a}`, debounceDelay: oe })]
41
+ plugins: [
42
+ await Q({ workspaceId: f(e, a), debounceDelay: oe })
43
+ ]
42
44
  }), ue = async (e, a) => {
43
- const t = await x.getItem({ namespace: e, slug: a });
45
+ const t = await g.getItem({ namespace: e, slug: a });
44
46
  if (!t)
45
47
  return {
46
48
  success: !1
47
49
  };
48
50
  const n = await ce({ namespace: e, slug: a });
49
- return n.loadWorkspace(t.workspace), W.value = { id: g(t.namespace, t.slug), label: t.name }, o.value = n, {
51
+ return n.loadWorkspace(t.workspace), W.value = { id: f(t.namespace, t.slug), label: t.name }, o.value = n, {
50
52
  success: !0,
51
53
  workspace: n.workspace
52
54
  };
@@ -74,7 +76,7 @@ const ce = async ({ namespace: e, slug: a }) => C({
74
76
  "x-scalar-icon": "interface-edit-tool-pencil"
75
77
  }
76
78
  });
77
- const s = await x.setItem(
79
+ const s = await g.setItem(
78
80
  { namespace: t, slug: n },
79
81
  {
80
82
  name: e,
@@ -83,18 +85,18 @@ const ce = async ({ namespace: e, slug: a }) => C({
83
85
  }
84
86
  );
85
87
  return I.value.push({
86
- id: g(s.namespace, s.slug),
88
+ id: f(s.namespace, s.slug),
87
89
  teamUid: s.teamUid,
88
90
  namespace: s.namespace,
89
91
  slug: s.slug,
90
92
  label: s.name
91
93
  }), s;
92
- }, L = async (e, a) => {
94
+ }, N = async (e, a) => {
93
95
  await l.value?.push({
94
96
  name: "workspace.environment",
95
97
  params: { namespace: e, workspaceSlug: a }
96
98
  });
97
- }, N = async ({
99
+ }, P = async ({
98
100
  key: e,
99
101
  name: a
100
102
  }) => {
@@ -102,7 +104,7 @@ const ce = async ({ namespace: e, slug: a }) => C({
102
104
  const t = await M({
103
105
  defaultValue: e?.slug ?? a,
104
106
  // Use the provided id if it exists, otherwise use the name
105
- validation: async (s) => !await x.has({ namespace: e?.namespace ?? "local", slug: s }),
107
+ validation: async (s) => !await g.has({ namespace: e?.namespace ?? "local", slug: s }),
106
108
  maxRetries: 100,
107
109
  transformation: te
108
110
  });
@@ -114,44 +116,44 @@ const ce = async ({ namespace: e, slug: a }) => C({
114
116
  slug: t,
115
117
  name: a
116
118
  }, u = await le(n);
117
- return await L(u.namespace, u.slug), u;
119
+ return await N(u.namespace, u.slug), u;
118
120
  }, ie = async (e, a) => {
119
- o.value = null, f.value = !0;
121
+ o.value = null, h.value = !0;
120
122
  const t = await ue(e, a);
121
123
  if (t.success) {
122
124
  const u = t.workspace["x-scalar-active-tab"] ?? 0, s = t.workspace["x-scalar-tabs"], D = s?.[u];
123
125
  D && await l.value?.replace({
124
126
  path: D.path,
125
127
  query: m.value?.query ?? {}
126
- }), s && u >= s.length && h.emit("tabs:update:tabs", {
128
+ }), s && u >= s.length && w.emit("tabs:update:tabs", {
127
129
  "x-scalar-active-tab": 0
128
- }), s || h.emit("tabs:update:tabs", {
130
+ }), s || w.emit("tabs:update:tabs", {
129
131
  "x-scalar-tabs": [U(m.value)],
130
132
  "x-scalar-active-tab": 0
131
- }), f.value = !1;
133
+ }), h.value = !1;
132
134
  return;
133
135
  }
134
- const n = await N({
136
+ const n = await P({
135
137
  name: "Default Workspace",
136
138
  key: { slug: "default" }
137
139
  });
138
- if (f.value = !1, !n)
140
+ if (h.value = !1, !n)
139
141
  return console.error("Failed to create the default workspace, something went wrong, can not load the workspace");
140
142
  r.reset();
141
- }, P = i(() => {
143
+ }, _ = i(() => {
142
144
  const e = o.value;
143
145
  if (!e)
144
146
  return [];
145
147
  const a = e.workspace["x-scalar-order"] ?? Object.keys(e.workspace.documents);
146
148
  return V(Object.keys(e.workspace.documents), a, (t) => t).map((t) => e.workspace.documents[t]?.["x-scalar-navigation"]).filter(A);
147
- }), r = j(P), y = ({
149
+ }), r = j(_), y = ({
148
150
  document: e,
149
151
  path: a,
150
152
  method: t,
151
153
  example: n
152
154
  }) => JSON.stringify([e, a, t, n].filter(A)), R = i(
153
155
  () => z({
154
- items: P.value,
156
+ items: _.value,
155
157
  nestedKey: "children",
156
158
  filter: (e) => e.type === "document" || e.type === "operation" || e.type === "example",
157
159
  getId: (e) => {
@@ -173,7 +175,7 @@ const ce = async ({ namespace: e, slug: a }) => C({
173
175
  method: e.method
174
176
  })
175
177
  );
176
- }, _ = (e) => {
178
+ }, $ = (e) => {
177
179
  const a = r.getEntryById(e);
178
180
  if (!a) {
179
181
  console.warn(`Could not find sidebar entry with id ${e} to select`);
@@ -270,8 +272,8 @@ const ce = async ({ namespace: e, slug: a }) => C({
270
272
  }
271
273
  }, ge = (e) => {
272
274
  const a = c("workspaceSlug", e), t = c("documentSlug", e);
273
- if (v.value = c("namespace", e), k.value = a, w.value = t, B.value = c("method", e), O.value = c("pathEncoded", e), $.value = c("exampleName", e), !(!v.value || !a)) {
274
- if (e.path !== "" && ne.setCurrentPath(e.path), g(v.value, a) !== W.value?.id)
275
+ if (v.value = c("namespace", e), k.value = a, x.value = t, B.value = c("method", e), O.value = c("pathEncoded", e), L.value = c("exampleName", e), !(!v.value || !a)) {
276
+ if (e.path !== "" && ne.setCurrentPath(e.path), f(v.value, a) !== W.value?.id)
275
277
  return ie(v.value, a);
276
278
  t && t !== o.value?.workspace[X.workspace.activeDocument] && o?.value?.update("x-scalar-active-document", t), be(e), H(e);
277
279
  }
@@ -293,17 +295,17 @@ const ce = async ({ namespace: e, slug: a }) => C({
293
295
  t && (r.setSelected(t.id), r.setExpanded(t.id, !0));
294
296
  };
295
297
  re({
296
- eventBus: h,
298
+ eventBus: w,
297
299
  router: l,
298
300
  store: o,
299
301
  navigateToCurrentTab: pe,
300
302
  rebuildSidebar: F,
301
303
  onAfterExampleCreation: me,
302
- onSelectSidebarItem: _,
304
+ onSelectSidebarItem: $,
303
305
  onCopyTabUrl: (e) => q(e),
304
306
  onToggleSidebar: () => S.value = !S.value
305
307
  });
306
- function Pe(e) {
308
+ function _e(e) {
307
309
  return e && (l.value = e), {
308
310
  /** Active workspace store */
309
311
  store: o,
@@ -311,7 +313,7 @@ function Pe(e) {
311
313
  state: r,
312
314
  width: ve,
313
315
  isOpen: S,
314
- handleSelectItem: _,
316
+ handleSelectItem: $,
315
317
  handleSidebarWidthUpdate: fe,
316
318
  getEntryByLocation: b
317
319
  },
@@ -321,28 +323,28 @@ function Pe(e) {
321
323
  copyTabUrl: q
322
324
  },
323
325
  workspace: {
324
- create: N,
326
+ create: P,
325
327
  workspaceList: I,
326
328
  activeWorkspace: W,
327
- navigateToWorkspace: L,
328
- isOpen: i(() => !!(k.value && !w.value))
329
+ navigateToWorkspace: N,
330
+ isOpen: i(() => !!(k.value && !x.value))
329
331
  },
330
- eventBus: h,
332
+ eventBus: w,
331
333
  router: l,
332
334
  currentRoute: m,
333
- loading: f,
335
+ loading: h,
334
336
  activeEntities: {
335
337
  namespace: v,
336
338
  workspaceSlug: k,
337
- documentSlug: w,
339
+ documentSlug: x,
338
340
  path: O,
339
341
  method: B,
340
- exampleName: $
342
+ exampleName: L
341
343
  },
342
344
  environment: se,
343
345
  document: T
344
346
  };
345
347
  }
346
348
  export {
347
- Pe as useAppState
349
+ _e as useAppState
348
350
  };
@@ -3,7 +3,7 @@ import type { WorkspaceStore } from '@scalar/workspace-store/client';
3
3
  import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
4
4
  import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
5
5
  import type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace';
6
- import type { MergedSecuritySchemes } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.js';
6
+ import type { MergedSecuritySchemes } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/merge-security.js';
7
7
  import type { ClientPlugin } from '../../../../v2/helpers/plugins.js';
8
8
  import type { ClientLayout } from '../../../../v2/types/layout';
9
9
  /** These props are provided at the route level */
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/app/helpers/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAGlF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kEAAkE,CAAA;AAU7G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,kDAAkD;AAClD,MAAM,MAAM,UAAU,GAAG;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,QAAQ,EAAE,iBAAiB,CAAA;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M;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAlBK,UAAU;8BAChB,iBAAiB;;oCAGX,WAAW;8BACjB,IAAI;;oCALE,UAAU;8BAChB,iBAAiB;;oCAGX,WAAW;8BACjB,IAAI;;;;;;;;;;;;;;;gCALE,UAAU;0BAChB,iBAAiB;;gCAGX,WAAW;0BACjB,IAAI;;gCALE,UAAU;0BAChB,iBAAiB;;gCAGX,WAAW;0BACjB,IAAI;;;;;;;;;IAgIM,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Authentication.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Authentication.vue"],"names":[],"mappings":";;;;;;;;;;;;;AAgOA,wBAMG"}
1
+ {"version":3,"file":"Authentication.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/collection/components/Authentication.vue"],"names":[],"mappings":";;;;;;;;;;;;;AA+OA,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import t from "./Authentication.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const c = /* @__PURE__ */ o(t, [["__scopeId", "data-v-dc159f6f"]]);
4
+ const c = /* @__PURE__ */ o(t, [["__scopeId", "data-v-1bfafc56"]]);
5
5
  export {
6
6
  c as default
7
7
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as u, computed as s, createElementBlock as m, openBlock as d, createElementVNode as n, createVNode as c, unref as i, normalizeClass as a } from "vue";
1
+ import { defineComponent as u, computed as s, createElementBlock as m, openBlock as d, createElementVNode as n, createVNode as c, unref as a, normalizeClass as i } from "vue";
2
2
  import { ScalarToggle as v } from "@scalar/components";
3
3
  import y from "../../../blocks/scalar-auth-selector-block/components/AuthSelector.vue.js";
4
- const f = { class: "flex flex-col gap-4" }, p = { class: "flex flex-col gap-2" }, h = { class: "flex h-8 items-center justify-between" }, b = /* @__PURE__ */ u({
4
+ const h = { class: "flex flex-col gap-4" }, f = { class: "flex flex-col gap-2" }, p = { class: "flex h-8 items-center justify-between" }, w = /* @__PURE__ */ u({
5
5
  __name: "Authentication",
6
6
  props: {
7
7
  documentSlug: {},
@@ -26,11 +26,11 @@ const f = { class: "flex flex-col gap-4" }, p = { class: "flex flex-col gap-2" }
26
26
  ({ url: o }) => o === e.document?.["x-scalar-selected-server"]
27
27
  ) ?? null
28
28
  );
29
- return (o, t) => (d(), m("div", f, [
30
- n("div", p, [
31
- n("div", h, [
29
+ return (o, t) => (d(), m("div", h, [
30
+ n("div", f, [
31
+ n("div", p, [
32
32
  t[1] || (t[1] = n("h3", { class: "font-bold" }, "Authentication", -1)),
33
- c(i(v), {
33
+ c(a(v), {
34
34
  class: "w-4",
35
35
  modelValue: l.value,
36
36
  "onUpdate:modelValue": t[0] || (t[0] = () => e.eventBus.emit("document:toggle:security"))
@@ -39,10 +39,10 @@ const f = { class: "flex flex-col gap-4" }, p = { class: "flex flex-col gap-2" }
39
39
  t[2] || (t[2] = n("p", { class: "pr-6 text-sm" }, " If enabled, all selected authentication will apply to all operations in this document. You can override this by disabling the toggle and authentication will then be applied at the operation level. ", -1))
40
40
  ]),
41
41
  n("div", {
42
- class: a(!l.value && "cursor-not-allowed")
42
+ class: i(!l.value && "cursor-not-allowed")
43
43
  }, [
44
- c(i(y), {
45
- class: a([
44
+ c(a(y), {
45
+ class: i([
46
46
  "scalar-collection-auth !border-none",
47
47
  !l.value && "pointer-events-none opacity-50 mix-blend-luminosity"
48
48
  ]),
@@ -53,7 +53,10 @@ const f = { class: "flex flex-col gap-4" }, p = { class: "flex flex-col gap-2" }
53
53
  proxyUrl: e.workspaceStore.workspace["x-scalar-active-proxy"] ?? "",
54
54
  securityRequirements: e.document?.security ?? [],
55
55
  securitySchemes: e.securitySchemes,
56
- selectedSecurity: e.document?.["x-scalar-selected-security"],
56
+ selectedSecurity: e.workspaceStore.auth.getAuthSelectedSchemas({
57
+ type: "document",
58
+ documentName: e.documentSlug
59
+ }),
57
60
  server: r.value,
58
61
  title: "Authentication"
59
62
  }, null, 8, ["class", "environment", "eventBus", "proxyUrl", "securityRequirements", "securitySchemes", "selectedSecurity", "server"])
@@ -62,5 +65,5 @@ const f = { class: "flex flex-col gap-4" }, p = { class: "flex flex-col gap-2" }
62
65
  }
63
66
  });
64
67
  export {
65
- b as default
68
+ w as default
66
69
  };
@@ -1 +1 @@
1
- {"version":3,"file":"import-document-to-workspace.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/import-listener/helpers/import-document-to-workspace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAA;AAI3F;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,yBAAyB,GAAU,2CAI7C;IACD,cAAc,EAAE,cAAc,GAAG,IAAI,CAAA;IACrC,cAAc,EAAE,iBAAiB,CAAA;IACjC,IAAI,EAAE,MAAM,CAAA;CACb,KAAG,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAsDpE,CAAA"}
1
+ {"version":3,"file":"import-document-to-workspace.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/import-listener/helpers/import-document-to-workspace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oDAAoD,CAAA;AAI3F;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,yBAAyB,GAAU,2CAI7C;IACD,cAAc,EAAE,cAAc,GAAG,IAAI,CAAA;IACrC,cAAc,EAAE,iBAAiB,CAAA;IACjC,IAAI,EAAE,MAAM,CAAA;CACb,KAAG,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAwDpE,CAAA"}
@@ -23,7 +23,9 @@ const m = async ({
23
23
  },
24
24
  overrides: {
25
25
  [e]: o.overrides[n] ?? {}
26
- }
26
+ },
27
+ history: {},
28
+ auth: {}
27
29
  }), t.buildSidebar(e), await t.saveDocument(e), { ok: !0, slug: e }) : { ok: !1, error: "Failed to generate a unique slug for the importing document" };
28
30
  };
29
31
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/modal/Modal.vue"],"names":[],"mappings":"AAkZA,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAExE,OAAO,EASL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACtB,MAAM,KAAK,CAAA;AAIZ,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AAIxF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAKxD,MAAM,MAAM,UAAU,GAAG;IACvB,4DAA4D;IAC5D,cAAc,EAAE,cAAc,CAAA;IAC9B,qDAAqD;IACrD,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,iDAAiD;IACjD,IAAI,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACrC,4CAA4C;IAC5C,QAA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AA;IAC9B,qDAAqD;IACrD,QAAQ,EAAE,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAA;IAC/C,iDAAiD;IACjD,IAAI,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IACrC,4CAA4C;IAC5C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,mDAAmD;IACnD,MAAM,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAC3C,yDAAyD;IACzD,WAAW,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5C,2CAA2C;IAC3C,UAAU,EAAE,UAAU,CAAA;IACtB,0DAA0D;IAC1D,YAAY,EAAE,qBAAqB,CAAA;IACnC,iDAAiD;IACjD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,wDAAwD;IACxD,OAAO,EAAE,gBAAgB,CACvB,OAAO,CACL,IAAI,CACF,4BAA4B,EAC1B,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,eAAe,GACf,SAAS,CACZ,CACF,CACF,CAAA;CACF,CAAA;AAED;;;;GAIG;;;;;AACH,wBA4WC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./Modal.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b54530a3"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-dbc80a57"]]);
5
5
  export {
6
6
  p as default
7
7
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as W, ref as w, useId as D, watch as I, nextTick as N, onBeforeMount as E, onBeforeUnmount as F, computed as d, toValue as U, withDirectives as k, createElementBlock as u, openBlock as m, createElementVNode as s, unref as o, createVNode as l, withCtx as V, vShow as b } from "vue";
2
- import { addScalarClassesToHeadless as A, ScalarTeleportRoot as $ } from "@scalar/components";
1
+ import { defineComponent as W, ref as w, useId as D, watch as I, nextTick as N, onBeforeMount as E, onBeforeUnmount as F, computed as u, toValue as U, withDirectives as k, createElementBlock as d, openBlock as m, createElementVNode as s, unref as o, createVNode as l, withCtx as V, vShow as b } from "vue";
2
+ import { addScalarClassesToHeadless as $, ScalarTeleportRoot as A } from "@scalar/components";
3
3
  import { ScalarToasts as z } from "@scalar/use-toasts";
4
4
  import { useFocusTrap as H } from "@vueuse/integrations/useFocusTrap";
5
- import { mergeAuthConfig as L } from "../../blocks/scalar-auth-selector-block/helpers/merge-auth-config.js";
5
+ import { mergeSecurity as L } from "../../blocks/scalar-auth-selector-block/helpers/merge-security.js";
6
6
  import { initializeModalEvents as M } from "./modal-events.js";
7
7
  import O from "../operation/Operation.vue.js";
8
8
  import { getActiveEnvironment as R } from "../../helpers/get-active-environment.js";
@@ -57,21 +57,23 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
57
57
  (a) => {
58
58
  g.value = a, a ? y({ checkCanFocusTrap: () => N() }) : S();
59
59
  }
60
- ), E(() => A()), F(() => S());
61
- const p = 288, c = d(
60
+ ), E(() => $()), F(() => S());
61
+ const p = 288, c = u(
62
62
  () => e.workspaceStore?.workspace?.["x-scalar-sidebar-width"] ?? p
63
- ), T = (a) => e.workspaceStore?.update("x-scalar-sidebar-width", a), h = d(
63
+ ), T = (a) => e.workspaceStore?.update("x-scalar-sidebar-width", a), h = u(
64
64
  () => R(e.workspaceStore, e.document.value)
65
- ), C = d(
65
+ ), C = u(
66
66
  () => L(
67
67
  e.document.value?.components?.securitySchemes,
68
- U(e.options)?.authentication?.securitySchemes
68
+ U(e.options)?.authentication?.securitySchemes,
69
+ e.workspaceStore.auth,
70
+ e.document.value?.["x-scalar-navigation"]?.name ?? ""
69
71
  )
70
72
  );
71
73
  return x({
72
74
  sidebarWidth: c,
73
75
  environment: h
74
- }), (a, t) => k((m(), u("div", P, [
76
+ }), (a, t) => k((m(), d("div", P, [
75
77
  s("div", J, [
76
78
  s("div", {
77
79
  id: o(f),
@@ -83,10 +85,10 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
83
85
  role: "dialog",
84
86
  tabindex: "-1"
85
87
  }, [
86
- l(o($), null, {
88
+ l(o(A), null, {
87
89
  default: V(() => [
88
90
  l(o(z)),
89
- e.document.value && e.path?.value && e.method?.value ? (m(), u("main", X, [
91
+ e.document.value && e.path?.value && e.method?.value ? (m(), d("main", X, [
90
92
  l(o(G), {
91
93
  modelValue: n.value,
92
94
  "onUpdate:modelValue": t[0] || (t[0] = (i) => n.value = i),
@@ -126,7 +128,7 @@ const P = { class: "scalar scalar-app" }, J = { class: "scalar-container" }, Q =
126
128
  securitySchemes: C.value,
127
129
  workspaceStore: e.workspaceStore
128
130
  }, null, 8, ["document", "documentSlug", "environment", "eventBus", "exampleName", "method", "options", "path", "plugins", "securitySchemes", "workspaceStore"])
129
- ])) : (m(), u("div", Y, [...t[3] || (t[3] = [
131
+ ])) : (m(), d("div", Y, [...t[3] || (t[3] = [
130
132
  s("span", { class: "text-c-3" }, "No document selected", -1)
131
133
  ])]))
132
134
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AAiMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAM/D;;;;;;;GAOG;;IAGC,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;;IAD/B,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;;AAHnC,wBAwPC"}
1
+ {"version":3,"file":"Operation.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/operation/Operation.vue"],"names":[],"mappings":"AA8MA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAM/D;;;;;;;GAOG;;IAGC,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;;IAD/B,6CAA6C;cACnC,UAAU,CAAC,SAAS,CAAC;;AAHnC,wBAkRC"}
@@ -1,15 +1,15 @@
1
- import { defineComponent as y, computed as n, toValue as o, onMounted as S, createBlock as x, createElementBlock as k, openBlock as c, unref as i, createElementVNode as g } from "vue";
2
- import { getResolvedRef as s } from "@scalar/workspace-store/helpers/get-resolved-ref";
1
+ import { defineComponent as y, computed as n, toValue as r, onMounted as f, createBlock as g, createElementBlock as k, openBlock as l, unref as i, createElementVNode as x } from "vue";
2
+ import { getResolvedRef as m } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
3
  import { mapHiddenClientsConfig as C } from "../modal/helpers/map-hidden-clients-config.js";
4
- import { combineParams as B } from "./helpers/combine-params.js";
5
- import { getSelectedServer as w } from "./helpers/get-selected-server.js";
4
+ import { combineParams as w } from "./helpers/combine-params.js";
5
+ import { getSelectedServer as B } from "./helpers/get-selected-server.js";
6
6
  import { getServers as U } from "../../helpers/get-servers.js";
7
- import p from "../../blocks/operation-block/OperationBlock.vue.js";
7
+ import N from "../../blocks/operation-block/OperationBlock.vue.js";
8
8
  const b = {
9
9
  key: 1,
10
10
  class: "flex h-full w-full items-center justify-center"
11
- }, N = {}, $ = /* @__PURE__ */ y({
12
- ...N,
11
+ }, V = {}, K = /* @__PURE__ */ y({
12
+ ...V,
13
13
  __name: "Operation",
14
14
  props: {
15
15
  documentSlug: {},
@@ -27,20 +27,20 @@ const b = {
27
27
  options: {}
28
28
  },
29
29
  setup(e) {
30
- const u = n(() => e.path ? s(e.document?.paths?.[e.path]) : null), l = n(() => {
30
+ const u = n(() => e.path ? m(e.document?.paths?.[e.path]) : null), c = n(() => {
31
31
  if (!e.path || !e.method)
32
32
  return null;
33
- const t = s(e.document?.paths?.[e.path]?.[e.method]);
33
+ const t = m(e.document?.paths?.[e.path]?.[e.method]);
34
34
  if (!t)
35
35
  return null;
36
36
  if (!u.value)
37
37
  return t;
38
- const a = B(
38
+ const a = w(
39
39
  u.value.parameters,
40
40
  t.parameters
41
41
  );
42
42
  return { ...t, parameters: a };
43
- }), m = n(() => [
43
+ }), s = n(() => [
44
44
  ...(e.workspaceStore.workspace?.["x-scalar-cookies"] ?? []).map((t) => ({
45
45
  ...t,
46
46
  location: "workspace"
@@ -49,58 +49,67 @@ const b = {
49
49
  ...t,
50
50
  location: "document"
51
51
  }))
52
- ]), r = n(() => {
53
- const t = o(e.options)?.servers ?? l.value?.servers ?? u.value?.servers ?? e.document?.servers;
52
+ ]), o = n(() => {
53
+ const t = r(e.options)?.servers ?? c.value?.servers ?? u.value?.servers ?? e.document?.servers;
54
54
  return U(t, {
55
- baseServerUrl: o(e.options)?.baseServerURL,
55
+ baseServerUrl: r(e.options)?.baseServerURL,
56
56
  documentUrl: e.document?.["x-scalar-original-source-url"]
57
57
  });
58
58
  }), d = n(
59
- () => w(e.document, r.value)
59
+ () => B(e.document, o.value)
60
60
  );
61
- S(() => {
62
- typeof e.document?.["x-scalar-selected-server"] > "u" && r.value?.[0]?.url && e.eventBus.emit("server:update:selected", { url: r.value[0].url });
61
+ f(() => {
62
+ typeof e.document?.["x-scalar-selected-server"] > "u" && o.value?.[0]?.url && e.eventBus.emit("server:update:selected", { url: o.value[0].url });
63
63
  });
64
- const v = n(() => e.document?.["x-scalar-set-operation-security"] ? {
64
+ const h = n(() => e.document?.["x-scalar-set-operation-security"] ? {
65
65
  type: "operation",
66
66
  path: e.path ?? "",
67
67
  method: e.method ?? "get"
68
68
  } : {
69
69
  type: "document"
70
- }), h = n(
71
- () => C(o(e.options)?.hiddenClients)
72
- ), f = "2.23.0";
73
- return (t, a) => e.path && e.method && e.exampleName && l.value ? (c(), x(i(p), {
70
+ }), v = n(
71
+ () => C(r(e.options)?.hiddenClients)
72
+ ), S = "2.23.2";
73
+ return (t, a) => e.path && e.method && e.exampleName && c.value ? (l(), g(i(N), {
74
74
  key: 0,
75
- appVersion: i(f),
76
- authMeta: v.value,
75
+ appVersion: i(S),
76
+ authMeta: h.value,
77
77
  documentSecurity: e.document?.security ?? [],
78
- documentSelectedSecurity: e.document?.["x-scalar-selected-security"],
78
+ documentSelectedSecurity: e.workspaceStore.auth.getAuthSelectedSchemas({
79
+ type: "document",
80
+ documentName: e.documentSlug
81
+ }),
79
82
  documentUrl: e.document?.["x-scalar-original-source-url"],
80
83
  environment: e.environment,
81
84
  eventBus: e.eventBus,
82
85
  exampleKey: e.exampleName,
83
- globalCookies: m.value,
84
- hideClientButton: o(e.options)?.hideClientButton ?? !1,
85
- history: [],
86
- httpClients: h.value,
86
+ globalCookies: s.value,
87
+ hideClientButton: r(e.options)?.hideClientButton ?? !1,
88
+ history: e.workspaceStore.history.getHistory(e.documentSlug, e.path, e.method),
89
+ httpClients: v.value,
87
90
  layout: e.layout,
88
91
  method: e.method,
89
- operation: l.value,
92
+ operation: c.value,
93
+ operationSelectedSecurity: e.workspaceStore.auth.getAuthSelectedSchemas({
94
+ type: "operation",
95
+ documentName: e.documentSlug,
96
+ path: e.path,
97
+ method: e.method
98
+ }),
90
99
  path: e.path,
91
100
  plugins: e.plugins,
92
101
  proxyUrl: e.workspaceStore.workspace["x-scalar-active-proxy"] ?? "",
93
102
  securitySchemes: e.securitySchemes,
94
103
  selectedClient: e.workspaceStore.workspace["x-scalar-default-client"],
95
104
  server: d.value,
96
- servers: r.value,
105
+ servers: o.value,
97
106
  setOperationSecurity: e.document?.["x-scalar-set-operation-security"] ?? !1,
98
- "onUpdate:servers": a[0] || (a[0] = (V) => e.eventBus.emit("ui:route:page", { name: "document.servers" }))
99
- }, null, 8, ["appVersion", "authMeta", "documentSecurity", "documentSelectedSecurity", "documentUrl", "environment", "eventBus", "exampleKey", "globalCookies", "hideClientButton", "httpClients", "layout", "method", "operation", "path", "plugins", "proxyUrl", "securitySchemes", "selectedClient", "server", "servers", "setOperationSecurity"])) : (c(), k("div", b, [...a[1] || (a[1] = [
100
- g("span", { class: "text-c-3" }, "Select an operation to view details", -1)
107
+ "onUpdate:servers": a[0] || (a[0] = (M) => e.eventBus.emit("ui:route:page", { name: "document.servers" }))
108
+ }, null, 8, ["appVersion", "authMeta", "documentSecurity", "documentSelectedSecurity", "documentUrl", "environment", "eventBus", "exampleKey", "globalCookies", "hideClientButton", "history", "httpClients", "layout", "method", "operation", "operationSelectedSecurity", "path", "plugins", "proxyUrl", "securitySchemes", "selectedClient", "server", "servers", "setOperationSecurity"])) : (l(), k("div", b, [...a[1] || (a[1] = [
109
+ x("span", { class: "text-c-3" }, "Select an operation to view details", -1)
101
110
  ])]));
102
111
  }
103
112
  });
104
113
  export {
105
- $ as default
114
+ K as default
106
115
  };
@@ -1,10 +1,8 @@
1
- import type { OpenApiDocument, OperationObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
1
+ import type { SelectedSecurity } from '@scalar/workspace-store/entities/auth';
2
+ import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
3
  /**
3
4
  * Get the selected security for an operation or document,
4
5
  * Defaults to the first requirement if no selection is made and you pass in requirements
5
6
  */
6
- export declare const getSelectedSecurity: (documentSelectedSecurity: OpenApiDocument["x-scalar-selected-security"], operationSelectedSecurity: OperationObject["x-scalar-selected-security"], securityRequirements?: NonNullable<OpenApiDocument["security"]>, setOperationSecurity?: boolean) => {
7
- selectedIndex: number;
8
- selectedSchemes: import("@scalar/workspace-store/schemas/v3.1/strict/security-requirement").SecurityRequirementObject[];
9
- };
7
+ export declare const getSelectedSecurity: (documentSelectedSecurity: SelectedSecurity | undefined, operationSelectedSecurity: SelectedSecurity | undefined, securityRequirements?: NonNullable<OpenApiDocument["security"]>, setOperationSecurity?: boolean) => SelectedSecurity;
10
8
  //# sourceMappingURL=get-selected-security.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-selected-security.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-selected-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAIpH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAC9B,0BAA0B,eAAe,CAAC,4BAA4B,CAAC,EACvE,2BAA2B,eAAe,CAAC,4BAA4B,CAAC,EACxE,uBAAsB,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,CAAM,EACnE,8BAA4B;;;CA6B7B,CAAA"}
1
+ {"version":3,"file":"get-selected-security.d.ts","sourceRoot":"","sources":["../../../../../src/v2/features/operation/helpers/get-selected-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8DAA8D,CAAA;AAInG;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAC9B,0BAA0B,gBAAgB,GAAG,SAAS,EACtD,2BAA2B,gBAAgB,GAAG,SAAS,EACvD,uBAAsB,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,CAAM,EACnE,8BAA4B,KAC3B,gBA4BF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-events.d.ts","sourceRoot":"","sources":["../../src/v2/workspace-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAkB,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAE3G,OAAO,EAAE,KAAK,GAAG,EAAY,MAAM,KAAK,CAAA;AAExC,KAAK,IAAI,CAAC,CAAC,SAAS,MAAM,kBAAkB,IAAI,OAAO,CAAC;IACtD,eAAe,EAAE,CACf,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,KAC3B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAA;IAClF,cAAc,EAAE,CAAC,OAAO,EAAE,k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