@scalar/api-client 2.19.0 → 2.19.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 (29) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/style.css +1 -1
  3. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +12 -12
  4. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts.map +1 -1
  5. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js +44 -47
  6. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts +4 -22
  7. package/dist/v2/blocks/request-block/components/RequestParams.vue.d.ts.map +1 -1
  8. package/dist/v2/blocks/request-block/components/RequestParams.vue.js +30 -28
  9. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +10 -20
  10. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  11. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +2 -2
  12. package/dist/v2/blocks/request-block/components/RequestTable.vue2.js +31 -40
  13. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts +4 -12
  14. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.d.ts.map +1 -1
  15. package/dist/v2/blocks/request-block/helpers/create-parameter-handlers.js +27 -44
  16. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  17. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +0 -2
  18. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  19. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +19 -20
  20. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts +25 -14
  21. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.d.ts.map +1 -1
  22. package/dist/v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js +65 -45
  23. package/dist/v2/features/app/app-events.d.ts.map +1 -1
  24. package/dist/v2/features/app/app-events.js +24 -27
  25. package/dist/v2/features/operation/Operation.vue.js +1 -1
  26. package/dist/v2/workspace-events.d.ts.map +1 -1
  27. package/dist/v2/workspace-events.js +7 -10
  28. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  29. package/package.json +17 -17
@@ -2,7 +2,7 @@ import { isDefined as v } from "@scalar/helpers/array/is-defined";
2
2
  import { getRaw as E } from "@scalar/json-magic/magic-proxy";
3
3
  import { getResolvedRef as m } from "@scalar/workspace-store/helpers/get-resolved-ref";
4
4
  import { unpackOverridesProxy as N } from "@scalar/workspace-store/helpers/overrides-proxy";
5
- const D = 10, P = 10, M = "propertyName*", j = (/* @__PURE__ */ new Date()).toISOString(), q = j.split("T")[0], k = j.split("T")[1].split(".")[0], C = {
5
+ const D = 10, P = 10, M = "additionalProperty", j = (/* @__PURE__ */ new Date()).toISOString(), q = j.split("T")[0], k = j.split("T")[1].split(".")[0], I = {
6
6
  "date-time": j,
7
7
  date: q,
8
8
  email: "hello@example.com",
@@ -29,7 +29,7 @@ const D = 10, P = 10, M = "propertyName*", j = (/* @__PURE__ */ new Date()).toIS
29
29
  uri: "https://example.com",
30
30
  uuid: "123e4567-e89b-12d3-a456-426614174000",
31
31
  "object-id": "6592008029c8c3e4dc76256c"
32
- }, R = (t, i = !1, o = "") => "type" in t && t.type === "string" && "format" in t && t.format === "binary" ? "@filename" : i && "format" in t && t.format ? C[t.format] ?? o : o, A = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), I = (t) => {
32
+ }, w = (t, i = !1, o = "") => "type" in t && t.type === "string" && "format" in t && t.format === "binary" ? "@filename" : i && "format" in t && t.format ? I[t.format] ?? o : o, A = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), _ = (t) => {
33
33
  if (!t)
34
34
  return;
35
35
  const i = S.get(t);
@@ -47,14 +47,14 @@ const D = 10, P = 10, M = "propertyName*", j = (/* @__PURE__ */ new Date()).toIS
47
47
  return i;
48
48
  const l = E(N(t)), d = A.get(l) ?? /* @__PURE__ */ new Map();
49
49
  return d && d.set(o, i), A.set(l, d), i;
50
- }, _ = (t) => !!(t.allOf || t.oneOf || t.anyOf), F = (t, i, o, l) => {
50
+ }, C = (t) => !!(t.allOf || t.oneOf || t.anyOf), F = (t, i, o, l) => {
51
51
  if (t.deprecated || l?.mode === "write" && t.readOnly || l?.mode === "read" && t.writeOnly)
52
52
  return !0;
53
- if (l?.omitEmptyAndOptionalProperties !== !0 || "type" in t && (t.type === "object" || t.type === "array") || _(t) || "examples" in t && Array.isArray(t.examples) && t.examples.length > 0 || "example" in t && t.example !== void 0 || "default" in t && t.default !== void 0 || "const" in t && t.const !== void 0 || "enum" in t && Array.isArray(t.enum) && t.enum.length > 0)
53
+ if (l?.omitEmptyAndOptionalProperties !== !0 || "type" in t && (t.type === "object" || t.type === "array") || C(t) || "examples" in t && Array.isArray(t.examples) && t.examples.length > 0 || "example" in t && t.example !== void 0 || "default" in t && t.default !== void 0 || "const" in t && t.const !== void 0 || "enum" in t && Array.isArray(t.enum) && t.enum.length > 0)
54
54
  return !1;
55
- const r = o ?? t.title ?? "", e = I(i);
55
+ const r = o ?? t.title ?? "", e = _(i);
56
56
  return !(e ? e.has(r) : !1);
57
- }, w = (t, i) => Array.isArray(t) && Array.isArray(i) ? [...t, ...i] : t && typeof t == "object" && i && typeof i == "object" ? { ...t, ...i } : i, L = (t, i, o, l, d) => {
57
+ }, R = (t, i) => Array.isArray(t) && Array.isArray(i) ? [...t, ...i] : t && typeof t == "object" && i && typeof i == "object" ? { ...t, ...i } : i, L = (t, i, o, l, d) => {
58
58
  const r = {};
59
59
  if ("properties" in t && t.properties) {
60
60
  const e = Object.keys(t.properties), n = o > 3 ? Math.min(P, e.length) : e.length;
@@ -83,7 +83,7 @@ const D = 10, P = 10, M = "propertyName*", j = (/* @__PURE__ */ new Date()).toIS
83
83
  }));
84
84
  }
85
85
  if ("additionalProperties" in t && t.additionalProperties) {
86
- const e = m(t.additionalProperties), n = t.additionalProperties === !0 || typeof t.additionalProperties == "object" && Object.keys(t.additionalProperties).length === 0, p = typeof e == "object" && "x-additionalPropertiesName" in e && typeof e["x-additionalPropertiesName"] == "string" && e["x-additionalPropertiesName"].trim().length > 0 ? `${e["x-additionalPropertiesName"].trim()}*` : M;
86
+ const e = m(t.additionalProperties), n = t.additionalProperties === !0 || typeof t.additionalProperties == "object" && Object.keys(t.additionalProperties).length === 0, p = typeof e == "object" && "x-additionalPropertiesName" in e && typeof e["x-additionalPropertiesName"] == "string" && e["x-additionalPropertiesName"].trim().length > 0 ? e["x-additionalPropertiesName"].trim() : M;
87
87
  r[p] = n ? "anything" : typeof e == "object" ? c(e, i, {
88
88
  level: o + 1,
89
89
  seen: l
@@ -113,7 +113,7 @@ const D = 10, P = 10, M = "propertyName*", j = (/* @__PURE__ */ new Date()).toIS
113
113
  parentSchema: t,
114
114
  seen: l
115
115
  });
116
- e = w(e, p);
116
+ e = R(e, p);
117
117
  }
118
118
  e && typeof e == "object" && Object.assign(r, e);
119
119
  }
@@ -173,7 +173,7 @@ const D = 10, P = 10, M = "propertyName*", j = (/* @__PURE__ */ new Date()).toIS
173
173
  if ("type" in t && t.type && !Array.isArray(t.type))
174
174
  switch (t.type) {
175
175
  case "string":
176
- return R(t, i, o ?? "");
176
+ return w(t, i, o ?? "");
177
177
  case "boolean":
178
178
  return !0;
179
179
  case "integer":
@@ -193,7 +193,7 @@ const D = 10, P = 10, M = "propertyName*", j = (/* @__PURE__ */ new Date()).toIS
193
193
  if (l)
194
194
  switch (l) {
195
195
  case "string":
196
- return R(t, i, o ?? "");
196
+ return w(t, i, o ?? "");
197
197
  case "boolean":
198
198
  return !0;
199
199
  case "integer":
@@ -223,7 +223,7 @@ const D = 10, P = 10, M = "propertyName*", j = (/* @__PURE__ */ new Date()).toIS
223
223
  return;
224
224
  const n = E(N(e));
225
225
  if (r.has(n))
226
- return "[Circular Reference]";
226
+ return;
227
227
  r.add(n);
228
228
  const p = z(i), x = A.get(n)?.get(p);
229
229
  if (typeof x < "u")
@@ -286,7 +286,7 @@ const D = 10, P = 10, M = "propertyName*", j = (/* @__PURE__ */ new Date()).toIS
286
286
  parentSchema: e,
287
287
  seen: r
288
288
  });
289
- f === void 0 ? f = b : f && typeof f == "object" && b && typeof b == "object" ? f = w(f, b) : b !== void 0 && (f = b);
289
+ f === void 0 ? f = b : f && typeof f == "object" && b && typeof b == "object" ? f = R(f, b) : b !== void 0 && (f = b);
290
290
  }
291
291
  return r.delete(n), a(e, f ?? null, p);
292
292
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RequestBodyForm.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyForm.vue"],"names":[],"mappings":"AA2HA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAA;AAOjG,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CAAA;IACzC,mBAAmB,EAAE,MAAM,CAAA;IAC3B,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;;;;;;;;;;;;;;AAsLF,wBAOG"}
1
+ {"version":3,"file":"RequestBodyForm.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestBodyForm.vue"],"names":[],"mappings":"AAoHA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAA;AAOjG,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CAAA;IACzC,mBAAmB,EAAE,MAAM,CAAA;IAC3B,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;;;;;;;;;;;;;;AAwKF,wBAOG"}
@@ -1,8 +1,8 @@
1
- import { defineComponent as c, ref as w, watch as y, createBlock as i, openBlock as v } from "vue";
2
- import s from "./RequestTable.vue.js";
3
- import { getFormBodyRows as F } from "../helpers/get-form-body-rows.js";
4
- import { useFileDialog as B } from "../../../../hooks/useFileDialog.js";
5
- const k = /* @__PURE__ */ c({
1
+ import { defineComponent as f, ref as R, watch as w, createBlock as i, openBlock as s } from "vue";
2
+ import v from "./RequestTable.vue.js";
3
+ import { getFormBodyRows as y } from "../helpers/get-form-body-rows.js";
4
+ import { useFileDialog as F } from "../../../../hooks/useFileDialog.js";
5
+ const D = /* @__PURE__ */ f({
6
6
  __name: "RequestBodyForm",
7
7
  props: {
8
8
  example: {},
@@ -10,68 +10,65 @@ const k = /* @__PURE__ */ c({
10
10
  environment: {}
11
11
  },
12
12
  emits: ["update:formValue"],
13
- setup(l, { emit: p }) {
14
- const u = p, e = w([]);
15
- y(
16
- () => l.example,
17
- (o) => {
18
- e.value = F(o, l.selectedContentType);
13
+ setup(a, { emit: d }) {
14
+ const u = d, e = R([]);
15
+ w(
16
+ () => a.example,
17
+ (t) => {
18
+ e.value = y(t, a.selectedContentType);
19
19
  },
20
20
  { immediate: !0 }
21
21
  );
22
- const d = (o) => {
23
- e.value = [
24
- ...e.value,
25
- { name: "", value: "", isDisabled: !1, ...o }
26
- ], u("update:formValue", e.value);
27
- }, m = (o, n) => {
22
+ const m = (t, o) => {
23
+ if (t >= e.value.length) {
24
+ e.value = [
25
+ ...e.value,
26
+ { name: "", value: "", ...o, isDisabled: !1 }
27
+ ], u("update:formValue", e.value);
28
+ return;
29
+ }
28
30
  e.value = e.value.map(
29
- (t, a) => a === o ? { ...t, ...n } : t
31
+ (n, l) => l === t ? { ...n, ...o } : n
30
32
  ), u("update:formValue", e.value);
31
- }, r = (o) => {
33
+ }, r = (t) => {
32
34
  e.value = e.value.filter(
33
- (n, t) => t !== o
35
+ (o, n) => n !== t
34
36
  ), u("update:formValue", e.value);
35
- }, f = (o) => {
36
- const { open: n } = B({
37
- onChange: (t) => {
38
- const a = t?.[0];
39
- if (a)
40
- if (o >= e.value.length)
41
- d({ name: a.name, value: a });
42
- else {
43
- const R = e.value[o];
44
- m(o, {
45
- name: R?.name || a.name,
46
- value: a
47
- });
48
- }
37
+ }, p = (t) => {
38
+ const { open: o } = F({
39
+ onChange: (n) => {
40
+ const l = n?.[0];
41
+ if (l) {
42
+ const c = e.value[t];
43
+ m(t, {
44
+ name: c?.name || l.name,
45
+ value: l
46
+ });
47
+ }
49
48
  },
50
49
  multiple: !1,
51
50
  accept: "*/*"
52
51
  });
53
- n();
52
+ o();
54
53
  };
55
- return (o, n) => l.selectedContentType === "multipart/form-data" ? (v(), i(s, {
54
+ return (t, o) => a.selectedContentType === "multipart/form-data" ? (s(), i(v, {
56
55
  key: 0,
57
56
  data: e.value,
58
- environment: l.environment,
57
+ environment: a.environment,
59
58
  showUploadButton: "",
60
- onAddRow: d,
61
- onDeleteRow: n[0] || (n[0] = (t) => r(t)),
62
- onRemoveFile: n[1] || (n[1] = (t) => m(t, { value: void 0 })),
63
- onUpdateRow: n[2] || (n[2] = (t, a) => m(t, a)),
64
- onUploadFile: f
65
- }, null, 8, ["data", "environment"])) : (v(), i(s, {
59
+ onDeleteRow: r,
60
+ onRemoveFile: o[0] || (o[0] = (n) => m(n, { value: void 0 })),
61
+ onUploadFile: p,
62
+ onUpsertRow: m
63
+ }, null, 8, ["data", "environment"])) : (s(), i(v, {
66
64
  key: 1,
67
65
  data: e.value,
68
- environment: l.environment,
69
- onAddRow: d,
66
+ environment: a.environment,
70
67
  onDeleteRow: r,
71
- onUpdateRow: m
68
+ onUpsertRow: m
72
69
  }, null, 8, ["data", "environment"]));
73
70
  }
74
71
  });
75
72
  export {
76
- k as default
73
+ D as default
77
74
  };
@@ -16,38 +16,20 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
16
16
  delete: (payload: {
17
17
  index: number;
18
18
  }) => any;
19
- add: (payload: Partial<{
19
+ upsert: (index: number, payload: {
20
20
  name: string;
21
- value: string | File;
22
- index: number;
21
+ value: string;
23
22
  isDisabled: boolean;
24
- }>) => any;
25
- update: (payload: {
26
- index: number;
27
- payload: {
28
- name: string;
29
- value: string | File;
30
- isDisabled: boolean;
31
- };
32
23
  }) => any;
33
24
  deleteAll: () => any;
34
25
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
35
26
  onDelete?: ((payload: {
36
27
  index: number;
37
28
  }) => any) | undefined;
38
- onAdd?: ((payload: Partial<{
29
+ onUpsert?: ((index: number, payload: {
39
30
  name: string;
40
- value: string | File;
41
- index: number;
31
+ value: string;
42
32
  isDisabled: boolean;
43
- }>) => any) | undefined;
44
- onUpdate?: ((payload: {
45
- index: number;
46
- payload: {
47
- name: string;
48
- value: string | File;
49
- isDisabled: boolean;
50
- };
51
33
  }) => any) | undefined;
52
34
  onDeleteAll?: (() => any) | undefined;
53
35
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestParams.vue"],"names":[],"mappings":"AAgGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAMnH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAErD,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,QAAQ,EAAE,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,WAAW,EAAE,kBAAkB,CAAA;IAC/B,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;;;eA4BgC,MAAM;;;cAb5B,MAAM;eACL,MAAM,GAAG,IAAI;eACb,MAAM;oBACD,OAAO;;;eAMZ,MAAM;iBACJ;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;YAAC,UAAU,EAAE,OAAO,CAAA;SAAE;;;;;eAGxC,MAAM;;;cAb5B,MAAM;eACL,MAAM,GAAG,IAAI;eACb,MAAM;oBACD,OAAO;;;eAMZ,MAAM;iBACJ;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;YAAC,UAAU,EAAE,OAAO,CAAA;SAAE;;;;AAyK1E,wBAOG"}
1
+ {"version":3,"file":"RequestParams.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestParams.vue"],"names":[],"mappings":"AA0GA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAMnH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAErD,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,QAAQ,EAAE,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,WAAW,EAAE,kBAAkB,CAAA;IAC/B,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;;;eAiBgC,MAAM;;;;;;;;;;eAAN,MAAM;;;;;;;;;AAsLxC,wBAOG"}
@@ -1,8 +1,8 @@
1
- import { defineComponent as v, computed as c, createBlock as i, openBlock as s, unref as n, withCtx as l, createVNode as r, createElementVNode as d, createCommentVNode as R, withModifiers as g, createTextVNode as m, toDisplayString as u } from "vue";
2
- import { ScalarTooltip as x, ScalarButton as b } from "@scalar/components";
3
- import y from "./RequestTable.vue.js";
4
- import P from "../../../components/layout/CollapsibleSection.vue.js";
5
- const h = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100" }, A = { class: "sr-only" }, T = /* @__PURE__ */ v({
1
+ import { defineComponent as h, computed as R, createBlock as s, openBlock as r, unref as n, withCtx as o, createVNode as m, createElementVNode as d, createCommentVNode as g, withModifiers as x, createTextVNode as u, toDisplayString as c } from "vue";
2
+ import { ScalarTooltip as b, ScalarButton as y } from "@scalar/components";
3
+ import P from "./RequestTable.vue.js";
4
+ import C from "../../../components/layout/CollapsibleSection.vue.js";
5
+ const A = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100" }, B = { class: "sr-only" }, V = /* @__PURE__ */ h({
6
6
  __name: "RequestParams",
7
7
  props: {
8
8
  rows: {},
@@ -15,43 +15,46 @@ const h = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
15
15
  environment: {},
16
16
  eventBus: {}
17
17
  },
18
- emits: ["add", "update", "delete", "deleteAll"],
19
- setup(e, { emit: w }) {
20
- const a = w, f = c(() => e.rows.length > 1);
21
- return (C, t) => (s(), i(n(P), {
18
+ emits: ["upsert", "delete", "deleteAll"],
19
+ setup(e, { emit: f }) {
20
+ const a = f, w = R(() => e.rows.length > 1), p = (i, t) => {
21
+ const { value: l, ...v } = t;
22
+ l instanceof File || a("upsert", i, { ...v, value: l ?? "" });
23
+ };
24
+ return (i, t) => (r(), s(n(C), {
22
25
  class: "group/params",
23
26
  itemCount: e.rows.length
24
27
  }, {
25
- title: l(() => [
26
- m(u(e.title), 1)
28
+ title: o(() => [
29
+ u(c(e.title), 1)
27
30
  ]),
28
- actions: l(() => [
29
- d("div", h, [
30
- f.value ? (s(), i(n(x), {
31
+ actions: o(() => [
32
+ d("div", A, [
33
+ w.value ? (r(), s(n(b), {
31
34
  key: 0,
32
35
  content: "Clear optional parameters",
33
36
  placement: "left"
34
37
  }, {
35
- default: l(() => [
36
- r(n(b), {
38
+ default: o(() => [
39
+ m(n(y), {
37
40
  class: "pr-0.75 pl-1 transition-none",
38
41
  size: "sm",
39
42
  variant: "ghost",
40
- onClick: t[0] || (t[0] = g((o) => a("deleteAll"), ["stop"]))
43
+ onClick: t[0] || (t[0] = x((l) => a("deleteAll"), ["stop"]))
41
44
  }, {
42
- default: l(() => [
43
- t[5] || (t[5] = m(" Clear ", -1)),
44
- d("span", A, "All " + u(e.title), 1)
45
+ default: o(() => [
46
+ t[3] || (t[3] = u(" Clear ", -1)),
47
+ d("span", B, "All " + c(e.title), 1)
45
48
  ]),
46
49
  _: 1
47
50
  })
48
51
  ]),
49
52
  _: 1
50
- })) : R("", !0)
53
+ })) : g("", !0)
51
54
  ])
52
55
  ]),
53
- default: l(() => [
54
- r(y, {
56
+ default: o(() => [
57
+ m(P, {
55
58
  class: "flex-1",
56
59
  columns: ["32px", "", ""],
57
60
  data: e.rows,
@@ -61,10 +64,9 @@ const h = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
61
64
  invalidParams: e.invalidParams,
62
65
  label: e.label,
63
66
  showAddRowPlaceholder: e.showAddRowPlaceholder,
64
- onAddRow: t[1] || (t[1] = (o) => a("add", o)),
65
- onDeleteRow: t[2] || (t[2] = (o) => a("delete", { index: o })),
66
- onNavigate: t[3] || (t[3] = (o) => e.eventBus.emit("ui:route:page", { name: o })),
67
- onUpdateRow: t[4] || (t[4] = (o, p) => a("update", { index: o, payload: p }))
67
+ onDeleteRow: t[1] || (t[1] = (l) => a("delete", { index: l })),
68
+ onNavigate: t[2] || (t[2] = (l) => e.eventBus.emit("ui:route:page", { name: l })),
69
+ onUpsertRow: p
68
70
  }, null, 8, ["data", "environment", "exampleKey", "globalRoute", "invalidParams", "label", "showAddRowPlaceholder"])
69
71
  ]),
70
72
  _: 1
@@ -72,5 +74,5 @@ const h = { class: "text-c-2 request-meta-buttons flex whitespace-nowrap opacity
72
74
  }
73
75
  });
74
76
  export {
75
- T as default
77
+ V as default
76
78
  };
@@ -12,34 +12,24 @@ type __VLS_Props = {
12
12
  };
13
13
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
14
  navigate: (route: string) => any;
15
- updateRow: (index: number, payload: {
16
- name: string;
17
- value: string | File;
18
- isDisabled: boolean;
19
- }) => any;
20
- addRow: (payload: {
21
- name: string;
22
- value: string | File;
23
- isDisabled: boolean;
24
- }) => any;
25
15
  deleteRow: (index: number) => any;
26
16
  uploadFile: (index: number) => any;
27
17
  removeFile: (index: number) => any;
28
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
29
- onNavigate?: ((route: string) => any) | undefined;
30
- onUpdateRow?: ((index: number, payload: {
31
- name: string;
32
- value: string | File;
33
- isDisabled: boolean;
34
- }) => any) | undefined;
35
- onAddRow?: ((payload: {
18
+ upsertRow: (index: number, payload: {
36
19
  name: string;
37
- value: string | File;
20
+ value: string | File | undefined;
38
21
  isDisabled: boolean;
39
- }) => any) | undefined;
22
+ }) => any;
23
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
24
+ onNavigate?: ((route: string) => any) | undefined;
40
25
  onDeleteRow?: ((index: number) => any) | undefined;
41
26
  onUploadFile?: ((index: number) => any) | undefined;
42
27
  onRemoveFile?: ((index: number) => any) | undefined;
28
+ onUpsertRow?: ((index: number, payload: {
29
+ name: string;
30
+ value: string | File | undefined;
31
+ isDisabled: boolean;
32
+ }) => any) | undefined;
43
33
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
44
34
  export default _default;
45
35
  //# sourceMappingURL=RequestTable.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestTable.vue"],"names":[],"mappings":"AAiKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAGnH,OAAwB,EACtB,KAAK,QAAQ,EACd,MAAM,0DAA0D,CAAA;AAOjE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,QAAQ,EAAE,CAAA;IAChB,8BAA8B;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;;;;cAoBmB,MAAM;eAAS,MAAM,GAAG,IAAI;oBAAc,OAAO;;;cALjD,MAAM;eAAS,MAAM,GAAG,IAAI;oBAAc,OAAO;;;;;;;;cAKjD,MAAM;eAAS,MAAM,GAAG,IAAI;oBAAc,OAAO;;;cALjD,MAAM;eAAS,MAAM,GAAG,IAAI;oBAAc,OAAO;;;;;;AA+NtE,wBAOG"}
1
+ {"version":3,"file":"RequestTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestTable.vue"],"names":[],"mappings":"AA6IA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAGnH,OAAwB,EACtB,KAAK,QAAQ,EACd,MAAM,0DAA0D,CAAA;AAOjE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,QAAQ,EAAE,CAAA;IAChB,8BAA8B;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,aAAa,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;;;;;;;cAiBU,MAAM;eACL,MAAM,GAAG,IAAI,GAAG,SAAS;oBACpB,OAAO;;;;;;;;cAFb,MAAM;eACL,MAAM,GAAG,IAAI,GAAG,SAAS;oBACpB,OAAO;;;AAsMzB,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./RequestTable.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-95e0197f"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2dc74300"]]);
5
5
  export {
6
- f as default
6
+ m as default
7
7
  };
@@ -1,9 +1,9 @@
1
- import { defineComponent as D, computed as f, createBlock as v, openBlock as r, unref as d, withCtx as u, createVNode as i, createElementBlock as k, createTextVNode as m, toDisplayString as s, Fragment as F, renderList as U } from "vue";
2
- import g from "./RequestTableRow.vue.js";
3
- import x from "../../../components/data-table/DataTable.vue.js";
4
- import y from "../../../components/data-table/DataTableRow.vue.js";
5
- import c from "../../../components/data-table/DataTableHeader.vue.js";
6
- const N = /* @__PURE__ */ D({
1
+ import { defineComponent as B, computed as f, createBlock as v, openBlock as r, unref as o, withCtx as n, createVNode as u, createElementBlock as D, createTextVNode as d, toDisplayString as m, Fragment as k, renderList as F } from "vue";
2
+ import U from "./RequestTableRow.vue.js";
3
+ import y from "../../../components/data-table/DataTable.vue.js";
4
+ import p from "../../../components/data-table/DataTableRow.vue.js";
5
+ import s from "../../../components/data-table/DataTableHeader.vue.js";
6
+ const N = /* @__PURE__ */ B({
7
7
  __name: "RequestTable",
8
8
  props: {
9
9
  data: {},
@@ -14,64 +14,55 @@ const N = /* @__PURE__ */ D({
14
14
  showAddRowPlaceholder: { type: Boolean, default: !0 },
15
15
  environment: {}
16
16
  },
17
- emits: ["addRow", "updateRow", "deleteRow", "uploadFile", "removeFile", "navigate"],
17
+ emits: ["upsertRow", "deleteRow", "uploadFile", "removeFile", "navigate"],
18
18
  setup(e, { emit: b }) {
19
19
  const t = b, w = f(() => e.showUploadButton ? ["36px", "", "", "auto"] : ["36px", "", ""]), h = f(() => {
20
20
  if (!e.showAddRowPlaceholder)
21
21
  return e.data;
22
- const a = e.data.at(-1);
23
- return !a || a.name !== "" || a.value !== "" ? [...e.data, { name: "", value: "", isDisabled: !0 }] : e.data;
24
- }), R = ({
25
- index: a,
26
- payload: o
27
- }) => {
28
- if (a >= e.data.length) {
29
- t("addRow", o);
30
- return;
31
- }
32
- t("updateRow", a, o);
33
- };
34
- return (a, o) => (r(), v(d(x), {
22
+ const i = e.data.at(-1);
23
+ return !i || i.name !== "" || i.value !== "" ? [...e.data, { name: "", value: "", isDisabled: !0 }] : e.data;
24
+ });
25
+ return (i, c) => (r(), v(o(y), {
35
26
  class: "group/table flex-1",
36
27
  columns: w.value
37
28
  }, {
38
- default: u(() => [
39
- i(d(y), { class: "sr-only !block" }, {
40
- default: u(() => [
41
- i(d(c), null, {
42
- default: u(() => [
43
- m(s(e.label) + " Enabled", 1)
29
+ default: n(() => [
30
+ u(o(p), { class: "sr-only !block" }, {
31
+ default: n(() => [
32
+ u(o(s), null, {
33
+ default: n(() => [
34
+ d(m(e.label) + " Enabled", 1)
44
35
  ]),
45
36
  _: 1
46
37
  }),
47
- i(d(c), null, {
48
- default: u(() => [
49
- m(s(e.label) + " Key", 1)
38
+ u(o(s), null, {
39
+ default: n(() => [
40
+ d(m(e.label) + " Key", 1)
50
41
  ]),
51
42
  _: 1
52
43
  }),
53
- i(d(c), null, {
54
- default: u(() => [
55
- m(s(e.label) + " Value", 1)
44
+ u(o(s), null, {
45
+ default: n(() => [
46
+ d(m(e.label) + " Value", 1)
56
47
  ]),
57
48
  _: 1
58
49
  })
59
50
  ]),
60
51
  _: 1
61
52
  }),
62
- (r(!0), k(F, null, U(h.value, (B, n) => (r(), v(g, {
63
- key: n,
64
- data: B,
53
+ (r(!0), D(k, null, F(h.value, (R, l) => (r(), v(U, {
54
+ key: l,
55
+ data: R,
65
56
  environment: e.environment,
66
57
  hasCheckboxDisabled: e.hasCheckboxDisabled,
67
58
  invalidParams: e.invalidParams,
68
59
  label: e.label,
69
60
  showUploadButton: e.showUploadButton,
70
- onDeleteRow: (l) => t("deleteRow", n),
71
- onNavigate: o[0] || (o[0] = (l) => t("navigate", l)),
72
- onRemoveFile: (l) => t("removeFile", n),
73
- onUploadFile: (l) => t("uploadFile", n),
74
- onUpsertRow: (l) => R({ index: n, payload: l })
61
+ onDeleteRow: (a) => t("deleteRow", l),
62
+ onNavigate: c[0] || (c[0] = (a) => t("navigate", a)),
63
+ onRemoveFile: (a) => t("removeFile", l),
64
+ onUploadFile: (a) => t("uploadFile", l),
65
+ onUpsertRow: (a) => t("upsertRow", l, a)
75
66
  }, null, 8, ["data", "environment", "hasCheckboxDisabled", "invalidParams", "label", "showUploadButton", "onDeleteRow", "onRemoveFile", "onUploadFile", "onUpsertRow"]))), 128))
76
67
  ]),
77
68
  _: 1
@@ -7,22 +7,14 @@ export declare const createParameterHandlers: (type: ParameterType, eventBus: Wo
7
7
  defaultParameters?: number;
8
8
  globalParameters?: number;
9
9
  }) => {
10
- add: (payload: {
11
- name?: string;
12
- value?: string;
13
- index?: number;
14
- }) => void;
15
10
  delete: (payload: {
16
11
  index: number;
17
12
  }) => void;
18
13
  deleteAll: () => void;
19
- update: (payload: {
20
- index: number;
21
- payload: {
22
- name: string;
23
- value: string;
24
- isDisabled: boolean;
25
- };
14
+ upsert: (index: number, payload: {
15
+ name: string;
16
+ value: string;
17
+ isDisabled: boolean;
26
18
  }) => void;
27
19
  };
28
20
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"create-parameter-handlers.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/helpers/create-parameter-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAE7F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0DAA0D,CAAA;AAExF,KAAK,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE3D,uDAAuD;AACvD,eAAO,MAAM,uBAAuB,GAClC,MAAM,aAAa,EACnB,UAAU,iBAAiB,EAC3B,MAAM,oBAAoB,EAC1B,mDAIG;IACD,OAAO,EAAE,QAAQ,EAAE,CAAA;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;mBAKgB;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;sBAgB9C;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE;;sBAWjB;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,OAAO,CAAA;SAAE,CAAA;KAAE;CA+BrG,CAAA"}
1
+ {"version":3,"file":"create-parameter-handlers.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/helpers/create-parameter-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAE7F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0DAA0D,CAAA;AAExF,KAAK,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE3D,uDAAuD;AACvD,eAAO,MAAM,uBAAuB,GAClC,MAAM,aAAa,EACnB,UAAU,iBAAiB,EAC3B,MAAM,oBAAoB,EAC1B,mDAIG;IACD,OAAO,EAAE,QAAQ,EAAE,CAAA;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;sBAKmB;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE;;oBAWnB,MAAM,WAAW;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE;CA8BxF,CAAA"}