@scalar/api-client 2.2.22 → 2.2.24

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 (127) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/components/AddressBar/AddressBar.vue.d.ts.map +1 -1
  3. package/dist/components/AddressBar/AddressBar.vue.js +2 -2
  4. package/dist/components/AddressBar/AddressBar.vue2.js +69 -70
  5. package/dist/components/AddressBar/AddressBarServer.vue.d.ts.map +1 -1
  6. package/dist/components/AddressBar/AddressBarServer.vue.js +69 -61
  7. package/dist/components/AddressBar/AddressBarServerItem.vue.d.ts.map +1 -1
  8. package/dist/components/AddressBar/AddressBarServerItem.vue.js +17 -16
  9. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  10. package/dist/components/CodeInput/CodeInput.vue.js +2 -2
  11. package/dist/components/CodeInput/CodeInput.vue2.js +46 -46
  12. package/dist/components/CodeInput/codeVariableWidget.d.ts +4 -4
  13. package/dist/components/CodeInput/codeVariableWidget.d.ts.map +1 -1
  14. package/dist/components/CodeInput/codeVariableWidget.js +42 -38
  15. package/dist/components/CommandPalette/CommandPaletteCollection.vue.js +25 -24
  16. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts +1 -1
  17. package/dist/components/CommandPalette/CommandPaletteExample.vue.d.ts.map +1 -1
  18. package/dist/components/CommandPalette/CommandPaletteExample.vue.js +64 -55
  19. package/dist/components/CommandPalette/CommandPaletteImport.vue.d.ts.map +1 -1
  20. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +110 -106
  21. package/dist/components/CommandPalette/CommandPaletteRequest.vue.js +2 -2
  22. package/dist/components/CommandPalette/TheCommandPalette.vue.d.ts +1 -1
  23. package/dist/components/CommandPalette/TheCommandPalette.vue.js +1 -1
  24. package/dist/components/CommandPalette/TheCommandPalette.vue2.js +38 -37
  25. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  26. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +52 -49
  27. package/dist/components/ImportCollection/DropEventListener.vue.d.ts.map +1 -1
  28. package/dist/components/ImportCollection/DropEventListener.vue.js +46 -43
  29. package/dist/components/ImportCollection/ImportCollectionModal.vue.js +40 -39
  30. package/dist/components/ImportCollection/ImportNowButton.vue.js +44 -42
  31. package/dist/components/ImportCollection/WorkspaceSelector.vue.js +76 -69
  32. package/dist/components/ScalarAsciiArt.vue.js +1 -1
  33. package/dist/components/ScalarAsciiArt.vue2.js +22 -19
  34. package/dist/components/Search/useSearch.d.ts.map +1 -1
  35. package/dist/components/Search/useSearch.js +57 -49
  36. package/dist/components/SideNav/SideNavRouterLink.vue.d.ts.map +1 -1
  37. package/dist/components/SideNav/SideNavRouterLink.vue.js +22 -19
  38. package/dist/components/Sidebar/SidebarListElement.vue.d.ts.map +1 -1
  39. package/dist/components/Sidebar/SidebarListElement.vue.js +2 -2
  40. package/dist/components/Sidebar/SidebarListElement.vue2.js +38 -36
  41. package/dist/components/TopNav/TopNav.vue.d.ts.map +1 -1
  42. package/dist/components/TopNav/TopNav.vue.js +71 -64
  43. package/dist/layouts/App/ApiClientApp.vue.js +4 -1
  44. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  45. package/dist/layouts/Modal/ApiClientModal.vue2.js +22 -19
  46. package/dist/layouts/Web/ApiClientWeb.vue.js +4 -1
  47. package/dist/libs/create-client.d.ts +10 -10
  48. package/dist/libs/create-client.d.ts.map +1 -1
  49. package/dist/libs/create-client.js +42 -36
  50. package/dist/libs/extractAttachmentFilename.d.ts +3 -0
  51. package/dist/libs/extractAttachmentFilename.d.ts.map +1 -1
  52. package/dist/libs/extractAttachmentFilename.js +7 -7
  53. package/dist/libs/importers/curl.d.ts.map +1 -1
  54. package/dist/libs/importers/curl.js +18 -18
  55. package/dist/libs/normalize-headers.d.ts.map +1 -1
  56. package/dist/libs/normalize-headers.js +2 -2
  57. package/dist/libs/parse-curl.js +39 -36
  58. package/dist/store/active-entities.d.ts +4 -4
  59. package/dist/store/active-entities.d.ts.map +1 -1
  60. package/dist/store/active-entities.js +88 -86
  61. package/dist/store/collections.d.ts.map +1 -1
  62. package/dist/store/collections.js +29 -29
  63. package/dist/store/request-example.d.ts.map +1 -1
  64. package/dist/store/request-example.js +27 -23
  65. package/dist/store/requests.d.ts.map +1 -1
  66. package/dist/store/requests.js +94 -77
  67. package/dist/store/security-schemes.d.ts.map +1 -1
  68. package/dist/store/security-schemes.js +27 -27
  69. package/dist/store/servers.d.ts.map +1 -1
  70. package/dist/store/servers.js +18 -18
  71. package/dist/store/tags.d.ts.map +1 -1
  72. package/dist/store/tags.js +35 -33
  73. package/dist/style.css +1 -1
  74. package/dist/views/Cookies/CookieForm.vue.d.ts.map +1 -1
  75. package/dist/views/Cookies/CookieForm.vue.js +14 -9
  76. package/dist/views/Cookies/Cookies.vue.d.ts.map +1 -1
  77. package/dist/views/Cookies/Cookies.vue2.js +39 -37
  78. package/dist/views/Environment/Environment.vue.d.ts.map +1 -1
  79. package/dist/views/Environment/Environment.vue2.js +94 -89
  80. package/dist/views/Request/Request.vue.d.ts.map +1 -1
  81. package/dist/views/Request/Request.vue.js +1 -1
  82. package/dist/views/Request/Request.vue2.js +118 -116
  83. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  84. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +28 -25
  85. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  86. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +1 -1
  87. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +38 -37
  88. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  89. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +2 -2
  90. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +76 -73
  91. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue.js +2 -2
  92. package/dist/views/Request/RequestSection/RequestAuth/RequestExampleAuth.vue2.js +80 -80
  93. package/dist/views/Request/RequestSection/RequestBody.vue.d.ts.map +1 -1
  94. package/dist/views/Request/RequestSection/RequestBody.vue.js +1 -1
  95. package/dist/views/Request/RequestSection/RequestBody.vue2.js +192 -178
  96. package/dist/views/Request/RequestSection/RequestParams.vue.d.ts.map +1 -1
  97. package/dist/views/Request/RequestSection/RequestParams.vue.js +80 -73
  98. package/dist/views/Request/RequestSection/RequestPathParams.vue.d.ts.map +1 -1
  99. package/dist/views/Request/RequestSection/RequestPathParams.vue.js +50 -48
  100. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  101. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  102. package/dist/views/Request/RequestSidebar.vue2.js +149 -144
  103. package/dist/views/Request/RequestSidebarItem.vue.d.ts.map +1 -1
  104. package/dist/views/Request/RequestSidebarItem.vue.js +2 -2
  105. package/dist/views/Request/RequestSidebarItem.vue2.js +168 -150
  106. package/dist/views/Request/RequestSidebarItemMenu.vue.d.ts.map +1 -1
  107. package/dist/views/Request/RequestSidebarItemMenu.vue.js +4 -4
  108. package/dist/views/Request/RequestSidebarItemMenu.vue2.js +80 -80
  109. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  110. package/dist/views/Request/ResponseSection/ResponseSection.vue.js +1 -1
  111. package/dist/views/Request/ResponseSection/ResponseSection.vue2.js +1 -1
  112. package/dist/views/Request/components/WorkspaceDropdown.vue.d.ts.map +1 -1
  113. package/dist/views/Request/components/WorkspaceDropdown.vue.js +166 -156
  114. package/dist/views/Request/handle-drag.d.ts.map +1 -1
  115. package/dist/views/Request/handle-drag.js +37 -31
  116. package/dist/views/Request/hooks/useOpenApiWatcher.js +27 -27
  117. package/dist/views/Request/libs/live-sync.d.ts.map +1 -1
  118. package/dist/views/Request/libs/live-sync.js +147 -130
  119. package/dist/views/Request/types/sidebar-item.d.ts +4 -1
  120. package/dist/views/Request/types/sidebar-item.d.ts.map +1 -1
  121. package/dist/views/Servers/ServerForm.vue.js +38 -35
  122. package/dist/views/Servers/Servers.vue2.js +38 -35
  123. package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
  124. package/dist/views/Settings/Settings.vue2.js +15 -15
  125. package/dist/views/Settings/SettingsGeneral.vue.d.ts.map +1 -1
  126. package/dist/views/Settings/SettingsGeneral.vue.js +206 -174
  127. package/package.json +8 -8
@@ -1,4 +1,4 @@
1
- import { defineComponent as j, useAttrs as J, ref as u, toRef as a, watch as L, computed as Q, openBlock as r, createElementBlock as p, Fragment as G, createBlock as v, mergeProps as H, unref as s, withKeys as h, withModifiers as D, createElementVNode as E, createVNode as X, createCommentVNode as f, renderSlot as $ } from "vue";
1
+ import { defineComponent as j, useAttrs as J, ref as u, toRef as r, watch as L, computed as Q, openBlock as s, createElementBlock as p, Fragment as G, createBlock as h, mergeProps as H, unref as n, withKeys as w, withModifiers as D, createElementVNode as E, createVNode as X, createCommentVNode as f, renderSlot as $ } from "vue";
2
2
  import { useCodeMirror as Y, useDropdown as Z, colorPicker as ee } from "@scalar/use-codemirror";
3
3
  import { nanoid as oe } from "nanoid";
4
4
  import q from "../DataTable/DataTableInputSelect.vue.js";
@@ -49,13 +49,13 @@ const de = ["id"], pe = {
49
49
  emits: ["submit", "update:modelValue", "curl"],
50
50
  setup(R, { expose: N, emit: O }) {
51
51
  var P;
52
- const e = R, i = O, w = J(), _ = w.id || `id-${oe()}`, V = u(!1), m = u(!1), g = u(""), B = u({ left: 0, top: 0 }), c = u(null), { activeEnvVariables: C, activeEnvironment: k, activeWorkspace: A } = ue(), { isReadOnly: S } = ie(), { copyToClipboard: I } = ae();
52
+ const e = R, i = O, V = J(), _ = V.id || `id-${oe()}`, g = u(!1), m = u(!1), B = u(""), C = u({ left: 0, top: 0 }), c = u(null), { activeEnvVariables: k, activeEnvironment: b, activeWorkspace: A } = ue(), { isReadOnly: S } = ie(), { copyToClipboard: I } = ae();
53
53
  function K(o) {
54
54
  var t;
55
- return o === e.modelValue ? null : e.importCurl && o.trim().toLowerCase().startsWith("curl") ? (i("curl", o), (t = n.value) == null || t.dispatch({
55
+ return o === e.modelValue ? null : e.importCurl && o.trim().toLowerCase().startsWith("curl") ? (i("curl", o), (t = a.value) == null || t.dispatch({
56
56
  changes: {
57
57
  from: 0,
58
- to: n.value.state.doc.length,
58
+ to: a.value.state.doc.length,
59
59
  insert: String(e.modelValue)
60
60
  }
61
61
  }), null) : e.handleFieldChange ? e.handleFieldChange(o) : i("update:modelValue", o);
@@ -64,45 +64,45 @@ const de = ["id"], pe = {
64
64
  return e.handleFieldSubmit ? e.handleFieldSubmit(o) : i("submit", o);
65
65
  }
66
66
  function T(o) {
67
- V.value = !1, e.emitOnBlur && e.modelValue && M(o);
67
+ g.value = !1, e.emitOnBlur && e.modelValue && M(o);
68
68
  }
69
- const b = [];
70
- e.colorPicker && b.push(ee), b.push(
69
+ const y = [];
70
+ e.colorPicker && y.push(ee), y.push(
71
71
  te({
72
- environment: k.value,
73
- envVariables: C.value,
72
+ environment: b.value,
73
+ envVariables: k.value,
74
74
  workspace: A.value,
75
75
  isReadOnly: S
76
76
  }),
77
77
  le
78
78
  );
79
- const x = u(null), { codeMirror: n } = Y({
80
- content: a(
79
+ const x = u(null), { codeMirror: a } = Y({
80
+ content: r(
81
81
  () => e.modelValue !== void 0 ? String(e.modelValue) : ""
82
82
  ),
83
83
  onChange: (o) => {
84
84
  K(o), z();
85
85
  },
86
- onFocus: () => V.value = !0,
86
+ onFocus: () => g.value = !0,
87
87
  onBlur: (o) => T(o),
88
88
  codeMirrorRef: x,
89
- disableTabIndent: a(() => e.disableTabIndent),
90
- disableEnter: a(() => e.disableEnter),
91
- disableCloseBrackets: a(() => e.disableCloseBrackets),
92
- lineNumbers: a(() => e.lineNumbers),
93
- language: a(() => e.language),
94
- lint: a(() => e.lint),
95
- extensions: b,
96
- placeholder: a(() => e.placeholder)
89
+ disableTabIndent: r(() => e.disableTabIndent),
90
+ disableEnter: r(() => e.disableEnter),
91
+ disableCloseBrackets: r(() => e.disableCloseBrackets),
92
+ lineNumbers: r(() => e.lineNumbers),
93
+ language: r(() => e.language),
94
+ lint: r(() => e.lint),
95
+ extensions: y,
96
+ placeholder: r(() => e.placeholder)
97
97
  });
98
- (P = n.value) == null || P.focus(), L(n, () => {
99
- n.value && Object.prototype.hasOwnProperty.call(w, "autofocus") && n.value.focus();
98
+ (P = a.value) == null || P.focus(), L(a, () => {
99
+ a.value && Object.prototype.hasOwnProperty.call(V, "autofocus") && a.value.focus();
100
100
  });
101
101
  const { handleDropdownSelect: W, updateDropdownVisibility: z } = Z({
102
- codeMirror: n,
103
- query: g,
102
+ codeMirror: a,
103
+ query: B,
104
104
  showDropdown: m,
105
- dropdownPosition: B
105
+ dropdownPosition: C
106
106
  }), U = Q(() => {
107
107
  var o;
108
108
  return e.type === "boolean" || (o = e.type) != null && o.includes("boolean") || e.nullable ? ["true", "false", "null"] : ["true", "false"];
@@ -110,31 +110,31 @@ const de = ["id"], pe = {
110
110
  N({
111
111
  focus: () => {
112
112
  var o;
113
- (o = n.value) == null || o.focus();
113
+ (o = a.value) == null || o.focus();
114
114
  }
115
115
  });
116
- const y = (o, t) => {
116
+ const v = (o, t) => {
117
117
  var d, l, F;
118
118
  m.value && (o === "down" ? (t.preventDefault(), (d = c.value) == null || d.handleArrowKey("down")) : o === "up" ? (t.preventDefault(), (l = c.value) == null || l.handleArrowKey("up")) : o === "enter" && (t.preventDefault(), (F = c.value) == null || F.handleSelect()));
119
119
  };
120
120
  return (o, t) => {
121
121
  var d;
122
- return r(), p(G, null, [
123
- e.enum && e.enum.length ? (r(), v(q, {
122
+ return s(), p(G, null, [
123
+ e.enum && e.enum.length ? (s(), h(q, {
124
124
  key: 0,
125
125
  default: e.default,
126
126
  modelValue: e.modelValue,
127
127
  value: e.enum,
128
128
  "onUpdate:modelValue": t[0] || (t[0] = (l) => i("update:modelValue", l))
129
- }, null, 8, ["default", "modelValue", "value"])) : e.type === "boolean" || (d = e.type) != null && d.includes("boolean") ? (r(), v(q, {
129
+ }, null, 8, ["default", "modelValue", "value"])) : e.type === "boolean" || (d = e.type) != null && d.includes("boolean") ? (s(), h(q, {
130
130
  key: 1,
131
131
  default: e.default,
132
132
  modelValue: e.modelValue,
133
133
  value: U.value,
134
134
  "onUpdate:modelValue": t[1] || (t[1] = (l) => i("update:modelValue", l))
135
- }, null, 8, ["default", "modelValue", "value"])) : (r(), p("div", H({
135
+ }, null, 8, ["default", "modelValue", "value"])) : (s(), p("div", H({
136
136
  key: 2,
137
- id: s(_)
137
+ id: n(_)
138
138
  }, o.$attrs, {
139
139
  ref_key: "codeMirrorRef",
140
140
  ref: x,
@@ -142,39 +142,39 @@ const de = ["id"], pe = {
142
142
  "flow-code-input--error": o.error
143
143
  }],
144
144
  onKeydown: [
145
- t[3] || (t[3] = h(D((l) => y("down", l), ["stop"]), ["down"])),
146
- t[4] || (t[4] = h((l) => y("enter", l), ["enter"])),
147
- t[5] || (t[5] = h(D((l) => y("up", l), ["stop"]), ["up"]))
145
+ t[3] || (t[3] = w(D((l) => v("down", l), ["stop"]), ["down"])),
146
+ t[4] || (t[4] = w((l) => v("enter", l), ["enter"])),
147
+ t[5] || (t[5] = w(D((l) => v("up", l), ["stop"]), ["up"]))
148
148
  ]
149
149
  }), [
150
- o.isCopyable ? (r(), p("div", pe, [
150
+ o.isCopyable ? (s(), p("div", pe, [
151
151
  E("button", {
152
152
  class: "copy-button",
153
153
  type: "button",
154
- onClick: t[2] || (t[2] = (l) => s(I)(s(se)(e.modelValue)))
154
+ onClick: t[2] || (t[2] = (l) => n(I)(n(se)(e.modelValue)))
155
155
  }, [
156
156
  t[6] || (t[6] = E("span", { class: "sr-only" }, "Copy content", -1)),
157
- X(s(re), {
157
+ X(n(re), {
158
158
  icon: "Clipboard",
159
159
  size: "md"
160
160
  })
161
161
  ])
162
162
  ])) : f("", !0)
163
163
  ], 16, de)),
164
- o.$slots.warning ? (r(), p("div", ce, [
164
+ o.$slots.warning ? (s(), p("div", ce, [
165
165
  $(o.$slots, "warning", {}, void 0, !0)
166
166
  ])) : f("", !0),
167
167
  $(o.$slots, "icon", {}, void 0, !0),
168
- o.required ? (r(), p("div", fe, " Required ")) : f("", !0),
169
- m.value && e.withVariables && !s(S) ? (r(), v(ne, {
168
+ o.required ? (s(), p("div", fe, " Required ")) : f("", !0),
169
+ m.value && e.withVariables && !n(S) && n(b) ? (s(), h(ne, {
170
170
  key: 5,
171
171
  ref_key: "dropdownRef",
172
172
  ref: c,
173
- dropdownPosition: B.value,
174
- envVariables: s(C),
175
- environment: s(k),
176
- query: g.value,
177
- onSelect: s(W)
173
+ dropdownPosition: C.value,
174
+ envVariables: n(k),
175
+ environment: n(b),
176
+ query: B.value,
177
+ onSelect: n(W)
178
178
  }, null, 8, ["dropdownPosition", "envVariables", "environment", "query", "onSelect"])) : f("", !0)
179
179
  ], 64);
180
180
  };
@@ -8,10 +8,10 @@ type IsReadOnly = WorkspaceStore['isReadOnly'];
8
8
  * Styles the active environment variable pill
9
9
  */
10
10
  export declare const pillPlugin: (props: {
11
- environment: Environment;
12
- envVariables: EnvVariables;
13
- workspace: Workspace;
14
- isReadOnly: IsReadOnly;
11
+ environment?: Environment;
12
+ envVariables?: EnvVariables;
13
+ workspace?: Workspace;
14
+ isReadOnly?: IsReadOnly;
15
15
  }) => ViewPlugin<{
16
16
  decorations: DecorationSet;
17
17
  update(update: ViewUpdate): void;
@@ -1 +1 @@
1
- {"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,oBAAoB,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAErE,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,UAAU,EAEV,UAAU,EACV,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;AAG/B,KAAK,UAAU,GAAG,cAAc,CAAC,YAAY,CAAC,CAAA;AA+H9C;;GAEG;AACH,eAAO,MAAM,UAAU,UAAW;IAChC,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,YAAY,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;IACpB,UAAU,EAAE,UAAU,CAAA;CACvB;iBAGkB,aAAa;mBAMX,UAAU;2BASF,UAAU;EAkCpC,CAAA;AAEH,eAAO,MAAM,gBAAgB,uCA8B3B,CAAA"}
1
+ {"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,oBAAoB,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAErE,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,UAAU,EAEV,UAAU,EACV,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;AAG/B,KAAK,UAAU,GAAG,cAAc,CAAC,YAAY,CAAC,CAAA;AAkI9C;;GAEG;AACH,eAAO,MAAM,UAAU,UAAW;IAChC,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,UAAU,CAAC,EAAE,UAAU,CAAA;CACxB;iBAGkB,aAAa;mBAMX,UAAU;2BASF,UAAU;EAkCpC,CAAA;AAEH,eAAO,MAAM,gBAAgB,uCA8B3B,CAAA"}
@@ -1,21 +1,21 @@
1
1
  var h = Object.defineProperty;
2
- var u = (i, t, e) => t in i ? h(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var r = (i, t, e) => u(i, typeof t != "symbol" ? t + "" : t, e);
2
+ var u = (n, t, e) => t in n ? h(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var l = (n, t, e) => u(n, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { getEnvColor as f } from "../../libs/env-helpers.js";
5
5
  import { ScalarButton as b, ScalarIcon as v, ScalarTooltip as g } from "@scalar/components";
6
6
  import { REGEX as w } from "@scalar/oas-utils/helpers";
7
7
  import { ViewPlugin as y, RangeSetBuilder as x, Decoration as E, EditorView as N, WidgetType as k } from "@scalar/use-codemirror";
8
- import { defineComponent as C, h as s, createApp as R } from "vue";
9
- import { parseEnvVariables as S } from "../../libs/environment-parser.js";
8
+ import { defineComponent as C, h as s, createApp as V } from "vue";
9
+ import { parseEnvVariables as R } from "../../libs/environment-parser.js";
10
10
  class d extends k {
11
- constructor(e, o, n, l, a) {
11
+ constructor(e, o, i, c, a) {
12
12
  super();
13
- r(this, "app");
14
- r(this, "environment");
15
- r(this, "envVariables");
16
- r(this, "workspace");
17
- r(this, "isReadOnly");
18
- this.variableName = e, this.variableName = e, this.environment = o, this.envVariables = n, this.workspace = l, this.isReadOnly = a;
13
+ l(this, "app");
14
+ l(this, "environment");
15
+ l(this, "envVariables");
16
+ l(this, "workspace");
17
+ l(this, "isReadOnly");
18
+ this.variableName = e, this.variableName = e, this.environment = o, this.envVariables = i, this.workspace = c, this.isReadOnly = a;
19
19
  }
20
20
  toDOM() {
21
21
  const e = document.createElement("span");
@@ -23,11 +23,11 @@ class d extends k {
23
23
  const o = C({
24
24
  props: { variableName: { type: String, default: null } },
25
25
  render: () => {
26
- const n = S(this.envVariables).find(
27
- (c) => c.key === this.variableName
28
- ), l = n && this.environment ? f(this.environment) : "#8E8E8E";
29
- e.style.setProperty("--tw-bg-base", l || "#8E8E8E"), e.style.opacity = n != null && n.value ? "1" : "0.5";
30
- const a = n != null && n.value ? s("div", { class: "p-2" }, n.value) : s("div", { class: "divide-y divide-1/2 grid" }, [
26
+ const i = this.envVariables ? R(this.envVariables).find(
27
+ (r) => r.key === this.variableName
28
+ ) : void 0, c = i && this.environment ? f(this.environment) : "#8E8E8E";
29
+ e.style.setProperty("--tw-bg-base", c || "#8E8E8E"), e.style.opacity = i != null && i.value ? "1" : "0.5";
30
+ const a = i != null && i.value ? s("div", { class: "p-2" }, i.value) : s("div", { class: "divide-y divide-1/2 grid" }, [
31
31
  s("span", { class: "p-2 opacity-25" }, "No value"),
32
32
  !this.isReadOnly && s("div", { class: "p-1" }, [
33
33
  s(
@@ -35,7 +35,11 @@ class d extends k {
35
35
  {
36
36
  class: "gap-1.5 justify-start font-normal px-1 py-1.5 h-auto transition-colors rounded no-underline text-xxs w-full hover:bg-b-2",
37
37
  variant: "ghost",
38
- onClick: () => window.location.href = `/workspace/${this.workspace.uid}/environment`
38
+ // TODO: Use router instead
39
+ onClick: () => {
40
+ var r;
41
+ return window.location.href = `/workspace/${(r = this.workspace) == null ? void 0 : r.uid}/environment`;
42
+ }
39
43
  },
40
44
  {
41
45
  default: () => [
@@ -66,7 +70,7 @@ class d extends k {
66
70
  {
67
71
  class: [
68
72
  "border w-content rounded bg-b-1 brightness-lifted text-xxs leading-5 text-c-1",
69
- n != null && n.value ? "border-solid" : "border-dashed"
73
+ i != null && i.value ? "border-solid" : "border-dashed"
70
74
  ]
71
75
  },
72
76
  a
@@ -75,7 +79,7 @@ class d extends k {
75
79
  );
76
80
  }
77
81
  });
78
- return this.app = R(o, { variableName: this.variableName }), this.app.mount(e), e;
82
+ return this.app = V(o, { variableName: this.variableName }), this.app.mount(e), e;
79
83
  }
80
84
  destroy() {
81
85
  this.app && this.app.unmount();
@@ -87,10 +91,10 @@ class d extends k {
87
91
  return !1;
88
92
  }
89
93
  }
90
- const q = (i) => y.fromClass(
94
+ const q = (n) => y.fromClass(
91
95
  class {
92
96
  constructor(t) {
93
- r(this, "decorations");
97
+ l(this, "decorations");
94
98
  this.decorations = this.buildDecorations(t);
95
99
  }
96
100
  update(t) {
@@ -100,21 +104,21 @@ const q = (i) => y.fromClass(
100
104
  }
101
105
  buildDecorations(t) {
102
106
  const e = new x();
103
- for (const { from: o, to: n } of t.visibleRanges) {
104
- const l = t.state.doc.sliceString(o, n);
107
+ for (const { from: o, to: i } of t.visibleRanges) {
108
+ const c = t.state.doc.sliceString(o, i);
105
109
  let a;
106
- for (; (a = w.VARIABLES.exec(l)) !== null; ) {
107
- const c = o + a.index, p = c + a[0].length, m = a[1];
110
+ for (; (a = w.VARIABLES.exec(c)) !== null; ) {
111
+ const r = o + a.index, p = r + a[0].length, m = a[1] ?? "";
108
112
  e.add(
109
- c,
113
+ r,
110
114
  p,
111
115
  E.widget({
112
116
  widget: new d(
113
117
  m,
114
- i.environment,
115
- i.envVariables,
116
- i.workspace,
117
- i.isReadOnly
118
+ n.environment,
119
+ n.envVariables,
120
+ n.workspace,
121
+ n.isReadOnly
118
122
  ),
119
123
  side: 1
120
124
  })
@@ -128,19 +132,19 @@ const q = (i) => y.fromClass(
128
132
  decorations: (t) => t.decorations
129
133
  }
130
134
  ), I = N.domEventHandlers({
131
- keydown(i, t) {
132
- if (i.key === "Backspace") {
133
- const { state: e } = t, { from: o, to: n } = e.selection.main;
134
- if (o === 0 && n === e.doc.length)
135
+ keydown(n, t) {
136
+ if (n.key === "Backspace") {
137
+ const { state: e } = t, { from: o, to: i } = e.selection.main;
138
+ if (o === 0 && i === e.doc.length)
135
139
  return t.dispatch({
136
140
  changes: { from: 0, to: e.doc.length },
137
141
  selection: { anchor: 0 }
138
- }), i.preventDefault(), !0;
139
- if (o === n && o > 0 && e.doc.sliceString(o - 2, o) === "}}")
142
+ }), n.preventDefault(), !0;
143
+ if (o === i && o > 0 && e.doc.sliceString(o - 2, o) === "}}")
140
144
  return t.dispatch({
141
- changes: { from: o - 2, to: n },
145
+ changes: { from: o - 2, to: i },
142
146
  selection: { anchor: o - 2 }
143
- }), i.preventDefault(), !0;
147
+ }), n.preventDefault(), !0;
144
148
  }
145
149
  return !1;
146
150
  }
@@ -1,22 +1,23 @@
1
- import { defineComponent as f, ref as i, openBlock as v, createBlock as b, withCtx as l, createVNode as n, unref as s, createTextVNode as _ } from "vue";
2
- import C from "../IconSelector.vue.js";
3
- import { useActiveEntities as V } from "../../store/active-entities.js";
4
- import { ScalarButton as k } from "@scalar/components";
5
- import { LibraryIcon as x } from "@scalar/icons";
6
- import { useToasts as N } from "@scalar/use-toasts";
7
- import B from "./CommandActionForm.vue.js";
8
- import S from "./CommandActionInput.vue.js";
9
- import { useWorkspace as $ } from "../../store/store.js";
10
- const D = /* @__PURE__ */ f({
1
+ import { defineComponent as v, ref as s, openBlock as b, createBlock as _, withCtx as l, createVNode as n, unref as m, createTextVNode as C } from "vue";
2
+ import V from "../IconSelector.vue.js";
3
+ import { useActiveEntities as k } from "../../store/active-entities.js";
4
+ import { ScalarButton as x } from "@scalar/components";
5
+ import { LibraryIcon as N } from "@scalar/icons";
6
+ import { useToasts as B } from "@scalar/use-toasts";
7
+ import S from "./CommandActionForm.vue.js";
8
+ import $ from "./CommandActionInput.vue.js";
9
+ import { useWorkspace as I } from "../../store/store.js";
10
+ const D = /* @__PURE__ */ v({
11
11
  __name: "CommandPaletteCollection",
12
12
  emits: ["close", "back"],
13
- setup(I, { emit: m }) {
14
- const r = m, { activeWorkspace: c } = V(), { collectionMutators: u } = $(), o = i(""), a = i("interface-content-folder"), { toast: d } = N(), p = () => {
13
+ setup(P, { emit: c }) {
14
+ const i = c, { activeWorkspace: u } = k(), { collectionMutators: d } = I(), o = s(""), a = s("interface-content-folder"), { toast: p } = B(), f = () => {
15
+ var r;
15
16
  if (!o.value) {
16
- d("Please enter a name before creating a collection.", "error");
17
+ p("Please enter a name before creating a collection.", "error");
17
18
  return;
18
19
  }
19
- u.add(
20
+ d.add(
20
21
  {
21
22
  openapi: "3.1.0",
22
23
  info: {
@@ -25,26 +26,26 @@ const D = /* @__PURE__ */ f({
25
26
  },
26
27
  "x-scalar-icon": a.value
27
28
  },
28
- c.value.uid
29
- ), r("close");
29
+ ((r = u.value) == null ? void 0 : r.uid) ?? ""
30
+ ), i("close");
30
31
  };
31
- return (P, e) => (v(), b(B, {
32
+ return (r, e) => (b(), _(S, {
32
33
  disabled: !o.value.trim(),
33
- onSubmit: p
34
+ onSubmit: f
34
35
  }, {
35
36
  options: l(() => [
36
- n(C, {
37
+ n(V, {
37
38
  modelValue: a.value,
38
39
  "onUpdate:modelValue": e[2] || (e[2] = (t) => a.value = t),
39
40
  placement: "bottom-start"
40
41
  }, {
41
42
  default: l(() => [
42
- n(s(k), {
43
+ n(m(x), {
43
44
  class: "aspect-square px-0 h-auto",
44
45
  variant: "outlined"
45
46
  }, {
46
47
  default: l(() => [
47
- n(s(x), {
48
+ n(m(N), {
48
49
  class: "size-4 text-c-2 stroke-[1.75]",
49
50
  src: a.value
50
51
  }, null, 8, ["src"])
@@ -56,15 +57,15 @@ const D = /* @__PURE__ */ f({
56
57
  }, 8, ["modelValue"])
57
58
  ]),
58
59
  submit: l(() => e[3] || (e[3] = [
59
- _("Create Collection")
60
+ C("Create Collection")
60
61
  ])),
61
62
  default: l(() => [
62
- n(S, {
63
+ n($, {
63
64
  modelValue: o.value,
64
65
  "onUpdate:modelValue": e[0] || (e[0] = (t) => o.value = t),
65
66
  label: "Collection Name",
66
67
  placeholder: "Collection Name",
67
- onOnDelete: e[1] || (e[1] = (t) => r("back", t))
68
+ onOnDelete: e[1] || (e[1] = (t) => i("back", t))
68
69
  }, null, 8, ["modelValue"])
69
70
  ]),
70
71
  _: 1
@@ -10,6 +10,6 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
10
10
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
11
  onClose?: (() => any) | undefined;
12
12
  onBack?: ((e: KeyboardEvent) => any) | undefined;
13
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLFormElement>;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
14
  export default _default;
15
15
  //# sourceMappingURL=CommandPaletteExample.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteExample.vue"],"names":[],"mappings":"AA8HA,KAAK,WAAW,GAAG;IACjB,oCAAoC;IACpC,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CAC/B,CAAC;;;;;;;;AAuQF,wBAQG"}
1
+ {"version":3,"file":"CommandPaletteExample.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteExample.vue"],"names":[],"mappings":"AA4IA,KAAK,WAAW,GAAG;IACjB,oCAAoC;IACpC,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CAC/B,CAAC;;;;;;;;AAqRF,wBAOG"}
@@ -1,75 +1,84 @@
1
- import { defineComponent as y, ref as f, openBlock as u, createBlock as v, withCtx as o, createVNode as s, unref as a, createElementVNode as x, createElementBlock as N, Fragment as V, renderList as B, createTextVNode as i, toDisplayString as b } from "vue";
2
- import k from "../HttpMethod/HttpMethod.vue.js";
3
- import { useActiveEntities as R } from "../../store/active-entities.js";
4
- import { ScalarDropdown as W, ScalarDropdownItem as j, ScalarButton as z, ScalarIcon as I } from "@scalar/components";
5
- import { useToasts as M } from "@scalar/use-toasts";
6
- import { useRouter as P } from "vue-router";
7
- import T from "./CommandActionForm.vue.js";
8
- import U from "./CommandActionInput.vue.js";
9
- import { useWorkspace as A } from "../../store/store.js";
10
- const F = { class: "flex items-center gap-2" }, H = { class: "max-h-40 custom-scroll" }, te = /* @__PURE__ */ y({
1
+ import { defineComponent as $, ref as v, computed as R, openBlock as i, createBlock as x, withCtx as l, createVNode as r, unref as n, createElementVNode as b, createElementBlock as B, Fragment as q, renderList as P, createTextVNode as u, toDisplayString as k, createCommentVNode as W } from "vue";
2
+ import h from "../HttpMethod/HttpMethod.vue.js";
3
+ import { useActiveEntities as j } from "../../store/active-entities.js";
4
+ import { ScalarDropdown as z, ScalarDropdownItem as I, ScalarButton as M, ScalarIcon as T } from "@scalar/components";
5
+ import { isDefined as U } from "@scalar/oas-utils/helpers";
6
+ import { useToasts as A } from "@scalar/use-toasts";
7
+ import { useRouter as F } from "vue-router";
8
+ import H from "./CommandActionForm.vue.js";
9
+ import L from "./CommandActionInput.vue.js";
10
+ import { useWorkspace as O } from "../../store/store.js";
11
+ const G = { class: "flex items-center gap-2" }, J = { class: "max-h-40 custom-scroll" }, me = /* @__PURE__ */ $({
11
12
  __name: "CommandPaletteExample",
12
13
  props: {
13
14
  metaData: {}
14
15
  },
15
16
  emits: ["close", "back"],
16
- setup(h, { emit: _ }) {
17
- var d;
18
- const w = h, c = _, { push: C } = P(), { activeRequest: E, activeWorkspace: S, activeWorkspaceRequests: D } = R(), { requests: n, requestExampleMutators: $ } = A(), { toast: g } = M(), r = f(""), l = f(
17
+ setup(_, { emit: w }) {
18
+ var f;
19
+ const C = _, c = w, { push: D } = F(), { activeRequest: E, activeWorkspace: S, activeWorkspaceRequests: g } = j(), { requests: s, requestExampleMutators: y } = O(), { toast: p } = A(), m = v(""), a = v(
19
20
  // Ensure we pre-select the correct request
20
- n[((d = w.metaData) == null ? void 0 : d.itemUid) ?? ""] ?? E.value
21
- ), p = (m) => l.value = m, q = () => {
22
- if (!r.value) {
23
- g("Please enter a name before creating an example.", "error");
21
+ s[((f = C.metaData) == null ? void 0 : f.itemUid) ?? ""] ?? E.value
22
+ ), d = (o) => a.value = o, N = () => {
23
+ var e;
24
+ if (!m.value) {
25
+ p("Please enter a name before creating an example.", "error");
24
26
  return;
25
27
  }
26
- const m = $.add(
27
- l.value,
28
- r.value
28
+ if (!a.value) {
29
+ p("Please select a request before creating an example.", "error");
30
+ return;
31
+ }
32
+ const o = y.add(
33
+ a.value,
34
+ m.value
29
35
  );
30
- m && (C(
31
- `/workspace/${S.value.uid}/request/${l.value.uid}/examples/${m.uid}`
36
+ o && (D(
37
+ `/workspace/${(e = S.value) == null ? void 0 : e.uid}/request/${a.value.uid}/examples/${o.uid}`
32
38
  ), c("close"));
33
- };
34
- return (m, t) => (u(), v(T, {
35
- disabled: !r.value.trim(),
36
- onSubmit: q
39
+ }, V = R(
40
+ () => g.value.map((o) => s == null ? void 0 : s[o]).filter(U)
41
+ );
42
+ return (o, e) => a.value ? (i(), x(H, {
43
+ key: 0,
44
+ disabled: !m.value.trim(),
45
+ onSubmit: N
37
46
  }, {
38
- options: o(() => [
39
- s(a(W), {
47
+ options: l(() => [
48
+ r(n(z), {
40
49
  placement: "bottom",
41
50
  resize: ""
42
51
  }, {
43
- items: o(() => [
44
- x("div", H, [
45
- (u(!0), N(V, null, B(a(D), (e) => (u(), v(a(j), {
46
- key: e,
52
+ items: l(() => [
53
+ b("div", J, [
54
+ (i(!0), B(q, null, P(V.value, (t) => (i(), x(n(I), {
55
+ key: t.uid,
47
56
  class: "flex h-7 w-full items-center justify-between px-1 pr-[26px]",
48
- onClick: (L) => p(a(n)[e])
57
+ onClick: (K) => d(t)
49
58
  }, {
50
- default: o(() => [
51
- i(b(a(n)[e].summary) + " ", 1),
52
- s(k, {
53
- method: a(n)[e].method
59
+ default: l(() => [
60
+ u(k(t.summary) + " ", 1),
61
+ r(h, {
62
+ method: t.method
54
63
  }, null, 8, ["method"])
55
64
  ]),
56
65
  _: 2
57
66
  }, 1032, ["onClick"]))), 128))
58
67
  ])
59
68
  ]),
60
- default: o(() => [
61
- s(a(z), {
69
+ default: l(() => [
70
+ r(n(M), {
62
71
  class: "justify-between p-2 max-h-8 w-full gap-1 text-xs hover:bg-b-2",
63
72
  variant: "outlined",
64
- onClick: t[2] || (t[2] = (e) => p(l.value))
73
+ onClick: e[2] || (e[2] = (t) => d(a.value))
65
74
  }, {
66
- default: o(() => [
67
- i(b(l.value.summary) + " ", 1),
68
- x("div", F, [
69
- s(k, {
70
- method: l.value.method
75
+ default: l(() => [
76
+ u(k(a.value.summary) + " ", 1),
77
+ b("div", G, [
78
+ r(h, {
79
+ method: a.value.method
71
80
  }, null, 8, ["method"]),
72
- s(a(I), {
81
+ r(n(T), {
73
82
  class: "text-c-3",
74
83
  icon: "ChevronDown",
75
84
  size: "md"
@@ -82,22 +91,22 @@ const F = { class: "flex items-center gap-2" }, H = { class: "max-h-40 custom-sc
82
91
  _: 1
83
92
  })
84
93
  ]),
85
- submit: o(() => t[3] || (t[3] = [
86
- i("Create Example")
94
+ submit: l(() => e[3] || (e[3] = [
95
+ u("Create Example")
87
96
  ])),
88
- default: o(() => [
89
- s(U, {
90
- modelValue: r.value,
91
- "onUpdate:modelValue": t[0] || (t[0] = (e) => r.value = e),
97
+ default: l(() => [
98
+ r(L, {
99
+ modelValue: m.value,
100
+ "onUpdate:modelValue": e[0] || (e[0] = (t) => m.value = t),
92
101
  label: "Example Name",
93
102
  placeholder: "Example Name",
94
- onOnDelete: t[1] || (t[1] = (e) => c("back", e))
103
+ onOnDelete: e[1] || (e[1] = (t) => c("back", t))
95
104
  }, null, 8, ["modelValue"])
96
105
  ]),
97
106
  _: 1
98
- }, 8, ["disabled"]));
107
+ }, 8, ["disabled"])) : W("", !0);
99
108
  }
100
109
  });
101
110
  export {
102
- te as default
111
+ me as default
103
112
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;AA2pBA,wBAOG"}
1
+ {"version":3,"file":"CommandPaletteImport.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CommandPalette/CommandPaletteImport.vue"],"names":[],"mappings":";;;;;;;AAiqBA,wBAOG"}