@scalar/api-client 2.12.0 → 2.13.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 (178) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/components/CodeInput/CodeInput.vue.d.ts +1 -1
  3. package/dist/components/CodeInput/CodeInput.vue.d.ts.map +1 -1
  4. package/dist/components/CommandPalette/CommandActionForm.vue.d.ts +2 -2
  5. package/dist/components/CommandPalette/CommandActionForm.vue.d.ts.map +1 -1
  6. package/dist/components/CommandPalette/CommandActionForm.vue.js +14 -14
  7. package/dist/components/CommandPalette/CommandPaletteImport.vue.js +38 -38
  8. package/dist/components/EmptyState.vue.d.ts.map +1 -1
  9. package/dist/components/EmptyState.vue.js +2 -2
  10. package/dist/components/EmptyState.vue2.js +27 -16
  11. package/dist/components/TopNav/TopNav.vue.js +33 -33
  12. package/dist/layouts/App/create-api-client-app.d.ts +28 -28
  13. package/dist/layouts/Web/create-api-client-web.d.ts +28 -28
  14. package/dist/libs/create-client.d.ts +28 -28
  15. package/dist/libs/hot-keys.d.ts +2 -2
  16. package/dist/libs/send-request/create-fetch-body.d.ts +2 -2
  17. package/dist/store/active-entities.d.ts +2 -2
  18. package/dist/store/collections.d.ts +4 -4
  19. package/dist/store/index.d.ts +1 -1
  20. package/dist/store/index.d.ts.map +1 -1
  21. package/dist/store/index.js +8 -8
  22. package/dist/store/request-example.d.ts +12 -12
  23. package/dist/store/store.d.ts +28 -28
  24. package/dist/store/workspace.d.ts +12 -12
  25. package/dist/style.css +1 -1
  26. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +1 -2
  27. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  28. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +9 -8
  29. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts +1 -1
  30. package/dist/v2/blocks/operation-block/components/Header.vue.d.ts.map +1 -1
  31. package/dist/v2/blocks/operation-block/components/Header.vue.js +3 -3
  32. package/dist/v2/blocks/operation-code-sample/index.d.ts.map +1 -1
  33. package/dist/v2/blocks/response-block/ResponseBlock.vue.d.ts.map +1 -1
  34. package/dist/v2/blocks/response-block/ResponseBlock.vue.js +1 -1
  35. package/dist/v2/blocks/response-block/ResponseBlock.vue2.js +14 -11
  36. package/dist/v2/blocks/response-block/components/ResponseBodyStreaming.vue.js +22 -22
  37. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts +2 -2
  38. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.d.ts.map +1 -1
  39. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue.js +2 -2
  40. package/dist/v2/blocks/response-block/components/ResponseEmpty.vue2.js +18 -15
  41. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue.js +2 -2
  42. package/dist/v2/blocks/response-block/components/ResponseLoadingOverlay.vue2.js +17 -17
  43. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.d.ts.map +1 -1
  44. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue.js +2 -2
  45. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBar.vue2.js +17 -12
  46. package/dist/v2/blocks/scalar-address-bar-block/index.d.ts.map +1 -1
  47. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +205 -0
  48. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -0
  49. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +52 -52
  50. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts +1 -1
  51. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue.d.ts.map +1 -1
  52. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +205 -0
  53. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -0
  54. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts.map +1 -1
  55. package/dist/v2/components/sidebar/Sidebar.vue.d.ts +1 -2
  56. package/dist/v2/components/sidebar/Sidebar.vue.d.ts.map +1 -1
  57. package/dist/v2/components/sidebar/Sidebar.vue.js +1 -1
  58. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  59. package/dist/v2/features/app/App.vue.js +126 -103
  60. package/dist/v2/features/app/components/AppSidebar.vue.d.ts +0 -2
  61. package/dist/v2/features/app/components/AppSidebar.vue.d.ts.map +1 -1
  62. package/dist/v2/features/app/components/AppSidebar.vue.js +1 -1
  63. package/dist/v2/features/app/components/AppSidebar.vue2.js +56 -53
  64. package/dist/v2/features/app/components/DesktopTab.vue.d.ts +26 -0
  65. package/dist/v2/features/app/components/DesktopTab.vue.d.ts.map +1 -0
  66. package/dist/v2/features/app/components/DesktopTab.vue.js +7 -0
  67. package/dist/v2/features/app/components/DesktopTab.vue2.js +134 -0
  68. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts +9 -4
  69. package/dist/v2/features/app/components/DesktopTabs.vue.d.ts.map +1 -1
  70. package/dist/v2/features/app/components/DesktopTabs.vue.js +47 -13
  71. package/dist/v2/features/app/components/DesktopTabs.vue2.js +2 -4
  72. package/dist/v2/features/app/components/SplashScreen.vue.js +2 -2
  73. package/dist/v2/features/app/components/SplashScreen.vue2.js +2 -2
  74. package/dist/v2/features/app/helpers/routes.js +1 -1
  75. package/dist/v2/features/collection/components/Settings.vue2.js +3 -3
  76. package/dist/v2/features/command-palette/components/CommandActionForm.vue.d.ts +61 -0
  77. package/dist/v2/features/command-palette/components/CommandActionForm.vue.d.ts.map +1 -0
  78. package/dist/v2/features/command-palette/components/CommandActionForm.vue.js +48 -0
  79. package/dist/v2/features/command-palette/components/CommandActionForm.vue2.js +4 -0
  80. package/dist/v2/features/command-palette/components/CommandActionInput.vue.d.ts +39 -0
  81. package/dist/v2/features/command-palette/components/CommandActionInput.vue.d.ts.map +1 -0
  82. package/dist/v2/features/command-palette/components/CommandActionInput.vue.js +52 -0
  83. package/dist/v2/features/command-palette/components/CommandActionInput.vue2.js +4 -0
  84. package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue.d.ts +36 -0
  85. package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue.d.ts.map +1 -0
  86. package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue.js +78 -0
  87. package/dist/v2/features/command-palette/components/CommandPaletteDocument.vue2.js +4 -0
  88. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts +30 -0
  89. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.d.ts.map +1 -0
  90. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue.js +169 -0
  91. package/dist/v2/features/command-palette/components/CommandPaletteExample.vue2.js +4 -0
  92. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts +34 -0
  93. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.d.ts.map +1 -0
  94. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue.js +175 -0
  95. package/dist/v2/features/command-palette/components/CommandPaletteImport.vue2.js +4 -0
  96. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.d.ts +43 -0
  97. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.d.ts.map +1 -0
  98. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue.js +7 -0
  99. package/dist/v2/features/command-palette/components/CommandPaletteImportCurl.vue2.js +115 -0
  100. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts +39 -0
  101. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.d.ts.map +1 -0
  102. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue.js +213 -0
  103. package/dist/v2/features/command-palette/components/CommandPaletteRequest.vue2.js +4 -0
  104. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts +38 -0
  105. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.d.ts.map +1 -0
  106. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue.js +89 -0
  107. package/dist/v2/features/command-palette/components/CommandPaletteTag.vue2.js +4 -0
  108. package/dist/v2/features/command-palette/components/TheCommandPalette.vue.d.ts +41 -0
  109. package/dist/v2/features/command-palette/components/TheCommandPalette.vue.d.ts.map +1 -0
  110. package/dist/v2/features/command-palette/components/TheCommandPalette.vue.js +7 -0
  111. package/dist/v2/features/command-palette/components/TheCommandPalette.vue2.js +172 -0
  112. package/dist/v2/features/command-palette/components/WatchModeToggle.vue.d.ts +33 -0
  113. package/dist/v2/features/command-palette/components/WatchModeToggle.vue.d.ts.map +1 -0
  114. package/dist/v2/features/command-palette/components/WatchModeToggle.vue.js +40 -0
  115. package/dist/v2/features/command-palette/components/WatchModeToggle.vue2.js +4 -0
  116. package/dist/v2/features/command-palette/components/index.d.ts +2 -0
  117. package/dist/v2/features/command-palette/components/index.d.ts.map +1 -0
  118. package/dist/v2/features/command-palette/components/index.js +4 -0
  119. package/dist/v2/features/command-palette/helpers/get-openapi-document-details.d.ts +23 -0
  120. package/dist/v2/features/command-palette/helpers/get-openapi-document-details.d.ts.map +1 -0
  121. package/dist/v2/features/command-palette/helpers/get-openapi-document-details.js +31 -0
  122. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts +13 -0
  123. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.d.ts.map +1 -0
  124. package/dist/v2/features/command-palette/helpers/get-openapi-from-postman.js +12 -0
  125. package/dist/v2/features/command-palette/helpers/get-operation-from-curl.d.ts +26 -0
  126. package/dist/v2/features/command-palette/helpers/get-operation-from-curl.d.ts.map +1 -0
  127. package/dist/v2/features/command-palette/helpers/get-operation-from-curl.js +70 -0
  128. package/dist/v2/features/command-palette/helpers/get-postman-document-details.d.ts +23 -0
  129. package/dist/v2/features/command-palette/helpers/get-postman-document-details.d.ts.map +1 -0
  130. package/dist/v2/features/command-palette/helpers/get-postman-document-details.js +18 -0
  131. package/dist/v2/features/command-palette/helpers/is-postman-collection.d.ts +11 -0
  132. package/dist/v2/features/command-palette/helpers/is-postman-collection.d.ts.map +1 -0
  133. package/dist/v2/features/command-palette/helpers/is-postman-collection.js +11 -0
  134. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts +202 -0
  135. package/dist/v2/features/command-palette/hooks/use-command-palette-state.d.ts.map +1 -0
  136. package/dist/v2/features/command-palette/hooks/use-command-palette-state.js +109 -0
  137. package/dist/v2/features/command-palette/types.d.ts +82 -0
  138. package/dist/v2/features/command-palette/types.d.ts.map +1 -0
  139. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  140. package/dist/v2/features/operation/Operation.vue.js +24 -20
  141. package/dist/v2/helpers/drag-handle-factory.d.ts +1 -2
  142. package/dist/v2/helpers/drag-handle-factory.d.ts.map +1 -1
  143. package/dist/v2/helpers/drag-handle-factory.js +74 -90
  144. package/dist/v2/helpers/get-tab-details.d.ts +43 -0
  145. package/dist/v2/helpers/get-tab-details.d.ts.map +1 -0
  146. package/dist/v2/helpers/get-tab-details.js +34 -0
  147. package/dist/v2/helpers/handle-hotkeys.js +1 -1
  148. package/dist/v2/helpers/is-url.d.ts +2 -0
  149. package/dist/v2/helpers/is-url.d.ts.map +1 -0
  150. package/dist/v2/helpers/is-url.js +5 -0
  151. package/dist/v2/helpers/remove-circular.d.ts +15 -0
  152. package/dist/v2/helpers/remove-circular.d.ts.map +1 -0
  153. package/dist/v2/helpers/remove-circular.js +18 -0
  154. package/dist/v2/helpers/storage.d.ts +4 -6
  155. package/dist/v2/helpers/storage.d.ts.map +1 -1
  156. package/dist/v2/helpers/storage.js +8 -12
  157. package/dist/v2/hooks/use-sidebar-state.d.ts +12 -19
  158. package/dist/v2/hooks/use-sidebar-state.d.ts.map +1 -1
  159. package/dist/v2/hooks/use-sidebar-state.js +20 -18
  160. package/dist/v2/hooks/use-sync-path.d.ts +11 -0
  161. package/dist/v2/hooks/use-sync-path.d.ts.map +1 -0
  162. package/dist/v2/hooks/use-sync-path.js +51 -0
  163. package/dist/v2/hooks/use-tabs.d.ts +31 -0
  164. package/dist/v2/hooks/use-tabs.d.ts.map +1 -0
  165. package/dist/v2/hooks/use-tabs.js +44 -0
  166. package/dist/v2/hooks/use-workspace-client-events.d.ts +5 -2
  167. package/dist/v2/hooks/use-workspace-client-events.d.ts.map +1 -1
  168. package/dist/v2/hooks/use-workspace-client-events.js +91 -36
  169. package/dist/v2/hooks/use-workspace-selector.d.ts +16 -6
  170. package/dist/v2/hooks/use-workspace-selector.d.ts.map +1 -1
  171. package/dist/v2/hooks/use-workspace-selector.js +58 -64
  172. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.d.ts.map +1 -1
  173. package/dist/views/Request/RequestSection/RequestAuth/OAuth2.vue.js +78 -78
  174. package/dist/views/Request/ResponseSection/ResponseBodyStreaming.vue.js +29 -29
  175. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  176. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue.js +2 -2
  177. package/dist/views/Request/ResponseSection/ResponseLoadingOverlay.vue2.js +19 -19
  178. package/package.json +136 -46
@@ -0,0 +1,205 @@
1
+ import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
2
+ import type { OAuthFlowsObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
+ type __VLS_Props = {
4
+ environment: XScalarEnvironment;
5
+ flows: OAuthFlowsObject;
6
+ type: keyof OAuthFlowsObject;
7
+ selectedScopes: string[];
8
+ server: ServerObject | undefined;
9
+ proxyUrl: string;
10
+ };
11
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
12
+ "update:selectedScopes": (payload: Pick<{
13
+ id: string[];
14
+ name: string;
15
+ scopes: string[];
16
+ meta: import("@scalar/workspace-store/mutators").AuthMeta;
17
+ }, "scopes">) => any;
18
+ "update:securityScheme": (payload: ({
19
+ type: "http";
20
+ } & Partial<Omit<import("@scalar/workspace-store/schemas/v3.1/strict/security-scheme").HttpObject, "type">>) | ({
21
+ type: "apiKey";
22
+ } & Partial<Omit<import("@scalar/workspace-store/schemas/v3.1/strict/security-scheme").ApiKeyObject, "type">>) | ({
23
+ type: "oauth2";
24
+ } & {
25
+ description?: string | undefined;
26
+ 'x-default-scopes'?: string[] | undefined;
27
+ flows?: {
28
+ implicit?: {
29
+ refreshUrl?: string | undefined;
30
+ scopes?: {
31
+ [x: string]: string | undefined;
32
+ } | undefined;
33
+ 'x-scalar-secret-client-id'?: string | undefined;
34
+ 'x-scalar-secret-token'?: string | undefined;
35
+ 'x-scalar-security-query'?: {
36
+ [x: string]: string | undefined;
37
+ } | undefined;
38
+ 'x-scalar-security-body'?: {
39
+ [x: string]: string | undefined;
40
+ } | undefined;
41
+ 'x-tokenName'?: string | undefined;
42
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
43
+ authorizationUrl?: string | undefined;
44
+ 'x-scalar-secret-redirect-uri'?: string | undefined;
45
+ } | undefined;
46
+ password?: {
47
+ refreshUrl?: string | undefined;
48
+ scopes?: {
49
+ [x: string]: string | undefined;
50
+ } | undefined;
51
+ 'x-scalar-secret-client-id'?: string | undefined;
52
+ 'x-scalar-secret-token'?: string | undefined;
53
+ 'x-scalar-security-query'?: {
54
+ [x: string]: string | undefined;
55
+ } | undefined;
56
+ 'x-scalar-security-body'?: {
57
+ [x: string]: string | undefined;
58
+ } | undefined;
59
+ 'x-tokenName'?: string | undefined;
60
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
61
+ tokenUrl?: string | undefined;
62
+ 'x-scalar-secret-username'?: string | undefined;
63
+ 'x-scalar-secret-password'?: string | undefined;
64
+ 'x-scalar-secret-client-secret'?: string | undefined;
65
+ } | undefined;
66
+ clientCredentials?: {
67
+ refreshUrl?: string | undefined;
68
+ scopes?: {
69
+ [x: string]: string | undefined;
70
+ } | undefined;
71
+ 'x-scalar-secret-client-id'?: string | undefined;
72
+ 'x-scalar-secret-token'?: string | undefined;
73
+ 'x-scalar-security-query'?: {
74
+ [x: string]: string | undefined;
75
+ } | undefined;
76
+ 'x-scalar-security-body'?: {
77
+ [x: string]: string | undefined;
78
+ } | undefined;
79
+ 'x-tokenName'?: string | undefined;
80
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
81
+ tokenUrl?: string | undefined;
82
+ 'x-scalar-secret-client-secret'?: string | undefined;
83
+ } | undefined;
84
+ authorizationCode?: {
85
+ refreshUrl?: string | undefined;
86
+ scopes?: {
87
+ [x: string]: string | undefined;
88
+ } | undefined;
89
+ 'x-scalar-secret-client-id'?: string | undefined;
90
+ 'x-scalar-secret-token'?: string | undefined;
91
+ 'x-scalar-security-query'?: {
92
+ [x: string]: string | undefined;
93
+ } | undefined;
94
+ 'x-scalar-security-body'?: {
95
+ [x: string]: string | undefined;
96
+ } | undefined;
97
+ 'x-tokenName'?: string | undefined;
98
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
99
+ authorizationUrl?: string | undefined;
100
+ tokenUrl?: string | undefined;
101
+ 'x-scalar-secret-client-secret'?: string | undefined;
102
+ 'x-scalar-secret-redirect-uri'?: string | undefined;
103
+ 'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
104
+ } | undefined;
105
+ } | undefined;
106
+ })) => any;
107
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
108
+ "onUpdate:selectedScopes"?: ((payload: Pick<{
109
+ id: string[];
110
+ name: string;
111
+ scopes: string[];
112
+ meta: import("@scalar/workspace-store/mutators").AuthMeta;
113
+ }, "scopes">) => any) | undefined;
114
+ "onUpdate:securityScheme"?: ((payload: ({
115
+ type: "http";
116
+ } & Partial<Omit<import("@scalar/workspace-store/schemas/v3.1/strict/security-scheme").HttpObject, "type">>) | ({
117
+ type: "apiKey";
118
+ } & Partial<Omit<import("@scalar/workspace-store/schemas/v3.1/strict/security-scheme").ApiKeyObject, "type">>) | ({
119
+ type: "oauth2";
120
+ } & {
121
+ description?: string | undefined;
122
+ 'x-default-scopes'?: string[] | undefined;
123
+ flows?: {
124
+ implicit?: {
125
+ refreshUrl?: string | undefined;
126
+ scopes?: {
127
+ [x: string]: string | undefined;
128
+ } | undefined;
129
+ 'x-scalar-secret-client-id'?: string | undefined;
130
+ 'x-scalar-secret-token'?: string | undefined;
131
+ 'x-scalar-security-query'?: {
132
+ [x: string]: string | undefined;
133
+ } | undefined;
134
+ 'x-scalar-security-body'?: {
135
+ [x: string]: string | undefined;
136
+ } | undefined;
137
+ 'x-tokenName'?: string | undefined;
138
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
139
+ authorizationUrl?: string | undefined;
140
+ 'x-scalar-secret-redirect-uri'?: string | undefined;
141
+ } | undefined;
142
+ password?: {
143
+ refreshUrl?: string | undefined;
144
+ scopes?: {
145
+ [x: string]: string | undefined;
146
+ } | undefined;
147
+ 'x-scalar-secret-client-id'?: string | undefined;
148
+ 'x-scalar-secret-token'?: string | undefined;
149
+ 'x-scalar-security-query'?: {
150
+ [x: string]: string | undefined;
151
+ } | undefined;
152
+ 'x-scalar-security-body'?: {
153
+ [x: string]: string | undefined;
154
+ } | undefined;
155
+ 'x-tokenName'?: string | undefined;
156
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
157
+ tokenUrl?: string | undefined;
158
+ 'x-scalar-secret-username'?: string | undefined;
159
+ 'x-scalar-secret-password'?: string | undefined;
160
+ 'x-scalar-secret-client-secret'?: string | undefined;
161
+ } | undefined;
162
+ clientCredentials?: {
163
+ refreshUrl?: string | undefined;
164
+ scopes?: {
165
+ [x: string]: string | undefined;
166
+ } | undefined;
167
+ 'x-scalar-secret-client-id'?: string | undefined;
168
+ 'x-scalar-secret-token'?: string | undefined;
169
+ 'x-scalar-security-query'?: {
170
+ [x: string]: string | undefined;
171
+ } | undefined;
172
+ 'x-scalar-security-body'?: {
173
+ [x: string]: string | undefined;
174
+ } | undefined;
175
+ 'x-tokenName'?: string | undefined;
176
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
177
+ tokenUrl?: string | undefined;
178
+ 'x-scalar-secret-client-secret'?: string | undefined;
179
+ } | undefined;
180
+ authorizationCode?: {
181
+ refreshUrl?: string | undefined;
182
+ scopes?: {
183
+ [x: string]: string | undefined;
184
+ } | undefined;
185
+ 'x-scalar-secret-client-id'?: string | undefined;
186
+ 'x-scalar-secret-token'?: string | undefined;
187
+ 'x-scalar-security-query'?: {
188
+ [x: string]: string | undefined;
189
+ } | undefined;
190
+ 'x-scalar-security-body'?: {
191
+ [x: string]: string | undefined;
192
+ } | undefined;
193
+ 'x-tokenName'?: string | undefined;
194
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
195
+ authorizationUrl?: string | undefined;
196
+ tokenUrl?: string | undefined;
197
+ 'x-scalar-secret-client-secret'?: string | undefined;
198
+ 'x-scalar-secret-redirect-uri'?: string | undefined;
199
+ 'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
200
+ } | undefined;
201
+ } | undefined;
202
+ })) => any) | undefined;
203
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
204
+ export default _default;
205
+ //# sourceMappingURL=OAuth2.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"names":[],"mappings":"AA2PA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAEnH,OAAO,KAAK,EAEV,gBAAgB,EAChB,YAAY,EACb,MAAM,8DAA8D,CAAA;AASrE,KAAK,WAAW,GAAG;IACf,WAAW,EAAE,kBAAkB,CAAA;IAC/B,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwhBJ,wBAOG"}
@@ -1,12 +1,12 @@
1
- import { defineComponent as z, computed as C, createElementBlock as k, openBlock as i, Fragment as V, createVNode as o, unref as r, withCtx as l, createTextVNode as u, createElementVNode as x, createBlock as v, createCommentVNode as f } from "vue";
1
+ import { defineComponent as z, computed as C, createElementBlock as k, openBlock as i, Fragment as V, createVNode as o, unref as n, withCtx as l, createTextVNode as u, createElementVNode as x, createBlock as f, createCommentVNode as v } from "vue";
2
2
  import { useLoadingState as T, ScalarButton as U } from "@scalar/components";
3
3
  import { pkceOptions as b } from "@scalar/oas-utils/entities/spec";
4
4
  import { useToasts as B } from "@scalar/use-toasts";
5
- import L from "./OAuthScopesInput.vue.js";
6
- import { authorizeOauth2 as P } from "../helpers/oauth.js";
5
+ import P from "./OAuthScopesInput.vue.js";
6
+ import { authorizeOauth2 as R } from "../helpers/oauth.js";
7
7
  import m from "./RequestAuthDataTableInput.vue.js";
8
8
  import d from "../../../../components/DataTable/DataTableRow.vue.js";
9
- const R = { class: "flex h-8 items-center justify-end gap-2 border-t" }, F = { class: "flex h-8 w-full items-center justify-end border-t" }, M = /* @__PURE__ */ z({
9
+ const F = { class: "flex h-8 items-center justify-end gap-2 border-t" }, O = { class: "flex h-8 w-full items-center justify-end border-t" }, M = /* @__PURE__ */ z({
10
10
  __name: "OAuth2",
11
11
  props: {
12
12
  environment: {},
@@ -18,26 +18,26 @@ const R = { class: "flex h-8 items-center justify-end gap-2 border-t" }, F = { c
18
18
  },
19
19
  emits: ["update:securityScheme", "update:selectedScopes"],
20
20
  setup(p, { emit: w }) {
21
- const y = w, c = T(), { toast: g } = B(), t = C(() => p.flows[p.type]), s = (a) => y("update:securityScheme", {
21
+ const y = w, c = T(), { toast: S } = B(), t = C(() => p.flows[p.type]), s = (a) => y("update:securityScheme", {
22
22
  type: "oauth2",
23
23
  flows: {
24
24
  [p.type]: a
25
25
  }
26
- }), S = async () => {
26
+ }), g = async () => {
27
27
  if (c.isLoading)
28
28
  return;
29
- c.startLoading();
30
- const [a, e] = await P(
29
+ c.start();
30
+ const [a, e] = await R(
31
31
  p.flows,
32
32
  p.type,
33
33
  p.selectedScopes,
34
34
  p.server,
35
35
  p.proxyUrl
36
- ).finally(() => c.stopLoading());
37
- e ? s({ "x-scalar-secret-token": e }) : (console.error(a), g(a?.message ?? "Failed to authorize", "error"));
36
+ );
37
+ await c.clear(), e ? s({ "x-scalar-secret-token": e }) : (console.error(a), S(a?.message ?? "Failed to authorize", "error"));
38
38
  };
39
39
  return (a, e) => t.value["x-scalar-secret-token"] ? (i(), k(V, { key: 0 }, [
40
- o(r(d), null, {
40
+ o(n(d), null, {
41
41
  default: l(() => [
42
42
  o(m, {
43
43
  class: "border-r-transparent",
@@ -45,7 +45,7 @@ const R = { class: "flex h-8 items-center justify-end gap-2 border-t" }, F = { c
45
45
  modelValue: t.value["x-scalar-secret-token"],
46
46
  placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
47
47
  type: "password",
48
- "onUpdate:modelValue": e[0] || (e[0] = (n) => s({ "x-scalar-secret-token": n }))
48
+ "onUpdate:modelValue": e[0] || (e[0] = (r) => s({ "x-scalar-secret-token": r }))
49
49
  }, {
50
50
  default: l(() => [...e[11] || (e[11] = [
51
51
  u(" Access Token ", -1)
@@ -55,12 +55,12 @@ const R = { class: "flex h-8 items-center justify-end gap-2 border-t" }, F = { c
55
55
  ]),
56
56
  _: 1
57
57
  }),
58
- o(r(d), { class: "min-w-full" }, {
58
+ o(n(d), { class: "min-w-full" }, {
59
59
  default: l(() => [
60
- x("div", R, [
61
- o(r(U), {
60
+ x("div", F, [
61
+ o(n(U), {
62
62
  class: "mr-1 p-0 px-2 py-0.5",
63
- loading: r(c),
63
+ loader: n(c),
64
64
  size: "sm",
65
65
  variant: "outlined",
66
66
  onClick: e[1] || (e[1] = () => s({ "x-scalar-secret-token": "" }))
@@ -69,49 +69,49 @@ const R = { class: "flex h-8 items-center justify-end gap-2 border-t" }, F = { c
69
69
  u(" Clear ", -1)
70
70
  ])]),
71
71
  _: 1
72
- }, 8, ["loading"])
72
+ }, 8, ["loader"])
73
73
  ])
74
74
  ]),
75
75
  _: 1
76
76
  })
77
77
  ], 64)) : (i(), k(V, { key: 1 }, [
78
- o(r(d), null, {
78
+ o(n(d), null, {
79
79
  default: l(() => [
80
- "authorizationUrl" in t.value ? (i(), v(m, {
80
+ "authorizationUrl" in t.value ? (i(), f(m, {
81
81
  key: 0,
82
82
  containerClass: "border-r-0",
83
83
  environment: a.environment,
84
84
  modelValue: t.value.authorizationUrl,
85
85
  placeholder: "https://galaxy.scalar.com/authorize",
86
- "onUpdate:modelValue": e[2] || (e[2] = (n) => s({ authorizationUrl: n }))
86
+ "onUpdate:modelValue": e[2] || (e[2] = (r) => s({ authorizationUrl: r }))
87
87
  }, {
88
88
  default: l(() => [...e[13] || (e[13] = [
89
89
  u(" Auth URL ", -1)
90
90
  ])]),
91
91
  _: 1
92
- }, 8, ["environment", "modelValue"])) : f("", !0),
93
- "tokenUrl" in t.value ? (i(), v(m, {
92
+ }, 8, ["environment", "modelValue"])) : v("", !0),
93
+ "tokenUrl" in t.value ? (i(), f(m, {
94
94
  key: 1,
95
95
  environment: a.environment,
96
96
  modelValue: t.value.tokenUrl,
97
97
  placeholder: "https://galaxy.scalar.com/token",
98
- "onUpdate:modelValue": e[3] || (e[3] = (n) => s({ tokenUrl: n }))
98
+ "onUpdate:modelValue": e[3] || (e[3] = (r) => s({ tokenUrl: r }))
99
99
  }, {
100
100
  default: l(() => [...e[14] || (e[14] = [
101
101
  u(" Token URL ", -1)
102
102
  ])]),
103
103
  _: 1
104
- }, 8, ["environment", "modelValue"])) : f("", !0)
104
+ }, 8, ["environment", "modelValue"])) : v("", !0)
105
105
  ]),
106
106
  _: 1
107
107
  }),
108
- "x-scalar-secret-redirect-uri" in t.value ? (i(), v(r(d), { key: 0 }, {
108
+ "x-scalar-secret-redirect-uri" in t.value ? (i(), f(n(d), { key: 0 }, {
109
109
  default: l(() => [
110
110
  o(m, {
111
111
  environment: a.environment,
112
112
  modelValue: t.value["x-scalar-secret-redirect-uri"],
113
113
  placeholder: "https://galaxy.scalar.com/callback",
114
- "onUpdate:modelValue": e[4] || (e[4] = (n) => s({ "x-scalar-secret-redirect-uri": n }))
114
+ "onUpdate:modelValue": e[4] || (e[4] = (r) => s({ "x-scalar-secret-redirect-uri": r }))
115
115
  }, {
116
116
  default: l(() => [...e[15] || (e[15] = [
117
117
  u(" Redirect URL ", -1)
@@ -120,16 +120,16 @@ const R = { class: "flex h-8 items-center justify-end gap-2 border-t" }, F = { c
120
120
  }, 8, ["environment", "modelValue"])
121
121
  ]),
122
122
  _: 1
123
- })) : f("", !0),
123
+ })) : v("", !0),
124
124
  "x-scalar-secret-username" in t.value && "x-scalar-secret-password" in t.value ? (i(), k(V, { key: 1 }, [
125
- o(r(d), null, {
125
+ o(n(d), null, {
126
126
  default: l(() => [
127
127
  o(m, {
128
128
  class: "text-c-2",
129
129
  environment: a.environment,
130
130
  modelValue: t.value["x-scalar-secret-username"],
131
131
  placeholder: "janedoe",
132
- "onUpdate:modelValue": e[5] || (e[5] = (n) => s({ "x-scalar-secret-username": n }))
132
+ "onUpdate:modelValue": e[5] || (e[5] = (r) => s({ "x-scalar-secret-username": r }))
133
133
  }, {
134
134
  default: l(() => [...e[16] || (e[16] = [
135
135
  u(" Username ", -1)
@@ -139,14 +139,14 @@ const R = { class: "flex h-8 items-center justify-end gap-2 border-t" }, F = { c
139
139
  ]),
140
140
  _: 1
141
141
  }),
142
- o(r(d), null, {
142
+ o(n(d), null, {
143
143
  default: l(() => [
144
144
  o(m, {
145
145
  environment: a.environment,
146
146
  modelValue: t.value["x-scalar-secret-password"],
147
147
  placeholder: "********",
148
148
  type: "password",
149
- "onUpdate:modelValue": e[6] || (e[6] = (n) => s({ "x-scalar-secret-password": n }))
149
+ "onUpdate:modelValue": e[6] || (e[6] = (r) => s({ "x-scalar-secret-password": r }))
150
150
  }, {
151
151
  default: l(() => [...e[17] || (e[17] = [
152
152
  u(" Password ", -1)
@@ -156,14 +156,14 @@ const R = { class: "flex h-8 items-center justify-end gap-2 border-t" }, F = { c
156
156
  ]),
157
157
  _: 1
158
158
  })
159
- ], 64)) : f("", !0),
160
- o(r(d), null, {
159
+ ], 64)) : v("", !0),
160
+ o(n(d), null, {
161
161
  default: l(() => [
162
162
  o(m, {
163
163
  environment: a.environment,
164
164
  modelValue: t.value["x-scalar-secret-client-id"],
165
165
  placeholder: "12345",
166
- "onUpdate:modelValue": e[7] || (e[7] = (n) => s({ "x-scalar-secret-client-id": n }))
166
+ "onUpdate:modelValue": e[7] || (e[7] = (r) => s({ "x-scalar-secret-client-id": r }))
167
167
  }, {
168
168
  default: l(() => [...e[18] || (e[18] = [
169
169
  u(" Client ID ", -1)
@@ -173,14 +173,14 @@ const R = { class: "flex h-8 items-center justify-end gap-2 border-t" }, F = { c
173
173
  ]),
174
174
  _: 1
175
175
  }),
176
- "x-scalar-secret-client-secret" in t.value ? (i(), v(r(d), { key: 2 }, {
176
+ "x-scalar-secret-client-secret" in t.value ? (i(), f(n(d), { key: 2 }, {
177
177
  default: l(() => [
178
178
  o(m, {
179
179
  environment: a.environment,
180
180
  modelValue: t.value["x-scalar-secret-client-secret"],
181
181
  placeholder: "XYZ123",
182
182
  type: "password",
183
- "onUpdate:modelValue": e[8] || (e[8] = (n) => s({ "x-scalar-secret-client-secret": n }))
183
+ "onUpdate:modelValue": e[8] || (e[8] = (r) => s({ "x-scalar-secret-client-secret": r }))
184
184
  }, {
185
185
  default: l(() => [...e[19] || (e[19] = [
186
186
  u(" Client Secret ", -1)
@@ -189,16 +189,16 @@ const R = { class: "flex h-8 items-center justify-end gap-2 border-t" }, F = { c
189
189
  }, 8, ["environment", "modelValue"])
190
190
  ]),
191
191
  _: 1
192
- })) : f("", !0),
193
- "x-usePkce" in t.value ? (i(), v(r(d), { key: 3 }, {
192
+ })) : v("", !0),
193
+ "x-usePkce" in t.value ? (i(), f(n(d), { key: 3 }, {
194
194
  default: l(() => [
195
195
  o(m, {
196
- enum: r(b),
196
+ enum: n(b),
197
197
  environment: a.environment,
198
198
  modelValue: t.value["x-usePkce"],
199
199
  readOnly: "",
200
- "onUpdate:modelValue": e[9] || (e[9] = (n) => s({
201
- "x-usePkce": n
200
+ "onUpdate:modelValue": e[9] || (e[9] = (r) => s({
201
+ "x-usePkce": r
202
202
  }))
203
203
  }, {
204
204
  default: l(() => [...e[20] || (e[20] = [
@@ -208,32 +208,32 @@ const R = { class: "flex h-8 items-center justify-end gap-2 border-t" }, F = { c
208
208
  }, 8, ["enum", "environment", "modelValue"])
209
209
  ]),
210
210
  _: 1
211
- })) : f("", !0),
212
- Object.keys(t.value.scopes ?? {}).length ? (i(), v(r(d), { key: 4 }, {
211
+ })) : v("", !0),
212
+ Object.keys(t.value.scopes ?? {}).length ? (i(), f(n(d), { key: 4 }, {
213
213
  default: l(() => [
214
- o(L, {
214
+ o(P, {
215
215
  flow: t.value,
216
216
  selectedScopes: a.selectedScopes,
217
- "onUpdate:selectedScopes": e[10] || (e[10] = (n) => y("update:selectedScopes", n))
217
+ "onUpdate:selectedScopes": e[10] || (e[10] = (r) => y("update:selectedScopes", r))
218
218
  }, null, 8, ["flow", "selectedScopes"])
219
219
  ]),
220
220
  _: 1
221
- })) : f("", !0),
222
- o(r(d), { class: "min-w-full" }, {
221
+ })) : v("", !0),
222
+ o(n(d), { class: "min-w-full" }, {
223
223
  default: l(() => [
224
- x("div", F, [
225
- o(r(U), {
224
+ x("div", O, [
225
+ o(n(U), {
226
226
  class: "mr-0.75 p-0 px-2 py-0.5",
227
- loading: r(c),
227
+ loader: n(c),
228
228
  size: "sm",
229
229
  variant: "outlined",
230
- onClick: S
230
+ onClick: g
231
231
  }, {
232
232
  default: l(() => [...e[21] || (e[21] = [
233
233
  u(" Authorize ", -1)
234
234
  ])]),
235
235
  _: 1
236
- }, 8, ["loading"])
236
+ }, 8, ["loader"])
237
237
  ])
238
238
  ]),
239
239
  _: 1
@@ -1,4 +1,4 @@
1
- import type { OAuthFlow } from '@scalar/workspace-store/schemas/v3.1/strict/oauth-flow';
1
+ import type { OAuthFlow } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
2
  type __VLS_Props = {
3
3
  flow: OAuthFlow;
4
4
  selectedScopes: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"OAuthScopesInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue"],"names":[],"mappings":"AAuIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAA;AASvF,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,SAAS,CAAA;IACf,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB,CAAC;;;gBAIgD,MAAM,EAAE;;;;gBAAR,MAAM,EAAE;;;AA0U1D,wBAOG"}
1
+ {"version":3,"file":"OAuthScopesInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue"],"names":[],"mappings":"AAuIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8DAA8D,CAAA;AAS7F,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,SAAS,CAAA;IACf,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB,CAAC;;;gBAIgD,MAAM,EAAE;;;;gBAAR,MAAM,EAAE;;;AA0U1D,wBAOG"}