@scalar/api-client 2.10.0 → 2.11.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 (156) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/components/ImportCollection/IntegrationLogo.vue.d.ts.map +1 -1
  3. package/dist/components/ImportCollection/IntegrationLogo.vue.js +1 -0
  4. package/dist/components/Server/ServerVariablesForm.vue.d.ts.map +1 -1
  5. package/dist/components/Server/ServerVariablesForm.vue.js +6 -6
  6. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.d.ts.map +1 -1
  7. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue.js +1 -1
  8. package/dist/components/Sidebar/Actions/SidebarListElementForm.vue2.js +14 -13
  9. package/dist/hooks/useClientConfig.d.ts +3 -3
  10. package/dist/layouts/App/create-api-client-app.d.ts +1 -1
  11. package/dist/layouts/Web/create-api-client-web.d.ts +1 -1
  12. package/dist/libs/create-client.d.ts +1 -1
  13. package/dist/store/store.d.ts +1 -1
  14. package/dist/style.css +1 -1
  15. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +4 -6
  16. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  17. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +24 -27
  18. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +3 -6
  19. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  20. package/dist/v2/blocks/operation-block/components/Header.vue.js +2 -2
  21. package/dist/v2/blocks/operation-block/components/Header.vue2.js +10 -12
  22. package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.d.ts.map +1 -1
  23. package/dist/v2/blocks/operation-code-sample/components/ExamplePicker.vue.js +11 -10
  24. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts +2 -5
  25. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  26. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  27. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +45 -47
  28. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +11 -9
  29. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  30. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.js +179 -5
  31. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue2.js +2 -179
  32. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +201 -198
  33. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +11 -6
  34. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  35. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +82 -5
  36. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue2.js +2 -85
  37. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts +3 -13
  38. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  39. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js +16 -18
  40. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +133 -142
  41. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +1 -1
  42. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  43. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +1 -1
  44. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue.d.ts +2 -16
  45. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue.d.ts.map +1 -1
  46. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue.js +2 -2
  47. package/dist/v2/blocks/scalar-operation-block/components/OperationBlock.vue2.js +202 -229
  48. package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue.d.ts +3 -5
  49. package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue.d.ts.map +1 -1
  50. package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue.js +2 -2
  51. package/dist/v2/blocks/scalar-operation-block/components/OperationBody.vue2.js +81 -85
  52. package/dist/v2/blocks/scalar-operation-block/components/OperationParams.vue.d.ts +2 -5
  53. package/dist/v2/blocks/scalar-operation-block/components/OperationParams.vue.d.ts.map +1 -1
  54. package/dist/v2/blocks/scalar-operation-block/components/OperationParams.vue.js +32 -34
  55. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue.d.ts +2 -5
  56. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue.d.ts.map +1 -1
  57. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue.js +2 -2
  58. package/dist/v2/blocks/scalar-operation-block/components/OperationTable.vue2.js +31 -33
  59. package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.vue.d.ts +2 -5
  60. package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.vue.d.ts.map +1 -1
  61. package/dist/v2/blocks/scalar-operation-block/components/OperationTableRow.vue.js +42 -45
  62. package/dist/v2/blocks/scalar-response-block/components/Headers.vue.d.ts +2 -2
  63. package/dist/v2/blocks/scalar-response-block/components/Headers.vue.d.ts.map +1 -1
  64. package/dist/v2/blocks/scalar-response-block/components/Headers.vue.js +9 -9
  65. package/dist/v2/blocks/scalar-response-block/components/ResponseBody.vue.d.ts.map +1 -1
  66. package/dist/v2/blocks/scalar-response-block/components/ResponseBody.vue.js +2 -2
  67. package/dist/v2/blocks/scalar-response-block/components/ResponseBody.vue2.js +18 -18
  68. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyStreaming.vue.d.ts.map +1 -1
  69. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyStreaming.vue.js +14 -14
  70. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyVirtual.vue.d.ts.map +1 -1
  71. package/dist/v2/blocks/scalar-response-block/components/ResponseBodyVirtual.vue.js +12 -12
  72. package/dist/v2/blocks/scalar-response-block/components/ResponseCookies.vue.d.ts.map +1 -1
  73. package/dist/v2/blocks/scalar-response-block/components/ResponseCookies.vue.js +13 -13
  74. package/dist/v2/components/data-table/DataTable.vue.d.ts.map +1 -1
  75. package/dist/v2/components/data-table/DataTable.vue.js +4 -4
  76. package/dist/v2/components/data-table/DataTableInput.vue.d.ts +5 -7
  77. package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
  78. package/dist/v2/components/data-table/DataTableInput.vue.js +2 -2
  79. package/dist/v2/components/data-table/DataTableInput.vue2.js +32 -36
  80. package/dist/v2/components/forms/ConfirmationForm.vue.d.ts +25 -0
  81. package/dist/v2/components/forms/ConfirmationForm.vue.d.ts.map +1 -0
  82. package/dist/v2/components/forms/ConfirmationForm.vue.js +7 -0
  83. package/dist/v2/components/forms/ConfirmationForm.vue2.js +45 -0
  84. package/dist/v2/components/forms/index.d.ts +2 -0
  85. package/dist/v2/components/forms/index.d.ts.map +1 -0
  86. package/dist/v2/components/forms/index.js +4 -0
  87. package/dist/v2/components/layout/CollapsibleSection.vue.d.ts +43 -0
  88. package/dist/v2/components/layout/CollapsibleSection.vue.d.ts.map +1 -0
  89. package/dist/v2/components/layout/CollapsibleSection.vue.js +89 -0
  90. package/dist/v2/components/layout/CollapsibleSection.vue2.js +4 -0
  91. package/dist/v2/components/layout/ValueEmitter.vue.d.ts +23 -0
  92. package/dist/v2/components/layout/ValueEmitter.vue.d.ts.map +1 -0
  93. package/dist/v2/components/layout/ValueEmitter.vue.js +21 -0
  94. package/dist/v2/components/layout/ValueEmitter.vue2.js +4 -0
  95. package/dist/v2/components/layout/index.d.ts +2 -0
  96. package/dist/v2/components/layout/index.d.ts.map +1 -0
  97. package/dist/v2/components/layout/index.js +4 -0
  98. package/dist/v2/components/modals/DeleteModal.vue.d.ts +15 -0
  99. package/dist/v2/components/modals/DeleteModal.vue.d.ts.map +1 -0
  100. package/dist/v2/components/modals/DeleteModal.vue.js +31 -0
  101. package/dist/v2/components/modals/DeleteModal.vue2.js +4 -0
  102. package/dist/v2/components/modals/index.d.ts +2 -0
  103. package/dist/v2/components/modals/index.d.ts.map +1 -0
  104. package/dist/v2/components/modals/index.js +4 -0
  105. package/dist/v2/components/server/ServerDropdown.vue.d.ts +4 -2
  106. package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
  107. package/dist/v2/components/server/ServerDropdown.vue.js +31 -31
  108. package/dist/v2/components/server/ServerDropdownItem.vue.d.ts +2 -6
  109. package/dist/v2/components/server/ServerDropdownItem.vue.d.ts.map +1 -1
  110. package/dist/v2/components/server/ServerDropdownItem.vue.js +1 -1
  111. package/dist/v2/components/server/ServerDropdownItem.vue2.js +16 -16
  112. package/dist/v2/components/server/index.d.ts.map +1 -1
  113. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +6 -2
  114. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  115. package/dist/v2/components/sidebar/Sidebar.vue.js +45 -55
  116. package/dist/v2/features/app/App.vue.d.ts +2 -2
  117. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  118. package/dist/v2/features/app/App.vue.js +89 -74
  119. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +6 -2
  120. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  121. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  122. package/dist/v2/features/app/components/AppSidebar.vue2.js +50 -47
  123. package/dist/v2/features/app/helpers/routes.d.ts +0 -10
  124. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  125. package/dist/v2/features/collection/DocumentCollection.vue.d.ts.map +1 -1
  126. package/dist/v2/features/collection/DocumentCollection.vue2.js +75 -73
  127. package/dist/v2/features/collection/components/Authentication.vue.d.ts +13 -25
  128. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  129. package/dist/v2/features/collection/components/Authentication.vue.js +2 -2
  130. package/dist/v2/features/collection/components/Authentication.vue2.js +47 -35
  131. package/dist/v2/features/collection/components/Form.vue.d.ts +3 -7
  132. package/dist/v2/features/collection/components/Form.vue.d.ts.map +1 -1
  133. package/dist/v2/features/collection/components/Form.vue.js +28 -33
  134. package/dist/v2/features/collection/components/Servers.vue.d.ts +13 -31
  135. package/dist/v2/features/collection/components/Servers.vue.d.ts.map +1 -1
  136. package/dist/v2/features/collection/components/Servers.vue2.js +103 -82
  137. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.d.ts.map +1 -1
  138. package/dist/v2/features/environments/components/EnvironmentVariablesTable.vue.js +3 -3
  139. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  140. package/dist/v2/features/modal/Modal.vue.js +3 -3
  141. package/dist/v2/features/modal/Modal.vue2.js +40 -32
  142. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  143. package/dist/v2/features/operation/Operation.vue.js +22 -28
  144. package/dist/v2/hooks/use-sidebar-state.d.ts +47 -0
  145. package/dist/v2/hooks/use-sidebar-state.d.ts.map +1 -0
  146. package/dist/v2/hooks/use-sidebar-state.js +112 -0
  147. package/dist/v2/hooks/use-workspace-client-events.d.ts.map +1 -1
  148. package/dist/v2/hooks/use-workspace-client-events.js +75 -107
  149. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  150. package/package.json +17 -17
  151. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +0 -45
  152. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +0 -1
  153. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +0 -29
  154. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +0 -1
  155. package/dist/v2/blocks/scalar-auth-selector-block/event-types.d.ts +0 -29
  156. package/dist/v2/blocks/scalar-auth-selector-block/event-types.d.ts.map +0 -1
@@ -0,0 +1,47 @@
1
+ import type { HttpMethod } from '@scalar/helpers/http/http-methods';
2
+ import type { WorkspaceStore } from '@scalar/workspace-store/client';
3
+ import type { TraversedEntry } from '@scalar/workspace-store/schemas/navigation';
4
+ import { type MaybeRefOrGetter } from 'vue';
5
+ /**
6
+ * useSidebarState - Custom hook to manage the sidebar state and navigation logic in the Scalar API client
7
+ *
8
+ * This composable manages the sidebar structure, synchronizes selection state
9
+ * with the current route, and provides a handler for selecting sidebar items.
10
+ *
11
+ * Example usage:
12
+ *
13
+ * const { handleSelectItem, sidebarState } = useSidebarState({
14
+ * workspaceStore,
15
+ * workspaceSlug,
16
+ * documentSlug,
17
+ * path,
18
+ * method,
19
+ * exampleName,
20
+ * })
21
+ */
22
+ export declare const useSidebarState: ({ workspaceStore, workspaceSlug, documentSlug, path, method, exampleName, }: {
23
+ workspaceStore: MaybeRefOrGetter<WorkspaceStore>;
24
+ workspaceSlug: MaybeRefOrGetter<string>;
25
+ documentSlug: MaybeRefOrGetter<string | undefined>;
26
+ path: MaybeRefOrGetter<string | undefined>;
27
+ method: MaybeRefOrGetter<HttpMethod | undefined>;
28
+ exampleName: MaybeRefOrGetter<string | undefined>;
29
+ }) => {
30
+ handleSelectItem: (id: string) => Promise<void | import("vue-router").NavigationFailure | undefined> | undefined;
31
+ sidebarState: {
32
+ items: import("vue").ComputedRef<TraversedEntry[]>;
33
+ index: import("vue").ComputedRef<Map<string, TraversedEntry & {
34
+ parent?: TraversedEntry | undefined;
35
+ }>>;
36
+ selectedItems: import("vue").Ref<Record<string, boolean>, Record<string, boolean>>;
37
+ expandedItems: import("vue").Ref<Record<string, boolean>, Record<string, boolean>>;
38
+ setSelected: (id: string | null) => void;
39
+ setExpanded: (id: string, value: boolean) => void;
40
+ isExpanded: (id: string) => boolean;
41
+ isSelected: (id: string) => boolean;
42
+ getEntryById: (id: string) => (TraversedEntry & {
43
+ parent?: TraversedEntry | undefined;
44
+ }) | undefined;
45
+ };
46
+ };
47
+ //# sourceMappingURL=use-sidebar-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-sidebar-state.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/use-sidebar-state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAEnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,EAAE,KAAK,gBAAgB,EAA4B,MAAM,KAAK,CAAA;AAGrE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,eAAe,GAAI,6EAO7B;IACD,cAAc,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAA;IAChD,aAAa,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IACvC,YAAY,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAClD,IAAI,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC1C,MAAM,EAAE,gBAAgB,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;IAChD,WAAW,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;CAClD;2BA6H+B,MAAM;;;;;;;;;;;;;;;;CAkGrC,CAAA"}
@@ -0,0 +1,112 @@
1
+ import { isDefined as c } from "@scalar/helpers/array/is-defined";
2
+ import { createSidebarState as I, generateReverseIndex as b } from "@scalar/sidebar";
3
+ import { computed as i, toValue as w, watch as R } from "vue";
4
+ import { useRouter as C } from "vue-router";
5
+ const U = ({
6
+ workspaceStore: l,
7
+ workspaceSlug: h,
8
+ documentSlug: x,
9
+ path: f,
10
+ method: y,
11
+ exampleName: S
12
+ }) => {
13
+ const m = C(), s = i(() => Object.values(w(l).workspace.documents).map((e) => e["x-scalar-navigation"]).filter(c)), n = I(s), a = (e, t) => {
14
+ if (t)
15
+ return t.type === e ? t : a(e, t.parent);
16
+ }, d = ({
17
+ document: e,
18
+ path: t,
19
+ method: r,
20
+ example: o
21
+ }) => JSON.stringify([e, t, r, o].filter(c)), u = i(
22
+ () => b({
23
+ items: s.value,
24
+ nestedKey: "children",
25
+ filter: (e) => e.type === "document" || e.type === "operation" || e.type === "example",
26
+ getId: (e) => {
27
+ const t = a("document", e), r = a("operation", e);
28
+ return d({
29
+ document: t?.name ?? "",
30
+ path: r?.path,
31
+ method: r?.method,
32
+ example: e.type === "example" ? e.name : void 0
33
+ });
34
+ }
35
+ })
36
+ ), E = (e) => {
37
+ const t = u.value.get(d(e));
38
+ return t || u.value.get(
39
+ d({
40
+ document: e.document,
41
+ path: e.path,
42
+ method: e.method
43
+ })
44
+ );
45
+ }, g = (e) => {
46
+ const t = n.getEntryById(e);
47
+ if (!t) {
48
+ console.warn(`Could not find sidebar entry with id ${e} to select`);
49
+ return;
50
+ }
51
+ if (t.type === "document")
52
+ return n.setSelected(e), n.setExpanded(e, !n.isExpanded(e)), m.push({
53
+ name: "document.overview",
54
+ params: { documentSlug: t.name }
55
+ });
56
+ if (t.type === "operation") {
57
+ if (n.isSelected(e)) {
58
+ n.setExpanded(e, !n.isExpanded(e));
59
+ return;
60
+ }
61
+ const r = t.children?.find((o) => o.type === "example");
62
+ return r ? (n.setSelected(r.id), n.setExpanded(r.id, !0)) : n.setSelected(e), m.push({
63
+ name: "example",
64
+ params: {
65
+ documentSlug: a("document", t)?.name,
66
+ pathEncoded: encodeURIComponent(t.path),
67
+ method: t.method,
68
+ exampleName: r?.name ?? "default"
69
+ }
70
+ });
71
+ }
72
+ if (t.type === "example") {
73
+ n.setSelected(e), n.setExpanded(e, !0);
74
+ const r = a("operation", t);
75
+ return m.push({
76
+ name: "example",
77
+ params: {
78
+ documentSlug: a("document", t)?.name,
79
+ pathEncoded: encodeURIComponent(r?.path ?? ""),
80
+ method: r?.method,
81
+ exampleName: t.name
82
+ }
83
+ });
84
+ }
85
+ n.setExpanded(e, !n.isExpanded(e));
86
+ };
87
+ return R(
88
+ [h, x, f, y, S],
89
+ ([e, t, r, o, v]) => {
90
+ if (!t) {
91
+ n.setSelected(null);
92
+ return;
93
+ }
94
+ const p = E({
95
+ document: t,
96
+ path: r,
97
+ method: o,
98
+ example: v
99
+ });
100
+ p && (n.setSelected(p.id), n.setExpanded(p.id, !0));
101
+ },
102
+ {
103
+ immediate: !0
104
+ }
105
+ ), {
106
+ handleSelectItem: g,
107
+ sidebarState: n
108
+ };
109
+ };
110
+ export {
111
+ U as useSidebarState
112
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"use-workspace-client-events.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/use-workspace-client-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAkB,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAuBvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAEtC;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,iBAAiB,EAC3B,UAAU,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,EAC/C,gBAAgB,cAAc,SA6L/B,CAAA"}
1
+ {"version":3,"file":"use-workspace-client-events.d.ts","sourceRoot":"","sources":["../../../src/v2/hooks/use-workspace-client-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,KAAK,EAAkB,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AA6BvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAEtC;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,iBAAiB,EAC3B,UAAU,WAAW,CAAC,iBAAiB,GAAG,IAAI,CAAC,EAC/C,gBAAgB,cAAc,SAoK/B,CAAA"}
@@ -1,140 +1,108 @@
1
- import { mergeObjects as l } from "@scalar/workspace-store/helpers/merge-object";
2
- import { upsertEnvironment as d, upsertEnvironmentVariable as u, deleteSecurityScheme as m, updateSelectedScopes as c, updateSelectedSecuritySchemes as s, updateSecurityScheme as v, updateSelectedAuthTab as y, updateOperationMethod as h, updateOperationPath as O, updateOperationSummary as R, addOperationParameter as q, updateOperationParameter as S, deleteOperationParameter as f, deleteAllOperationParameters as w, updateOperationRequestBodyContentType as b, updateOperationRequestBodyExample as x, addOperationRequestBodyFormRow as P, updateOperationRequestBodyFormRow as E, deleteOperationRequestBodyFormRow as T } from "@scalar/workspace-store/mutators";
3
- const F = (t, o, i) => {
4
- const p = (e, a) => a === "document" ? e.value : i.workspace;
5
- t.on(
1
+ import { mergeObjects as i } from "@scalar/workspace-store/helpers/merge-object";
2
+ import { toggleDocumentSecurity as d, upsertEnvironment as u, upsertEnvironmentVariable as v, deleteSecurityScheme as m, updateSelectedAuthTab as c, updateSecurityScheme as s, updateSelectedScopes as y, updateSelectedSecuritySchemes as S, addServer as h, updateServer as O, deleteServer as R, updateServerVariables as q, updateSelectedServer as b, updateOperationMethod as f, updateOperationPath as g, updateOperationSummary as w, addOperationParameter as x, updateOperationParameter as P, deleteOperationParameter as E, deleteAllOperationParameters as T, updateOperationRequestBodyContentType as C, updateOperationRequestBodyExample as F, addOperationRequestBodyFormRow as k, updateOperationRequestBodyFormRow as A, deleteOperationRequestBodyFormRow as V } from "@scalar/workspace-store/mutators";
3
+ const M = (r, a, n) => {
4
+ const p = (e, o) => o === "document" ? e.value : n.workspace;
5
+ r.on(
6
6
  "document:update:icon",
7
- (e) => o.value && (o.value["x-scalar-client-config-icon"] = e)
8
- ), t.on(
9
- "document:update:info",
10
- (e) => o.value && (o.value.info = l(o.value.info, e))
11
- ), t.on(
7
+ (e) => a.value && (a.value["x-scalar-client-config-icon"] = e)
8
+ ), r.on("document:update:info", (e) => a.value && i(a.value.info, e)), r.on("document:toggle:document-security", () => d(a.value)), r.on(
12
9
  "environment:upsert:environment",
13
- (e) => d(o.value, i.workspace, e)
14
- ), t.on(
10
+ (e) => u(a.value, n.workspace, e)
11
+ ), r.on(
15
12
  "environment:delete:environment",
16
- ({ environmentName: e, collectionType: a }) => delete p(o, a)?.["x-scalar-environments"]?.[e]
17
- ), t.on(
13
+ ({ environmentName: e, collectionType: o }) => delete p(a, o)?.["x-scalar-environments"]?.[e]
14
+ ), r.on(
18
15
  "environment:upsert:environment-variable",
19
- (e) => u(p(o, e.collectionType), e)
20
- ), t.on(
16
+ (e) => v(p(a, e.collectionType), e)
17
+ ), r.on(
21
18
  "environment:delete:environment-variable",
22
- ({ environmentName: e, index: a, collectionType: r }) => p(o, r)?.["x-scalar-environments"]?.[e]?.variables?.splice(a, 1)
23
- ), t.on("auth:delete:security-scheme", ({ names: e }) => {
24
- m({
25
- document: o.value,
26
- names: e
27
- });
28
- }), t.on("auth:update:selected-scopes", ({ id: e, name: a, scopes: r, meta: n }) => {
29
- c({
30
- document: o.value,
31
- id: e,
32
- name: a,
33
- scopes: r,
34
- meta: n
35
- });
36
- }), t.on("auth:update:selected-security-schemes", ({ newSchemes: e, selectedRequirements: a, meta: r }) => {
37
- s({
38
- document: o.value,
39
- newSchemes: e,
40
- selectedRequirements: a,
41
- meta: r
42
- });
43
- }), t.on("auth:update:security-scheme", ({ data: e, name: a }) => {
44
- v({
45
- document: o.value,
46
- data: e,
47
- name: a
48
- });
49
- }), t.on("auth:update:active-index", ({ index: e, meta: a }) => {
50
- y({
51
- document: o.value,
52
- index: e,
53
- meta: a
54
- });
55
- }), t.on("operation:update:method", ({ payload: e, meta: a }) => {
56
- h({
57
- document: o.value,
58
- meta: a,
19
+ ({ environmentName: e, index: o, collectionType: t }) => p(a, t)?.["x-scalar-environments"]?.[e]?.variables?.splice(o, 1)
20
+ ), r.on("auth:delete:security-scheme", (e) => m(a.value, e)), r.on("auth:update:active-index", (e) => c(a.value, e)), r.on("auth:update:security-scheme", (e) => s(a.value, e)), r.on("auth:update:selected-scopes", (e) => y(a.value, e)), r.on(
21
+ "auth:update:selected-security-schemes",
22
+ (e) => S(a.value, e)
23
+ ), r.on("server:add:server", () => h(a.value)), r.on("server:update:server", (e) => O(a.value, e)), r.on("server:delete:server", (e) => R(a.value, e)), r.on("server:update:variables", (e) => q(a.value, e)), r.on("server:update:selected", (e) => b(a.value, e)), r.on("operation:update:method", ({ payload: e, meta: o }) => {
24
+ f({
25
+ document: a.value,
26
+ meta: o,
59
27
  payload: e
60
28
  });
61
- }), t.on("operation:update:path", ({ meta: e, payload: a }) => {
62
- O({
63
- document: o.value,
29
+ }), r.on("operation:update:path", ({ meta: e, payload: o }) => {
30
+ g({
31
+ document: a.value,
64
32
  meta: e,
65
- payload: a
33
+ payload: o
66
34
  });
67
- }), t.on("operation:update:summary", ({ payload: e, meta: a }) => {
68
- R({
69
- document: o.value,
70
- meta: a,
35
+ }), r.on("operation:update:summary", ({ payload: e, meta: o }) => {
36
+ w({
37
+ document: a.value,
38
+ meta: o,
71
39
  payload: e
72
40
  });
73
- }), t.on("operation:add:parameter", ({ type: e, meta: a, payload: r }) => {
74
- q({
75
- document: o.value,
76
- meta: a,
77
- payload: r,
41
+ }), r.on("operation:add:parameter", ({ type: e, meta: o, payload: t }) => {
42
+ x({
43
+ document: a.value,
44
+ meta: o,
45
+ payload: t,
78
46
  type: e
79
47
  });
80
- }), t.on("operation:update:parameter", ({ meta: e, payload: a, index: r, type: n }) => {
81
- S({
82
- document: o.value,
48
+ }), r.on("operation:update:parameter", ({ meta: e, payload: o, index: t, type: l }) => {
49
+ P({
50
+ document: a.value,
83
51
  meta: e,
84
- payload: a,
85
- index: r,
86
- type: n
52
+ payload: o,
53
+ index: t,
54
+ type: l
87
55
  });
88
- }), t.on("operation:delete:parameter", ({ index: e, meta: a, type: r }) => {
89
- f({
90
- document: o.value,
91
- meta: a,
56
+ }), r.on("operation:delete:parameter", ({ index: e, meta: o, type: t }) => {
57
+ E({
58
+ document: a.value,
59
+ meta: o,
92
60
  index: e,
93
- type: r
61
+ type: t
94
62
  });
95
- }), t.on("operation:delete-all:parameters", ({ meta: e, type: a }) => {
96
- w({
97
- document: o.value,
63
+ }), r.on("operation:delete-all:parameters", ({ meta: e, type: o }) => {
64
+ T({
65
+ document: a.value,
98
66
  meta: e,
99
- type: a
67
+ type: o
100
68
  });
101
- }), t.on("operation:update:requestBody:contentType", ({ payload: e, meta: a }) => {
102
- b({
103
- document: o.value,
104
- meta: a,
69
+ }), r.on("operation:update:requestBody:contentType", ({ payload: e, meta: o }) => {
70
+ C({
71
+ document: a.value,
72
+ meta: o,
105
73
  payload: e
106
74
  });
107
- }), t.on("operation:update:requestBody:value", ({ contentType: e, payload: a, meta: r }) => {
108
- x({
109
- document: o.value,
110
- meta: r,
111
- payload: a,
75
+ }), r.on("operation:update:requestBody:value", ({ contentType: e, payload: o, meta: t }) => {
76
+ F({
77
+ document: a.value,
78
+ meta: t,
79
+ payload: o,
112
80
  contentType: e
113
81
  });
114
- }), t.on("operation:add:requestBody:formRow", ({ payload: e, contentType: a, meta: r }) => {
115
- P({
116
- document: o.value,
117
- meta: r,
82
+ }), r.on("operation:add:requestBody:formRow", ({ payload: e, contentType: o, meta: t }) => {
83
+ k({
84
+ document: a.value,
85
+ meta: t,
118
86
  payload: e,
119
- contentType: a
87
+ contentType: o
120
88
  });
121
- }), t.on("operation:update:requestBody:formRow", ({ index: e, payload: a, contentType: r, meta: n }) => {
122
- E({
123
- document: o.value,
124
- meta: n,
89
+ }), r.on("operation:update:requestBody:formRow", ({ index: e, payload: o, contentType: t, meta: l }) => {
90
+ A({
91
+ document: a.value,
92
+ meta: l,
125
93
  index: e,
126
- payload: a,
127
- contentType: r
94
+ payload: o,
95
+ contentType: t
128
96
  });
129
- }), t.on("operation:delete:requestBody:formRow", ({ index: e, contentType: a, meta: r }) => {
130
- T({
131
- document: o.value,
132
- meta: r,
97
+ }), r.on("operation:delete:requestBody:formRow", ({ index: e, contentType: o, meta: t }) => {
98
+ V({
99
+ document: a.value,
100
+ meta: t,
133
101
  index: e,
134
- contentType: a
102
+ contentType: o
135
103
  });
136
104
  });
137
105
  };
138
106
  export {
139
- F as useWorkspaceClientEvents
107
+ M as useWorkspaceClientEvents
140
108
  };
@@ -33,7 +33,7 @@ const W = { class: "flex-center relative flex flex-1 flex-col gap-6 p-2 capitali
33
33
  }));
34
34
  }, f = (o) => {
35
35
  o?.createNew && g.name === "request" && d();
36
- }, v = "2.10.0";
36
+ }, v = "2.11.0";
37
37
  return q(() => a.hotKeys.on(f)), R(() => a.hotKeys.off(f)), (o, e) => (i(), l("div", W, [
38
38
  s("div", {
39
39
  class: y(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center", {
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  "rest",
19
19
  "testing"
20
20
  ],
21
- "version": "2.10.0",
21
+ "version": "2.11.0",
22
22
  "engines": {
23
23
  "node": ">=20"
24
24
  },
@@ -232,25 +232,25 @@
232
232
  "yaml": "2.8.0",
233
233
  "zod": "4.1.11",
234
234
  "@scalar/analytics-client": "1.0.0",
235
- "@scalar/components": "0.16.2",
236
- "@scalar/draggable": "0.3.0",
237
- "@scalar/helpers": "0.1.0",
235
+ "@scalar/components": "0.16.3",
236
+ "@scalar/helpers": "0.1.1",
238
237
  "@scalar/icons": "0.5.0",
239
- "@scalar/import": "0.4.33",
240
- "@scalar/oas-utils": "0.6.2",
241
- "@scalar/json-magic": "0.8.0",
242
- "@scalar/object-utils": "1.2.10",
243
- "@scalar/openapi-parser": "0.23.1",
238
+ "@scalar/draggable": "0.3.0",
239
+ "@scalar/import": "0.4.34",
240
+ "@scalar/oas-utils": "0.6.3",
241
+ "@scalar/object-utils": "1.2.11",
242
+ "@scalar/openapi-parser": "0.23.2",
243
+ "@scalar/json-magic": "0.8.1",
244
+ "@scalar/postman-to-openapi": "0.3.44",
244
245
  "@scalar/openapi-types": "0.5.1",
245
- "@scalar/postman-to-openapi": "0.3.43",
246
- "@scalar/sidebar": "0.2.2",
247
- "@scalar/types": "0.4.0",
248
- "@scalar/themes": "0.13.23",
249
246
  "@scalar/snippetz": "0.5.2",
247
+ "@scalar/sidebar": "0.3.0",
248
+ "@scalar/themes": "0.13.23",
249
+ "@scalar/types": "0.4.0",
250
+ "@scalar/use-codemirror": "0.12.47",
251
+ "@scalar/use-toasts": "0.9.0",
250
252
  "@scalar/use-hooks": "0.3.0",
251
- "@scalar/use-codemirror": "0.12.46",
252
- "@scalar/workspace-store": "0.19.0",
253
- "@scalar/use-toasts": "0.9.0"
253
+ "@scalar/workspace-store": "0.20.0"
254
254
  },
255
255
  "devDependencies": {
256
256
  "@tailwindcss/vite": "^4.1.7",
@@ -265,7 +265,7 @@
265
265
  "vite-svg-loader": "5.1.0",
266
266
  "vitest": "3.2.4",
267
267
  "@scalar/build-tooling": "0.2.8",
268
- "@scalar/galaxy": "0.5.10"
268
+ "@scalar/galaxy": "0.5.11"
269
269
  },
270
270
  "scripts": {
271
271
  "build": "scalar-build-vite",
@@ -1,45 +0,0 @@
1
- import type { Environment } from '@scalar/oas-utils/entities/environment';
2
- import type { OAuthFlowsObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
- import { type EnvVariable } from '../../../../store/index.js';
4
- type __VLS_Props = {
5
- environment: Environment;
6
- envVariables: EnvVariable[];
7
- flows: OAuthFlowsObject;
8
- type: keyof OAuthFlowsObject;
9
- selectedScopes: string[];
10
- server: ServerObject | undefined;
11
- proxyUrl: string;
12
- };
13
- declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
- "update:selectedScopes": (payload: {
15
- scopes: string[];
16
- }) => any;
17
- "update:securityScheme": (payload: Partial<{
18
- authUrl: string;
19
- tokenUrl: string;
20
- token: string;
21
- redirectUrl: string;
22
- clientId: string;
23
- clientSecret: string;
24
- usePkce: "no" | "SHA-256" | "plain";
25
- username: string;
26
- password: string;
27
- }>) => any;
28
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
29
- "onUpdate:selectedScopes"?: ((payload: {
30
- scopes: string[];
31
- }) => any) | undefined;
32
- "onUpdate:securityScheme"?: ((payload: Partial<{
33
- authUrl: string;
34
- tokenUrl: string;
35
- token: string;
36
- redirectUrl: string;
37
- clientId: string;
38
- clientSecret: string;
39
- usePkce: "no" | "SHA-256" | "plain";
40
- username: string;
41
- password: string;
42
- }>) => any) | undefined;
43
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
44
- export default _default;
45
- //# sourceMappingURL=OAuth2.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"names":[],"mappings":"AAiQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAGzE,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAIrE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAA;AAO1C,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,KAAK,EAAE,gBAAgB,CAAA;IACvB,IAAI,EAAE,MAAM,gBAAgB,CAAA;IAC5B,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,MAAM,EAAE,YAAY,GAAG,SAAS,CAAA;IAChC,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAC;;;gBAYgD,MAAM,EAAE;;;;;;;;;;;;;;;gBAAR,MAAM,EAAE;;;;;;;;;;;;;;AAohB1D,wBAOG"}
@@ -1,29 +0,0 @@
1
- import type { Environment } from '@scalar/oas-utils/entities/environment';
2
- import type { ComponentsObject, OpenApiDocument, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
- import { type EnvVariable } from '../../../../store/index.js';
4
- import type { UpdateSecuritySchemeEvent } from '../../../../v2/blocks/scalar-auth-selector-block/event-types';
5
- type __VLS_Props = {
6
- environment: Environment;
7
- envVariables: EnvVariable[];
8
- layout: 'client' | 'reference';
9
- selectedSecuritySchemas: NonNullable<OpenApiDocument['x-scalar-selected-security']>['x-schemes'][number];
10
- securitySchemes: NonNullable<ComponentsObject['securitySchemes']>;
11
- server: ServerObject | undefined;
12
- };
13
- declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
- "update:selectedScopes": (payload: {
15
- id: string[];
16
- name: string;
17
- scopes: string[];
18
- }) => any;
19
- "update:securityScheme": (payload: UpdateSecuritySchemeEvent) => any;
20
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
21
- "onUpdate:selectedScopes"?: ((payload: {
22
- id: string[];
23
- name: string;
24
- scopes: string[];
25
- }) => any) | undefined;
26
- "onUpdate:securityScheme"?: ((payload: UpdateSecuritySchemeEvent) => any) | undefined;
27
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
- export default _default;
29
- //# sourceMappingURL=RequestAuthTab.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RequestAuthTab.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue"],"names":[],"mappings":"AAuRA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAEzE,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAEf,YAAY,EACb,MAAM,8DAA8D,CAAA;AAIrE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAA;AAInG,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,WAAW,CAAA;IACxB,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,MAAM,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC9B,uBAAuB,EAAE,WAAW,CAClC,eAAe,CAAC,4BAA4B,CAAC,CAC9C,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;IACtB,eAAe,EAAE,WAAW,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,CAAA;IACjE,MAAM,EAAE,YAAY,GAAG,SAAS,CAAA;CACjC,CAAC;;;YAciB,MAAM,EAAE;cAAQ,MAAM;gBAAU,MAAM,EAAE;;;;;YAAxC,MAAM,EAAE;cAAQ,MAAM;gBAAU,MAAM,EAAE;;;;AAqhB3D,wBAOG"}
@@ -1,29 +0,0 @@
1
- export type UpdateSecuritySchemeEvent = {
2
- type: 'http';
3
- payload: Partial<{
4
- token: string;
5
- username: string;
6
- password: string;
7
- }>;
8
- } | {
9
- type: 'apiKey';
10
- payload: Partial<{
11
- name: string;
12
- value: string;
13
- }>;
14
- } | {
15
- type: 'oauth2';
16
- flow: 'implicit' | 'password' | 'clientCredentials' | 'authorizationCode';
17
- payload: Partial<{
18
- authUrl: string;
19
- tokenUrl: string;
20
- token: string;
21
- redirectUrl: string;
22
- clientId: string;
23
- clientSecret: string;
24
- usePkce: 'no' | 'SHA-256' | 'plain';
25
- username: string;
26
- password: string;
27
- }>;
28
- };
29
- //# sourceMappingURL=event-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"event-types.d.ts","sourceRoot":"","sources":["../../../../src/v2/blocks/scalar-auth-selector-block/event-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,yBAAyB,GACjC;IACE,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,OAAO,CAAC;QACf,KAAK,EAAE,MAAM,CAAA;QACb,QAAQ,EAAE,MAAM,CAAA;QAChB,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAC,CAAA;CACH,GACD;IACE,IAAI,EAAE,QAAQ,CAAA;IACd,OAAO,EAAE,OAAO,CAAC;QACf,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,EAAE,MAAM,CAAA;KACd,CAAC,CAAA;CACH,GACD;IACE,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,mBAAmB,GAAG,mBAAmB,CAAA;IACzE,OAAO,EAAE,OAAO,CAAC;QACf,OAAO,EAAE,MAAM,CAAA;QACf,QAAQ,EAAE,MAAM,CAAA;QAChB,KAAK,EAAE,MAAM,CAAA;QACb,WAAW,EAAE,MAAM,CAAA;QACnB,QAAQ,EAAE,MAAM,CAAA;QAChB,YAAY,EAAE,MAAM,CAAA;QACpB,OAAO,EAAE,IAAI,GAAG,SAAS,GAAG,OAAO,CAAA;QACnC,QAAQ,EAAE,MAAM,CAAA;QAChB,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAC,CAAA;CACH,CAAA"}