@scalar/api-client 3.21.4 → 3.21.5

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 (91) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/plugins/posthog/sanitize-event-payload.d.ts.map +1 -1
  3. package/dist/plugins/posthog/sanitize-event-payload.js +1 -0
  4. package/dist/plugins/posthog/sanitize-event-payload.js.map +1 -1
  5. package/dist/style.css +59 -49
  6. package/dist/v2/blocks/operation-block/OperationBlock.vue.d.ts.map +1 -1
  7. package/dist/v2/blocks/operation-block/OperationBlock.vue.js.map +1 -1
  8. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js +1 -1
  9. package/dist/v2/blocks/operation-block/OperationBlock.vue.script.js.map +1 -1
  10. package/dist/v2/blocks/request-block/RequestBlock.vue.script.js.map +1 -1
  11. package/dist/v2/blocks/request-block/components/RequestBody.vue.d.ts.map +1 -1
  12. package/dist/v2/blocks/request-block/components/RequestBody.vue.js +1 -1
  13. package/dist/v2/blocks/request-block/components/RequestBody.vue.js.map +1 -1
  14. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js +1 -1
  15. package/dist/v2/blocks/request-block/components/RequestBody.vue.script.js.map +1 -1
  16. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.d.ts.map +1 -1
  17. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js +1 -1
  18. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.js.map +1 -1
  19. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js +1 -1
  20. package/dist/v2/blocks/scalar-address-bar-block/components/AddressBarHistory.vue.script.js.map +1 -1
  21. package/dist/v2/blocks/scalar-auth-selector-block/components/AuthSelector.vue.script.js.map +1 -1
  22. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.d.ts.map +1 -1
  23. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.js.map +1 -1
  24. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js +53 -22
  25. package/dist/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue.script.js.map +1 -1
  26. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts +4 -0
  27. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.d.ts.map +1 -1
  28. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.js.map +1 -1
  29. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.script.js +23 -12
  30. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue.script.js.map +1 -1
  31. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.d.ts.map +1 -1
  32. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.js.map +1 -1
  33. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js +30 -6
  34. package/dist/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue.script.js.map +1 -1
  35. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.d.ts.map +1 -1
  36. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js +3 -1
  37. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth-device-authorization.js.map +1 -1
  38. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.d.ts.map +1 -1
  39. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js +9 -3
  40. package/dist/v2/blocks/scalar-auth-selector-block/helpers/oauth.js.map +1 -1
  41. package/dist/v2/components/code-input/CodeInput.vue.d.ts.map +1 -1
  42. package/dist/v2/components/code-input/CodeInput.vue.js +1 -1
  43. package/dist/v2/components/code-input/CodeInput.vue.js.map +1 -1
  44. package/dist/v2/components/code-input/CodeInput.vue.script.js.map +1 -1
  45. package/dist/v2/components/data-table/DataTableInput.vue.d.ts.map +1 -1
  46. package/dist/v2/components/data-table/DataTableInput.vue.js +1 -1
  47. package/dist/v2/components/data-table/DataTableInput.vue.js.map +1 -1
  48. package/dist/v2/components/data-table/DataTableInput.vue.script.js +15 -11
  49. package/dist/v2/components/data-table/DataTableInput.vue.script.js.map +1 -1
  50. package/dist/v2/components/server/ServerDropdown.vue.d.ts.map +1 -1
  51. package/dist/v2/components/server/ServerDropdown.vue.js.map +1 -1
  52. package/dist/v2/components/server/ServerDropdown.vue.script.js +1 -1
  53. package/dist/v2/components/server/ServerDropdown.vue.script.js.map +1 -1
  54. package/dist/v2/constants.js +1 -1
  55. package/dist/v2/features/localization/locales/ar.d.ts +3 -0
  56. package/dist/v2/features/localization/locales/ar.d.ts.map +1 -1
  57. package/dist/v2/features/localization/locales/ar.js +4 -1
  58. package/dist/v2/features/localization/locales/ar.js.map +1 -1
  59. package/dist/v2/features/localization/locales/de.d.ts +3 -0
  60. package/dist/v2/features/localization/locales/de.d.ts.map +1 -1
  61. package/dist/v2/features/localization/locales/de.js +4 -1
  62. package/dist/v2/features/localization/locales/de.js.map +1 -1
  63. package/dist/v2/features/localization/locales/es.d.ts +3 -0
  64. package/dist/v2/features/localization/locales/es.d.ts.map +1 -1
  65. package/dist/v2/features/localization/locales/es.js +4 -1
  66. package/dist/v2/features/localization/locales/es.js.map +1 -1
  67. package/dist/v2/features/localization/locales/fr.d.ts +3 -0
  68. package/dist/v2/features/localization/locales/fr.d.ts.map +1 -1
  69. package/dist/v2/features/localization/locales/fr.js +4 -1
  70. package/dist/v2/features/localization/locales/fr.js.map +1 -1
  71. package/dist/v2/features/localization/locales/pt.d.ts +3 -0
  72. package/dist/v2/features/localization/locales/pt.d.ts.map +1 -1
  73. package/dist/v2/features/localization/locales/pt.js +4 -1
  74. package/dist/v2/features/localization/locales/pt.js.map +1 -1
  75. package/dist/v2/features/localization/locales/ru.d.ts +3 -0
  76. package/dist/v2/features/localization/locales/ru.d.ts.map +1 -1
  77. package/dist/v2/features/localization/locales/ru.js +4 -1
  78. package/dist/v2/features/localization/locales/ru.js.map +1 -1
  79. package/dist/v2/features/localization/locales/zh-cn.d.ts +3 -0
  80. package/dist/v2/features/localization/locales/zh-cn.d.ts.map +1 -1
  81. package/dist/v2/features/localization/locales/zh-cn.js +4 -1
  82. package/dist/v2/features/localization/locales/zh-cn.js.map +1 -1
  83. package/dist/v2/features/localization/translations.d.ts +3 -0
  84. package/dist/v2/features/localization/translations.d.ts.map +1 -1
  85. package/dist/v2/features/localization/translations.js +4 -1
  86. package/dist/v2/features/localization/translations.js.map +1 -1
  87. package/dist/v2/workspace-events.d.ts.map +1 -1
  88. package/dist/v2/workspace-events.js +1 -0
  89. package/dist/v2/workspace-events.js.map +1 -1
  90. package/dist/vue-styles.css +29 -31
  91. package/package.json +11 -11
@@ -10,6 +10,7 @@ import { getEnvironmentVariables } from "@scalar/workspace-store/request-example
10
10
  import { useToasts } from "@scalar/use-toasts";
11
11
  import { useLoadingState } from "@scalar/components/loading";
12
12
  import { pkceOptions } from "@scalar/types/entities";
13
+ import { isSecretFieldCleared } from "@scalar/workspace-store/helpers/auth-secret-fields";
13
14
  //#region src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue?vue&type=script&setup=true&lang.ts
14
15
  var _hoisted_1 = { class: "flex h-8 items-center justify-end gap-2 border-t" };
15
16
  var _hoisted_2 = { class: "w-full p-2" };
@@ -99,6 +100,19 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
99
100
  name: __props.name
100
101
  });
101
102
  };
103
+ /** Reset only this field; redirect URI may need its browser default prefilled again. */
104
+ const handleResetSecret = (field) => {
105
+ if (field === "x-scalar-secret-redirect-uri") hasHandledRedirectPrefill.value = false;
106
+ __props.eventBus.emit("auth:reset:security-scheme-secret", {
107
+ name: __props.name,
108
+ flow: __props.type,
109
+ field
110
+ });
111
+ };
112
+ /** Fixed-choice fields must never write an empty string into the document. */
113
+ const handlePkceUpdate = (value) => {
114
+ if (value === "SHA-256" || value === "plain" || value === "no") handleOauth2Update({ "x-usePkce": value });
115
+ };
102
116
  /** Clears the flow secrets */
103
117
  const clearOauth2Secrets = () => {
104
118
  if (loader.isLoading) return;
@@ -134,7 +148,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
134
148
  const newRedirectUri = currentFlow["x-scalar-secret-redirect-uri"];
135
149
  const defaultRedirectUri = resolveDefaultOAuth2RedirectUri(__props.options);
136
150
  hasHandledRedirectPrefill.value = true;
137
- if (newRedirectUri || !defaultRedirectUri || __props.options.captureOAuth2Callback) return;
151
+ if (isSecretFieldCleared(currentFlow, "x-scalar-secret-redirect-uri") || newRedirectUri || !defaultRedirectUri || __props.options.captureOAuth2Callback) return;
138
152
  handleOauth2SecretsUpdate({ "x-scalar-secret-redirect-uri": defaultRedirectUri });
139
153
  }, { immediate: true });
140
154
  /**
@@ -194,20 +208,23 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
194
208
  };
195
209
  /** Updates the secret location */
196
210
  const handleSecretLocationUpdate = (value) => {
197
- const credentialsLocation = value === "body" ? "body" : "header";
211
+ if (value !== "body" && value !== "header") return;
212
+ const credentialsLocation = value;
198
213
  if (__props.scheme.type !== "openIdConnect") handleOauth2Update({ "x-scalar-credentials-location": credentialsLocation });
199
214
  handleOauth2SecretsUpdate({ "x-scalar-credentials-location": credentialsLocation });
200
215
  };
201
216
  return (_ctx, _cache) => {
202
- return Boolean(flow.value["x-scalar-secret-token"]) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
217
+ return Boolean(flow.value["x-scalar-secret-token"]) || unref(isSecretFieldCleared)(flow.value, "x-scalar-secret-token") ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
203
218
  createVNode(unref(DataTableRow_default), null, {
204
219
  default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
220
+ canReset: "",
205
221
  class: "border-r-transparent",
206
222
  environment: __props.environment,
207
223
  modelValue: flow.value["x-scalar-secret-token"],
208
224
  placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
209
225
  type: "password",
210
- "onUpdate:modelValue": _cache[0] || (_cache[0] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-token": v }))
226
+ onReset: _cache[0] || (_cache[0] = ($event) => handleResetSecret("x-scalar-secret-token")),
227
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-token": v }))
211
228
  }, {
212
229
  default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauth2.accessToken")), 1)]),
213
230
  _: 1
@@ -220,7 +237,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
220
237
  environment: __props.environment,
221
238
  modelValue: flow.value.refreshUrl ?? "",
222
239
  placeholder: refreshUrlPlaceholder.value,
223
- "onUpdate:modelValue": _cache[1] || (_cache[1] = (v) => handleOauth2Update({ refreshUrl: v }))
240
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = (v) => handleOauth2Update({ refreshUrl: v }))
224
241
  }, {
225
242
  default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauth2.refreshUrl")), 1)]),
226
243
  _: 1
@@ -252,7 +269,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
252
269
  variant: "outlined",
253
270
  onClick: handleClearAccessTokens
254
271
  }, {
255
- default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauth2.clear")), 1)]),
272
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauth2.clearTokens")), 1)]),
256
273
  _: 1
257
274
  }, 8, ["disabled"])])]),
258
275
  _: 1
@@ -262,7 +279,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
262
279
  default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
263
280
  environment: __props.environment,
264
281
  modelValue: flow.value.deviceAuthorizationUrl,
265
- "onUpdate:modelValue": _cache[2] || (_cache[2] = (v) => handleOauth2Update({ deviceAuthorizationUrl: v }))
282
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = (v) => handleOauth2Update({ deviceAuthorizationUrl: v }))
266
283
  }, {
267
284
  default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauth2.deviceAuthorizationUrl")), 1)]),
268
285
  _: 1
@@ -293,25 +310,29 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
293
310
  createVNode(unref(DataTableRow_default), null, {
294
311
  default: withCtx(() => ["authorizationUrl" in flow.value ? (openBlock(), createBlock(RequestAuthDataTableInput_default, {
295
312
  key: 0,
313
+ canReset: "",
296
314
  containerClass: "border-r-0",
297
315
  environment: __props.environment,
298
316
  modelValue: flow.value["x-scalar-secret-auth-url"] ?? "",
299
317
  placeholder: "https://galaxy.scalar.com/authorize",
300
- "onUpdate:modelValue": _cache[3] || (_cache[3] = (v) => {
318
+ onReset: _cache[4] || (_cache[4] = ($event) => handleResetSecret("x-scalar-secret-auth-url")),
319
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = (v) => {
301
320
  handleOauth2SecretsUpdate({ "x-scalar-secret-auth-url": v });
302
- handleOauth2Update({ authorizationUrl: v });
321
+ if (v) handleOauth2Update({ authorizationUrl: v });
303
322
  })
304
323
  }, {
305
324
  default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauth2.authUrl")), 1)]),
306
325
  _: 1
307
326
  }, 8, ["environment", "modelValue"])) : createCommentVNode("", true), "tokenUrl" in flow.value ? (openBlock(), createBlock(RequestAuthDataTableInput_default, {
308
327
  key: 1,
328
+ canReset: "",
309
329
  environment: __props.environment,
310
330
  modelValue: flow.value["x-scalar-secret-token-url"] ?? "",
311
331
  placeholder: "https://galaxy.scalar.com/token",
312
- "onUpdate:modelValue": _cache[4] || (_cache[4] = (v) => {
332
+ onReset: _cache[6] || (_cache[6] = ($event) => handleResetSecret("x-scalar-secret-token-url")),
333
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = (v) => {
313
334
  handleOauth2SecretsUpdate({ "x-scalar-secret-token-url": v });
314
- handleOauth2Update({ tokenUrl: v });
335
+ if (v) handleOauth2Update({ tokenUrl: v });
315
336
  })
316
337
  }, {
317
338
  default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauth2.tokenUrl")), 1)]),
@@ -321,10 +342,12 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
321
342
  }),
322
343
  "x-scalar-secret-redirect-uri" in flow.value ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 2 }, {
323
344
  default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
345
+ canReset: "",
324
346
  environment: __props.environment,
325
347
  modelValue: flow.value["x-scalar-secret-redirect-uri"],
326
348
  placeholder: __props.options.captureOAuth2Callback ? `${unref(resolveDefaultOAuth2RedirectUri)(__props.options) || "http://127.0.0.1"} (handled automatically)` : unref(translate)("apiClient.oauth2.optionalRedirectUrl"),
327
- "onUpdate:modelValue": _cache[5] || (_cache[5] = (v) => {
349
+ onReset: _cache[8] || (_cache[8] = ($event) => handleResetSecret("x-scalar-secret-redirect-uri")),
350
+ "onUpdate:modelValue": _cache[9] || (_cache[9] = (v) => {
328
351
  hasHandledRedirectPrefill.value = true;
329
352
  handleOauth2SecretsUpdate({ "x-scalar-secret-redirect-uri": v });
330
353
  })
@@ -340,11 +363,13 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
340
363
  })) : createCommentVNode("", true),
341
364
  "x-scalar-secret-username" in flow.value && "x-scalar-secret-password" in flow.value ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [createVNode(unref(DataTableRow_default), null, {
342
365
  default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
366
+ canReset: "",
343
367
  class: "text-c-2",
344
368
  environment: __props.environment,
345
369
  modelValue: flow.value["x-scalar-secret-username"],
346
370
  placeholder: "janedoe",
347
- "onUpdate:modelValue": _cache[6] || (_cache[6] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-username": v }))
371
+ onReset: _cache[10] || (_cache[10] = ($event) => handleResetSecret("x-scalar-secret-username")),
372
+ "onUpdate:modelValue": _cache[11] || (_cache[11] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-username": v }))
348
373
  }, {
349
374
  default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauth2.username")), 1)]),
350
375
  _: 1
@@ -352,11 +377,13 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
352
377
  _: 1
353
378
  }), createVNode(unref(DataTableRow_default), null, {
354
379
  default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
380
+ canReset: "",
355
381
  environment: __props.environment,
356
382
  modelValue: flow.value["x-scalar-secret-password"],
357
383
  placeholder: "********",
358
384
  type: "password",
359
- "onUpdate:modelValue": _cache[7] || (_cache[7] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-password": v }))
385
+ onReset: _cache[12] || (_cache[12] = ($event) => handleResetSecret("x-scalar-secret-password")),
386
+ "onUpdate:modelValue": _cache[13] || (_cache[13] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-password": v }))
360
387
  }, {
361
388
  default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauth2.password")), 1)]),
362
389
  _: 1
@@ -365,10 +392,12 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
365
392
  })], 64)) : createCommentVNode("", true),
366
393
  createVNode(unref(DataTableRow_default), null, {
367
394
  default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
395
+ canReset: "",
368
396
  environment: __props.environment,
369
397
  modelValue: flow.value["x-scalar-secret-client-id"],
370
398
  placeholder: "12345",
371
- "onUpdate:modelValue": _cache[8] || (_cache[8] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-client-id": v }))
399
+ onReset: _cache[14] || (_cache[14] = ($event) => handleResetSecret("x-scalar-secret-client-id")),
400
+ "onUpdate:modelValue": _cache[15] || (_cache[15] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-client-id": v }))
372
401
  }, {
373
402
  default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauth2.clientID")), 1)]),
374
403
  _: 1
@@ -377,11 +406,13 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
377
406
  }),
378
407
  showClientSecret.value ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 4 }, {
379
408
  default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, {
409
+ canReset: "",
380
410
  environment: __props.environment,
381
411
  modelValue: clientSecretValue.value,
382
412
  placeholder: "XYZ123",
383
413
  type: "password",
384
- "onUpdate:modelValue": _cache[9] || (_cache[9] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-client-secret": v }))
414
+ onReset: _cache[16] || (_cache[16] = ($event) => handleResetSecret("x-scalar-secret-client-secret")),
415
+ "onUpdate:modelValue": _cache[17] || (_cache[17] = (v) => handleOauth2SecretsUpdate({ "x-scalar-secret-client-secret": v }))
385
416
  }, {
386
417
  default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauth2.clientSecret")), 1)]),
387
418
  _: 1
@@ -394,7 +425,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
394
425
  environment: __props.environment,
395
426
  modelValue: flow.value["x-usePkce"],
396
427
  readOnly: "",
397
- "onUpdate:modelValue": _cache[10] || (_cache[10] = (v) => handleOauth2Update({ "x-usePkce": v }))
428
+ "onUpdate:modelValue": handlePkceUpdate
398
429
  }, {
399
430
  default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauth2.usePKCE")), 1)]),
400
431
  _: 1
@@ -412,7 +443,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
412
443
  modelValue: flow.value["x-scalar-credentials-location"] || "header",
413
444
  placeholder: "header",
414
445
  readOnly: "",
415
- "onUpdate:modelValue": _cache[11] || (_cache[11] = (v) => handleSecretLocationUpdate(v))
446
+ "onUpdate:modelValue": _cache[18] || (_cache[18] = (v) => handleSecretLocationUpdate(v))
416
447
  }, {
417
448
  default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauth2.credentialsLocation")), 1)]),
418
449
  _: 1
@@ -424,9 +455,9 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
424
455
  flow: flow.value,
425
456
  flowType: __props.type,
426
457
  selectedScopes: selectedScopes.value,
427
- "onDelete:scope": _cache[12] || (_cache[12] = (v) => emits("delete:scope", v)),
428
- "onUpdate:selectedScopes": _cache[13] || (_cache[13] = (v) => emits("update:selectedScopes", v)),
429
- "onUpsert:scope": _cache[14] || (_cache[14] = (v) => emits("upsert:scope", v))
458
+ "onDelete:scope": _cache[19] || (_cache[19] = (v) => emits("delete:scope", v)),
459
+ "onUpdate:selectedScopes": _cache[20] || (_cache[20] = (v) => emits("update:selectedScopes", v)),
460
+ "onUpsert:scope": _cache[21] || (_cache[21] = (v) => emits("upsert:scope", v))
430
461
  }, null, 8, [
431
462
  "flow",
432
463
  "flowType",
@@ -446,7 +477,7 @@ var OAuth2_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
446
477
  variant: "outlined",
447
478
  onClick: clearOauth2Secrets
448
479
  }, {
449
- default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauth2.clear")), 1)]),
480
+ default: withCtx(() => [createTextVNode(toDisplayString(unref(translate)("apiClient.oauth2.resetDiscovery")), 1)]),
450
481
  _: 1
451
482
  }, 8, ["disabled"])) : createCommentVNode("", true), createVNode(unref(ScalarButton), {
452
483
  class: "mr-0.75 p-0 px-2 py-0.5",
@@ -1 +1 @@
1
- {"version":3,"file":"OAuth2.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Any config options required for the OAuth2 flow */\nexport type OAuth2Options = Pick<\n ApiClientConfiguration,\n 'oauth2RedirectUri'\n> & {\n /** Optional fetch override (IPC-backed on desktop) used for token exchange, refresh, and OIDC discovery */\n customFetch?: typeof fetch\n /** Optional redirect capture (loopback-backed on desktop) for interactive OAuth2 flows */\n captureOAuth2Callback?: CaptureOAuth2Callback\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { useLoadingState } from '@scalar/components/loading'\nimport type { ApiClientConfiguration } from '@scalar/types/api-reference'\nimport { pkceOptions } from '@scalar/types/entities'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { SecretsOAuthFlows } from '@scalar/workspace-store/entities/auth'\nimport type {\n ApiReferenceEvents,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport {\n getEnvironmentVariables,\n type OAuthFlowAuthorizationCodeSecret,\n type OAuthFlowClientCredentialsSecret,\n type OAuthFlowPasswordSecret,\n type OAuthFlowsObjectSecret,\n type SecuritySchemeObjectSecret,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { XScalarCredentialsLocation } from '@scalar/workspace-store/schemas/extensions/security/x-scalar-credentials-location'\nimport { type XusePkce } from '@scalar/workspace-store/schemas/extensions/security/x-use-pkce'\nimport type {\n OAuthFlow,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, onBeforeUnmount, ref, watch } from 'vue'\n\nimport OAuthScopesInput from '@/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue'\nimport {\n authorizeOauth2,\n refreshOauth2Token,\n type CaptureOAuth2Callback,\n} from '@/v2/blocks/scalar-auth-selector-block/helpers/oauth'\nimport { resolveDefaultOAuth2RedirectUri } from '@/v2/blocks/scalar-auth-selector-block/helpers/resolve-default-oauth2-redirect-url'\nimport { DataTableRow } from '@/v2/components/data-table'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport type { DeviceAuthorizationPrompt } from '../helpers/oauth-device-authorization'\nimport RequestAuthDataTableInput from './RequestAuthDataTableInput.vue'\n\nconst {\n environment,\n flows,\n type,\n scheme,\n selectedScopes: selectedScopesProp,\n server,\n proxyUrl,\n eventBus,\n name,\n options = {},\n} = defineProps<{\n /** Current environment configuration */\n environment: XScalarEnvironment\n /** OAuth flows */\n flows: OAuthFlowsObjectSecret\n /** Type of the OAuth flow */\n type: keyof OAuthFlowsObjectSecret\n /** Selected scopes */\n selectedScopes: string[]\n /** Security scheme */\n scheme: SecuritySchemeObjectSecret\n /** Current server configuration */\n server: ServerObject | null\n /** Proxy URL */\n proxyUrl: string\n /** Name of the security scheme */\n name: string\n /** Event bus for authentication updates */\n eventBus: WorkspaceEventBus\n /** Any config options required for the OAuth2 flow */\n options?: OAuth2Options\n /**\n * Hides the Authorize / Refresh / Clear actions. Used when the form is embedded as a\n * configuration-only view (e.g. behind a gear icon), so the host component owns the\n * authorize action and the tokens are routed to the scheme it chooses.\n */\n hideActions?: boolean\n}>()\n\nconst emits = defineEmits<{\n (\n e: 'update:selectedScopes',\n payload: { scopes?: string[]; scope?: string; selected?: boolean },\n ): void\n (\n e: 'upsert:scope',\n payload: Omit<ApiReferenceEvents['auth:upsert:scopes'], 'name'>,\n ): void\n (\n e: 'delete:scope',\n payload: Omit<ApiReferenceEvents['auth:delete:scopes'], 'name'>,\n ): void\n}>()\n\nconst devicePrompt = ref<DeviceAuthorizationPrompt | null>(null)\nlet deviceController: AbortController | undefined\nconst cancelDeviceAuthorization = (): void => {\n deviceController?.abort()\n devicePrompt.value = null\n}\nonBeforeUnmount(cancelDeviceAuthorization)\nwatch(() => [type, name, flows], cancelDeviceAuthorization)\n\nconst { translate } = useLocalization()\n\nconst loader = useLoadingState()\nconst { toast } = useToasts()\n\n/** The current OAuth flow based on the selected type */\nconst flow = computed(() => flows[type]!)\ntype NonImplicitFlow =\n | OAuthFlowPasswordSecret\n | OAuthFlowClientCredentialsSecret\n | OAuthFlowAuthorizationCodeSecret\n\n/** We filter selected scopes to only include scopes that are defined on this flow (own keys only). */\nconst selectedScopes = computed(() => {\n const definedScopes = flow.value.scopes\n if (!definedScopes) {\n return []\n }\n return selectedScopesProp.filter((scope) =>\n Object.hasOwn(definedScopes, scope),\n )\n})\n\n/**\n * Show the client secret whenever the flow supports one. PKCE and a client\n * secret are independent, so confidential clients can use both together\n * (see RFC 9700 Section 2.1.1).\n */\nconst showClientSecret = computed(\n () => 'x-scalar-secret-client-secret' in flow.value,\n)\n\nconst clientSecretValue = computed((): string => {\n const f = flow.value as { 'x-scalar-secret-client-secret'?: string }\n return f['x-scalar-secret-client-secret'] ?? ''\n})\n\n/** Updates the security scheme base */\nconst handleOauth2Update = (\n payload: Partial<OAuthFlow & XScalarCredentialsLocation> & {\n deviceAuthorizationUrl?: string\n },\n): void => {\n // OpenIdConnect uses the secrets update for all\n if (scheme.type === 'openIdConnect') {\n return handleOauth2SecretsUpdate(payload)\n }\n\n // Only OAuth2 schemes carry flows on the document; this component is never\n // rendered for the other scheme types.\n if (scheme.type !== 'oauth2') {\n return\n }\n\n eventBus.emit('auth:update:security-scheme', {\n payload: {\n type: scheme.type,\n flows: {\n [type]: payload,\n },\n },\n name,\n })\n}\n\n/** Updates the flow secrets */\nconst handleOauth2SecretsUpdate = (\n payload: Omit<Partial<SecretsOAuthFlows[keyof SecretsOAuthFlows]>, 'type'>,\n): void => {\n // This component only renders for oauth2/openIdConnect. Other scheme types (e.g. mutualTLS)\n // carry no flow secrets, so there is nothing to persist and no matching secrets payload type.\n if (scheme.type !== 'oauth2' && scheme.type !== 'openIdConnect') {\n return\n }\n\n eventBus.emit('auth:update:security-scheme-secrets', {\n payload: {\n type: scheme.type,\n [type]: payload,\n },\n name,\n })\n}\n\n/** Clears the flow secrets */\nconst clearOauth2Secrets = (): void => {\n if (loader.isLoading) {\n return\n }\n eventBus.emit('auth:clear:security-scheme-secrets', {\n name,\n })\n}\n\n/** Clears stored access and refresh tokens (authorized state) */\nconst handleClearAccessTokens = (): void => {\n if (loader.isLoading) {\n return\n }\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': '',\n 'x-scalar-secret-refresh-token': '',\n })\n}\n\n/** Track redirect URI prefill per flow instance to support document switching */\nconst prefilledFlowIdentity = ref<string | null>(null)\nconst hasHandledRedirectPrefill = ref(false)\n\nconst resolveFlowIdentity = (\n currentFlow: OAuthFlowsObjectSecret[keyof OAuthFlowsObjectSecret] | undefined,\n): string =>\n JSON.stringify({\n type,\n authorizationUrl:\n currentFlow && 'authorizationUrl' in currentFlow\n ? currentFlow.authorizationUrl\n : '',\n tokenUrl:\n currentFlow && 'tokenUrl' in currentFlow ? currentFlow.tokenUrl : '',\n refreshUrl: currentFlow?.refreshUrl ?? '',\n scopes: Object.keys(currentFlow?.scopes ?? {}),\n })\n\n/** Default the redirect-uri to the current origin if we have access to window */\nwatch(\n () => flow.value,\n (currentFlow) => {\n if (!currentFlow || !('x-scalar-secret-redirect-uri' in currentFlow)) {\n return\n }\n\n const flowIdentity = resolveFlowIdentity(currentFlow)\n if (prefilledFlowIdentity.value !== flowIdentity) {\n prefilledFlowIdentity.value = flowIdentity\n hasHandledRedirectPrefill.value = false\n }\n\n if (hasHandledRedirectPrefill.value) {\n return\n }\n\n const newRedirectUri = (currentFlow as OAuthFlowAuthorizationCodeSecret)[\n 'x-scalar-secret-redirect-uri'\n ]\n const defaultRedirectUri = resolveDefaultOAuth2RedirectUri(options)\n\n hasHandledRedirectPrefill.value = true\n\n // The desktop loopback path computes the redirect URI at authorize time (an\n // ephemeral 127.0.0.1 port), so persisting a default into the document would\n // only bake in a stale, unused value. Leave it empty and show a hint instead.\n if (\n newRedirectUri ||\n !defaultRedirectUri ||\n options.captureOAuth2Callback\n ) {\n return\n }\n\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-redirect-uri': defaultRedirectUri,\n })\n },\n { immediate: true },\n)\n\n/**\n * Authorizes the user using the specified OAuth flow.\n * Opens the appropriate OAuth dialog and/or performs the token exchange.\n */\nconst handleAuthorize = async (): Promise<void> => {\n if (loader.isLoading) {\n return\n }\n\n loader.start()\n const controller = new AbortController()\n deviceController = controller\n\n const [error, tokens] = await authorizeOauth2(\n flows,\n type,\n selectedScopes.value,\n server,\n proxyUrl,\n getEnvironmentVariables(environment),\n options.customFetch,\n options.captureOAuth2Callback,\n {\n signal: controller.signal,\n onPrompt: (prompt) => {\n devicePrompt.value = prompt\n },\n },\n )\n devicePrompt.value = null\n\n await loader.clear()\n if (controller.signal.aborted) {\n return\n }\n\n if (tokens?.accessToken) {\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': tokens.accessToken,\n ...(tokens.refreshToken\n ? { 'x-scalar-secret-refresh-token': tokens.refreshToken }\n : {}),\n })\n } else {\n console.error(error)\n toast(\n error?.message ?? translate('apiClient.oauth2.failedToauthorize'),\n 'error',\n )\n }\n}\n\n/** Refreshing requires a token issued by the provider, not just a compatible flow. */\nconst canRefreshToken = computed<boolean>(\n (): boolean =>\n type !== 'implicit' && Boolean(flow.value['x-scalar-secret-refresh-token']),\n)\n\n/**\n * Refresh URL placeholder, shows tokenUrl as hint if refreshUrl is not specified.\n * This helps users understand that tokenUrl will be used as fallback.\n */\nconst refreshUrlPlaceholder = computed(() => {\n if ('tokenUrl' in flow.value && flow.value.tokenUrl) {\n return flow.value.tokenUrl\n }\n return 'https://galaxy.scalar.com/oauth/refresh'\n})\n\n/**\n * Uses the stored refresh token to obtain a new access token\n * via grant_type=refresh_token.\n */\nconst handleRefresh = async (): Promise<void> => {\n // The explicit flow check narrows the type for refreshOauth2Token; the computed boolean cannot.\n if (loader.isLoading || type === 'implicit' || !canRefreshToken.value) {\n return\n }\n\n loader.start()\n\n const [error, tokens] = await refreshOauth2Token(\n flows,\n type,\n proxyUrl,\n server,\n getEnvironmentVariables(environment),\n options.customFetch,\n )\n\n await loader.clear()\n\n if (tokens?.accessToken) {\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': tokens.accessToken,\n ...(tokens.refreshToken\n ? { 'x-scalar-secret-refresh-token': tokens.refreshToken }\n : {}),\n })\n } else {\n console.error(error)\n toast(\n error?.message ?? translate('apiClient.oauth2.failedToRefreshToken'),\n 'error',\n )\n }\n}\n\n/** Updates the secret location */\nconst handleSecretLocationUpdate = (value: string): void => {\n const credentialsLocation = value === 'body' ? 'body' : 'header'\n\n if (scheme.type !== 'openIdConnect') {\n handleOauth2Update({\n 'x-scalar-credentials-location': credentialsLocation,\n })\n }\n\n handleOauth2SecretsUpdate({\n 'x-scalar-credentials-location': credentialsLocation,\n })\n}\n</script>\n\n<template>\n <!-- Access Token Display: Shows when user is already authorized -->\n <template v-if=\"Boolean(flow['x-scalar-secret-token'])\">\n <DataTableRow>\n <RequestAuthDataTableInput\n class=\"border-r-transparent\"\n :environment\n :modelValue=\"flow['x-scalar-secret-token']\"\n placeholder=\"QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT\"\n type=\"password\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-token': v })\n \">\n {{ translate('apiClient.oauth2.accessToken') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"canRefreshToken\">\n <RequestAuthDataTableInput\n class=\"border-r-transparent\"\n :environment\n :modelValue=\"flow.refreshUrl ?? ''\"\n :placeholder=\"refreshUrlPlaceholder\"\n @update:modelValue=\"(v) => handleOauth2Update({ refreshUrl: v })\">\n {{ translate('apiClient.oauth2.refreshUrl') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow\n v-if=\"!hideActions\"\n class=\"min-w-full\">\n <div class=\"flex h-8 items-center justify-end gap-2 border-t\">\n <ScalarButton\n v-if=\"canRefreshToken\"\n class=\"p-0 px-2 py-0.5\"\n :loader\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleRefresh\">\n {{ translate('apiClient.oauth2.refresh') }}\n </ScalarButton>\n <ScalarButton\n class=\"mr-1 p-0 px-2 py-0.5\"\n :disabled=\"loader.isLoading\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleClearAccessTokens\">\n {{ translate('apiClient.oauth2.clear') }}\n </ScalarButton>\n </div>\n </DataTableRow>\n </template>\n\n <!-- Authorization Form: Shows when user needs to authorize -->\n <template v-else>\n <DataTableRow v-if=\"'deviceAuthorizationUrl' in flow\">\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow.deviceAuthorizationUrl\"\n @update:modelValue=\"\n (v) => handleOauth2Update({ deviceAuthorizationUrl: v })\n \">\n {{ translate('apiClient.oauth2.deviceAuthorizationUrl') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n <DataTableRow v-if=\"devicePrompt\">\n <div class=\"w-full p-2\">\n <div\n class=\"bg-b-2 flex flex-col gap-3 rounded-lg border p-3 text-sm\"\n role=\"status\">\n <p class=\"text-c-2 text-xs leading-normal\">\n {{ translate('apiClient.oauth2.deviceVerificationPrompt') }}\n </p>\n <strong\n class=\"bg-b-1 font-code w-fit max-w-full rounded border px-3 py-2 text-base font-medium tracking-widest break-all select-all\">\n {{ devicePrompt.userCode }}\n </strong>\n <a\n class=\"text-c-accent w-fit max-w-full text-xs break-all underline underline-offset-2\"\n :href=\"\n devicePrompt.verificationUriComplete ||\n devicePrompt.verificationUri\n \"\n rel=\"noopener noreferrer\"\n target=\"_blank\">\n {{ devicePrompt.verificationUri }}\n </a>\n <div class=\"flex items-center justify-between gap-3\">\n <p class=\"text-c-2 text-xs\">\n {{ translate('apiClient.oauth2.waitingForAuthorization') }}\n </p>\n <ScalarButton\n size=\"xs\"\n variant=\"outlined\"\n @click=\"cancelDeviceAuthorization\">\n {{ translate('apiClient.oauth2.cancelDeviceAuthorization') }}\n </ScalarButton>\n </div>\n </div>\n </div>\n </DataTableRow>\n <DataTableRow>\n <RequestAuthDataTableInput\n v-if=\"'authorizationUrl' in flow\"\n containerClass=\"border-r-0\"\n :environment\n :modelValue=\"flow['x-scalar-secret-auth-url'] ?? ''\"\n placeholder=\"https://galaxy.scalar.com/authorize\"\n @update:modelValue=\"\n (v) => {\n handleOauth2SecretsUpdate({ 'x-scalar-secret-auth-url': v })\n handleOauth2Update({ authorizationUrl: v })\n }\n \">\n {{ translate('apiClient.oauth2.authUrl') }}\n </RequestAuthDataTableInput>\n\n <RequestAuthDataTableInput\n v-if=\"'tokenUrl' in flow\"\n :environment\n :modelValue=\"flow['x-scalar-secret-token-url'] ?? ''\"\n placeholder=\"https://galaxy.scalar.com/token\"\n @update:modelValue=\"\n (v) => {\n handleOauth2SecretsUpdate({ 'x-scalar-secret-token-url': v })\n handleOauth2Update({ tokenUrl: v })\n }\n \">\n {{ translate('apiClient.oauth2.tokenUrl') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"'x-scalar-secret-redirect-uri' in flow\">\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow['x-scalar-secret-redirect-uri']\"\n :placeholder=\"\n options.captureOAuth2Callback\n ? `${resolveDefaultOAuth2RedirectUri(options) || 'http://127.0.0.1'} (handled automatically)`\n : translate('apiClient.oauth2.optionalRedirectUrl')\n \"\n @update:modelValue=\"\n (v) => {\n hasHandledRedirectPrefill = true\n handleOauth2SecretsUpdate({ 'x-scalar-secret-redirect-uri': v })\n }\n \">\n {{ translate('apiClient.oauth2.redirectUrl') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <template\n v-if=\"\n 'x-scalar-secret-username' in flow && 'x-scalar-secret-password' in flow\n \">\n <DataTableRow>\n <RequestAuthDataTableInput\n class=\"text-c-2\"\n :environment\n :modelValue=\"flow['x-scalar-secret-username']\"\n placeholder=\"janedoe\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-username': v })\n \">\n {{ translate('apiClient.oauth2.username') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow>\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow['x-scalar-secret-password']\"\n placeholder=\"********\"\n type=\"password\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-password': v })\n \">\n {{ translate('apiClient.oauth2.password') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n </template>\n\n <DataTableRow>\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow['x-scalar-secret-client-id']\"\n placeholder=\"12345\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-client-id': v })\n \">\n {{ translate('apiClient.oauth2.clientID') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"showClientSecret\">\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"clientSecretValue\"\n placeholder=\"XYZ123\"\n type=\"password\"\n @update:modelValue=\"\n (v) =>\n handleOauth2SecretsUpdate({ 'x-scalar-secret-client-secret': v })\n \">\n {{ translate('apiClient.oauth2.clientSecret') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"'x-usePkce' in flow\">\n <RequestAuthDataTableInput\n :enum=\"pkceOptions\"\n :environment\n :modelValue=\"flow['x-usePkce']\"\n readOnly\n @update:modelValue=\"\n (v) =>\n handleOauth2Update({\n 'x-usePkce': v as XusePkce['x-usePkce'],\n })\n \">\n {{ translate('apiClient.oauth2.usePKCE') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <!-- Credentials Location -->\n <DataTableRow v-if=\"type !== 'implicit'\">\n <RequestAuthDataTableInput\n :enum=\"['header', 'body']\"\n :environment\n :modelValue=\"\n (flow as NonImplicitFlow)['x-scalar-credentials-location'] || 'header'\n \"\n placeholder=\"header\"\n readOnly\n @update:modelValue=\"(v) => handleSecretLocationUpdate(v)\">\n {{ translate('apiClient.oauth2.credentialsLocation') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <!-- Scopes -->\n <DataTableRow>\n <OAuthScopesInput\n :flow\n :flowType=\"type\"\n :selectedScopes\n @delete:scope=\"(v) => emits('delete:scope', v)\"\n @update:selectedScopes=\"(v) => emits('update:selectedScopes', v)\"\n @upsert:scope=\"(v) => emits('upsert:scope', v)\" />\n </DataTableRow>\n\n <DataTableRow\n v-if=\"!hideActions\"\n class=\"min-w-full\">\n <div class=\"flex h-8 w-full items-center justify-end border-t\">\n <!-- Allow clearing the oauth section and going back to discovery -->\n <ScalarButton\n v-if=\"scheme.type === 'openIdConnect'\"\n class=\"mr-1 p-0 px-2 py-0.5\"\n :disabled=\"loader.isLoading\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"clearOauth2Secrets\">\n {{ translate('apiClient.oauth2.clear') }}\n </ScalarButton>\n\n <ScalarButton\n class=\"mr-0.75 p-0 px-2 py-0.5\"\n :loader\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleAuthorize\">\n {{ translate('apiClient.oauth2.authorize') }}\n </ScalarButton>\n </div>\n </DataTableRow>\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8FA,MAAM,QAAQ;EAed,MAAM,eAAe,IAAsC,IAAI;EAC/D,IAAI;EACJ,MAAM,kCAAwC;GAC5C,kBAAkB,MAAM;GACxB,aAAa,QAAQ;EACvB;EACA,gBAAgB,yBAAyB;EACzC,YAAY;GAAC,QAAA;GAAM,QAAA;GAAM,QAAA;EAAK,GAAG,yBAAyB;EAE1D,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,SAAS,gBAAgB;EAC/B,MAAM,EAAE,UAAU,UAAU;;EAG5B,MAAM,OAAO,eAAe,QAAA,MAAM,QAAA,KAAM;EAOxC,MAAM,iBAAiB,eAAe;GACpC,MAAM,gBAAgB,KAAK,MAAM;GACjC,IAAI,CAAC,eACH,OA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A;MACN,aAAA,QAAA;MACA,YAAwB,KAAA,MAAI,oCAAA;MAG7B,aAAY;MACZ,UAAA;MACC,uBAAiB,OAAA,QAAA,OAAA,OAAG,MAAM,2BAA2B,CAAC;;6BACA,CAAA,gBAAA,gBAApD,MAAA,SAAA,CAAS,CAAA,sCAAA,CAAA,GAAA,CAAA,CAAA,CAAA;;;;;IAKhB,YAQe,MAAA,oBAAA,GAAA,MAAA;4BADuC,CANpD,YAMoD,0BAAA;MALjD,MAAA,KAAA;MACA,UAAU,QAAA;MACV,gBAAA,eAAA;MACA,kBAAY,OAAA,QAAA,OAAA,OAAG,MAAM,MAAK,gBAAiB,CAAC;MAC5C,2BAAqB,OAAA,QAAA,OAAA,OAAG,MAAM,MAAK,yBAA0B,CAAC;MAC9D,kBAAY,OAAA,QAAA,OAAA,OAAG,MAAM,MAAK,gBAAiB,CAAC;;;;;;;;KAIxC,QAAA,eAAA,UAAA,GADT,YAwBe,MAAA,oBAAA,GAAA;;KAtBb,OAAM;;4BAqBA,CApBN,mBAoBM,OApBN,YAoBM,CAjBI,QAAA,OAAO,SAAI,mBAAA,UAAA,GADnB,YAQe,MAAA,YAAA,GAAA;;MANb,OAAM;MACL,UAAU,MAAA,MAAA,CAAM,CAAC;MAClB,MAAK;MACL,SAAQ;MACP,SAAO;;6BACiC,CAAA,gBAAA,gBAAtC,MAAA,SAAA,CAAS,CAAA,wBAAA,CAAA,GAAA,CAAA,CAAA,CAAA;;0DAGd,YAOe,MAAA,YAAA,GAAA;MANb,OAAM;MACL,QAAA,MAAA,MAAA;MACD,MAAK;MACL,SAAQ;MACP,SAAO;;6BACqC,CAAA,gBAAA,gBAA1C,MAAA,SAAA,CAAS,CAAA,4BAAA,CAAA,GAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"OAuth2.vue.script.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/OAuth2.vue"],"sourcesContent":["<script lang=\"ts\">\n/** Any config options required for the OAuth2 flow */\nexport type OAuth2Options = Pick<\n ApiClientConfiguration,\n 'oauth2RedirectUri'\n> & {\n /** Optional fetch override (IPC-backed on desktop) used for token exchange, refresh, and OIDC discovery */\n customFetch?: typeof fetch\n /** Optional redirect capture (loopback-backed on desktop) for interactive OAuth2 flows */\n captureOAuth2Callback?: CaptureOAuth2Callback\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { useLoadingState } from '@scalar/components/loading'\nimport type { ApiClientConfiguration } from '@scalar/types/api-reference'\nimport { pkceOptions } from '@scalar/types/entities'\nimport { useToasts } from '@scalar/use-toasts'\nimport type { SecretsOAuthFlows } from '@scalar/workspace-store/entities/auth'\nimport type {\n ApiReferenceEvents,\n WorkspaceEventBus,\n} from '@scalar/workspace-store/events'\nimport {\n isSecretFieldCleared,\n type AuthSecretField,\n} from '@scalar/workspace-store/helpers/auth-secret-fields'\nimport {\n getEnvironmentVariables,\n type OAuthFlowAuthorizationCodeSecret,\n type OAuthFlowClientCredentialsSecret,\n type OAuthFlowPasswordSecret,\n type OAuthFlowsObjectSecret,\n type SecuritySchemeObjectSecret,\n} from '@scalar/workspace-store/request-example'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { XScalarCredentialsLocation } from '@scalar/workspace-store/schemas/extensions/security/x-scalar-credentials-location'\nimport type {\n OAuthFlow,\n ServerObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, onBeforeUnmount, ref, watch } from 'vue'\n\nimport OAuthScopesInput from '@/v2/blocks/scalar-auth-selector-block/components/OAuthScopesInput.vue'\nimport {\n authorizeOauth2,\n refreshOauth2Token,\n type CaptureOAuth2Callback,\n} from '@/v2/blocks/scalar-auth-selector-block/helpers/oauth'\nimport { resolveDefaultOAuth2RedirectUri } from '@/v2/blocks/scalar-auth-selector-block/helpers/resolve-default-oauth2-redirect-url'\nimport { DataTableRow } from '@/v2/components/data-table'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport type { DeviceAuthorizationPrompt } from '../helpers/oauth-device-authorization'\nimport RequestAuthDataTableInput from './RequestAuthDataTableInput.vue'\n\nconst {\n environment,\n flows,\n type,\n scheme,\n selectedScopes: selectedScopesProp,\n server,\n proxyUrl,\n eventBus,\n name,\n options = {},\n} = defineProps<{\n /** Current environment configuration */\n environment: XScalarEnvironment\n /** OAuth flows */\n flows: OAuthFlowsObjectSecret\n /** Type of the OAuth flow */\n type: keyof OAuthFlowsObjectSecret\n /** Selected scopes */\n selectedScopes: string[]\n /** Security scheme */\n scheme: SecuritySchemeObjectSecret\n /** Current server configuration */\n server: ServerObject | null\n /** Proxy URL */\n proxyUrl: string\n /** Name of the security scheme */\n name: string\n /** Event bus for authentication updates */\n eventBus: WorkspaceEventBus\n /** Any config options required for the OAuth2 flow */\n options?: OAuth2Options\n /**\n * Hides the Authorize / Refresh / Clear actions. Used when the form is embedded as a\n * configuration-only view (e.g. behind a gear icon), so the host component owns the\n * authorize action and the tokens are routed to the scheme it chooses.\n */\n hideActions?: boolean\n}>()\n\nconst emits = defineEmits<{\n (\n e: 'update:selectedScopes',\n payload: { scopes?: string[]; scope?: string; selected?: boolean },\n ): void\n (\n e: 'upsert:scope',\n payload: Omit<ApiReferenceEvents['auth:upsert:scopes'], 'name'>,\n ): void\n (\n e: 'delete:scope',\n payload: Omit<ApiReferenceEvents['auth:delete:scopes'], 'name'>,\n ): void\n}>()\n\nconst devicePrompt = ref<DeviceAuthorizationPrompt | null>(null)\nlet deviceController: AbortController | undefined\nconst cancelDeviceAuthorization = (): void => {\n deviceController?.abort()\n devicePrompt.value = null\n}\nonBeforeUnmount(cancelDeviceAuthorization)\nwatch(() => [type, name, flows], cancelDeviceAuthorization)\n\nconst { translate } = useLocalization()\n\nconst loader = useLoadingState()\nconst { toast } = useToasts()\n\n/** The current OAuth flow based on the selected type */\nconst flow = computed(() => flows[type]!)\ntype NonImplicitFlow =\n | OAuthFlowPasswordSecret\n | OAuthFlowClientCredentialsSecret\n | OAuthFlowAuthorizationCodeSecret\n\n/** We filter selected scopes to only include scopes that are defined on this flow (own keys only). */\nconst selectedScopes = computed(() => {\n const definedScopes = flow.value.scopes\n if (!definedScopes) {\n return []\n }\n return selectedScopesProp.filter((scope) =>\n Object.hasOwn(definedScopes, scope),\n )\n})\n\n/**\n * Show the client secret whenever the flow supports one. PKCE and a client\n * secret are independent, so confidential clients can use both together\n * (see RFC 9700 Section 2.1.1).\n */\nconst showClientSecret = computed(\n () => 'x-scalar-secret-client-secret' in flow.value,\n)\n\nconst clientSecretValue = computed((): string => {\n const f = flow.value as { 'x-scalar-secret-client-secret'?: string }\n return f['x-scalar-secret-client-secret'] ?? ''\n})\n\n/** Updates the security scheme base */\nconst handleOauth2Update = (\n payload: Partial<OAuthFlow & XScalarCredentialsLocation> & {\n deviceAuthorizationUrl?: string\n },\n): void => {\n // OpenIdConnect uses the secrets update for all\n if (scheme.type === 'openIdConnect') {\n return handleOauth2SecretsUpdate(payload)\n }\n\n // Only OAuth2 schemes carry flows on the document; this component is never\n // rendered for the other scheme types.\n if (scheme.type !== 'oauth2') {\n return\n }\n\n eventBus.emit('auth:update:security-scheme', {\n payload: {\n type: scheme.type,\n flows: {\n [type]: payload,\n },\n },\n name,\n })\n}\n\n/** Updates the flow secrets */\nconst handleOauth2SecretsUpdate = (\n payload: Omit<Partial<SecretsOAuthFlows[keyof SecretsOAuthFlows]>, 'type'>,\n): void => {\n // This component only renders for oauth2/openIdConnect. Other scheme types (e.g. mutualTLS)\n // carry no flow secrets, so there is nothing to persist and no matching secrets payload type.\n if (scheme.type !== 'oauth2' && scheme.type !== 'openIdConnect') {\n return\n }\n\n eventBus.emit('auth:update:security-scheme-secrets', {\n payload: {\n type: scheme.type,\n [type]: payload,\n },\n name,\n })\n}\n\n/** Reset only this field; redirect URI may need its browser default prefilled again. */\nconst handleResetSecret = (field: AuthSecretField): void => {\n if (field === 'x-scalar-secret-redirect-uri') {\n hasHandledRedirectPrefill.value = false\n }\n eventBus.emit('auth:reset:security-scheme-secret', {\n name,\n flow: type,\n field,\n })\n}\n\n/** Fixed-choice fields must never write an empty string into the document. */\nconst handlePkceUpdate = (value: string): void => {\n if (value === 'SHA-256' || value === 'plain' || value === 'no') {\n handleOauth2Update({ 'x-usePkce': value })\n }\n}\n\n/** Clears the flow secrets */\nconst clearOauth2Secrets = (): void => {\n if (loader.isLoading) {\n return\n }\n eventBus.emit('auth:clear:security-scheme-secrets', {\n name,\n })\n}\n\n/** Clears stored access and refresh tokens (authorized state) */\nconst handleClearAccessTokens = (): void => {\n if (loader.isLoading) {\n return\n }\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': '',\n 'x-scalar-secret-refresh-token': '',\n })\n}\n\n/** Track redirect URI prefill per flow instance to support document switching */\nconst prefilledFlowIdentity = ref<string | null>(null)\nconst hasHandledRedirectPrefill = ref(false)\n\nconst resolveFlowIdentity = (\n currentFlow: OAuthFlowsObjectSecret[keyof OAuthFlowsObjectSecret] | undefined,\n): string =>\n JSON.stringify({\n type,\n authorizationUrl:\n currentFlow && 'authorizationUrl' in currentFlow\n ? currentFlow.authorizationUrl\n : '',\n tokenUrl:\n currentFlow && 'tokenUrl' in currentFlow ? currentFlow.tokenUrl : '',\n refreshUrl: currentFlow?.refreshUrl ?? '',\n scopes: Object.keys(currentFlow?.scopes ?? {}),\n })\n\n/** Default the redirect-uri to the current origin if we have access to window */\nwatch(\n () => flow.value,\n (currentFlow) => {\n if (!currentFlow || !('x-scalar-secret-redirect-uri' in currentFlow)) {\n return\n }\n\n const flowIdentity = resolveFlowIdentity(currentFlow)\n if (prefilledFlowIdentity.value !== flowIdentity) {\n prefilledFlowIdentity.value = flowIdentity\n hasHandledRedirectPrefill.value = false\n }\n\n if (hasHandledRedirectPrefill.value) {\n return\n }\n\n const newRedirectUri = (currentFlow as OAuthFlowAuthorizationCodeSecret)[\n 'x-scalar-secret-redirect-uri'\n ]\n const defaultRedirectUri = resolveDefaultOAuth2RedirectUri(options)\n\n hasHandledRedirectPrefill.value = true\n\n // The desktop loopback path computes the redirect URI at authorize time (an\n // ephemeral 127.0.0.1 port), so persisting a default into the document would\n // only bake in a stale, unused value. Leave it empty and show a hint instead.\n if (\n isSecretFieldCleared(currentFlow, 'x-scalar-secret-redirect-uri') ||\n newRedirectUri ||\n !defaultRedirectUri ||\n options.captureOAuth2Callback\n ) {\n return\n }\n\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-redirect-uri': defaultRedirectUri,\n })\n },\n { immediate: true },\n)\n\n/**\n * Authorizes the user using the specified OAuth flow.\n * Opens the appropriate OAuth dialog and/or performs the token exchange.\n */\nconst handleAuthorize = async (): Promise<void> => {\n if (loader.isLoading) {\n return\n }\n\n loader.start()\n const controller = new AbortController()\n deviceController = controller\n\n const [error, tokens] = await authorizeOauth2(\n flows,\n type,\n selectedScopes.value,\n server,\n proxyUrl,\n getEnvironmentVariables(environment),\n options.customFetch,\n options.captureOAuth2Callback,\n {\n signal: controller.signal,\n onPrompt: (prompt) => {\n devicePrompt.value = prompt\n },\n },\n )\n devicePrompt.value = null\n\n await loader.clear()\n if (controller.signal.aborted) {\n return\n }\n\n if (tokens?.accessToken) {\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': tokens.accessToken,\n ...(tokens.refreshToken\n ? { 'x-scalar-secret-refresh-token': tokens.refreshToken }\n : {}),\n })\n } else {\n console.error(error)\n toast(\n error?.message ?? translate('apiClient.oauth2.failedToauthorize'),\n 'error',\n )\n }\n}\n\n/** Refreshing requires a token issued by the provider, not just a compatible flow. */\nconst canRefreshToken = computed<boolean>(\n (): boolean =>\n type !== 'implicit' && Boolean(flow.value['x-scalar-secret-refresh-token']),\n)\n\n/**\n * Refresh URL placeholder, shows tokenUrl as hint if refreshUrl is not specified.\n * This helps users understand that tokenUrl will be used as fallback.\n */\nconst refreshUrlPlaceholder = computed(() => {\n if ('tokenUrl' in flow.value && flow.value.tokenUrl) {\n return flow.value.tokenUrl\n }\n return 'https://galaxy.scalar.com/oauth/refresh'\n})\n\n/**\n * Uses the stored refresh token to obtain a new access token\n * via grant_type=refresh_token.\n */\nconst handleRefresh = async (): Promise<void> => {\n // The explicit flow check narrows the type for refreshOauth2Token; the computed boolean cannot.\n if (loader.isLoading || type === 'implicit' || !canRefreshToken.value) {\n return\n }\n\n loader.start()\n\n const [error, tokens] = await refreshOauth2Token(\n flows,\n type,\n proxyUrl,\n server,\n getEnvironmentVariables(environment),\n options.customFetch,\n )\n\n await loader.clear()\n\n if (tokens?.accessToken) {\n handleOauth2SecretsUpdate({\n 'x-scalar-secret-token': tokens.accessToken,\n ...(tokens.refreshToken\n ? { 'x-scalar-secret-refresh-token': tokens.refreshToken }\n : {}),\n })\n } else {\n console.error(error)\n toast(\n error?.message ?? translate('apiClient.oauth2.failedToRefreshToken'),\n 'error',\n )\n }\n}\n\n/** Updates the secret location */\nconst handleSecretLocationUpdate = (value: string): void => {\n if (value !== 'body' && value !== 'header') return\n const credentialsLocation = value\n\n if (scheme.type !== 'openIdConnect') {\n handleOauth2Update({\n 'x-scalar-credentials-location': credentialsLocation,\n })\n }\n\n handleOauth2SecretsUpdate({\n 'x-scalar-credentials-location': credentialsLocation,\n })\n}\n</script>\n\n<template>\n <!-- Access Token Display: Shows when user is already authorized -->\n <template\n v-if=\"\n Boolean(flow['x-scalar-secret-token']) ||\n isSecretFieldCleared(flow, 'x-scalar-secret-token')\n \">\n <DataTableRow>\n <RequestAuthDataTableInput\n canReset\n class=\"border-r-transparent\"\n :environment\n :modelValue=\"flow['x-scalar-secret-token']\"\n placeholder=\"QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT\"\n type=\"password\"\n @reset=\"handleResetSecret('x-scalar-secret-token')\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-token': v })\n \">\n {{ translate('apiClient.oauth2.accessToken') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"canRefreshToken\">\n <RequestAuthDataTableInput\n class=\"border-r-transparent\"\n :environment\n :modelValue=\"flow.refreshUrl ?? ''\"\n :placeholder=\"refreshUrlPlaceholder\"\n @update:modelValue=\"(v) => handleOauth2Update({ refreshUrl: v })\">\n {{ translate('apiClient.oauth2.refreshUrl') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow\n v-if=\"!hideActions\"\n class=\"min-w-full\">\n <div class=\"flex h-8 items-center justify-end gap-2 border-t\">\n <ScalarButton\n v-if=\"canRefreshToken\"\n class=\"p-0 px-2 py-0.5\"\n :loader\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleRefresh\">\n {{ translate('apiClient.oauth2.refresh') }}\n </ScalarButton>\n <ScalarButton\n class=\"mr-1 p-0 px-2 py-0.5\"\n :disabled=\"loader.isLoading\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleClearAccessTokens\">\n {{ translate('apiClient.oauth2.clearTokens') }}\n </ScalarButton>\n </div>\n </DataTableRow>\n </template>\n\n <!-- Authorization Form: Shows when user needs to authorize -->\n <template v-else>\n <DataTableRow v-if=\"'deviceAuthorizationUrl' in flow\">\n <RequestAuthDataTableInput\n :environment\n :modelValue=\"flow.deviceAuthorizationUrl\"\n @update:modelValue=\"\n (v) => handleOauth2Update({ deviceAuthorizationUrl: v })\n \">\n {{ translate('apiClient.oauth2.deviceAuthorizationUrl') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n <DataTableRow v-if=\"devicePrompt\">\n <div class=\"w-full p-2\">\n <div\n class=\"bg-b-2 flex flex-col gap-3 rounded-lg border p-3 text-sm\"\n role=\"status\">\n <p class=\"text-c-2 text-xs leading-normal\">\n {{ translate('apiClient.oauth2.deviceVerificationPrompt') }}\n </p>\n <strong\n class=\"bg-b-1 font-code w-fit max-w-full rounded border px-3 py-2 text-base font-medium tracking-widest break-all select-all\">\n {{ devicePrompt.userCode }}\n </strong>\n <a\n class=\"text-c-accent w-fit max-w-full text-xs break-all underline underline-offset-2\"\n :href=\"\n devicePrompt.verificationUriComplete ||\n devicePrompt.verificationUri\n \"\n rel=\"noopener noreferrer\"\n target=\"_blank\">\n {{ devicePrompt.verificationUri }}\n </a>\n <div class=\"flex items-center justify-between gap-3\">\n <p class=\"text-c-2 text-xs\">\n {{ translate('apiClient.oauth2.waitingForAuthorization') }}\n </p>\n <ScalarButton\n size=\"xs\"\n variant=\"outlined\"\n @click=\"cancelDeviceAuthorization\">\n {{ translate('apiClient.oauth2.cancelDeviceAuthorization') }}\n </ScalarButton>\n </div>\n </div>\n </div>\n </DataTableRow>\n <DataTableRow>\n <RequestAuthDataTableInput\n v-if=\"'authorizationUrl' in flow\"\n canReset\n containerClass=\"border-r-0\"\n :environment\n :modelValue=\"flow['x-scalar-secret-auth-url'] ?? ''\"\n placeholder=\"https://galaxy.scalar.com/authorize\"\n @reset=\"handleResetSecret('x-scalar-secret-auth-url')\"\n @update:modelValue=\"\n (v) => {\n handleOauth2SecretsUpdate({ 'x-scalar-secret-auth-url': v })\n if (v) handleOauth2Update({ authorizationUrl: v })\n }\n \">\n {{ translate('apiClient.oauth2.authUrl') }}\n </RequestAuthDataTableInput>\n\n <RequestAuthDataTableInput\n v-if=\"'tokenUrl' in flow\"\n canReset\n :environment\n :modelValue=\"flow['x-scalar-secret-token-url'] ?? ''\"\n placeholder=\"https://galaxy.scalar.com/token\"\n @reset=\"handleResetSecret('x-scalar-secret-token-url')\"\n @update:modelValue=\"\n (v) => {\n handleOauth2SecretsUpdate({ 'x-scalar-secret-token-url': v })\n if (v) handleOauth2Update({ tokenUrl: v })\n }\n \">\n {{ translate('apiClient.oauth2.tokenUrl') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"'x-scalar-secret-redirect-uri' in flow\">\n <RequestAuthDataTableInput\n canReset\n :environment\n :modelValue=\"flow['x-scalar-secret-redirect-uri']\"\n :placeholder=\"\n options.captureOAuth2Callback\n ? `${resolveDefaultOAuth2RedirectUri(options) || 'http://127.0.0.1'} (handled automatically)`\n : translate('apiClient.oauth2.optionalRedirectUrl')\n \"\n @reset=\"handleResetSecret('x-scalar-secret-redirect-uri')\"\n @update:modelValue=\"\n (v) => {\n hasHandledRedirectPrefill = true\n handleOauth2SecretsUpdate({ 'x-scalar-secret-redirect-uri': v })\n }\n \">\n {{ translate('apiClient.oauth2.redirectUrl') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <template\n v-if=\"\n 'x-scalar-secret-username' in flow && 'x-scalar-secret-password' in flow\n \">\n <DataTableRow>\n <RequestAuthDataTableInput\n canReset\n class=\"text-c-2\"\n :environment\n :modelValue=\"flow['x-scalar-secret-username']\"\n placeholder=\"janedoe\"\n @reset=\"handleResetSecret('x-scalar-secret-username')\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-username': v })\n \">\n {{ translate('apiClient.oauth2.username') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow>\n <RequestAuthDataTableInput\n canReset\n :environment\n :modelValue=\"flow['x-scalar-secret-password']\"\n placeholder=\"********\"\n type=\"password\"\n @reset=\"handleResetSecret('x-scalar-secret-password')\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-password': v })\n \">\n {{ translate('apiClient.oauth2.password') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n </template>\n\n <DataTableRow>\n <RequestAuthDataTableInput\n canReset\n :environment\n :modelValue=\"flow['x-scalar-secret-client-id']\"\n placeholder=\"12345\"\n @reset=\"handleResetSecret('x-scalar-secret-client-id')\"\n @update:modelValue=\"\n (v) => handleOauth2SecretsUpdate({ 'x-scalar-secret-client-id': v })\n \">\n {{ translate('apiClient.oauth2.clientID') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"showClientSecret\">\n <RequestAuthDataTableInput\n canReset\n :environment\n :modelValue=\"clientSecretValue\"\n placeholder=\"XYZ123\"\n type=\"password\"\n @reset=\"handleResetSecret('x-scalar-secret-client-secret')\"\n @update:modelValue=\"\n (v) =>\n handleOauth2SecretsUpdate({ 'x-scalar-secret-client-secret': v })\n \">\n {{ translate('apiClient.oauth2.clientSecret') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <DataTableRow v-if=\"'x-usePkce' in flow\">\n <RequestAuthDataTableInput\n :enum=\"pkceOptions\"\n :environment\n :modelValue=\"flow['x-usePkce']\"\n readOnly\n @update:modelValue=\"handlePkceUpdate\">\n {{ translate('apiClient.oauth2.usePKCE') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <!-- Credentials Location -->\n <DataTableRow v-if=\"type !== 'implicit'\">\n <RequestAuthDataTableInput\n :enum=\"['header', 'body']\"\n :environment\n :modelValue=\"\n (flow as NonImplicitFlow)['x-scalar-credentials-location'] || 'header'\n \"\n placeholder=\"header\"\n readOnly\n @update:modelValue=\"(v) => handleSecretLocationUpdate(v)\">\n {{ translate('apiClient.oauth2.credentialsLocation') }}\n </RequestAuthDataTableInput>\n </DataTableRow>\n\n <!-- Scopes -->\n <DataTableRow>\n <OAuthScopesInput\n :flow\n :flowType=\"type\"\n :selectedScopes\n @delete:scope=\"(v) => emits('delete:scope', v)\"\n @update:selectedScopes=\"(v) => emits('update:selectedScopes', v)\"\n @upsert:scope=\"(v) => emits('upsert:scope', v)\" />\n </DataTableRow>\n\n <DataTableRow\n v-if=\"!hideActions\"\n class=\"min-w-full\">\n <div class=\"flex h-8 w-full items-center justify-end border-t\">\n <!-- Allow clearing the oauth section and going back to discovery -->\n <ScalarButton\n v-if=\"scheme.type === 'openIdConnect'\"\n class=\"mr-1 p-0 px-2 py-0.5\"\n :disabled=\"loader.isLoading\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"clearOauth2Secrets\">\n {{ translate('apiClient.oauth2.resetDiscovery') }}\n </ScalarButton>\n\n <ScalarButton\n class=\"mr-0.75 p-0 px-2 py-0.5\"\n :loader\n size=\"sm\"\n variant=\"outlined\"\n @click=\"handleAuthorize\">\n {{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CAAA,gBAAA,gBAA1C,MAAA,SAAA,CAAS,CAAA,4BAAA,CAAA,GAAA,CAAA,CAAA,CAAA"}
@@ -1,6 +1,8 @@
1
1
  import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
2
2
  import type { VueClassProp } from '../../../../types/vue';
3
3
  type __VLS_Props = {
4
+ /** Restore this credential's current document or configured default. */
5
+ canReset?: boolean;
4
6
  containerClass?: VueClassProp;
5
7
  environment: XScalarEnvironment;
6
8
  readOnly?: boolean;
@@ -20,10 +22,12 @@ type __VLS_Slots = {} & {
20
22
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
23
  "update:modelValue": (value: string) => any;
22
24
  } & {
25
+ reset: () => any;
23
26
  selectVariable: (value: string) => any;
24
27
  inputFocus: () => any;
25
28
  inputBlur: () => any;
26
29
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
30
+ onReset?: (() => any) | undefined;
27
31
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
28
32
  onSelectVariable?: ((value: string) => any) | undefined;
29
33
  onInputFocus?: (() => any) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthDataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue"],"names":[],"mappings":"AAkEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAGnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG/C,KAAK,WAAW,GAAG;IACjB,cAAc,CAAC,EAAE,YAAY,CAAA;IAC7B,WAAW,EAAE,kBAAkB,CAAA;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;AA8BF,KAAK,gBAAgB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;CAClB,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AAyGxD,QAAA,IAAI,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AAC/C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAK7C,QAAA,MAAM,UAAU;;;;;;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"RequestAuthDataTableInput.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue"],"names":[],"mappings":"AAgFA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAGnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAI/C,KAAK,WAAW,GAAG;IACjB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,cAAc,CAAC,EAAE,YAAY,CAAA;IAC7B,WAAW,EAAE,kBAAkB,CAAA;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAC;AAiCF,KAAK,gBAAgB,GAAG;IACxB,UAAU,EAAE,MAAM,CAAC;CAClB,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AA6IxD,QAAA,IAAI,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AAC/C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAK7C,QAAA,MAAM,UAAU;;;;;;;;;;;;;kFAGd,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthDataTableInput.vue.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { useId } from 'vue'\n\nimport type { VueClassProp } from '@/types/vue'\nimport { DataTableInput } from '@/v2/components/data-table'\n\nconst {\n containerClass,\n environment,\n readOnly = false,\n required = false,\n type,\n} = defineProps<{\n containerClass?: VueClassProp\n environment: XScalarEnvironment\n readOnly?: boolean\n required?: boolean\n type?: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'inputFocus'): void\n (e: 'inputBlur'): void\n (e: 'selectVariable', value: string): void\n}>()\n\nconst modelValue = defineModel<string>({ default: '', required: true })\nconst id = useId()\n/**\n * The unmasked editor is a contenteditable div, which a <label for> cannot\n * name, so the field points back at the visible label via aria-labelledby.\n * The masked native input keeps its <label for> and gets the same text.\n */\nconst labelId = `${id}-label`\n</script>\n<template>\n <DataTableInput\n :id=\"id\"\n v-bind=\"$attrs\"\n v-model=\"modelValue\"\n :aria-labelledby=\"labelId\"\n :canAddCustomEnumValue=\"!readOnly\"\n :containerClass=\"containerClass\"\n :environment=\"environment\"\n :readOnly=\"readOnly\"\n :required=\"required\"\n :type=\"type\"\n @inputBlur=\"emit('inputBlur')\"\n @inputFocus=\"emit('inputFocus')\"\n @selectVariable=\"emit('selectVariable', $event)\">\n <template #default>\n <label\n :id=\"labelId\"\n :for=\"id\">\n <slot />\n </label>\n </template>\n <template #icon>\n <slot name=\"icon\" />\n </template>\n </DataTableInput>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RequestAuthDataTableInput.vue.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconArrowCounterClockwise } from '@scalar/icons'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { useId } from 'vue'\n\nimport type { VueClassProp } from '@/types/vue'\nimport { DataTableInput } from '@/v2/components/data-table'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst {\n canReset = false,\n containerClass,\n environment,\n readOnly = false,\n required = false,\n type,\n} = defineProps<{\n /** Restore this credential's current document or configured default. */\n canReset?: boolean\n containerClass?: VueClassProp\n environment: XScalarEnvironment\n readOnly?: boolean\n required?: boolean\n type?: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'reset'): void\n (e: 'inputFocus'): void\n (e: 'inputBlur'): void\n (e: 'selectVariable', value: string): void\n}>()\n\nconst modelValue = defineModel<string>({ default: '', required: true })\nconst id = useId()\nconst { translate } = useLocalization()\n/**\n * The unmasked editor is a contenteditable div, which a <label for> cannot\n * name, so the field points back at the visible label via aria-labelledby.\n * The masked native input is named the same way.\n */\nconst labelId = `${id}-label`\n</script>\n<template>\n <DataTableInput\n :id=\"id\"\n v-bind=\"$attrs\"\n v-model=\"modelValue\"\n :aria-labelledby=\"labelId\"\n :canAddCustomEnumValue=\"!readOnly\"\n :containerClass=\"containerClass\"\n :environment=\"environment\"\n :readOnly=\"readOnly\"\n :required=\"required\"\n :type=\"type\"\n @inputBlur=\"emit('inputBlur')\"\n @inputFocus=\"emit('inputFocus')\"\n @selectVariable=\"emit('selectVariable', $event)\">\n <template #default>\n <label :id=\"labelId\">\n <slot />\n </label>\n </template>\n <template #icon>\n <slot name=\"icon\" />\n <ScalarIconButton\n v-if=\"canReset && !readOnly\"\n class=\"h-6 w-6 self-center p-1.25\"\n :icon=\"ScalarIconArrowCounterClockwise\"\n :label=\"translate('apiClient.dataTableInput.resetValue')\"\n @click=\"emit('reset')\" />\n </template>\n </DataTableInput>\n</template>\n"],"mappings":""}
@@ -1,10 +1,16 @@
1
+ import { useLocalization } from "../../../features/localization/index.js";
1
2
  import DataTableInput_default from "../../../components/data-table/DataTableInput.vue.js";
2
- import { createBlock, createElementVNode, defineComponent, mergeModels, mergeProps, openBlock, renderSlot, unref, useId, useModel, withCtx } from "vue";
3
+ import { createBlock, createCommentVNode, createElementVNode, defineComponent, mergeModels, mergeProps, openBlock, renderSlot, unref, useId, useModel, withCtx } from "vue";
4
+ import { ScalarIconArrowCounterClockwise } from "@scalar/icons";
5
+ import { ScalarIconButton } from "@scalar/components/icon-button";
3
6
  //#region src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue?vue&type=script&setup=true&lang.ts
4
- var _hoisted_1 = ["for"];
5
7
  var RequestAuthDataTableInput_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
6
8
  __name: "RequestAuthDataTableInput",
7
9
  props: /*@__PURE__*/ mergeModels({
10
+ canReset: {
11
+ type: Boolean,
12
+ default: false
13
+ },
8
14
  containerClass: {},
9
15
  environment: {},
10
16
  readOnly: {
@@ -24,6 +30,7 @@ var RequestAuthDataTableInput_vue_vue_type_script_setup_true_lang_default = /*@_
24
30
  "modelModifiers": {}
25
31
  }),
26
32
  emits: /*@__PURE__*/ mergeModels([
33
+ "reset",
27
34
  "inputFocus",
28
35
  "inputBlur",
29
36
  "selectVariable"
@@ -32,16 +39,17 @@ var RequestAuthDataTableInput_vue_vue_type_script_setup_true_lang_default = /*@_
32
39
  const emit = __emit;
33
40
  const modelValue = useModel(__props, "modelValue");
34
41
  const id = useId();
42
+ const { translate } = useLocalization();
35
43
  /**
36
44
  * The unmasked editor is a contenteditable div, which a <label for> cannot
37
45
  * name, so the field points back at the visible label via aria-labelledby.
38
- * The masked native input keeps its <label for> and gets the same text.
46
+ * The masked native input is named the same way.
39
47
  */
40
48
  const labelId = `${id}-label`;
41
49
  return (_ctx, _cache) => {
42
50
  return openBlock(), createBlock(unref(DataTableInput_default), mergeProps({ id: unref(id) }, _ctx.$attrs, {
43
51
  modelValue: modelValue.value,
44
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
52
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => modelValue.value = $event),
45
53
  "aria-labelledby": labelId,
46
54
  canAddCustomEnumValue: !__props.readOnly,
47
55
  containerClass: __props.containerClass,
@@ -49,15 +57,18 @@ var RequestAuthDataTableInput_vue_vue_type_script_setup_true_lang_default = /*@_
49
57
  readOnly: __props.readOnly,
50
58
  required: __props.required,
51
59
  type: __props.type,
52
- onInputBlur: _cache[1] || (_cache[1] = ($event) => emit("inputBlur")),
53
- onInputFocus: _cache[2] || (_cache[2] = ($event) => emit("inputFocus")),
54
- onSelectVariable: _cache[3] || (_cache[3] = ($event) => emit("selectVariable", $event))
60
+ onInputBlur: _cache[2] || (_cache[2] = ($event) => emit("inputBlur")),
61
+ onInputFocus: _cache[3] || (_cache[3] = ($event) => emit("inputFocus")),
62
+ onSelectVariable: _cache[4] || (_cache[4] = ($event) => emit("selectVariable", $event))
55
63
  }), {
56
- default: withCtx(() => [createElementVNode("label", {
57
- id: labelId,
58
- for: unref(id)
59
- }, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1)]),
60
- icon: withCtx(() => [renderSlot(_ctx.$slots, "icon")]),
64
+ default: withCtx(() => [createElementVNode("label", { id: labelId }, [renderSlot(_ctx.$slots, "default")])]),
65
+ icon: withCtx(() => [renderSlot(_ctx.$slots, "icon"), __props.canReset && !__props.readOnly ? (openBlock(), createBlock(unref(ScalarIconButton), {
66
+ key: 0,
67
+ class: "h-6 w-6 self-center p-1.25",
68
+ icon: unref(ScalarIconArrowCounterClockwise),
69
+ label: unref(translate)("apiClient.dataTableInput.resetValue"),
70
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("reset"))
71
+ }, null, 8, ["icon", "label"])) : createCommentVNode("", true)]),
61
72
  _: 3
62
73
  }, 16, [
63
74
  "id",
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthDataTableInput.vue.script.js","names":["$attrs"],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { useId } from 'vue'\n\nimport type { VueClassProp } from '@/types/vue'\nimport { DataTableInput } from '@/v2/components/data-table'\n\nconst {\n containerClass,\n environment,\n readOnly = false,\n required = false,\n type,\n} = defineProps<{\n containerClass?: VueClassProp\n environment: XScalarEnvironment\n readOnly?: boolean\n required?: boolean\n type?: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'inputFocus'): void\n (e: 'inputBlur'): void\n (e: 'selectVariable', value: string): void\n}>()\n\nconst modelValue = defineModel<string>({ default: '', required: true })\nconst id = useId()\n/**\n * The unmasked editor is a contenteditable div, which a <label for> cannot\n * name, so the field points back at the visible label via aria-labelledby.\n * The masked native input keeps its <label for> and gets the same text.\n */\nconst labelId = `${id}-label`\n</script>\n<template>\n <DataTableInput\n :id=\"id\"\n v-bind=\"$attrs\"\n v-model=\"modelValue\"\n :aria-labelledby=\"labelId\"\n :canAddCustomEnumValue=\"!readOnly\"\n :containerClass=\"containerClass\"\n :environment=\"environment\"\n :readOnly=\"readOnly\"\n :required=\"required\"\n :type=\"type\"\n @inputBlur=\"emit('inputBlur')\"\n @inputFocus=\"emit('inputFocus')\"\n @selectVariable=\"emit('selectVariable', $event)\">\n <template #default>\n <label\n :id=\"labelId\"\n :for=\"id\">\n <slot />\n </label>\n </template>\n <template #icon>\n <slot name=\"icon\" />\n </template>\n </DataTableInput>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBA,MAAM,OAAO;EAMb,MAAM,aAAa,SAAmB,SAAA,YAAgC;EACtE,MAAM,KAAK,MAAM;;;;;;EAMjB,MAAM,UAAU,GAAG,GAAG;;uBAGpB,YAwBiB,MAAA,sBAAA,GAxBjB,WAwBiB,EAvBd,IAAI,MAAA,EAAA,EAAE,GACCA,KAAAA,QAAM;gBACL,WAAA;4EAAU,QAAA;IAClB,mBAAiB;IACjB,uBAAqB,CAAG,QAAA;IACxB,gBAAgB,QAAA;IAChB,aAAa,QAAA;IACb,UAAU,QAAA;IACV,UAAU,QAAA;IACV,MAAM,QAAA;IACN,aAAS,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,WAAA;IACf,cAAU,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,YAAA;IAChB,kBAAc,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,kBAAmB,MAAM;;IACnC,SAAO,cAKR,CAJR,mBAIQ,SAAA;KAHL,IAAI;KACJ,KAAK,MAAA,EAAA;QACN,WAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,GAAA,UAAA,CAAA,CAAA;IAGD,MAAI,cACO,CAApB,WAAoB,KAAA,QAAA,MAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"RequestAuthDataTableInput.vue.script.js","names":["$attrs"],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthDataTableInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconArrowCounterClockwise } from '@scalar/icons'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport { useId } from 'vue'\n\nimport type { VueClassProp } from '@/types/vue'\nimport { DataTableInput } from '@/v2/components/data-table'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst {\n canReset = false,\n containerClass,\n environment,\n readOnly = false,\n required = false,\n type,\n} = defineProps<{\n /** Restore this credential's current document or configured default. */\n canReset?: boolean\n containerClass?: VueClassProp\n environment: XScalarEnvironment\n readOnly?: boolean\n required?: boolean\n type?: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'reset'): void\n (e: 'inputFocus'): void\n (e: 'inputBlur'): void\n (e: 'selectVariable', value: string): void\n}>()\n\nconst modelValue = defineModel<string>({ default: '', required: true })\nconst id = useId()\nconst { translate } = useLocalization()\n/**\n * The unmasked editor is a contenteditable div, which a <label for> cannot\n * name, so the field points back at the visible label via aria-labelledby.\n * The masked native input is named the same way.\n */\nconst labelId = `${id}-label`\n</script>\n<template>\n <DataTableInput\n :id=\"id\"\n v-bind=\"$attrs\"\n v-model=\"modelValue\"\n :aria-labelledby=\"labelId\"\n :canAddCustomEnumValue=\"!readOnly\"\n :containerClass=\"containerClass\"\n :environment=\"environment\"\n :readOnly=\"readOnly\"\n :required=\"required\"\n :type=\"type\"\n @inputBlur=\"emit('inputBlur')\"\n @inputFocus=\"emit('inputFocus')\"\n @selectVariable=\"emit('selectVariable', $event)\">\n <template #default>\n <label :id=\"labelId\">\n <slot />\n </label>\n </template>\n <template #icon>\n <slot name=\"icon\" />\n <ScalarIconButton\n v-if=\"canReset && !readOnly\"\n class=\"h-6 w-6 self-center p-1.25\"\n :icon=\"ScalarIconArrowCounterClockwise\"\n :label=\"translate('apiClient.dataTableInput.resetValue')\"\n @click=\"emit('reset')\" />\n </template>\n </DataTableInput>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BA,MAAM,OAAO;EAOb,MAAM,aAAa,SAAmB,SAAA,YAAgC;EACtE,MAAM,KAAK,MAAM;EACjB,MAAM,EAAE,cAAc,gBAAgB;;;;;;EAMtC,MAAM,UAAU,GAAG,GAAG;;uBAGpB,YA4BiB,MAAA,sBAAA,GA5BjB,WA4BiB,EA3Bd,IAAI,MAAA,EAAA,EAAE,GACCA,KAAAA,QAAM;gBACL,WAAA;4EAAU,QAAA;IAClB,mBAAiB;IACjB,uBAAqB,CAAG,QAAA;IACxB,gBAAgB,QAAA;IAChB,aAAa,QAAA;IACb,UAAU,QAAA;IACV,UAAU,QAAA;IACV,MAAM,QAAA;IACN,aAAS,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,WAAA;IACf,cAAU,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,YAAA;IAChB,kBAAc,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,kBAAmB,MAAM;;IACnC,SAAO,cAGR,CAFR,mBAEQ,SAAA,EAFA,IAAI,QAAO,GAAA,CACjB,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA,CAAA,CAAA;IAGD,MAAI,cACO,CAApB,WAAoB,KAAA,QAAA,MAAA,GAEZ,QAAA,YAAQ,CAAK,QAAA,YAAA,UAAA,GADrB,YAK2B,MAAA,gBAAA,GAAA;;KAHzB,OAAM;KACL,MAAM,MAAA,+BAAA;KACN,OAAO,MAAA,SAAA,CAAS,CAAA,qCAAA;KAChB,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestAuthTab.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue"],"names":[],"mappings":"AAqtBA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AAEvC,OAAO,EAEL,KAAK,qBAAqB,EAG3B,MAAM,yCAAyC,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAEnH,OAAO,KAAK,EAEV,yBAAyB,EACzB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAiBrE,OAAe,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAA;AAKzD,KAAK,WAAW,GAAG;IACjB,wCAAwC;IACxC,WAAW,EAAE,kBAAkB,CAAA;IAC/B,yFAAyF;IACzF,QAAQ,EAAE,OAAO,CAAA;IACjB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,+BAA+B;IAC/B,uBAAuB,EAAE,yBAAyB,CAAA;IAClD,oGAAoG;IACpG,eAAe,EAAE,qBAAqB,CAAA;IACtC,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,uDAAuD;IACvD,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,yFAAyF;IACzF,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;CACtC,CAAC;AAgxCF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"RequestAuthTab.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/components/RequestAuthTab.vue"],"names":[],"mappings":"AAkvBA,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,gCAAgC,CAAA;AAEvC,OAAO,EAEL,KAAK,qBAAqB,EAG3B,MAAM,yCAAyC,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AAEnH,OAAO,KAAK,EAEV,yBAAyB,EACzB,YAAY,EACb,MAAM,8DAA8D,CAAA;AAiBrE,OAAe,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAA;AAKzD,KAAK,WAAW,GAAG;IACjB,wCAAwC;IACxC,WAAW,EAAE,kBAAkB,CAAA;IAC/B,yFAAyF;IACzF,QAAQ,EAAE,OAAO,CAAA;IACjB,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,+BAA+B;IAC/B,uBAAuB,EAAE,yBAAyB,CAAA;IAClD,oGAAoG;IACpG,eAAe,EAAE,qBAAqB,CAAA;IACtC,mCAAmC;IACnC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,2CAA2C;IAC3C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,uDAAuD;IACvD,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,yFAAyF;IACzF,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAA;CACtC,CAAC;AAi2CF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}