@scalar/api-client 2.3.31 → 2.3.33

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 (112) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  3. package/dist/components/CodeInput/CodeInput.vue.js +1 -1
  4. package/dist/components/CodeInput/CodeInput.vue2.js +63 -61
  5. package/dist/components/DataTable/DataTable.vue.js +1 -1
  6. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.d.ts.map +1 -1
  7. package/dist/components/EnvironmentSelector/EnvironmentSelector.vue.js +58 -48
  8. package/dist/components/Sidebar/SidebarListElement.vue.d.ts +2 -2
  9. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.d.ts.map +1 -1
  10. package/dist/components/ViewLayout/ViewLayoutCollapse.vue.js +34 -32
  11. package/dist/components/ViewLayout/ViewLayoutSection.vue.d.ts.map +1 -1
  12. package/dist/components/ViewLayout/ViewLayoutSection.vue.js +6 -6
  13. package/dist/hooks/useClientConfig.d.ts +3 -0
  14. package/dist/hooks/useClientConfig.d.ts.map +1 -1
  15. package/dist/layouts/App/create-api-client-app.d.ts +64 -24
  16. package/dist/layouts/App/create-api-client-app.d.ts.map +1 -1
  17. package/dist/layouts/Modal/create-api-client-modal.d.ts +128 -48
  18. package/dist/layouts/Modal/create-api-client-modal.d.ts.map +1 -1
  19. package/dist/layouts/Web/create-api-client-web.d.ts +64 -24
  20. package/dist/layouts/Web/create-api-client-web.d.ts.map +1 -1
  21. package/dist/libs/create-client.d.ts +64 -24
  22. package/dist/libs/create-client.d.ts.map +1 -1
  23. package/dist/libs/index.js +26 -25
  24. package/dist/libs/local-storage.d.ts +8 -0
  25. package/dist/libs/local-storage.d.ts.map +1 -1
  26. package/dist/libs/local-storage.js +28 -24
  27. package/dist/libs/send-request/create-request-operation.d.ts.map +1 -1
  28. package/dist/libs/send-request/create-request-operation.js +8 -8
  29. package/dist/libs/send-request/create-request-operation.test.d.ts +2 -2
  30. package/dist/libs/send-request/create-request-operation.test.d.ts.map +1 -1
  31. package/dist/libs/send-request/decode-buffer.js +4 -4
  32. package/dist/store/active-entities.d.ts +2 -2
  33. package/dist/store/active-entities.d.ts.map +1 -1
  34. package/dist/store/request-example.d.ts +22 -22
  35. package/dist/store/request-example.d.ts.map +1 -1
  36. package/dist/store/security-schemes.d.ts +42 -2
  37. package/dist/store/security-schemes.d.ts.map +1 -1
  38. package/dist/store/store.d.ts +64 -24
  39. package/dist/store/store.d.ts.map +1 -1
  40. package/dist/style.css +1 -1
  41. package/dist/views/Collection/CollectionAuthentication.vue.d.ts.map +1 -1
  42. package/dist/views/Collection/CollectionAuthentication.vue.js +1 -1
  43. package/dist/views/Collection/CollectionAuthentication.vue2.js +32 -32
  44. package/dist/views/Collection/CollectionEnvironment.vue.d.ts.map +1 -1
  45. package/dist/views/Collection/CollectionEnvironment.vue.js +3 -2
  46. package/dist/views/Collection/CollectionEnvironment.vue2.js +233 -9
  47. package/dist/views/Collection/CollectionNavigation.vue.js +36 -36
  48. package/dist/views/Collection/CollectionServers.vue.d.ts.map +1 -1
  49. package/dist/views/Collection/CollectionServers.vue2.js +6 -6
  50. package/dist/views/Collection/components/EnvironmentForm.vue.d.ts +13 -0
  51. package/dist/views/Collection/components/EnvironmentForm.vue.d.ts.map +1 -0
  52. package/dist/views/Collection/components/EnvironmentForm.vue.js +7 -0
  53. package/dist/views/Collection/components/EnvironmentForm.vue2.js +274 -0
  54. package/dist/views/Components/CodeSnippet/CodeSnippet.vue.d.ts +2 -0
  55. package/dist/views/Components/CodeSnippet/CodeSnippet.vue.d.ts.map +1 -1
  56. package/dist/views/Components/CodeSnippet/CodeSnippet.vue.js +15 -13
  57. package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.d.ts.map +1 -1
  58. package/dist/views/Components/CodeSnippet/helpers/convert-to-har-request.js +35 -34
  59. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts +3 -1
  60. package/dist/views/Components/CodeSnippet/helpers/get-har-request.d.ts.map +1 -1
  61. package/dist/views/Components/CodeSnippet/helpers/get-har-request.js +74 -31
  62. package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts +3 -1
  63. package/dist/views/Components/CodeSnippet/helpers/get-snippet.d.ts.map +1 -1
  64. package/dist/views/Components/CodeSnippet/helpers/get-snippet.js +8 -6
  65. package/dist/views/Environment/EnvironmentModal.vue.d.ts.map +1 -1
  66. package/dist/views/Environment/EnvironmentModal.vue.js +32 -28
  67. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts +1 -0
  68. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  69. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +67 -65
  70. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.d.ts.map +1 -1
  71. package/dist/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue.js +94 -97
  72. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts +1 -0
  73. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.d.ts.map +1 -1
  74. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue.js +2 -2
  75. package/dist/views/Request/RequestSection/RequestAuth/RequestAuth.vue2.js +116 -99
  76. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts +1 -0
  77. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.d.ts.map +1 -1
  78. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue.js +1 -1
  79. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue2.js +27 -25
  80. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts +1 -0
  81. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.d.ts.map +1 -1
  82. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue.js +2 -2
  83. package/dist/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue2.js +114 -73
  84. package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts +2 -0
  85. package/dist/views/Request/RequestSection/RequestCodeExample.vue.d.ts.map +1 -1
  86. package/dist/views/Request/RequestSection/RequestCodeExample.vue.js +2 -2
  87. package/dist/views/Request/RequestSection/RequestCodeExample.vue2.js +54 -59
  88. package/dist/views/Request/RequestSection/RequestSection.vue.d.ts.map +1 -1
  89. package/dist/views/Request/RequestSection/RequestSection.vue.js +3 -3
  90. package/dist/views/Request/RequestSection/RequestSection.vue2.js +27 -26
  91. package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts +8 -0
  92. package/dist/views/Request/RequestSection/helpers/update-scheme.d.ts.map +1 -0
  93. package/dist/views/Request/RequestSection/helpers/update-scheme.js +17 -0
  94. package/dist/views/Request/RequestSection/helpers/update-scheme.test.d.ts +2 -0
  95. package/dist/views/Request/RequestSection/helpers/update-scheme.test.d.ts.map +1 -0
  96. package/dist/views/Request/RequestSidebar.vue.d.ts.map +1 -1
  97. package/dist/views/Request/RequestSidebar.vue.js +1 -1
  98. package/dist/views/Request/RequestSidebar.vue2.js +87 -84
  99. package/dist/views/Request/ResponseSection/ResponseBody.vue.js +2 -2
  100. package/dist/views/Request/ResponseSection/ResponseBody.vue2.js +21 -21
  101. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.d.ts.map +1 -1
  102. package/dist/views/Request/ResponseSection/ResponseBodyDownload.vue.js +11 -11
  103. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  104. package/dist/views/Request/consts/index.js +7 -5
  105. package/dist/views/Request/consts/mediaTypes.d.ts +4 -0
  106. package/dist/views/Request/consts/mediaTypes.d.ts.map +1 -1
  107. package/dist/views/Request/consts/mediaTypes.js +22 -4
  108. package/dist/views/Request/consts/mediaTypes.test.d.ts +2 -0
  109. package/dist/views/Request/consts/mediaTypes.test.d.ts.map +1 -0
  110. package/dist/views/Request/libs/oauth2.d.ts.map +1 -1
  111. package/dist/views/Request/libs/oauth2.js +53 -47
  112. package/package.json +16 -16
@@ -1,134 +1,131 @@
1
- import { defineComponent as j, computed as k, resolveComponent as N, createBlock as h, openBlock as u, unref as o, withCtx as c, createElementVNode as n, createVNode as a, normalizeClass as z, toDisplayString as m, createCommentVNode as C, withModifiers as A, createTextVNode as V, createElementBlock as B, Fragment as T, renderList as E } from "vue";
2
- import { Disclosure as F, DisclosureButton as I, DisclosurePanel as R } from "@headlessui/vue";
3
- import { ScalarIcon as L } from "@scalar/components";
1
+ import { defineComponent as j, computed as y, createBlock as h, openBlock as u, unref as o, withCtx as c, createElementVNode as a, createVNode as i, normalizeClass as N, toDisplayString as m, createCommentVNode as k, withModifiers as z, createTextVNode as C, createElementBlock as V, Fragment as A, renderList as T } from "vue";
2
+ import { Disclosure as _, DisclosureButton as E, DisclosurePanel as F } from "@headlessui/vue";
3
+ import { ScalarButton as I, ScalarIcon as R } from "@scalar/components";
4
4
  import D from "../../../../components/DataTable/DataTableCell.vue.js";
5
- import M from "../../../../components/DataTable/DataTableRow.vue.js";
6
- import P from "../../../../components/DataTable/DataTableCheckbox.vue.js";
7
- const U = { class: "flex h-fit w-full" }, q = { class: "flex-1" }, G = { class: "gap-1.75 flex items-center" }, H = {
5
+ import L from "../../../../components/DataTable/DataTableRow.vue.js";
6
+ import M from "../../../../components/DataTable/DataTableCheckbox.vue.js";
7
+ const P = { class: "flex h-fit w-full" }, U = { class: "flex-1" }, q = { class: "gap-1.75 flex items-center" }, G = {
8
8
  class: "grid auto-rows-auto",
9
9
  style: { gridTemplateColumns: "1fr auto" }
10
- }, J = { key: 0 }, K = { class: "font-code text-xs" }, te = /* @__PURE__ */ j({
10
+ }, H = { key: 0 }, J = { class: "font-code text-xs" }, ee = /* @__PURE__ */ j({
11
11
  __name: "OAuthScopesInput",
12
12
  props: {
13
13
  flow: {},
14
14
  updateScheme: { type: Function }
15
15
  },
16
16
  setup(t) {
17
- const $ = k(
17
+ const $ = y(
18
18
  () => {
19
19
  var e;
20
- return Object.entries(((e = t.flow) == null ? void 0 : e.scopes) ?? {}).map(([l, r]) => ({
20
+ return Object.entries(((e = t.flow) == null ? void 0 : e.scopes) ?? {}).map(([l, n]) => ({
21
21
  id: l,
22
22
  label: l,
23
- description: r
23
+ description: n
24
24
  }));
25
25
  }
26
- ), d = k(() => {
26
+ ), d = y(() => {
27
27
  var e;
28
28
  return ((e = t.flow) == null ? void 0 : e.selectedScopes) || [];
29
29
  });
30
- function O(e, l) {
30
+ function B(e, l) {
31
31
  l ? t.updateScheme(`flows.${t.flow.type}.selectedScopes`, [
32
32
  ...d.value,
33
33
  e
34
34
  ]) : t.updateScheme(
35
35
  `flows.${t.flow.type}.selectedScopes`,
36
- d.value.filter((r) => r !== e)
36
+ d.value.filter((n) => n !== e)
37
37
  );
38
38
  }
39
- function _() {
39
+ function O() {
40
40
  var e;
41
41
  t.updateScheme(
42
42
  `flows.${t.flow.type}.selectedScopes`,
43
43
  Object.keys(((e = t.flow) == null ? void 0 : e.scopes) ?? {})
44
44
  );
45
45
  }
46
- return (e, l) => {
47
- const r = N("ScalarButton");
48
- return u(), h(o(D), { class: "h-auto !max-h-[initial] min-h-8 items-center" }, {
49
- default: c(() => [
50
- n("div", U, [
51
- l[1] || (l[1] = n("div", { class: "text-c-1 h-full items-center" }, null, -1)),
52
- a(o(F), {
53
- as: "div",
54
- class: "bl flex w-full flex-col"
55
- }, {
56
- default: c(() => {
57
- var w, S;
58
- return [
59
- a(o(I), {
60
- class: z([
61
- "group/scopes-accordion hover:text-c-1 pr-2.25 flex h-auto min-h-8 cursor-pointer items-center gap-1.5 pl-3 text-left",
62
- (((S = (w = e.flow) == null ? void 0 : w.selectedScopes) == null ? void 0 : S.length) || 0) > 0 ? "text-c-1" : "text-c-3"
63
- ])
64
- }, {
65
- default: c(({ open: s }) => {
66
- var f, i, p, x, v, g, b, y;
67
- return [
68
- n("div", q, " Scopes Selected " + m(((i = (f = e.flow) == null ? void 0 : f.selectedScopes) == null ? void 0 : i.length) || 0) + " / " + m(Object.keys(((p = e.flow) == null ? void 0 : p.scopes) ?? {}).length || 0), 1),
69
- n("div", G, [
70
- ((v = (x = e.flow) == null ? void 0 : x.selectedScopes) == null ? void 0 : v.length) > 4 && s && ((b = (g = e.flow) == null ? void 0 : g.selectedScopes) == null ? void 0 : b.length) < Object.keys(((y = e.flow) == null ? void 0 : y.scopes) ?? {}).length ? (u(), h(r, {
71
- key: 0,
72
- class: "text-c-3 hover:bg-b-2 hover:text-c-1 rounded px-1.5",
73
- size: "sm",
74
- onClick: A(_, ["stop"])
75
- }, {
76
- default: c(() => l[0] || (l[0] = [
77
- V(" Select All ")
78
- ])),
79
- _: 1
80
- })) : C("", !0),
81
- a(o(L), {
82
- class: "text-c-3 group-hover/scopes-accordion:text-c-2",
83
- icon: s ? "ChevronDown" : "ChevronRight",
84
- size: "md"
85
- }, null, 8, ["icon"])
86
- ])
87
- ];
88
- }),
89
- _: 1
90
- }, 8, ["class"]),
91
- a(o(R), { as: "template" }, {
92
- default: c(() => [
93
- n("table", H, [
94
- (u(!0), B(T, null, E($.value, ({ id: s, label: f, description: i }) => (u(), h(o(M), {
95
- key: s,
96
- class: "text-c-2",
97
- onClick: (p) => O(s, !d.value.includes(s))
46
+ return (e, l) => (u(), h(o(D), { class: "h-auto !max-h-[initial] min-h-8 items-center" }, {
47
+ default: c(() => [
48
+ a("div", P, [
49
+ l[1] || (l[1] = a("div", { class: "text-c-1 h-full items-center" }, null, -1)),
50
+ i(o(_), {
51
+ as: "div",
52
+ class: "bl flex w-full flex-col"
53
+ }, {
54
+ default: c(() => {
55
+ var n, w;
56
+ return [
57
+ i(o(E), {
58
+ class: N([
59
+ "group/scopes-accordion hover:text-c-1 pr-2.25 flex h-auto min-h-8 cursor-pointer items-center gap-1.5 pl-3 text-left",
60
+ (((w = (n = e.flow) == null ? void 0 : n.selectedScopes) == null ? void 0 : w.length) || 0) > 0 ? "text-c-1" : "text-c-3"
61
+ ])
62
+ }, {
63
+ default: c(({ open: s }) => {
64
+ var f, r, p, x, S, v, g, b;
65
+ return [
66
+ a("div", U, " Scopes Selected " + m(((r = (f = e.flow) == null ? void 0 : f.selectedScopes) == null ? void 0 : r.length) || 0) + " / " + m(Object.keys(((p = e.flow) == null ? void 0 : p.scopes) ?? {}).length || 0), 1),
67
+ a("div", q, [
68
+ ((S = (x = e.flow) == null ? void 0 : x.selectedScopes) == null ? void 0 : S.length) > 4 && s && ((g = (v = e.flow) == null ? void 0 : v.selectedScopes) == null ? void 0 : g.length) < Object.keys(((b = e.flow) == null ? void 0 : b.scopes) ?? {}).length ? (u(), h(o(I), {
69
+ key: 0,
70
+ class: "text-c-3 hover:bg-b-2 hover:text-c-1 rounded px-1.5",
71
+ size: "sm",
72
+ onClick: z(O, ["stop"])
98
73
  }, {
99
- default: c(() => [
100
- a(o(D), { class: "hover:text-c-1 box-border !max-h-[initial] w-full cursor-pointer px-3 py-1.5" }, {
101
- default: c(() => [
102
- i ? (u(), B("div", J, [
103
- n("span", K, m(f), 1),
104
- V(" – " + m(i), 1)
105
- ])) : C("", !0)
106
- ]),
107
- _: 2
108
- }, 1024),
109
- a(o(P), {
110
- modelValue: d.value.includes(s),
111
- "onUpdate:modelValue": () => {
112
- }
113
- }, null, 8, ["modelValue"])
114
- ]),
115
- _: 2
116
- }, 1032, ["onClick"]))), 128))
74
+ default: c(() => l[0] || (l[0] = [
75
+ C(" Select All ")
76
+ ])),
77
+ _: 1
78
+ })) : k("", !0),
79
+ i(o(R), {
80
+ class: "text-c-3 group-hover/scopes-accordion:text-c-2",
81
+ icon: s ? "ChevronDown" : "ChevronRight",
82
+ size: "md"
83
+ }, null, 8, ["icon"])
117
84
  ])
118
- ]),
119
- _: 1
120
- })
121
- ];
122
- }),
123
- _: 1
124
- })
125
- ])
126
- ]),
127
- _: 1
128
- });
129
- };
85
+ ];
86
+ }),
87
+ _: 1
88
+ }, 8, ["class"]),
89
+ i(o(F), { as: "template" }, {
90
+ default: c(() => [
91
+ a("table", G, [
92
+ (u(!0), V(A, null, T($.value, ({ id: s, label: f, description: r }) => (u(), h(o(L), {
93
+ key: s,
94
+ class: "text-c-2",
95
+ onClick: (p) => B(s, !d.value.includes(s))
96
+ }, {
97
+ default: c(() => [
98
+ i(o(D), { class: "hover:text-c-1 box-border !max-h-[initial] w-full cursor-pointer px-3 py-1.5" }, {
99
+ default: c(() => [
100
+ r ? (u(), V("div", H, [
101
+ a("span", J, m(f), 1),
102
+ C(" – " + m(r), 1)
103
+ ])) : k("", !0)
104
+ ]),
105
+ _: 2
106
+ }, 1024),
107
+ i(o(M), {
108
+ modelValue: d.value.includes(s),
109
+ "onUpdate:modelValue": () => {
110
+ }
111
+ }, null, 8, ["modelValue"])
112
+ ]),
113
+ _: 2
114
+ }, 1032, ["onClick"]))), 128))
115
+ ])
116
+ ]),
117
+ _: 1
118
+ })
119
+ ];
120
+ }),
121
+ _: 1
122
+ })
123
+ ])
124
+ ]),
125
+ _: 1
126
+ }));
130
127
  }
131
128
  });
132
129
  export {
133
- te as default
130
+ ee as default
134
131
  };
@@ -9,6 +9,7 @@ type __VLS_Props = {
9
9
  envVariables: EnvVariable[];
10
10
  layout: 'client' | 'reference';
11
11
  operation?: Operation | undefined;
12
+ persistAuth?: boolean;
12
13
  selectedSecuritySchemeUids: SelectedSecuritySchemeUids;
13
14
  server: Server | undefined;
14
15
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuth.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuth.vue"],"names":[],"mappings":"AA+VA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EAET,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAMrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAe1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IACjC,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AA4YF,wBAOG"}
1
+ {"version":3,"file":"RequestAuth.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuth.vue"],"names":[],"mappings":"AAsXA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AACnF,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EAET,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAOrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAe1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IACjC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAgaF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import t from "./RequestAuth.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-1f349e0c"]]);
4
+ const p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-78825580"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1,13 +1,14 @@
1
- import { defineComponent as I, useId as L, ref as D, computed as h, createBlock as N, openBlock as m, withCtx as d, createVNode as f, unref as r, createElementVNode as i, createElementBlock as p, Fragment as g, createTextVNode as k, toDisplayString as x, createCommentVNode as z, normalizeClass as E } from "vue";
2
- import { useModal as K, ScalarComboboxMultiselect as W, ScalarButton as F, ScalarIcon as G } from "@scalar/components";
3
- import { isDefined as H } from "@scalar/oas-utils/helpers";
4
- import J from "../../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
1
+ import { defineComponent as K, useId as L, ref as E, computed as p, createBlock as N, openBlock as d, withCtx as f, createVNode as y, unref as i, createElementVNode as a, createElementBlock as S, Fragment as k, createTextVNode as x, toDisplayString as A, createCommentVNode as j, normalizeClass as z } from "vue";
2
+ import { useModal as W, ScalarComboboxMultiselect as Y, ScalarButton as F, ScalarIcon as H } from "@scalar/components";
3
+ import { isDefined as J } from "@scalar/oas-utils/helpers";
4
+ import G from "../../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
5
5
  import { useLayout as P } from "../../../../hooks/useLayout.js";
6
- import { useWorkspace as Q } from "../../../../store/store.js";
7
- import X from "./DeleteRequestAuthModal.vue.js";
8
- import Y from "./RequestAuthDataTable.vue.js";
9
- import { getSecurityRequirements as Z, formatComplexScheme as _, formatScheme as ee, getSchemeOptions as te } from "../../libs/auth.js";
10
- const le = ["id"], oe = { class: "-mx-1 flex flex-1" }, ne = { class: "text-c-1" }, he = /* @__PURE__ */ I({
6
+ import { CLIENT_LS_KEYS as Q } from "../../../../libs/local-storage.js";
7
+ import { useWorkspace as X } from "../../../../store/store.js";
8
+ import Z from "./DeleteRequestAuthModal.vue.js";
9
+ import _ from "./RequestAuthDataTable.vue.js";
10
+ import { getSecurityRequirements as ee, formatComplexScheme as te, formatScheme as le, getSchemeOptions as oe } from "../../libs/auth.js";
11
+ const ne = ["id"], se = { class: "-mx-1 flex flex-1" }, re = { class: "text-c-1" }, Se = /* @__PURE__ */ K({
11
12
  __name: "RequestAuth",
12
13
  props: {
13
14
  collection: {},
@@ -15,137 +16,152 @@ const le = ["id"], oe = { class: "-mx-1 flex flex-1" }, ne = { class: "text-c-1"
15
16
  envVariables: {},
16
17
  layout: {},
17
18
  operation: {},
19
+ persistAuth: { type: Boolean, default: !1 },
18
20
  selectedSecuritySchemeUids: {},
19
21
  server: {},
20
22
  title: {},
21
23
  workspace: {}
22
24
  },
23
25
  setup(s) {
24
- const { layout: q } = P(), {
25
- securitySchemes: v,
26
+ const { layout: C } = P(), {
27
+ securitySchemes: u,
26
28
  securitySchemeMutators: O,
27
- requestMutators: w,
28
- collectionMutators: M
29
- } = Q(), R = L(), C = D(null), y = K(), S = D(
29
+ requestMutators: T,
30
+ collectionMutators: w
31
+ } = X(), q = L(), R = E(null), h = W(), v = E(
30
32
  null
31
- ), A = h(() => {
32
- const e = Z(s.operation, s.collection);
33
- return { filteredRequirements: e.filter((o) => Object.keys(o).length), requirements: e };
34
- }), b = h(() => {
35
- const { filteredRequirements: e, requirements: t } = A.value;
33
+ ), V = p(() => {
34
+ const e = ee(s.operation, s.collection);
35
+ return { filteredRequirements: e.filter((n) => Object.keys(n).length), requirements: e };
36
+ }), g = p(() => {
37
+ const { filteredRequirements: e, requirements: t } = V.value;
36
38
  if (!t.length)
37
39
  return null;
38
- const n = !t.some(
39
- (u) => Object.keys(u).length > 1
40
- ) && e.length < t.length, l = n ? "Unlock" : "Lock", c = n ? "Optional" : "Required", j = `${e.length === 1 ? (() => {
41
- const u = Object.keys(e[0] || {});
42
- return u.length > 1 ? u.join(" & ") : u[0] || "";
43
- })() : ""} ${c}`;
44
- return { icon: l, text: j };
45
- }), a = h(
40
+ const o = !t.some(
41
+ (m) => Object.keys(m).length > 1
42
+ ) && e.length < t.length, l = o ? "Unlock" : "Lock", r = o ? "Optional" : "Required", $ = `${e.length === 1 ? (() => {
43
+ const m = Object.keys(e[0] || {});
44
+ return m.length > 1 ? m.join(" & ") : m[0] || "";
45
+ })() : ""} ${r}`;
46
+ return { icon: l, text: $ };
47
+ }), c = p(
46
48
  () => s.selectedSecuritySchemeUids.map((e) => {
47
49
  if (Array.isArray(e))
48
- return _(e, v);
49
- const t = v[e ?? ""];
50
+ return te(e, u);
51
+ const t = u[e ?? ""];
50
52
  if (t)
51
- return ee(t);
52
- }).filter(H)
53
+ return le(t);
54
+ }).filter(J)
53
55
  );
54
- function U(e) {
55
- var n;
56
- const t = e.find((l) => l.payload), o = e.filter((l) => !l.payload).map(({ id: l }) => {
57
- const c = l.split(",");
58
- return c.length > 1 ? c : l;
56
+ function M(e) {
57
+ var o;
58
+ const t = e.find((l) => l.payload), n = e.filter((l) => !l.payload).map(({ id: l }) => {
59
+ const r = l.split(",");
60
+ return r.length > 1 ? r : l;
59
61
  });
60
62
  if (t != null && t.payload) {
61
63
  const l = O.add(
62
64
  t.payload,
63
- (n = s.collection) == null ? void 0 : n.uid
65
+ (o = s.collection) == null ? void 0 : o.uid
64
66
  );
65
- l && o.push(l.uid);
67
+ l && n.push(l.uid);
66
68
  }
67
- V(o);
69
+ D(n);
68
70
  }
69
- const V = (e) => {
71
+ const D = (e) => {
70
72
  var t;
71
- s.collection.useCollectionSecurity ? M.edit(s.collection.uid, "selectedSecuritySchemeUids", e) : (t = s.operation) != null && t.uid && w.edit(s.operation.uid, "selectedSecuritySchemeUids", e);
73
+ if (s.collection.useCollectionSecurity) {
74
+ if (w.edit(s.collection.uid, "selectedSecuritySchemeUids", e), !s.persistAuth)
75
+ return;
76
+ const n = e.map((o) => {
77
+ var l;
78
+ return Array.isArray(o) ? o.map((r) => {
79
+ var b;
80
+ return (b = u[r]) == null ? void 0 : b.nameKey;
81
+ }) : (l = u[o]) == null ? void 0 : l.nameKey;
82
+ });
83
+ localStorage.setItem(
84
+ Q.SELECTED_SECURITY_SCHEMES,
85
+ JSON.stringify(n)
86
+ );
87
+ } else (t = s.operation) != null && t.uid && T.edit(s.operation.uid, "selectedSecuritySchemeUids", e);
72
88
  };
73
- function $({ id: e, label: t }) {
74
- S.value = { id: e, label: t }, y.show();
89
+ function U({ id: e, label: t }) {
90
+ v.value = { id: e, label: t }, h.show();
75
91
  }
76
92
  const B = (e) => {
77
- var o;
93
+ var n;
78
94
  if (!e)
79
95
  return;
80
- const t = s.selectedSecuritySchemeUids.filter((n) => {
96
+ const t = s.selectedSecuritySchemeUids.filter((o) => {
81
97
  const l = e.split(",");
82
- return l.length > 1 && Array.isArray(n) && l.length === n.length ? n.every((c) => !l.includes(c)) : n !== e;
98
+ return l.length > 1 && Array.isArray(o) && l.length === o.length ? o.every((r) => !l.includes(r)) : o !== e;
83
99
  });
84
- V(t), (o = C.value) == null || o.$el.focus(), y.hide();
85
- }, T = h(
100
+ D(t), (n = R.value) == null || n.$el.focus(), h.hide();
101
+ }, I = p(
86
102
  () => {
87
103
  var e;
88
- return te(
89
- A.value.filteredRequirements,
104
+ return oe(
105
+ V.value.filteredRequirements,
90
106
  ((e = s.collection) == null ? void 0 : e.securitySchemes) ?? [],
91
- v,
92
- q === "modal" || s.layout === "reference"
107
+ u,
108
+ C === "modal" || s.layout === "reference"
93
109
  );
94
110
  }
95
111
  );
96
- return (e, t) => (m(), N(J, {
112
+ return (e, t) => (d(), N(G, {
97
113
  class: "group/params",
98
- itemCount: a.value.length,
114
+ itemCount: c.value.length,
99
115
  layout: e.layout
100
116
  }, {
101
- title: d(() => [
102
- i("div", {
103
- id: r(R),
117
+ title: f(() => [
118
+ a("div", {
119
+ id: i(q),
104
120
  class: "inline-flex items-center gap-1"
105
121
  }, [
106
- i("span", null, x(e.title), 1),
107
- b.value ? (m(), p("span", {
122
+ a("span", null, A(e.title), 1),
123
+ g.value ? (d(), S("span", {
108
124
  key: 0,
109
- class: E(["text-c-3 text-xs leading-[normal]", { "text-c-1": b.value.text === "Required" }])
110
- }, x(b.value.text), 3)) : z("", !0)
111
- ], 8, le)
125
+ class: z(["text-c-3 text-xs leading-[normal]", { "text-c-1": g.value.text === "Required" }])
126
+ }, A(g.value.text), 3)) : j("", !0)
127
+ ], 8, ne)
112
128
  ]),
113
- actions: d(() => [
114
- i("div", oe, [
115
- f(r(W), {
129
+ actions: f(() => [
130
+ a("div", se, [
131
+ y(i(Y), {
116
132
  class: "w-72 text-xs",
117
- isDeletable: r(q) !== "modal" && e.layout !== "reference",
118
- modelValue: a.value,
133
+ isDeletable: i(C) !== "modal" && e.layout !== "reference",
134
+ modelValue: c.value,
119
135
  multiple: "",
120
- options: T.value,
121
- onDelete: $,
122
- "onUpdate:modelValue": U
136
+ options: I.value,
137
+ onDelete: U,
138
+ "onUpdate:modelValue": M
123
139
  }, {
124
- default: d(() => [
125
- f(r(F), {
140
+ default: f(() => [
141
+ y(i(F), {
126
142
  ref_key: "comboboxButtonRef",
127
- ref: C,
128
- "aria-describedby": r(R),
143
+ ref: R,
144
+ "aria-describedby": i(q),
129
145
  class: "hover:bg-b-3 text-c-1 hover:text-c-1 py-0.25 h-fit px-1.5 font-normal",
130
146
  fullWidth: "",
131
147
  variant: "ghost"
132
148
  }, {
133
- default: d(() => {
134
- var o;
149
+ default: f(() => {
150
+ var n;
135
151
  return [
136
- i("div", ne, [
137
- a.value.length === 0 ? (m(), p(g, { key: 0 }, [
138
- t[2] || (t[2] = i("span", { class: "sr-only" }, "Select", -1)),
139
- t[3] || (t[3] = k(" Auth Type "))
140
- ], 64)) : a.value.length === 1 ? (m(), p(g, { key: 1 }, [
141
- t[4] || (t[4] = i("span", { class: "sr-only" }, "Selected Auth Type:", -1)),
142
- k(" " + x((o = a.value[0]) == null ? void 0 : o.label), 1)
143
- ], 64)) : (m(), p(g, { key: 2 }, [
144
- t[5] || (t[5] = k(" Multiple ")),
145
- t[6] || (t[6] = i("span", { class: "sr-only" }, "Auth Types Selected", -1))
152
+ a("div", re, [
153
+ c.value.length === 0 ? (d(), S(k, { key: 0 }, [
154
+ t[2] || (t[2] = a("span", { class: "sr-only" }, "Select", -1)),
155
+ t[3] || (t[3] = x(" Auth Type "))
156
+ ], 64)) : c.value.length === 1 ? (d(), S(k, { key: 1 }, [
157
+ t[4] || (t[4] = a("span", { class: "sr-only" }, "Selected Auth Type:", -1)),
158
+ x(" " + A((n = c.value[0]) == null ? void 0 : n.label), 1)
159
+ ], 64)) : (d(), S(k, { key: 2 }, [
160
+ t[5] || (t[5] = x(" Multiple ")),
161
+ t[6] || (t[6] = a("span", { class: "sr-only" }, "Auth Types Selected", -1))
146
162
  ], 64))
147
163
  ]),
148
- f(r(G), {
164
+ y(i(H), {
149
165
  class: "ml-1 shrink-0",
150
166
  icon: "ChevronDown",
151
167
  size: "sm"
@@ -159,23 +175,24 @@ const le = ["id"], oe = { class: "-mx-1 flex flex-1" }, ne = { class: "text-c-1"
159
175
  }, 8, ["isDeletable", "modelValue", "options"])
160
176
  ])
161
177
  ]),
162
- default: d(() => [
163
- f(Y, {
178
+ default: f(() => [
179
+ y(_, {
164
180
  collection: e.collection,
165
181
  envVariables: e.envVariables,
166
182
  environment: e.environment,
167
183
  layout: e.layout,
168
- selectedSchemeOptions: a.value,
184
+ persistAuth: e.persistAuth,
185
+ selectedSchemeOptions: c.value,
169
186
  server: e.server,
170
187
  workspace: e.workspace
171
- }, null, 8, ["collection", "envVariables", "environment", "layout", "selectedSchemeOptions", "server", "workspace"]),
172
- f(X, {
173
- scheme: S.value,
174
- state: r(y),
175
- onClose: t[0] || (t[0] = (o) => r(y).hide()),
176
- onDelete: t[1] || (t[1] = (o) => {
177
- var n;
178
- return B((n = S.value) == null ? void 0 : n.id);
188
+ }, null, 8, ["collection", "envVariables", "environment", "layout", "persistAuth", "selectedSchemeOptions", "server", "workspace"]),
189
+ y(Z, {
190
+ scheme: v.value,
191
+ state: i(h),
192
+ onClose: t[0] || (t[0] = (n) => i(h).hide()),
193
+ onDelete: t[1] || (t[1] = (n) => {
194
+ var o;
195
+ return B((o = v.value) == null ? void 0 : o.id);
179
196
  })
180
197
  }, null, 8, ["scheme", "state"])
181
198
  ]),
@@ -184,5 +201,5 @@ const le = ["id"], oe = { class: "-mx-1 flex flex-1" }, ne = { class: "text-c-1"
184
201
  }
185
202
  });
186
203
  export {
187
- he as default
204
+ Se as default
188
205
  };
@@ -7,6 +7,7 @@ type __VLS_Props = {
7
7
  environment: Environment;
8
8
  envVariables: EnvVariable[];
9
9
  layout: 'client' | 'reference';
10
+ persistAuth: boolean;
10
11
  selectedSchemeOptions: {
11
12
  id: string;
12
13
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue"],"names":[],"mappings":"AAgNA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EACV,UAAU,EAEV,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAIrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAO1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,qBAAqB,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAgNF,wBAOG"}
1
+ {"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue"],"names":[],"mappings":"AAmNA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EACV,UAAU,EAEV,MAAM,EACP,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAIrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAO1D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,WAAW,EAAE,OAAO,CAAA;IACpB,qBAAqB,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACtD,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,SAAS,EAAE,SAAS,CAAA;CACrB,CAAC;;AAkNF,wBAOG"}
@@ -1,7 +1,7 @@
1
1
  import t from "./RequestAuthDataTable.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-9f1d3e60"]]);
4
+ const f = /* @__PURE__ */ o(t, [["__scopeId", "data-v-6e4f51b7"]]);
5
5
  export {
6
6
  f as default
7
7
  };