@scalar/api-client 2.23.4 → 2.24.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 (89) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/layouts/Modal/ApiClientModal.vue.d.ts.map +1 -1
  3. package/dist/layouts/Modal/ApiClientModal.vue.js +2 -2
  4. package/dist/style.css +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +8 -0
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  7. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +33 -29
  8. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +6 -0
  9. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  10. package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
  11. package/dist/v2/blocks/operation-block/components/Header.vue2.js +46 -29
  12. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  13. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts +15 -0
  14. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.d.ts.map +1 -0
  15. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue.js +125 -0
  16. package/dist/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue2.js +4 -0
  17. package/dist/v2/components/sidebar/SidebarMenu.vue.js +6 -6
  18. package/dist/v2/features/app/App.vue.d.ts +5 -0
  19. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  20. package/dist/v2/features/app/App.vue.js +89 -108
  21. package/dist/v2/features/app/app-state.d.ts +5 -7
  22. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  23. package/dist/v2/features/app/app-state.js +210 -205
  24. package/dist/v2/features/app/hooks/use-document-watcher.js +8 -8
  25. package/dist/v2/features/collection/components/Environment.vue.d.ts.map +1 -1
  26. package/dist/v2/features/collection/components/Environment.vue.js +12 -11
  27. package/dist/v2/features/collection/components/Settings.vue.d.ts.map +1 -1
  28. package/dist/v2/features/collection/components/Settings.vue.js +17 -25
  29. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts +1 -1
  30. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -1
  31. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js +115 -118
  32. package/dist/v2/features/{import-listener → command-palette}/helpers/generate-unique-slug.d.ts.map +1 -1
  33. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts +14 -4
  34. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts.map +1 -1
  35. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.js +5 -6
  36. package/dist/v2/features/{import-listener → command-palette}/helpers/import-document-to-workspace.d.ts.map +1 -1
  37. package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts +16 -0
  38. package/dist/v2/features/command-palette/helpers/load-document-from-source.d.ts.map +1 -0
  39. package/dist/v2/features/command-palette/helpers/load-document-from-source.js +34 -0
  40. package/dist/v2/features/command-palette/index.d.ts +4 -0
  41. package/dist/v2/features/command-palette/index.d.ts.map +1 -0
  42. package/dist/v2/features/command-palette/index.js +8 -0
  43. package/dist/v2/features/environments/EnvironmentsList.vue.d.ts +4 -0
  44. package/dist/v2/features/environments/EnvironmentsList.vue.d.ts.map +1 -1
  45. package/dist/v2/features/environments/EnvironmentsList.vue.js +29 -27
  46. package/dist/v2/features/environments/components/Environment.vue.d.ts +1 -0
  47. package/dist/v2/features/environments/components/Environment.vue.d.ts.map +1 -1
  48. package/dist/v2/features/environments/components/Environment.vue.js +37 -24
  49. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  50. package/dist/v2/features/modal/Modal.vue.js +2 -2
  51. package/dist/v2/features/modal/Modal.vue2.js +39 -38
  52. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  53. package/dist/v2/features/operation/Operation.vue.js +35 -26
  54. package/dist/v2/workspace-events.d.ts.map +1 -1
  55. package/dist/v2/workspace-events.js +7 -0
  56. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  57. package/package.json +15 -15
  58. package/dist/v2/features/import-listener/ImportListener.vue.d.ts +0 -52
  59. package/dist/v2/features/import-listener/ImportListener.vue.d.ts.map +0 -1
  60. package/dist/v2/features/import-listener/ImportListener.vue.js +0 -91
  61. package/dist/v2/features/import-listener/ImportListener.vue2.js +0 -4
  62. package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts +0 -7
  63. package/dist/v2/features/import-listener/components/DropEventListener.vue.d.ts.map +0 -1
  64. package/dist/v2/features/import-listener/components/DropEventListener.vue.js +0 -81
  65. package/dist/v2/features/import-listener/components/DropEventListener.vue2.js +0 -4
  66. package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts +0 -40
  67. package/dist/v2/features/import-listener/components/ImportModal.vue.d.ts.map +0 -1
  68. package/dist/v2/features/import-listener/components/ImportModal.vue.js +0 -170
  69. package/dist/v2/features/import-listener/components/ImportModal.vue3.js +0 -5
  70. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts +0 -29
  71. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.d.ts.map +0 -1
  72. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue.js +0 -83
  73. package/dist/v2/features/import-listener/components/WorkspaceSelector.vue2.js +0 -4
  74. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts +0 -8
  75. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.d.ts.map +0 -1
  76. package/dist/v2/features/import-listener/helpers/get-url-query-parameter.js +0 -4
  77. package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts +0 -15
  78. package/dist/v2/features/import-listener/helpers/load-document-from-source.d.ts.map +0 -1
  79. package/dist/v2/features/import-listener/helpers/load-document-from-source.js +0 -28
  80. package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts +0 -15
  81. package/dist/v2/features/import-listener/helpers/wait-for-condition.d.ts.map +0 -1
  82. package/dist/v2/features/import-listener/helpers/wait-for-condition.js +0 -16
  83. package/dist/v2/features/import-listener/index.d.ts +0 -2
  84. package/dist/v2/features/import-listener/index.d.ts.map +0 -1
  85. package/dist/v2/features/import-listener/index.js +0 -4
  86. /package/dist/v2/features/{import-listener → command-palette}/helpers/generate-unique-slug.d.ts +0 -0
  87. /package/dist/v2/features/{import-listener → command-palette}/helpers/generate-unique-slug.js +0 -0
  88. /package/dist/v2/features/{import-listener → command-palette}/helpers/import-document-to-workspace.d.ts +0 -0
  89. /package/dist/v2/features/{import-listener → command-palette}/helpers/import-document-to-workspace.js +0 -0
@@ -73,6 +73,10 @@ declare const _default: import("vue").DefineComponent<{
73
73
  securitySchemes: MergedSecuritySchemes;
74
74
  /** Client plugins */
75
75
  plugins: ClientPlugin[];
76
+ /** Environment list */
77
+ environments?: string[];
78
+ /** Currently selected environment */
79
+ activeEnvironment?: string;
76
80
  /** For environment variables in the inputs */
77
81
  environment: XScalarEnvironment;
78
82
  /** The proxy URL for sending requests */
@@ -128,6 +132,10 @@ declare const _default: import("vue").DefineComponent<{
128
132
  securitySchemes: MergedSecuritySchemes;
129
133
  /** Client plugins */
130
134
  plugins: ClientPlugin[];
135
+ /** Environment list */
136
+ environments?: string[];
137
+ /** Currently selected environment */
138
+ activeEnvironment?: string;
131
139
  /** For environment variables in the inputs */
132
140
  environment: XScalarEnvironment;
133
141
  /** The proxy URL for sending requests */
@@ -1 +1 @@
1
- {"version":3,"file":"OperationBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue"],"names":[],"mappings":"AAsYA,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAErF,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK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;IAC1B,kCAAkC;+BACP,gBAAgB,GAAG,SAAS;IACvD,qDAAqD;0BAC/B,OAAO;IAC7B,+DAA+D;gBACnD,MAAM;IAClB,2CAA2C;cACjC,QAAQ;IAClB,wCAAwC;qBACvB,qBAAqB;IACtC,qBAAqB;aACZ,YAAY,EAAE;IACvB,8CAA8C;iBACjC,kBAAkB;IAC/B,yCAAyC;cAC/B,MAAM;;;;IAnDhB,gBAAgB;cACN,iBAAiB;IAC3B,gCAAgC;sBACd,eAAe,CAAC,UAAU,CAAC;IAC7C,iCAAiC;8BACP,gBAAgB,GAAG,SAAS;IACtD,0BAA0B;gBACd,MAAM;IAClB,iCAAiC;mBAClB,oBAAoB,EAAE;IACrC,2BAA2B;UACrB,MAAM;IACZ,6BAA6B;YACrB,cAAc;IACtB,mBAAmB;iBACN,gBAAgB;IAC7B,oCAAoC;cAC1B,YAAY,EAAE;IACxB,oBAAoB;YACZ,YAAY;IACpB,gCAAgC;YACxB,YAAY,GAAG,IAAI;IAC3B,gCAAgC;oBAChB,cAAc,CAAC,WAAW,CAAC,CAAC,yBAAyB,CAAC;IACtE,mDAAmD;aAC1C,YAAY,EAAE;IACvB,4CAA4C;uBACzB,OAAO;IAC1B,0BAA0B;kBACZ,MAAM,GAAG,IAAI;IAC3B,mEAAmE;kBACrD,MAAM;IACpB,oBAAoB;aACX,SAAS,GAAG,eAAe;IACpC,uBAAuB;eACZ,eAAe;IAC1B,kCAAkC;+BACP,gBAAgB,GAAG,SAAS;IACvD,qDAAqD;0BAC/B,OAAO;IAC7B,+DAA+D;gBACnD,MAAM;IAClB,2CAA2C;cACjC,QAAQ;IAClB,wCAAwC;qBACvB,qBAAqB;IACtC,qBAAqB;aACZ,YAAY,EAAE;IACvB,8CAA8C;iBACjC,kBAAkB;IAC/B,yCAAyC;cAC/B,MAAM;;;;AArDlB,wBA4dC"}
1
+ {"version":3,"file":"OperationBlock.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/operation-block/OperationBlock.vue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C7B,+DAA+D;gBACnD,MAAM;IAClB,2CAA2C;cACjC,QAAQ;IAClB,wCAAwC;qBACvB,qBAAqB;IACtC,qBAAqB;aACZ,YAAY,EAAE;IACvB,uBAAuB;mBACR,MAAM,EAAE;IACvB,qCAAqC;wBACjB,MAAM;IAC1B,8CAA8C;iBACjC,kBAAkB;IAC/B,yCAAyC;cAC/B,MAAM;;;;AAzDlB,wBAseC"}
@@ -1,4 +1,4 @@
1
- import { defineComponent as E, computed as u, ref as m, onMounted as K, onBeforeUnmount as g, watch as O, createElementBlock as V, openBlock as w, createElementVNode as T, createVNode as a, withCtx as x, unref as B } from "vue";
1
+ import { defineComponent as b, computed as a, ref as c, onMounted as K, onBeforeUnmount as g, watch as O, createElementBlock as V, openBlock as w, createElementVNode as T, createVNode as l, withCtx as x, unref as B } from "vue";
2
2
  import { AVAILABLE_CLIENTS as I } from "@scalar/types/snippetz";
3
3
  import { useToasts as M } from "@scalar/use-toasts";
4
4
  import A from "../../../components/ViewLayout/ViewLayout.vue.js";
@@ -17,7 +17,7 @@ import J from "../request-block/RequestBlock.vue.js";
17
17
  import W from "../response-block/ResponseBlock.vue.js";
18
18
  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
19
  name: "OperationBlock"
20
- }, ve = /* @__PURE__ */ E({
20
+ }, ye = /* @__PURE__ */ b({
21
21
  ...Z,
22
22
  props: {
23
23
  eventBus: {},
@@ -44,23 +44,25 @@ const X = { class: "bg-b-1 flex h-full flex-col" }, Y = { class: "lg:min-h-heade
44
44
  authMeta: {},
45
45
  securitySchemes: {},
46
46
  plugins: { default: () => [] },
47
+ environments: {},
48
+ activeEnvironment: {},
47
49
  environment: {},
48
50
  proxyUrl: {}
49
51
  },
50
52
  emits: ["update:servers"],
51
53
  setup(e, { emit: q }) {
52
- const R = q, C = u(() => Q(e.httpClients)), d = u(
54
+ const R = q, C = a(() => Q(e.httpClients)), d = a(
53
55
  () => z(e.documentSecurity, e.operation.security)
54
- ), h = u(
56
+ ), h = a(
55
57
  () => G(
56
58
  e.documentSelectedSecurity,
57
59
  e.operationSelectedSecurity,
58
60
  d.value,
59
61
  e.setOperationSecurity
60
62
  )
61
- ), y = u(
63
+ ), v = a(
62
64
  () => H(e.securitySchemes, h.value.selectedSchemes)
63
- ), { toast: v } = M(), f = m(null), l = m(null), i = m(null), s = () => f.value?.abort(N.REQUEST_ABORTED), c = async () => {
65
+ ), { toast: y } = M(), f = c(null), i = c(null), u = c(null), s = () => f.value?.abort(N.REQUEST_ABORTED), m = async () => {
64
66
  const [t, n] = P({
65
67
  environment: e.environment,
66
68
  exampleKey: e.exampleKey,
@@ -68,15 +70,15 @@ const X = { class: "bg-b-1 flex h-full flex-col" }, Y = { class: "lg:min-h-heade
68
70
  method: e.method,
69
71
  operation: e.operation,
70
72
  path: e.path,
71
- selectedSecuritySchemes: y.value,
73
+ selectedSecuritySchemes: v.value,
72
74
  server: e.server,
73
75
  proxyUrl: e.proxyUrl
74
76
  });
75
77
  if (t) {
76
- v(t.message, "error");
78
+ y(t.message, "error");
77
79
  return;
78
80
  }
79
- f.value = n.controller, l.value && "reader" in l.value && l.value.reader.cancel(), e.eventBus.emit("hooks:on:request:sent", {
81
+ f.value = n.controller, i.value && "reader" in i.value && i.value.reader.cancel(), e.eventBus.emit("hooks:on:request:sent", {
80
82
  meta: {
81
83
  method: e.method,
82
84
  path: e.path,
@@ -102,17 +104,17 @@ const X = { class: "bg-b-1 flex h-full flex-col" }, Y = { class: "lg:min-h-heade
102
104
  exampleKey: e.exampleKey
103
105
  }
104
106
  }), o) {
105
- v(o.message, "error");
107
+ y(o.message, "error");
106
108
  return;
107
109
  }
108
- l.value = r.response, i.value = r.request;
110
+ i.value = r.response, u.value = r.request;
109
111
  };
110
112
  K(() => {
111
- e.eventBus.on("operation:send:request:hotkey", c), e.eventBus.on("operation:cancel:request", s);
113
+ e.eventBus.on("operation:send:request:hotkey", m), e.eventBus.on("operation:cancel:request", s);
112
114
  }), g(() => {
113
- e.eventBus.off("operation:send:request:hotkey", c), e.eventBus.off("operation:cancel:request", s);
115
+ e.eventBus.off("operation:send:request:hotkey", m), e.eventBus.off("operation:cancel:request", s);
114
116
  });
115
- const S = u(
117
+ const S = a(
116
118
  () => e.history.map((t) => ({
117
119
  method: t.request.method,
118
120
  path: t.request.url,
@@ -126,16 +128,16 @@ const X = { class: "bg-b-1 flex h-full flex-col" }, Y = { class: "lg:min-h-heade
126
128
  const r = () => e.eventBus.emit("ui:route:example", {
127
129
  exampleName: "draft",
128
130
  callback: async () => {
129
- const U = $({
131
+ const E = $({
130
132
  harResponse: o.response,
131
133
  url: o.request.url,
132
134
  method: e.method,
133
135
  path: e.path,
134
136
  duration: o.time
135
- }), b = F({
137
+ }), U = F({
136
138
  harRequest: o.request
137
139
  });
138
- l.value = U, i.value = b;
140
+ i.value = E, u.value = U;
139
141
  }
140
142
  });
141
143
  e.eventBus.emit("operation:reload:history", {
@@ -148,14 +150,16 @@ const X = { class: "bg-b-1 flex h-full flex-col" }, Y = { class: "lg:min-h-heade
148
150
  });
149
151
  };
150
152
  return O([() => e.path, () => e.method, () => e.exampleKey], () => {
151
- l.value = null, i.value = null, s();
153
+ i.value = null, u.value = null, s();
152
154
  }), g(() => {
153
155
  s();
154
156
  }), (t, n) => (w(), V("div", X, [
155
157
  T("div", Y, [
156
- a(D, {
158
+ l(D, {
159
+ activeEnvironment: e.activeEnvironment,
157
160
  documentUrl: e.documentUrl,
158
161
  environment: e.environment,
162
+ environments: e.environments,
159
163
  eventBus: e.eventBus,
160
164
  hideClientButton: e.hideClientButton,
161
165
  history: S.value,
@@ -166,16 +170,16 @@ const X = { class: "bg-b-1 flex h-full flex-col" }, Y = { class: "lg:min-h-heade
166
170
  server: e.server,
167
171
  servers: e.servers,
168
172
  source: e.source,
169
- onExecute: c,
173
+ onExecute: m,
170
174
  "onSelect:history:item": k,
171
175
  "onUpdate:servers": n[0] || (n[0] = (o) => R("update:servers"))
172
- }, null, 8, ["documentUrl", "environment", "eventBus", "hideClientButton", "history", "integration", "layout", "method", "path", "server", "servers", "source"])
176
+ }, null, 8, ["activeEnvironment", "documentUrl", "environment", "environments", "eventBus", "hideClientButton", "history", "integration", "layout", "method", "path", "server", "servers", "source"])
173
177
  ]),
174
- a(A, { class: "border-t" }, {
178
+ l(A, { class: "border-t" }, {
175
179
  default: x(() => [
176
- a(L, { class: "flex-1" }, {
180
+ l(L, { class: "flex-1" }, {
177
181
  default: x(() => [
178
- a(B(J), {
182
+ l(B(J), {
179
183
  authMeta: e.authMeta,
180
184
  clientOptions: C.value,
181
185
  environment: e.environment,
@@ -192,16 +196,16 @@ const X = { class: "bg-b-1 flex h-full flex-col" }, Y = { class: "lg:min-h-heade
192
196
  securitySchemes: e.securitySchemes,
193
197
  selectedClient: e.selectedClient,
194
198
  selectedSecurity: h.value,
195
- selectedSecuritySchemes: y.value,
199
+ selectedSecuritySchemes: v.value,
196
200
  server: e.server
197
201
  }, null, 8, ["authMeta", "clientOptions", "environment", "eventBus", "exampleKey", "globalCookies", "layout", "method", "operation", "path", "plugins", "proxyUrl", "securityRequirements", "securitySchemes", "selectedClient", "selectedSecurity", "selectedSecuritySchemes", "server"]),
198
- a(B(W), {
202
+ l(B(W), {
199
203
  appVersion: e.appVersion,
200
204
  eventBus: e.eventBus,
201
205
  layout: e.layout,
202
206
  plugins: e.plugins,
203
- request: i.value,
204
- response: l.value,
207
+ request: u.value,
208
+ response: i.value,
205
209
  totalPerformedRequests: S.value.length
206
210
  }, null, 8, ["appVersion", "eventBus", "layout", "plugins", "request", "response", "totalPerformedRequests"])
207
211
  ]),
@@ -214,5 +218,5 @@ const X = { class: "bg-b-1 flex h-full flex-col" }, Y = { class: "lg:min-h-heade
214
218
  }
215
219
  });
216
220
  export {
217
- ve as default
221
+ ye as default
218
222
  };
@@ -27,6 +27,10 @@ type __VLS_Props = {
27
27
  history: History[];
28
28
  /** Event bus */
29
29
  eventBus: WorkspaceEventBus;
30
+ /** Environment list */
31
+ environments?: string[];
32
+ /** Currently selected environment */
33
+ activeEnvironment?: string;
30
34
  /** Environment variables */
31
35
  environment: XScalarEnvironment;
32
36
  };
@@ -36,12 +40,14 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
36
40
  "select:history:item": (payload: {
37
41
  index: number;
38
42
  }) => any;
43
+ "add:environment": () => any;
39
44
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
40
45
  onExecute?: (() => any) | undefined;
41
46
  "onUpdate:servers"?: (() => any) | undefined;
42
47
  "onSelect:history:item"?: ((payload: {
43
48
  index: number;
44
49
  }) => any) | undefined;
50
+ "onAdd:environment"?: (() => any) | undefined;
45
51
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
46
52
  export default _default;
47
53
  //# sourceMappingURL=Header.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Header.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/operation-block/components/Header.vue"],"names":[],"mappings":"AAsIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAE/E,KAAK,WAAW,GAAG;IACjB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,MAAM,EAAE,UAAU,CAAA;IAClB,oBAAoB;IACpB,MAAM,EAAE,YAAY,CAAA;IACpB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC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mE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oBAAoB;IACpB,MAAM,CAAC,EAAE,SAAS,GAAG,eAAe,CAAA;IACpC,gCAAgC;IAChC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,mDAAmD;IACnD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,8BAA8B;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,gBAAgB;IAChB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,uBAAuB;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,4BAA4B;IAC5B,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;;;;;eAO6C,MAAM;;;;;;;eAAN,MAAM;;;;AAuQrD,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./Header.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-43c7b0fc"]]);
4
+ const d = /* @__PURE__ */ r(o, [["__scopeId", "data-v-1de95fda"]]);
5
5
  export {
6
- e as default
6
+ d as default
7
7
  };
@@ -1,8 +1,9 @@
1
- import { defineComponent as c, createElementBlock as s, openBlock as l, createElementVNode as o, createVNode as u, unref as i, createBlock as v, createCommentVNode as m } from "vue";
2
- import { ScalarIcon as a } from "@scalar/components";
3
- import f from "../../scalar-address-bar-block/components/AddressBar.vue.js";
4
- import y from "../../../../components/OpenApiClientButton.vue.js";
5
- const g = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap items-center justify-center p-2 pt-2 lg:p-1 lg:pt-1" }, x = { class: "mb-2 flex w-1/2 flex-row items-center justify-end gap-1 lg:mb-0 lg:flex-1 lg:px-2.5" }, w = /* @__PURE__ */ c({
1
+ import { defineComponent as g, createElementBlock as s, openBlock as o, createElementVNode as i, createVNode as u, unref as l, createBlock as a, createCommentVNode as m } from "vue";
2
+ import { ScalarIcon as d } from "@scalar/components";
3
+ import x from "../../scalar-address-bar-block/components/EnvironmentSelector.vue.js";
4
+ import B from "../../scalar-address-bar-block/components/AddressBar.vue.js";
5
+ import k from "../../../../components/OpenApiClientButton.vue.js";
6
+ const b = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap items-center justify-center p-2 pt-2 lg:p-1 lg:pt-1" }, C = { class: "mb-2 flex w-1/2 flex-row items-center justify-end gap-2 lg:mb-0 lg:flex-1 lg:px-2.5" }, A = /* @__PURE__ */ g({
6
7
  __name: "Header",
7
8
  props: {
8
9
  path: {},
@@ -16,17 +17,25 @@ const g = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap i
16
17
  servers: {},
17
18
  history: {},
18
19
  eventBus: {},
20
+ environments: {},
21
+ activeEnvironment: {},
19
22
  environment: {}
20
23
  },
21
- emits: ["execute", "update:servers", "select:history:item"],
22
- setup(e, { emit: d }) {
23
- const r = d;
24
- return (b, t) => (l(), s("div", g, [
25
- t[7] || (t[7] = o("div", { class: "mb-2 flex w-1/2 flex-row items-center gap-1 lg:mb-0 lg:flex-1 lg:px-1" }, [
26
- o("div", { class: "size-8" })
24
+ emits: ["execute", "update:servers", "select:history:item", "add:environment"],
25
+ setup(e, { emit: c }) {
26
+ const r = c, f = (v) => {
27
+ e.eventBus.emit("workspace:update:active-environment", v);
28
+ }, y = () => {
29
+ e.eventBus.emit("ui:route:page", { name: "workspace.environment" });
30
+ };
31
+ return (v, t) => (o(), s("div", b, [
32
+ t[8] || (t[8] = i("div", { class: "mb-2 flex w-1/2 flex-row items-center gap-1 lg:mb-0 lg:flex-1 lg:px-1" }, [
33
+ i("div", { class: "size-8" })
27
34
  ], -1)),
28
- u(i(f), {
35
+ u(l(B), {
36
+ activeEnvironment: e.activeEnvironment,
29
37
  environment: e.environment,
38
+ environments: e.environments,
30
39
  eventBus: e.eventBus,
31
40
  history: e.history,
32
41
  layout: e.layout,
@@ -34,49 +43,57 @@ const g = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap i
34
43
  path: e.path,
35
44
  server: e.server,
36
45
  servers: e.servers,
37
- onExecute: t[0] || (t[0] = (n) => r("execute")),
38
- "onSelect:history:item": t[1] || (t[1] = (n) => r("select:history:item", n)),
39
- "onUpdate:servers": t[2] || (t[2] = (n) => r("update:servers"))
40
- }, null, 8, ["environment", "eventBus", "history", "layout", "method", "path", "server", "servers"]),
41
- o("div", x, [
42
- e.layout === "modal" && e.documentUrl && !e.hideClientButton ? (l(), v(i(y), {
46
+ "onAdd:environment": t[0] || (t[0] = (n) => r("add:environment")),
47
+ onExecute: t[1] || (t[1] = (n) => r("execute")),
48
+ "onSelect:history:item": t[2] || (t[2] = (n) => r("select:history:item", n)),
49
+ "onUpdate:servers": t[3] || (t[3] = (n) => r("update:servers"))
50
+ }, null, 8, ["activeEnvironment", "environment", "environments", "eventBus", "history", "layout", "method", "path", "server", "servers"]),
51
+ i("div", C, [
52
+ e.layout !== "modal" ? (o(), a(x, {
43
53
  key: 0,
54
+ activeEnvironment: e.activeEnvironment,
55
+ environments: e.environments,
56
+ "onAdd:environment": y,
57
+ "onSelect:environment": f
58
+ }, null, 8, ["activeEnvironment", "environments"])) : m("", !0),
59
+ e.layout === "modal" && e.documentUrl && !e.hideClientButton ? (o(), a(l(k), {
60
+ key: 1,
44
61
  buttonSource: "modal",
45
62
  class: "!w-fit lg:-mr-1",
46
63
  integration: e.integration ?? null,
47
64
  source: e.source ?? "api-reference",
48
65
  url: e.documentUrl
49
66
  }, null, 8, ["integration", "source", "url"])) : m("", !0),
50
- e.layout === "modal" && e.source !== "gitbook" ? (l(), s("button", {
51
- key: 1,
67
+ e.layout === "modal" && e.source !== "gitbook" ? (o(), s("button", {
68
+ key: 2,
52
69
  class: "app-exit-button zoomed:static zoomed:p-1 fixed top-2 right-2 rounded-full p-2",
53
70
  type: "button",
54
- onClick: t[3] || (t[3] = (n) => e.eventBus.emit("ui:close:client-modal"))
71
+ onClick: t[4] || (t[4] = (n) => e.eventBus.emit("ui:close:client-modal"))
55
72
  }, [
56
- u(i(a), {
73
+ u(l(d), {
57
74
  icon: "Close",
58
75
  size: "lg",
59
76
  thickness: "2"
60
77
  }),
61
- t[5] || (t[5] = o("span", { class: "sr-only" }, "Close Client", -1))
78
+ t[6] || (t[6] = i("span", { class: "sr-only" }, "Close Client", -1))
62
79
  ])) : m("", !0),
63
- e.layout === "modal" && e.source === "gitbook" ? (l(), s("button", {
64
- key: 2,
80
+ e.layout === "modal" && e.source === "gitbook" ? (o(), s("button", {
81
+ key: 3,
65
82
  class: "text-c-1 hover:bg-b-2 active:text-c-1 -mr-1.5 rounded p-2",
66
83
  type: "button",
67
- onClick: t[4] || (t[4] = (n) => e.eventBus.emit("ui:close:client-modal"))
84
+ onClick: t[5] || (t[5] = (n) => e.eventBus.emit("ui:close:client-modal"))
68
85
  }, [
69
- u(i(a), {
86
+ u(l(d), {
70
87
  icon: "Close",
71
88
  size: "md",
72
89
  thickness: "1.75"
73
90
  }),
74
- t[6] || (t[6] = o("span", { class: "sr-only" }, "Close Client", -1))
91
+ t[7] || (t[7] = i("span", { class: "sr-only" }, "Close Client", -1))
75
92
  ])) : m("", !0)
76
93
  ])
77
94
  ]));
78
95
  }
79
96
  });
80
97
  export {
81
- w as default
98
+ A as default
82
99
  };
@@ -1,7 +1,7 @@
1
1
  import { canMethodHaveBody as p } from "@scalar/helpers/http/can-method-have-body";
2
2
  import { getResolvedRef as n } from "@scalar/workspace-store/helpers/get-resolved-ref";
3
3
  import { isElectron as u } from "../../../../libs/electron.js";
4
- const i = "2.23.4", m = "application/json", h = "*/*", c = (r, t, o) => ({
4
+ const i = "2.24.0", m = "application/json", h = "*/*", c = (r, t, o) => ({
5
5
  name: r,
6
6
  defaultValue: t,
7
7
  isOverridden: o.has(r.toLowerCase())
@@ -0,0 +1,15 @@
1
+ type __VLS_Props = {
2
+ /** List of available environments */
3
+ environments?: string[];
4
+ /** Currently selected environment */
5
+ activeEnvironment?: string;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
8
+ "select:environment": (environmentName: string) => any;
9
+ "add:environment": () => any;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ "onSelect:environment"?: ((environmentName: string) => any) | undefined;
12
+ "onAdd:environment"?: (() => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ export default _default;
15
+ //# sourceMappingURL=EnvironmentSelector.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EnvironmentSelector.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-address-bar-block/components/EnvironmentSelector.vue"],"names":[],"mappings":"AAyLA,KAAK,WAAW,GAAG;IACjB,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAC;;;;;;;;AA6YF,wBAOG"}
@@ -0,0 +1,125 @@
1
+ import { defineComponent as z, computed as v, createElementBlock as m, openBlock as n, createCommentVNode as d, createVNode as s, unref as e, withCtx as c, normalizeClass as f, createElementVNode as t, toDisplayString as p, createBlock as x, withModifiers as g, Fragment as D, renderList as A } from "vue";
2
+ import { ScalarDropdown as j, ScalarButton as B, ScalarIcon as u, ScalarDropdownItem as h, ScalarDropdownDivider as y } from "@scalar/components";
3
+ const I = { class: "relative flex items-center" }, V = {
4
+ key: 0,
5
+ "aria-hidden": "true",
6
+ class: "bg-c-accent absolute -top-0.5 -left-0.5 size-2 rounded-full",
7
+ title: "Environment active"
8
+ }, $ = { class: "flex items-center gap-1.5" }, L = { class: "text-xxs line-clamp-1 max-w-[120px] text-left font-medium" }, N = { class: "overflow-hidden text-ellipsis" }, F = { class: "flex h-4 w-4 items-center justify-center" }, G = {
9
+ key: 3,
10
+ class: "text-c-3 px-2 py-1.5 text-xs"
11
+ }, T = /* @__PURE__ */ z({
12
+ __name: "EnvironmentSelector",
13
+ props: {
14
+ environments: { default: () => [] },
15
+ activeEnvironment: {}
16
+ },
17
+ emits: ["select:environment", "add:environment"],
18
+ setup(a, { emit: C }) {
19
+ const b = C, r = v(() => !!a.activeEnvironment), l = v(() => a.environments.length > 0), k = v(() => r.value ? a.activeEnvironment : l.value ? "Select Environment" : "Add Environment"), S = v(() => r.value ? "bg-c-accent/10 text-c-accent hover:bg-c-accent/20 border-c-accent/30" : l.value ? "hover:bg-b-2 text-c-2 border-transparent" : "hover:bg-b-2 text-c-3 border-transparent"), _ = () => {
20
+ b("add:environment");
21
+ }, w = (E) => {
22
+ b("select:environment", E);
23
+ };
24
+ return (E, i) => (n(), m("div", I, [
25
+ r.value ? (n(), m("div", V)) : d("", !0),
26
+ s(e(j), null, {
27
+ items: c(() => [
28
+ r.value ? (n(), x(e(h), {
29
+ key: 0,
30
+ class: "group/item flex w-full items-center gap-1.5",
31
+ onClick: i[0] || (i[0] = g((o) => w(""), ["stop"]))
32
+ }, {
33
+ default: c(() => [
34
+ t("div", {
35
+ class: f([
36
+ "flex h-4 w-4 items-center justify-center rounded-full p-[3px]",
37
+ a.activeEnvironment ? "shadow-border text-transparent" : "bg-c-accent text-b-1"
38
+ ])
39
+ }, [
40
+ s(e(u), {
41
+ class: "size-2.5",
42
+ icon: "Checkmark",
43
+ thickness: "3"
44
+ })
45
+ ], 2),
46
+ i[1] || (i[1] = t("span", { class: "text-c-2" }, "No Environment", -1))
47
+ ]),
48
+ _: 1
49
+ })) : d("", !0),
50
+ r.value && l.value ? (n(), x(e(y), { key: 1 })) : d("", !0),
51
+ (n(!0), m(D, null, A(a.environments, (o) => (n(), x(e(h), {
52
+ key: o,
53
+ class: "group/item flex w-full items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap",
54
+ onClick: g((M) => w(o), ["stop"])
55
+ }, {
56
+ default: c(() => [
57
+ t("div", {
58
+ class: f([
59
+ "flex h-4 w-4 items-center justify-center rounded-full p-[3px]",
60
+ a.activeEnvironment === o ? "bg-c-accent text-b-1" : "shadow-border text-transparent"
61
+ ])
62
+ }, [
63
+ s(e(u), {
64
+ class: "size-2.5",
65
+ icon: "Checkmark",
66
+ thickness: "3"
67
+ })
68
+ ], 2),
69
+ t("span", N, p(o), 1)
70
+ ]),
71
+ _: 2
72
+ }, 1032, ["onClick"]))), 128)),
73
+ l.value ? (n(), x(e(y), { key: 2 })) : d("", !0),
74
+ s(e(h), {
75
+ class: "text-c-accent flex items-center gap-1.5",
76
+ onClick: _
77
+ }, {
78
+ default: c(() => [
79
+ t("div", F, [
80
+ s(e(u), {
81
+ icon: "Add",
82
+ size: "sm"
83
+ })
84
+ ]),
85
+ t("span", null, p(l.value ? "New Environment" : "Create Environment"), 1)
86
+ ]),
87
+ _: 1
88
+ }),
89
+ !l.value && !r.value ? (n(), m("div", G, [...i[2] || (i[2] = [
90
+ t("p", { class: "mb-1" }, " Environments let you manage variables like API keys and base URLs across different contexts. ", -1)
91
+ ])])) : d("", !0)
92
+ ]),
93
+ default: c(() => [
94
+ s(e(B), {
95
+ "aria-label": `Current environment: ${k.value}`,
96
+ class: f(["line-clamp-1 h-full w-fit justify-start border px-2 py-1 font-normal transition-colors", S.value]),
97
+ size: "sm",
98
+ variant: "ghost"
99
+ }, {
100
+ default: c(() => [
101
+ t("div", $, [
102
+ s(e(u), {
103
+ class: f(["shrink-0", r.value ? "text-c-accent" : "text-c-3"]),
104
+ icon: "Globe",
105
+ size: "sm"
106
+ }, null, 8, ["class"]),
107
+ t("span", L, p(k.value), 1),
108
+ s(e(u), {
109
+ class: "shrink-0",
110
+ icon: "ChevronDown",
111
+ size: "xs"
112
+ })
113
+ ])
114
+ ]),
115
+ _: 1
116
+ }, 8, ["aria-label", "class"])
117
+ ]),
118
+ _: 1
119
+ })
120
+ ]));
121
+ }
122
+ });
123
+ export {
124
+ T as default
125
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./EnvironmentSelector.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -9,8 +9,8 @@ const L = /* @__PURE__ */ p({
9
9
  workspaces: {}
10
10
  },
11
11
  emits: ["create:workspace", "select:workspace"],
12
- setup(a, { emit: i }) {
13
- const n = i;
12
+ setup(n, { emit: i }) {
13
+ const a = i;
14
14
  return (c, e) => (k(), u(o(S), null, {
15
15
  products: t(() => [...e[2] || (e[2] = [])]),
16
16
  sections: t(({ close: l }) => [
@@ -18,10 +18,10 @@ const L = /* @__PURE__ */ p({
18
18
  default: t(() => [
19
19
  m(c.$slots, "sidebarMenuActions", {}, () => [
20
20
  r(o(w), {
21
- modelValue: a.activeWorkspace.id,
22
- workspaceOptions: a.workspaces,
23
- onCreateWorkspace: e[0] || (e[0] = (s) => n("create:workspace")),
24
- "onUpdate:modelValue": e[1] || (e[1] = (s) => n("select:workspace", s))
21
+ modelValue: n.activeWorkspace.id,
22
+ workspaceOptions: [{ options: n.workspaces }],
23
+ onCreateWorkspace: e[0] || (e[0] = (s) => a("create:workspace")),
24
+ "onUpdate:modelValue": e[1] || (e[1] = (s) => a("select:workspace", s))
25
25
  }, null, 8, ["modelValue", "workspaceOptions"]),
26
26
  r(o(M), {
27
27
  is: o(v),
@@ -25,6 +25,11 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
25
25
  * This slot is used to render custom actions or components within the actions section.
26
26
  */
27
27
  'sidebar-menu-actions': [];
28
+ /**
29
+ * Slot for customizing the create workspace modal.
30
+ * This slot is used to render custom actions or components within the create workspace modal.
31
+ */
32
+ 'create-workspace'?: () => unknown;
28
33
  }>;
29
34
  export default _default;
30
35
  type __VLS_WithSlots<T, S> = T & {
@@ -1 +1 @@
1
- {"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/features/app/App.vue"],"names":[],"mappings":"AA2QA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGxD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