@scalar/api-client 2.23.0 → 2.23.3

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 (95) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/dist/style.css +1 -1
  3. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts +13 -3
  4. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  5. package/dist/v2/blocks/operation-block/OperationBlock.vue.js +68 -68
  6. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.d.ts.map +1 -1
  7. package/dist/v2/blocks/operation-block/helpers/build-request-parameters.js +54 -53
  8. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts +5 -3
  9. package/dist/v2/blocks/operation-block/helpers/build-request-security.d.ts.map +1 -1
  10. package/dist/v2/blocks/operation-block/helpers/build-request-security.js +1 -1
  11. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts +3 -2
  12. package/dist/v2/blocks/operation-block/helpers/build-request.d.ts.map +1 -1
  13. package/dist/v2/blocks/operation-block/index.d.ts +2 -1
  14. package/dist/v2/blocks/operation-block/index.d.ts.map +1 -1
  15. package/dist/v2/blocks/operation-block/index.js +7 -4
  16. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts +3 -2
  17. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.d.ts.map +1 -1
  18. package/dist/v2/blocks/operation-code-sample/components/OperationCodeSample.vue.js +2 -2
  19. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts +3 -2
  20. package/dist/v2/blocks/operation-code-sample/helpers/generate-code-snippet.d.ts.map +1 -1
  21. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.d.ts.map +1 -1
  22. package/dist/v2/blocks/operation-code-sample/helpers/get-example-from-schema.js +78 -78
  23. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts +2 -2
  24. package/dist/v2/blocks/operation-code-sample/helpers/get-secrets.d.ts.map +1 -1
  25. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts +3 -2
  26. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.d.ts.map +1 -1
  27. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts +2 -2
  28. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/process-security-schemes.d.ts.map +1 -1
  29. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts +8 -5
  30. package/dist/v2/blocks/request-block/RequestBlock.vue.d.ts.map +1 -1
  31. package/dist/v2/blocks/request-block/RequestBlock.vue.js +2 -2
  32. package/dist/v2/blocks/request-block/RequestBlock.vue2.js +4 -4
  33. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.d.ts.map +1 -1
  34. package/dist/v2/blocks/request-block/components/RequestCodeSnippet.vue.js +49 -45
  35. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  36. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js +63 -51
  37. package/dist/v2/blocks/request-block/helpers/get-default-headers.js +1 -1
  38. package/dist/v2/blocks/response-block/components/ResponseBody.vue.js +2 -2
  39. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts +4 -2
  40. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.d.ts.map +1 -1
  41. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts +18 -181
  42. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  43. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js +118 -107
  44. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts +3 -2
  45. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.d.ts.map +1 -1
  46. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue.js +30 -33
  47. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts +11 -178
  48. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  49. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js +107 -110
  50. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.d.ts.map +1 -1
  51. package/dist/v2/blocks/scalar-auth-selector-block/helpers/auth-options.js +5 -29
  52. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts +6 -0
  53. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.d.ts.map +1 -0
  54. package/dist/v2/blocks/scalar-auth-selector-block/helpers/extract-security-scheme-secrets.js +85 -0
  55. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts +9 -0
  56. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.d.ts.map +1 -0
  57. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-security.js +15 -0
  58. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts +3 -2
  59. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  60. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts +23 -0
  61. package/dist/v2/blocks/scalar-auth-selector-block/helpers/secret-types.d.ts.map +1 -0
  62. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts +2 -2
  63. package/dist/v2/blocks/scalar-auth-selector-block/index.d.ts.map +1 -1
  64. package/dist/v2/blocks/scalar-auth-selector-block/index.js +4 -6
  65. package/dist/v2/features/app/App.vue.d.ts.map +1 -1
  66. package/dist/v2/features/app/App.vue.js +51 -42
  67. package/dist/v2/features/app/app-state.d.ts +1 -1
  68. package/dist/v2/features/app/app-state.d.ts.map +1 -1
  69. package/dist/v2/features/app/app-state.js +40 -38
  70. package/dist/v2/features/app/helpers/routes.d.ts +1 -1
  71. package/dist/v2/features/app/helpers/routes.d.ts.map +1 -1
  72. package/dist/v2/features/collection/components/Authentication.vue.d.ts.map +1 -1
  73. package/dist/v2/features/collection/components/Authentication.vue.js +1 -1
  74. package/dist/v2/features/collection/components/Authentication.vue2.js +14 -11
  75. package/dist/v2/features/import-listener/helpers/import-document-to-workspace.d.ts.map +1 -1
  76. package/dist/v2/features/import-listener/helpers/import-document-to-workspace.js +3 -1
  77. package/dist/v2/features/modal/Modal.vue.d.ts.map +1 -1
  78. package/dist/v2/features/modal/Modal.vue.js +1 -1
  79. package/dist/v2/features/modal/Modal.vue2.js +14 -12
  80. package/dist/v2/features/operation/Operation.vue.d.ts.map +1 -1
  81. package/dist/v2/features/operation/Operation.vue.js +44 -35
  82. package/dist/v2/features/operation/helpers/get-selected-security.d.ts +3 -5
  83. package/dist/v2/features/operation/helpers/get-selected-security.d.ts.map +1 -1
  84. package/dist/v2/workspace-events.d.ts.map +1 -1
  85. package/dist/v2/workspace-events.js +116 -109
  86. package/dist/views/Request/ResponseSection/ResponseEmpty.vue2.js +1 -1
  87. package/package.json +17 -17
  88. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.bench.d.ts +0 -2
  89. package/dist/v2/blocks/operation-code-sample/helpers/operation-to-har/operation-to-har.bench.d.ts.map +0 -1
  90. package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.d.ts +0 -8
  91. package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.d.ts.map +0 -1
  92. package/dist/v2/blocks/scalar-auth-selector-block/helpers/convert-security-scheme-secrets.js +0 -33
  93. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.d.ts +0 -7
  94. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.d.ts.map +0 -1
  95. package/dist/v2/blocks/scalar-auth-selector-block/helpers/merge-auth-config.js +0 -13
@@ -1,12 +1,25 @@
1
+ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
1
2
  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
+ import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
4
+ import type { OAuthFlowsObjectSecret } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/secret-types';
3
5
  type __VLS_Props = {
6
+ /** Current environment configuration */
4
7
  environment: XScalarEnvironment;
5
- flows: OAuthFlowsObject;
6
- type: keyof OAuthFlowsObject;
8
+ /** OAuth flows */
9
+ flows: OAuthFlowsObjectSecret;
10
+ /** Current environment configuration */
11
+ /** Type of the OAuth flow */
12
+ type: keyof OAuthFlowsObjectSecret;
13
+ /** Selected scopes */
7
14
  selectedScopes: string[];
15
+ /** Current server configuration */
8
16
  server: ServerObject | null;
17
+ /** Proxy URL */
9
18
  proxyUrl: string;
19
+ /** Name of the security scheme */
20
+ name: string;
21
+ /** Event bus for authentication updates */
22
+ eventBus: WorkspaceEventBus;
10
23
  };
11
24
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
12
25
  "update:selectedScopes": (payload: Pick<{
@@ -16,98 +29,10 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
16
29
  newScopePayload?: {
17
30
  name: string;
18
31
  description: string;
19
- flowType: keyof OAuthFlowsObject;
32
+ flowType: keyof import("@scalar/workspace-store/schemas/v3.1/strict/oauthflows").OAuthFlowsObject;
20
33
  };
21
34
  meta: import("@scalar/workspace-store/events").AuthMeta;
22
35
  }, "scopes" | "newScopePayload">) => any;
23
- "update:securityScheme": (payload: ({
24
- type: "http";
25
- } & Partial<Omit<import("@scalar/workspace-store/schemas/v3.1/strict/security-scheme").HttpObject, "type">>) | ({
26
- type: "apiKey";
27
- } & Partial<Omit<import("@scalar/workspace-store/schemas/v3.1/strict/security-scheme").ApiKeyObject, "type">>) | ({
28
- type: "oauth2";
29
- } & {
30
- description?: string | undefined;
31
- 'x-default-scopes'?: string[] | undefined;
32
- flows?: {
33
- implicit?: {
34
- refreshUrl?: string | undefined;
35
- scopes?: {
36
- [x: string]: string | undefined;
37
- } | undefined;
38
- 'x-scalar-secret-client-id'?: string | undefined;
39
- 'x-scalar-secret-token'?: string | undefined;
40
- 'x-scalar-security-query'?: {
41
- [x: string]: string | undefined;
42
- } | undefined;
43
- 'x-scalar-security-body'?: {
44
- [x: string]: string | undefined;
45
- } | undefined;
46
- 'x-tokenName'?: string | undefined;
47
- authorizationUrl?: string | undefined;
48
- 'x-scalar-secret-redirect-uri'?: string | undefined;
49
- } | undefined;
50
- password?: {
51
- refreshUrl?: string | undefined;
52
- scopes?: {
53
- [x: string]: string | undefined;
54
- } | undefined;
55
- 'x-scalar-secret-client-id'?: string | undefined;
56
- 'x-scalar-secret-token'?: string | undefined;
57
- 'x-scalar-security-query'?: {
58
- [x: string]: string | undefined;
59
- } | undefined;
60
- 'x-scalar-security-body'?: {
61
- [x: string]: string | undefined;
62
- } | undefined;
63
- 'x-tokenName'?: string | undefined;
64
- tokenUrl?: string | undefined;
65
- 'x-scalar-secret-username'?: string | undefined;
66
- 'x-scalar-secret-password'?: string | undefined;
67
- 'x-scalar-secret-client-secret'?: string | undefined;
68
- 'x-scalar-credentials-location'?: "header" | "body" | undefined;
69
- } | undefined;
70
- clientCredentials?: {
71
- refreshUrl?: string | undefined;
72
- scopes?: {
73
- [x: string]: string | undefined;
74
- } | undefined;
75
- 'x-scalar-secret-client-id'?: string | undefined;
76
- 'x-scalar-secret-token'?: string | undefined;
77
- 'x-scalar-security-query'?: {
78
- [x: string]: string | undefined;
79
- } | undefined;
80
- 'x-scalar-security-body'?: {
81
- [x: string]: string | undefined;
82
- } | undefined;
83
- 'x-tokenName'?: string | undefined;
84
- tokenUrl?: string | undefined;
85
- 'x-scalar-secret-client-secret'?: string | undefined;
86
- 'x-scalar-credentials-location'?: "header" | "body" | undefined;
87
- } | undefined;
88
- authorizationCode?: {
89
- refreshUrl?: string | undefined;
90
- scopes?: {
91
- [x: string]: string | undefined;
92
- } | undefined;
93
- 'x-scalar-secret-client-id'?: string | undefined;
94
- 'x-scalar-secret-token'?: string | undefined;
95
- 'x-scalar-security-query'?: {
96
- [x: string]: string | undefined;
97
- } | undefined;
98
- 'x-scalar-security-body'?: {
99
- [x: string]: string | undefined;
100
- } | undefined;
101
- 'x-tokenName'?: string | undefined;
102
- authorizationUrl?: string | undefined;
103
- tokenUrl?: string | undefined;
104
- 'x-scalar-secret-client-secret'?: string | undefined;
105
- 'x-scalar-secret-redirect-uri'?: string | undefined;
106
- 'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
107
- 'x-scalar-credentials-location'?: "header" | "body" | undefined;
108
- } | undefined;
109
- } | undefined;
110
- })) => any;
111
36
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
112
37
  "onUpdate:selectedScopes"?: ((payload: Pick<{
113
38
  id: string[];
@@ -116,98 +41,10 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
116
41
  newScopePayload?: {
117
42
  name: string;
118
43
  description: string;
119
- flowType: keyof OAuthFlowsObject;
44
+ flowType: keyof import("@scalar/workspace-store/schemas/v3.1/strict/oauthflows").OAuthFlowsObject;
120
45
  };
121
46
  meta: import("@scalar/workspace-store/events").AuthMeta;
122
47
  }, "scopes" | "newScopePayload">) => any) | undefined;
123
- "onUpdate:securityScheme"?: ((payload: ({
124
- type: "http";
125
- } & Partial<Omit<import("@scalar/workspace-store/schemas/v3.1/strict/security-scheme").HttpObject, "type">>) | ({
126
- type: "apiKey";
127
- } & Partial<Omit<import("@scalar/workspace-store/schemas/v3.1/strict/security-scheme").ApiKeyObject, "type">>) | ({
128
- type: "oauth2";
129
- } & {
130
- description?: string | undefined;
131
- 'x-default-scopes'?: string[] | undefined;
132
- flows?: {
133
- implicit?: {
134
- refreshUrl?: string | undefined;
135
- scopes?: {
136
- [x: string]: string | undefined;
137
- } | undefined;
138
- 'x-scalar-secret-client-id'?: string | undefined;
139
- 'x-scalar-secret-token'?: string | undefined;
140
- 'x-scalar-security-query'?: {
141
- [x: string]: string | undefined;
142
- } | undefined;
143
- 'x-scalar-security-body'?: {
144
- [x: string]: string | undefined;
145
- } | undefined;
146
- 'x-tokenName'?: string | undefined;
147
- authorizationUrl?: string | undefined;
148
- 'x-scalar-secret-redirect-uri'?: string | undefined;
149
- } | undefined;
150
- password?: {
151
- refreshUrl?: string | undefined;
152
- scopes?: {
153
- [x: string]: string | undefined;
154
- } | undefined;
155
- 'x-scalar-secret-client-id'?: string | undefined;
156
- 'x-scalar-secret-token'?: string | undefined;
157
- 'x-scalar-security-query'?: {
158
- [x: string]: string | undefined;
159
- } | undefined;
160
- 'x-scalar-security-body'?: {
161
- [x: string]: string | undefined;
162
- } | undefined;
163
- 'x-tokenName'?: string | undefined;
164
- tokenUrl?: string | undefined;
165
- 'x-scalar-secret-username'?: string | undefined;
166
- 'x-scalar-secret-password'?: string | undefined;
167
- 'x-scalar-secret-client-secret'?: string | undefined;
168
- 'x-scalar-credentials-location'?: "header" | "body" | undefined;
169
- } | undefined;
170
- clientCredentials?: {
171
- refreshUrl?: string | undefined;
172
- scopes?: {
173
- [x: string]: string | undefined;
174
- } | undefined;
175
- 'x-scalar-secret-client-id'?: string | undefined;
176
- 'x-scalar-secret-token'?: string | undefined;
177
- 'x-scalar-security-query'?: {
178
- [x: string]: string | undefined;
179
- } | undefined;
180
- 'x-scalar-security-body'?: {
181
- [x: string]: string | undefined;
182
- } | undefined;
183
- 'x-tokenName'?: string | undefined;
184
- tokenUrl?: string | undefined;
185
- 'x-scalar-secret-client-secret'?: string | undefined;
186
- 'x-scalar-credentials-location'?: "header" | "body" | undefined;
187
- } | undefined;
188
- authorizationCode?: {
189
- refreshUrl?: string | undefined;
190
- scopes?: {
191
- [x: string]: string | undefined;
192
- } | undefined;
193
- 'x-scalar-secret-client-id'?: string | undefined;
194
- 'x-scalar-secret-token'?: string | undefined;
195
- 'x-scalar-security-query'?: {
196
- [x: string]: string | undefined;
197
- } | undefined;
198
- 'x-scalar-security-body'?: {
199
- [x: string]: string | undefined;
200
- } | undefined;
201
- 'x-tokenName'?: string | undefined;
202
- authorizationUrl?: string | undefined;
203
- tokenUrl?: string | undefined;
204
- 'x-scalar-secret-client-secret'?: string | undefined;
205
- 'x-scalar-secret-redirect-uri'?: string | undefined;
206
- 'x-usePkce'?: "SHA-256" | "plain" | "no" | undefined;
207
- 'x-scalar-credentials-location'?: "header" | "body" | undefined;
208
- } | undefined;
209
- } | undefined;
210
- })) => any) | undefined;
211
48
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
212
49
  export default _default;
213
50
  //# sourceMappingURL=OAuth2.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"names":[],"mappings":"AAgUA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAQnH,OAAO,KAAK,EAEV,gBAAgB,EAChB,YAAY,EACb,MAAM,8DAA8D,CAAA;AASrE,KAAK,WAAW,GAAG;IACjB,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,IAAI,CAAA;IAC3B,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgnBF,wBAOG"}
1
+ {"version":3,"file":"OAuth2.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"names":[],"mappings":"AAiWA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAGnH,OAAO,KAAK,EAEV,YAAY,EACb,MAAM,8DAA8D,CAAA;AAMrE,OAAO,KAAK,EAIV,sBAAsB,EACvB,MAAM,6DAA6D,CAAA;AAIpE,KAAK,WAAW,GAAG;IACjB,wCAAwC;IACxC,WAAW,EAAE,kBAAkB,CAAA;IAC/B,kBAAkB;IAClB,KAAK,EAAE,sBAAsB,CAAA;IAC7B,wCAAwC;IACxC,6BAA6B;IAC7B,IAAI,EAAE,MAAM,sBAAsB,CAAA;IAClC,sBAAsB;IACtB,cAAc,EAAE,MAAM,EAAE,CAAA;IACxB,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;CAC5B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;AAmoBF,wBAOG"}
@@ -1,13 +1,13 @@
1
- import { defineComponent as b, computed as w, watch as B, createElementBlock as x, openBlock as c, Fragment as y, createVNode as r, unref as o, withCtx as t, createTextVNode as s, createElementVNode as U, createBlock as f, createCommentVNode as v } from "vue";
2
- import { useLoadingState as L, ScalarButton as S } from "@scalar/components";
1
+ import { defineComponent as b, computed as w, watch as L, createElementBlock as x, openBlock as c, Fragment as V, createVNode as r, unref as o, withCtx as l, createTextVNode as s, createElementVNode as U, createBlock as f, createCommentVNode as v } from "vue";
2
+ import { useLoadingState as O, ScalarButton as S } from "@scalar/components";
3
3
  import { pkceOptions as P } from "@scalar/oas-utils/entities/spec";
4
4
  import { useToasts as R } from "@scalar/use-toasts";
5
5
  import F from "./OAuthScopesInput.vue.js";
6
6
  /* empty css */
7
- import { authorizeOauth2 as O } from "../helpers/oauth.js";
8
- import m from "./RequestAuthDataTableInput.vue.js";
7
+ import { authorizeOauth2 as A } from "../helpers/oauth.js";
8
+ import i from "./RequestAuthDataTableInput.vue.js";
9
9
  import u from "../../../../components/DataTable/DataTableRow.vue.js";
10
- const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { class: "flex h-8 w-full items-center justify-end border-t" }, X = /* @__PURE__ */ b({
10
+ const I = { class: "flex h-8 items-center justify-end gap-2 border-t" }, N = { class: "flex h-8 w-full items-center justify-end border-t" }, Y = /* @__PURE__ */ b({
11
11
  __name: "OAuth2",
12
12
  props: {
13
13
  environment: {},
@@ -15,54 +15,65 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
15
15
  type: {},
16
16
  selectedScopes: {},
17
17
  server: {},
18
- proxyUrl: {}
18
+ proxyUrl: {},
19
+ name: {},
20
+ eventBus: {}
19
21
  },
20
- emits: ["update:securityScheme", "update:selectedScopes"],
21
- setup(a, { emit: g }) {
22
- const V = g, p = L(), { toast: C } = R(), l = w(() => a.flows[a.type]), k = w(
23
- () => a.selectedScopes.filter((i) => i in (l.value.scopes ?? {}))
24
- ), d = (i) => V("update:securityScheme", {
25
- type: "oauth2",
26
- flows: {
27
- [a.type]: i
28
- }
22
+ emits: ["update:selectedScopes"],
23
+ setup(t, { emit: g }) {
24
+ const C = g, p = O(), { toast: T } = R(), a = w(() => t.flows[t.type]), k = w(
25
+ () => t.selectedScopes.filter((d) => d in (a.value.scopes ?? {}))
26
+ ), y = (d) => t.eventBus.emit("auth:update:security-scheme", {
27
+ payload: {
28
+ type: "oauth2",
29
+ flows: {
30
+ [t.type]: d
31
+ }
32
+ },
33
+ name: t.name
34
+ }), m = (d) => t.eventBus.emit("auth:update:security-scheme-secrets", {
35
+ payload: {
36
+ type: "oauth2",
37
+ [t.type]: d
38
+ },
39
+ name: t.name
29
40
  });
30
- B(
31
- () => l.value["x-scalar-secret-redirect-uri"],
32
- (i) => {
33
- i || typeof window > "u" || !("x-scalar-secret-redirect-uri" in l.value) || d({
41
+ L(
42
+ () => a.value["x-scalar-secret-redirect-uri"],
43
+ (d) => {
44
+ d || typeof window > "u" || !("x-scalar-secret-redirect-uri" in a.value) || m({
34
45
  "x-scalar-secret-redirect-uri": window.location.origin + window.location.pathname
35
46
  });
36
47
  },
37
48
  { immediate: !0 }
38
49
  );
39
- const T = async () => {
50
+ const z = async () => {
40
51
  if (p.isLoading)
41
52
  return;
42
53
  p.start();
43
- const [i, e] = await O(
44
- a.flows,
45
- a.type,
54
+ const [d, e] = await A(
55
+ t.flows,
56
+ t.type,
46
57
  k.value,
47
- a.server,
48
- a.proxyUrl
58
+ t.server,
59
+ t.proxyUrl
49
60
  );
50
- await p.clear(), e ? d({ "x-scalar-secret-token": e }) : (console.error(i), C(i?.message ?? "Failed to authorize", "error"));
51
- }, z = (i) => d({
52
- "x-scalar-credentials-location": i === "body" ? "body" : "header"
61
+ await p.clear(), e ? m({ "x-scalar-secret-token": e }) : (console.error(d), T(d?.message ?? "Failed to authorize", "error"));
62
+ }, B = (d) => y({
63
+ "x-scalar-credentials-location": d === "body" ? "body" : "header"
53
64
  });
54
- return (i, e) => l.value["x-scalar-secret-token"] ? (c(), x(y, { key: 0 }, [
65
+ return (d, e) => a.value["x-scalar-secret-token"] ? (c(), x(V, { key: 0 }, [
55
66
  r(o(u), null, {
56
- default: t(() => [
57
- r(m, {
67
+ default: l(() => [
68
+ r(i, {
58
69
  class: "border-r-transparent",
59
- environment: a.environment,
60
- modelValue: l.value["x-scalar-secret-token"],
70
+ environment: t.environment,
71
+ modelValue: a.value["x-scalar-secret-token"],
61
72
  placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
62
73
  type: "password",
63
- "onUpdate:modelValue": e[0] || (e[0] = (n) => d({ "x-scalar-secret-token": n }))
74
+ "onUpdate:modelValue": e[0] || (e[0] = (n) => m({ "x-scalar-secret-token": n }))
64
75
  }, {
65
- default: t(() => [...e[12] || (e[12] = [
76
+ default: l(() => [...e[12] || (e[12] = [
66
77
  s(" Access Token ", -1)
67
78
  ])]),
68
79
  _: 1
@@ -71,16 +82,16 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
71
82
  _: 1
72
83
  }),
73
84
  r(o(u), { class: "min-w-full" }, {
74
- default: t(() => [
75
- U("div", A, [
85
+ default: l(() => [
86
+ U("div", I, [
76
87
  r(o(S), {
77
88
  class: "mr-1 p-0 px-2 py-0.5",
78
89
  loader: o(p),
79
90
  size: "sm",
80
91
  variant: "outlined",
81
- onClick: e[1] || (e[1] = () => d({ "x-scalar-secret-token": "" }))
92
+ onClick: e[1] || (e[1] = () => m({ "x-scalar-secret-token": "" }))
82
93
  }, {
83
- default: t(() => [...e[13] || (e[13] = [
94
+ default: l(() => [...e[13] || (e[13] = [
84
95
  s(" Clear ", -1)
85
96
  ])]),
86
97
  _: 1
@@ -89,30 +100,30 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
89
100
  ]),
90
101
  _: 1
91
102
  })
92
- ], 64)) : (c(), x(y, { key: 1 }, [
103
+ ], 64)) : (c(), x(V, { key: 1 }, [
93
104
  r(o(u), null, {
94
- default: t(() => [
95
- "authorizationUrl" in l.value ? (c(), f(m, {
105
+ default: l(() => [
106
+ "authorizationUrl" in a.value ? (c(), f(i, {
96
107
  key: 0,
97
108
  containerClass: "border-r-0",
98
- environment: a.environment,
99
- modelValue: l.value.authorizationUrl,
109
+ environment: t.environment,
110
+ modelValue: a.value.authorizationUrl,
100
111
  placeholder: "https://galaxy.scalar.com/authorize",
101
- "onUpdate:modelValue": e[2] || (e[2] = (n) => d({ authorizationUrl: n }))
112
+ "onUpdate:modelValue": e[2] || (e[2] = (n) => y({ authorizationUrl: n }))
102
113
  }, {
103
- default: t(() => [...e[14] || (e[14] = [
114
+ default: l(() => [...e[14] || (e[14] = [
104
115
  s(" Auth URL ", -1)
105
116
  ])]),
106
117
  _: 1
107
118
  }, 8, ["environment", "modelValue"])) : v("", !0),
108
- "tokenUrl" in l.value ? (c(), f(m, {
119
+ "tokenUrl" in a.value ? (c(), f(i, {
109
120
  key: 1,
110
- environment: a.environment,
111
- modelValue: l.value.tokenUrl,
121
+ environment: t.environment,
122
+ modelValue: a.value.tokenUrl,
112
123
  placeholder: "https://galaxy.scalar.com/token",
113
- "onUpdate:modelValue": e[3] || (e[3] = (n) => d({ tokenUrl: n }))
124
+ "onUpdate:modelValue": e[3] || (e[3] = (n) => y({ tokenUrl: n }))
114
125
  }, {
115
- default: t(() => [...e[15] || (e[15] = [
126
+ default: l(() => [...e[15] || (e[15] = [
116
127
  s(" Token URL ", -1)
117
128
  ])]),
118
129
  _: 1
@@ -120,15 +131,15 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
120
131
  ]),
121
132
  _: 1
122
133
  }),
123
- "x-scalar-secret-redirect-uri" in l.value ? (c(), f(o(u), { key: 0 }, {
124
- default: t(() => [
125
- r(m, {
126
- environment: a.environment,
127
- modelValue: l.value["x-scalar-secret-redirect-uri"],
134
+ "x-scalar-secret-redirect-uri" in a.value ? (c(), f(o(u), { key: 0 }, {
135
+ default: l(() => [
136
+ r(i, {
137
+ environment: t.environment,
138
+ modelValue: a.value["x-scalar-secret-redirect-uri"],
128
139
  placeholder: "https://galaxy.scalar.com/callback",
129
- "onUpdate:modelValue": e[4] || (e[4] = (n) => d({ "x-scalar-secret-redirect-uri": n }))
140
+ "onUpdate:modelValue": e[4] || (e[4] = (n) => m({ "x-scalar-secret-redirect-uri": n }))
130
141
  }, {
131
- default: t(() => [...e[16] || (e[16] = [
142
+ default: l(() => [...e[16] || (e[16] = [
132
143
  s(" Redirect URL ", -1)
133
144
  ])]),
134
145
  _: 1
@@ -136,17 +147,17 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
136
147
  ]),
137
148
  _: 1
138
149
  })) : v("", !0),
139
- "x-scalar-secret-username" in l.value && "x-scalar-secret-password" in l.value ? (c(), x(y, { key: 1 }, [
150
+ "x-scalar-secret-username" in a.value && "x-scalar-secret-password" in a.value ? (c(), x(V, { key: 1 }, [
140
151
  r(o(u), null, {
141
- default: t(() => [
142
- r(m, {
152
+ default: l(() => [
153
+ r(i, {
143
154
  class: "text-c-2",
144
- environment: a.environment,
145
- modelValue: l.value["x-scalar-secret-username"],
155
+ environment: t.environment,
156
+ modelValue: a.value["x-scalar-secret-username"],
146
157
  placeholder: "janedoe",
147
- "onUpdate:modelValue": e[5] || (e[5] = (n) => d({ "x-scalar-secret-username": n }))
158
+ "onUpdate:modelValue": e[5] || (e[5] = (n) => m({ "x-scalar-secret-username": n }))
148
159
  }, {
149
- default: t(() => [...e[17] || (e[17] = [
160
+ default: l(() => [...e[17] || (e[17] = [
150
161
  s(" Username ", -1)
151
162
  ])]),
152
163
  _: 1
@@ -155,15 +166,15 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
155
166
  _: 1
156
167
  }),
157
168
  r(o(u), null, {
158
- default: t(() => [
159
- r(m, {
160
- environment: a.environment,
161
- modelValue: l.value["x-scalar-secret-password"],
169
+ default: l(() => [
170
+ r(i, {
171
+ environment: t.environment,
172
+ modelValue: a.value["x-scalar-secret-password"],
162
173
  placeholder: "********",
163
174
  type: "password",
164
- "onUpdate:modelValue": e[6] || (e[6] = (n) => d({ "x-scalar-secret-password": n }))
175
+ "onUpdate:modelValue": e[6] || (e[6] = (n) => m({ "x-scalar-secret-password": n }))
165
176
  }, {
166
- default: t(() => [...e[18] || (e[18] = [
177
+ default: l(() => [...e[18] || (e[18] = [
167
178
  s(" Password ", -1)
168
179
  ])]),
169
180
  _: 1
@@ -173,14 +184,14 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
173
184
  })
174
185
  ], 64)) : v("", !0),
175
186
  r(o(u), null, {
176
- default: t(() => [
177
- r(m, {
178
- environment: a.environment,
179
- modelValue: l.value["x-scalar-secret-client-id"],
187
+ default: l(() => [
188
+ r(i, {
189
+ environment: t.environment,
190
+ modelValue: a.value["x-scalar-secret-client-id"],
180
191
  placeholder: "12345",
181
- "onUpdate:modelValue": e[7] || (e[7] = (n) => d({ "x-scalar-secret-client-id": n }))
192
+ "onUpdate:modelValue": e[7] || (e[7] = (n) => m({ "x-scalar-secret-client-id": n }))
182
193
  }, {
183
- default: t(() => [...e[19] || (e[19] = [
194
+ default: l(() => [...e[19] || (e[19] = [
184
195
  s(" Client ID ", -1)
185
196
  ])]),
186
197
  _: 1
@@ -188,16 +199,16 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
188
199
  ]),
189
200
  _: 1
190
201
  }),
191
- "x-scalar-secret-client-secret" in l.value ? (c(), f(o(u), { key: 2 }, {
192
- default: t(() => [
193
- r(m, {
194
- environment: a.environment,
195
- modelValue: l.value["x-scalar-secret-client-secret"],
202
+ "x-scalar-secret-client-secret" in a.value ? (c(), f(o(u), { key: 2 }, {
203
+ default: l(() => [
204
+ r(i, {
205
+ environment: t.environment,
206
+ modelValue: a.value["x-scalar-secret-client-secret"],
196
207
  placeholder: "XYZ123",
197
208
  type: "password",
198
- "onUpdate:modelValue": e[8] || (e[8] = (n) => d({ "x-scalar-secret-client-secret": n }))
209
+ "onUpdate:modelValue": e[8] || (e[8] = (n) => m({ "x-scalar-secret-client-secret": n }))
199
210
  }, {
200
- default: t(() => [...e[20] || (e[20] = [
211
+ default: l(() => [...e[20] || (e[20] = [
201
212
  s(" Client Secret ", -1)
202
213
  ])]),
203
214
  _: 1
@@ -205,18 +216,18 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
205
216
  ]),
206
217
  _: 1
207
218
  })) : v("", !0),
208
- "x-usePkce" in l.value ? (c(), f(o(u), { key: 3 }, {
209
- default: t(() => [
210
- r(m, {
219
+ "x-usePkce" in a.value ? (c(), f(o(u), { key: 3 }, {
220
+ default: l(() => [
221
+ r(i, {
211
222
  enum: o(P),
212
- environment: a.environment,
213
- modelValue: l.value["x-usePkce"],
223
+ environment: t.environment,
224
+ modelValue: a.value["x-usePkce"],
214
225
  readOnly: "",
215
- "onUpdate:modelValue": e[9] || (e[9] = (n) => d({
226
+ "onUpdate:modelValue": e[9] || (e[9] = (n) => y({
216
227
  "x-usePkce": n
217
228
  }))
218
229
  }, {
219
- default: t(() => [...e[21] || (e[21] = [
230
+ default: l(() => [...e[21] || (e[21] = [
220
231
  s(" Use PKCE ", -1)
221
232
  ])]),
222
233
  _: 1
@@ -224,17 +235,17 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
224
235
  ]),
225
236
  _: 1
226
237
  })) : v("", !0),
227
- a.type !== "implicit" ? (c(), f(o(u), { key: 4 }, {
228
- default: t(() => [
229
- r(m, {
238
+ t.type !== "implicit" ? (c(), f(o(u), { key: 4 }, {
239
+ default: l(() => [
240
+ r(i, {
230
241
  enum: ["header", "body"],
231
- environment: a.environment,
232
- modelValue: l.value["x-scalar-credentials-location"] || "header",
242
+ environment: t.environment,
243
+ modelValue: a.value["x-scalar-credentials-location"] || "header",
233
244
  placeholder: "header",
234
245
  readOnly: "",
235
- "onUpdate:modelValue": e[10] || (e[10] = (n) => z(n))
246
+ "onUpdate:modelValue": e[10] || (e[10] = (n) => B(n))
236
247
  }, {
237
- default: t(() => [...e[22] || (e[22] = [
248
+ default: l(() => [...e[22] || (e[22] = [
238
249
  s(" Credentials Location ", -1)
239
250
  ])]),
240
251
  _: 1
@@ -243,27 +254,27 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
243
254
  _: 1
244
255
  })) : v("", !0),
245
256
  r(o(u), null, {
246
- default: t(() => [
257
+ default: l(() => [
247
258
  r(F, {
248
- flow: l.value,
249
- flowType: a.type,
259
+ flow: a.value,
260
+ flowType: t.type,
250
261
  selectedScopes: k.value,
251
- "onUpdate:selectedScopes": e[11] || (e[11] = (n) => V("update:selectedScopes", n))
262
+ "onUpdate:selectedScopes": e[11] || (e[11] = (n) => C("update:selectedScopes", n))
252
263
  }, null, 8, ["flow", "flowType", "selectedScopes"])
253
264
  ]),
254
265
  _: 1
255
266
  }),
256
267
  r(o(u), { class: "min-w-full" }, {
257
- default: t(() => [
258
- U("div", I, [
268
+ default: l(() => [
269
+ U("div", N, [
259
270
  r(o(S), {
260
271
  class: "mr-0.75 p-0 px-2 py-0.5",
261
272
  loader: o(p),
262
273
  size: "sm",
263
274
  variant: "outlined",
264
- onClick: T
275
+ onClick: z
265
276
  }, {
266
- default: t(() => [...e[23] || (e[23] = [
277
+ default: l(() => [...e[23] || (e[23] = [
267
278
  s(" Authorize ", -1)
268
279
  ])]),
269
280
  _: 1
@@ -276,5 +287,5 @@ const A = { class: "flex h-8 items-center justify-end gap-2 border-t" }, I = { c
276
287
  }
277
288
  });
278
289
  export {
279
- X as default
290
+ Y as default
280
291
  };
@@ -1,6 +1,7 @@
1
1
  import type { AuthMeta, WorkspaceEventBus } from '@scalar/workspace-store/events';
2
2
  import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
3
- import type { ComponentsObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
+ import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
4
+ import type { MergedSecuritySchemes } from '../../../../v2/blocks/scalar-auth-selector-block/index.js';
4
5
  import type { SecuritySchemeOption } from '../../../../v2/blocks/scalar-auth-selector-block/helpers/security-scheme.js';
5
6
  type __VLS_Props = {
6
7
  /** The current environment configuration */
@@ -14,7 +15,7 @@ type __VLS_Props = {
14
15
  /** Proxy URL */
15
16
  proxyUrl: string;
16
17
  /** OpenAPI security scheme definitions */
17
- securitySchemes: ComponentsObject['securitySchemes'];
18
+ securitySchemes: MergedSecuritySchemes;
18
19
  /** Current server configuration */
19
20
  server: ServerObject | null;
20
21
  /** Event bus for authentication updates */
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AAwJA,OAAO,KAAK,EAEV,QAAQ,EACR,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAGrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAA;AAK1G,KAAK,WAAW,GAAG;IACjB,4CAA4C;IAC5C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAA;IACjB,8CAA8C;IAC9C,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,0CAA0C;IAC1C,eAAe,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IACpD,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,CAAA;CACf,CAAC;;;;AAmOF,wBAOG"}
1
+ {"version":3,"file":"RequestAuthDataTable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTable.vue"],"names":[],"mappings":"AA4IA,OAAO,KAAK,EAEV,QAAQ,EACR,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAA;AACnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAA;AAK1G,KAAK,WAAW,GAAG;IACjB,4CAA4C;IAC5C,WAAW,EAAE,kBAAkB,CAAA;IAC/B,mEAAmE;IACnE,QAAQ,EAAE,OAAO,CAAA;IACjB,8CAA8C;IAC9C,qBAAqB,EAAE,oBAAoB,EAAE,CAAA;IAC7C,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,0CAA0C;IAC1C,eAAe,EAAE,qBAAqB,CAAA;IACtC,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,CAAA;CACf,CAAC;;;;AAsNF,wBAOG"}