@scalar/api-client 3.26.0 → 3.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/style.css +61 -26
  3. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.d.ts.map +1 -1
  4. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue.js.map +1 -1
  5. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue_vue_type_script_setup_true_lang.js +88 -15
  6. package/dist/v2/blocks/request-block/components/RequestBodyForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  7. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts +6 -4
  8. package/dist/v2/blocks/request-block/components/RequestTable.vue.d.ts.map +1 -1
  9. package/dist/v2/blocks/request-block/components/RequestTable.vue.js +1 -1
  10. package/dist/v2/blocks/request-block/components/RequestTable.vue.js.map +1 -1
  11. package/dist/v2/blocks/request-block/components/RequestTable.vue_vue_type_script_setup_true_lang.js +3 -1
  12. package/dist/v2/blocks/request-block/components/RequestTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  13. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.d.ts +35 -0
  14. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.d.ts.map +1 -0
  15. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.js +7 -0
  16. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue.js.map +1 -0
  17. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue_vue_type_script_setup_true_lang.js +111 -0
  18. package/dist/v2/blocks/request-block/components/RequestTableFileList.vue_vue_type_script_setup_true_lang.js.map +1 -0
  19. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts +9 -4
  20. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.d.ts.map +1 -1
  21. package/dist/v2/blocks/request-block/components/RequestTableRow.vue.js.map +1 -1
  22. package/dist/v2/blocks/request-block/components/RequestTableRow.vue_vue_type_script_setup_true_lang.js +65 -17
  23. package/dist/v2/blocks/request-block/components/RequestTableRow.vue_vue_type_script_setup_true_lang.js.map +1 -1
  24. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.d.ts.map +1 -1
  25. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue.js.map +1 -1
  26. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue_vue_type_script_setup_true_lang.js +22 -17
  27. package/dist/v2/blocks/request-block/components/RequestTableTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  28. package/dist/v2/blocks/request-block/helpers/group-form-body-files.d.ts +9 -0
  29. package/dist/v2/blocks/request-block/helpers/group-form-body-files.d.ts.map +1 -0
  30. package/dist/v2/blocks/request-block/helpers/group-form-body-files.js +60 -0
  31. package/dist/v2/blocks/request-block/helpers/group-form-body-files.js.map +1 -0
  32. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js +2 -2
  33. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.js.map +1 -1
  34. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts +8 -8
  35. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.d.ts.map +1 -1
  36. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js +9 -10
  37. package/dist/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.js.map +1 -1
  38. package/dist/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.js +1 -1
  39. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts +1 -0
  40. package/dist/v2/components/data-table/DataTableCheckbox.vue.d.ts.map +1 -1
  41. package/dist/v2/components/data-table/DataTableCheckbox.vue.js.map +1 -1
  42. package/dist/v2/components/data-table/DataTableCheckbox.vue_vue_type_script_setup_true_lang.js +14 -4
  43. package/dist/v2/components/data-table/DataTableCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  44. package/dist/v2/constants.js +1 -1
  45. package/dist/v2/features/localization/locales/ar.d.ts +4 -0
  46. package/dist/v2/features/localization/locales/ar.d.ts.map +1 -1
  47. package/dist/v2/features/localization/locales/ar.js +4 -0
  48. package/dist/v2/features/localization/locales/ar.js.map +1 -1
  49. package/dist/v2/features/localization/locales/de.d.ts +4 -0
  50. package/dist/v2/features/localization/locales/de.d.ts.map +1 -1
  51. package/dist/v2/features/localization/locales/de.js +4 -0
  52. package/dist/v2/features/localization/locales/de.js.map +1 -1
  53. package/dist/v2/features/localization/locales/es.d.ts +4 -0
  54. package/dist/v2/features/localization/locales/es.d.ts.map +1 -1
  55. package/dist/v2/features/localization/locales/es.js +4 -0
  56. package/dist/v2/features/localization/locales/es.js.map +1 -1
  57. package/dist/v2/features/localization/locales/fr.d.ts +4 -0
  58. package/dist/v2/features/localization/locales/fr.d.ts.map +1 -1
  59. package/dist/v2/features/localization/locales/fr.js +4 -0
  60. package/dist/v2/features/localization/locales/fr.js.map +1 -1
  61. package/dist/v2/features/localization/locales/pt.d.ts +4 -0
  62. package/dist/v2/features/localization/locales/pt.d.ts.map +1 -1
  63. package/dist/v2/features/localization/locales/pt.js +4 -0
  64. package/dist/v2/features/localization/locales/pt.js.map +1 -1
  65. package/dist/v2/features/localization/locales/ru.d.ts +4 -0
  66. package/dist/v2/features/localization/locales/ru.d.ts.map +1 -1
  67. package/dist/v2/features/localization/locales/ru.js +4 -0
  68. package/dist/v2/features/localization/locales/ru.js.map +1 -1
  69. package/dist/v2/features/localization/locales/zh-cn.d.ts +4 -0
  70. package/dist/v2/features/localization/locales/zh-cn.d.ts.map +1 -1
  71. package/dist/v2/features/localization/locales/zh-cn.js +4 -0
  72. package/dist/v2/features/localization/locales/zh-cn.js.map +1 -1
  73. package/dist/v2/features/localization/locales/zh-tw.d.ts +4 -0
  74. package/dist/v2/features/localization/locales/zh-tw.d.ts.map +1 -1
  75. package/dist/v2/features/localization/locales/zh-tw.js +4 -0
  76. package/dist/v2/features/localization/locales/zh-tw.js.map +1 -1
  77. package/dist/v2/features/localization/translations.d.ts +4 -0
  78. package/dist/v2/features/localization/translations.d.ts.map +1 -1
  79. package/dist/v2/features/localization/translations.js +4 -0
  80. package/dist/v2/features/localization/translations.js.map +1 -1
  81. package/dist/vue-styles.css +3 -3
  82. package/package.json +17 -17
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTableRow.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","DataTableRow","_normalizeClass","_withCtx","_createVNode","DataTableCheckbox","DataTableCell","CodeInputLite","DataTableInputSelect","_createCommentVNode","RequestTableTooltip","_createElementBlock","_Fragment","_createElementVNode","_toDisplayString"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableRow.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconGlobe, ScalarIconTrash } from '@scalar/icons'\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport { isFileSchema } from '@scalar/workspace-store/helpers/is-file-schema'\nimport { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type {\n ParameterObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, ref, useTemplateRef, watch } from 'vue'\n\nimport { getFileName } from '@/v2/blocks/request-block/helpers/files'\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { CodeInputLite } from '@/v2/components/code-input'\nimport {\n DataTableCell,\n DataTableCheckbox,\n DataTableInputSelect,\n DataTableRow,\n} from '@/v2/components/data-table'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport RequestTableTooltip from './RequestTableTooltip.vue'\n\nconst {\n data,\n environment,\n hasCheckboxDisabled,\n deferKeyUpdates,\n invalidParams,\n showUploadButton,\n allowUnknownFileUploads = true,\n} = defineProps<{\n data: TableRow\n /** Keep key edits local until blur when the row identity depends on its name. */\n deferKeyUpdates?: boolean\n hasCheckboxDisabled?: boolean\n invalidParams?: Set<string>\n label?: string\n environment: XScalarEnvironment\n showUploadButton?: boolean\n /** Unknown fields remain editable as files only in free-form multipart requests. */\n allowUnknownFileUploads?: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'upsertRow', payload: TableRowUpsertPayload): void\n (e: 'deleteRow'): void\n (e: 'uploadFile'): void\n (e: 'removeFile'): void\n (e: 'navigate', route: NonNullable<TableRow['globalRoute']>): void\n /** Select a value for a grouped global cookie preset. */\n (e: 'selectPreset', value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst valueInput = useTemplateRef('valueInput')\ndefineExpose({ focusValue: (): void => valueInput.value?.focus() })\n\nexport type TableRow = {\n /** The parameter or field name/key */\n name: string\n /** The parameter value, can be a string, file, or null */\n value: string | File | null\n /** Optional description for the parameter */\n description?: string\n /** Optional route for global parameters (e.g., cookies shared across workspace) */\n globalRoute?: ApiReferenceEvents['ui:navigate']\n /** Whether the parameter is disabled/inactive */\n isDisabled?: boolean\n /** Whether an optional parameter is disabled because it has no explicit x-disabled value */\n isDisabledByDefault?: boolean\n /** OpenAPI schema object with type, validation rules, examples, etc. */\n schema?: SchemaObject\n /** Explicit media type for this multipart field. */\n contentType?: string\n /** Preserve array values even while their JSON text is temporarily invalid. */\n isArray?: boolean\n /** Text representation used by array enum controls. */\n arrayEncoding?: 'json' | 'comma-separated'\n /** Whether the parameter is required */\n isRequired?: boolean\n /**\n * Whether the parameter is readonly and can not be modifies directly\n * User can still override the parameter which is going to show up with the linethrough style\n */\n isReadonly?: boolean\n /** Whether the parameter is overridden later on */\n isOverridden?: boolean\n /** Track the original parameter so we can update it */\n originalParameter?: ParameterObject\n /** Path to a value inside the original parameter example for expanded object parameters */\n sourceParameterValuePath?: string[]\n /**\n * Selectable values for a grouped global cookie preset. When set, the value cell renders a\n * dropdown to switch between predefined values (for example a `Culture` cookie with `PL`/`EN`)\n * instead of an editable input.\n */\n presetOptions?: string[]\n}\n\nexport type TableRowUpsertPayload = {\n name: string\n value: string | File\n isDisabled: boolean\n shouldRenameExpandedRow?: boolean\n}\n\n/**\n * Track local state for the row\n *\n * Now this is required because of the way we get default values from the schema.\n * If we have a default value in data.value, then we update isDisabled to true. We lose the default value since now\n * we have an example where value: ''. This is why we need to track the local state and update all of the params at the\n * same time.\n */\nconst name = ref<string>(data.name ?? '')\nconst value = ref<string | File>(unpackProxyObject(data.value) ?? '')\nconst isDisabled = ref<boolean>(data.isDisabled ?? false)\n\n// Keep the above state synced with the data prop\nwatch(\n () => data.name,\n (newName) => {\n // Do not overwrite a valid local name with an empty incoming prop — this\n // can happen when the placeholder row (appended by displayData) is briefly\n // mapped onto this component instance before Vue re-keys the list.\n if (!newName && name.value && !deferKeyUpdates) {\n return\n }\n name.value = newName ?? ''\n },\n)\nwatch(\n () => data.value,\n (newValue) => (value.value = unpackProxyObject(newValue) ?? ''),\n)\nwatch(\n () => data.isDisabled,\n (newIsDisabled) => (isDisabled.value = newIsDisabled ?? false),\n)\n\n/** Check if the value is a File instance */\nconst isFile = computed(() => value.value instanceof File)\n\n/** Whether this row’s schema accepts a file part. */\nconst canUploadFile = computed<boolean>(() =>\n data.schema\n ? isFileSchema(data.schema, true, data.contentType)\n : allowUnknownFileUploads,\n)\n\n/** Display value handles File instances and shows filename instead */\nconst displayValue = computed(\n () =>\n (isFile.value\n ? getFileName(value.value as File)\n : (value.value as string)) ?? '',\n)\n\nconst defaultValue = computed(() => data.schema?.default as string)\n\n/** See if we can extract enum values from the schema */\nconst enumValue = computed<unknown[]>(() => {\n if (!data.schema) {\n return []\n }\n\n // Grab the enum from the schema\n if (data.schema.enum) {\n return data.schema.enum.map((item) => String(item))\n }\n\n // Grab the enum from the items schema\n if ('items' in data.schema) {\n const resolved = resolve.schema(data.schema.items)\n if (resolved?.enum) {\n return data.arrayEncoding === 'json'\n ? resolved.enum\n : resolved.enum.map((item) => String(item))\n }\n }\n\n return []\n})\n\nconst typeValue = computed(() =>\n data.schema && 'type' in data.schema ? data.schema.type : undefined,\n)\n\nconst validationResult = computed(() =>\n validateParameter(data.schema, value.value),\n)\n\n/** Handle row updates while preserving existing properties */\nconst handleUpdateRow = (\n payload: Partial<{ name: string; value: string; isDisabled: boolean }>,\n options: { shouldRenameExpandedRow?: boolean; commitKey?: boolean } = {},\n): void => {\n // Update our local state\n if (payload.name !== undefined) {\n name.value = payload.name\n }\n if (payload.value !== undefined) {\n value.value = payload.value\n\n // Optional parameters start unchecked, but entering a value expresses intent to send it.\n // Explicit x-disabled values stay unchanged so a deliberate opt-out is preserved.\n if (data.isDisabledByDefault) {\n isDisabled.value = false\n }\n }\n\n // Is disabled should only be updated when explicitly provided in the payload\n if (payload.isDisabled !== undefined) {\n isDisabled.value = payload.isDisabled\n }\n\n if (\n payload.name !== undefined &&\n (deferKeyUpdates || data.sourceParameterValuePath) &&\n !options.shouldRenameExpandedRow &&\n !options.commitKey\n ) {\n return\n }\n\n // Emit all of the local state\n emit('upsertRow', {\n name: name.value,\n value: value.value,\n isDisabled: isDisabled.value,\n ...(options.shouldRenameExpandedRow\n ? { shouldRenameExpandedRow: true }\n : {}),\n })\n}\n\n/**\n * Commit a key edit when the input loses focus. Body and expanded-object rows defer their rename to blur (see\n * handleUpdateRow), so we only emit when the key actually changed. Focusing and blurring the field\n * without typing should not re-emit the row or silently reset its disabled state. The current\n * disabled state is passed through so a renamed row keeps it.\n */\nconst handleKeyBlur = (newName: string): void => {\n if (newName === data.name) {\n return\n }\n // Do not emit an update that would blank the parameter name — this can fire\n // when CodeInputLite blurs before it has rendered its initial value.\n if (!newName && data.name && (!deferKeyUpdates || name.value !== '')) {\n return\n }\n\n handleUpdateRow(\n { name: newName, isDisabled: isDisabled.value },\n {\n shouldRenameExpandedRow: Boolean(data.sourceParameterValuePath),\n commitKey: true,\n },\n )\n}\n\n/** Save a pending body key before the send shortcut reaches the request handler. */\nconst handleKeydown = (event: KeyboardEvent): void => {\n if (\n deferKeyUpdates &&\n event.key === 'Enter' &&\n (event.metaKey || event.ctrlKey)\n ) {\n handleKeyBlur(name.value)\n }\n}\n</script>\n\n<template>\n <DataTableRow\n :id=\"data.name\"\n :class=\"{\n alert: validationResult.ok === false,\n error: validationResult.ok === false && invalidParams?.has(data.name),\n }\">\n <DataTableCheckbox\n :ariaLabel=\"\n translate('apiClient.requestTableRow.include', {\n name: data.name || translate('apiClient.requestTableRow.row'),\n })\n \"\n class=\"!border-r\"\n :disabled=\"hasCheckboxDisabled ?? false\"\n :modelValue=\"!isDisabled\"\n @update:modelValue=\"(v) => handleUpdateRow({ isDisabled: !v })\" />\n\n <!-- Name -->\n <DataTableCell>\n <CodeInputLite\n :aria-label=\"\n translate('apiClient.requestTableRow.keyLabel', { name: label ?? '' })\n \"\n :disabled=\"data.isReadonly\"\n :environment=\"environment\"\n :modelValue=\"name\"\n :placeholder=\"translate('apiClient.requestTableRow.key')\"\n :required=\"Boolean(data.isRequired)\"\n @blur=\"(v) => handleKeyBlur(v)\"\n @keydown.capture=\"handleKeydown\"\n @navigate=\"(route) => emit('navigate', route)\"\n @update:modelValue=\"(v) => handleUpdateRow({ name: v })\" />\n </DataTableCell>\n\n <!-- Value -->\n <DataTableCell>\n <!-- Preset switcher for grouped global cookies that share a name -->\n <DataTableInputSelect\n v-if=\"data.presetOptions?.length\"\n :canAddCustomValue=\"false\"\n :modelValue=\"displayValue\"\n :value=\"data.presetOptions\"\n @update:modelValue=\"(v) => emit('selectPreset', v)\" />\n <CodeInputLite\n v-else\n ref=\"valueInput\"\n :aria-label=\"\n translate('apiClient.requestTableRow.valueLabel', {\n name: label ?? '',\n })\n \"\n :arrayEncoding=\"data.arrayEncoding\"\n class=\"pr-6 group-hover:pr-10 group-has-[.code-input-lite__editor:focus]:pr-10\"\n :default=\"defaultValue\"\n :disabled=\"data.isReadonly\"\n :enum=\"enumValue\"\n :environment=\"environment\"\n :examples=\"\n data.schema?.examples?.map((example) => String(example)) ?? []\n \"\n :linethrough=\"data.isOverridden\"\n :modelValue=\"displayValue\"\n :placeholder=\"translate('apiClient.requestTableRow.value')\"\n :type=\"typeValue\"\n withFakeData\n @navigate=\"(route) => emit('navigate', route)\"\n @update:modelValue=\"(v) => handleUpdateRow({ value: v })\">\n <template #icon>\n <ScalarButton\n v-if=\"\n Boolean(data.name || value) &&\n !data.isRequired &&\n data.isReadonly !== true\n \"\n :aria-label=\"\n translate('apiClient.requestTableRow.deleteRow', {\n name: data.name || translate('apiClient.requestTableRow.row'),\n })\n \"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 hidden h-fit rounded p-1 group-hover:flex group-has-[.code-input-lite__editor:focus]:flex\"\n size=\"sm\"\n variant=\"ghost\"\n @click=\"emit('deleteRow')\">\n <ScalarIconTrash class=\"size-3.5\" />\n </ScalarButton>\n\n <ScalarIconButton\n v-if=\"data.globalRoute !== undefined\"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 h-fit\"\n :icon=\"ScalarIconGlobe\"\n :label=\"translate('apiClient.requestTableRow.globalCookieHint')\"\n size=\"xs\"\n tooltip=\"top\"\n variant=\"ghost\"\n @click=\"emit('navigate', data.globalRoute)\" />\n\n <RequestTableTooltip\n v-if=\"data.isReadonly\"\n :description=\"translate('apiClient.requestTableRow.readOnlyHint')\"\n :value=\"null\" />\n <RequestTableTooltip\n v-else-if=\"data.schema\"\n :description=\"data.description\"\n :schema=\"data.schema\"\n :value />\n </template>\n </CodeInputLite>\n </DataTableCell>\n\n <!-- File upload -->\n <DataTableCell\n v-if=\"showUploadButton\"\n class=\"group/upload flex items-center justify-center whitespace-nowrap\">\n <template v-if=\"isFile\">\n <div\n class=\"text-c-2 flex w-full max-w-[100%] items-center justify-center overflow-hidden p-1\">\n <span\n class=\"truncate\"\n :title=\"displayValue\"\n >{{ displayValue }}</span\n >\n </div>\n <button\n class=\"bg-b-2 mt-1 block rounded p-0.5 text-center text-xs font-medium md:pointer-events-none md:absolute md:inset-x-1 md:top-1/2 md:mt-0 md:-translate-y-1/2 md:opacity-0 md:group-hover/upload:pointer-events-auto md:group-hover/upload:opacity-100\"\n type=\"button\"\n @click=\"emit('removeFile')\">\n {{ translate('apiClient.requestTableRow.delete') }}\n </button>\n </template>\n <template v-else-if=\"canUploadFile\">\n <div class=\"p-0.5\">\n <ScalarButton\n class=\"bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"emit('uploadFile')\">\n <span>{{ translate('apiClient.requestTableRow.selectFile') }}</span>\n <ScalarIcon\n class=\"ml-1\"\n icon=\"Upload\"\n size=\"xs\"\n thickness=\"2.5\" />\n </ScalarButton>\n </div>\n </template>\n </DataTableCell>\n </DataTableRow>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkDA,MAAM,OAAO;EAUb,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,aAAa,eAAe,YAAY;EAC9C,SAAa,EAAE,kBAAwB,WAAW,OAAO,MAAM,EAAE,CAAC;EA2DlE,MAAM,OAAO,IAAY,QAAA,KAAK,QAAQ,EAAE;EACxC,MAAM,QAAQ,IAAmB,kBAAkB,QAAA,KAAK,KAAK,KAAK,EAAE;EACpE,MAAM,aAAa,IAAa,QAAA,KAAK,cAAc,KAAK;EAGxD,YACQ,QAAA,KAAK,OACV,YAAY;GAIX,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,QAAA,iBAC7B;GAEF,KAAK,QAAQ,WAAW;EAC1B,CACF;EACA,YACQ,QAAA,KAAK,QACV,aAAc,MAAM,QAAQ,kBAAkB,QAAQ,KAAK,EAC9D;EACA,YACQ,QAAA,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WC,UAAA,EAAA,KAAA,EAAA,GAAA,CAdTC,mBAOM,OAPN,YAOM,CALJA,mBAIC,QAAA;OAHC,OAAM;OACL,OAAO,aAAA;MACJ,GAAAC,gBAAA,aAAA,KAAY,GAAA,GAAA,UAAA,C,IAGpBD,mBAKS,UAAA;OAJP,OAAM;OACN,MAAK;OACJ,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,YAAA;MACT,GAAAC,gBAAAd,MAAA,SAAA,CAAS,CAAA,kCAAA,CAAA,GAAA,CAAA,C,UAGK,cAAA,SACnBF,UAAA,GAAAa,mBAaM,OAbN,YAaM,CAZJP,YAWeJ,MAAA,YAAA,GAAA;OAVb,OAAM;OACN,MAAK;OACL,SAAQ;OACP,SAAK,OAAA,QAAA,OAAA,OAAA,WAAE,KAAI,YAAA;;OACZ,SAAAG,cAAoE,CAApEU,mBAAoE,QAAA,MAAAC,gBAA3Dd,MAAA,SAAA,CAAS,CAAA,sCAAA,CAAA,GAAA,CAAA,GAClBI,YAIoBJ,MAAA,UAAA,GAAA;QAHlB,OAAM;QACN,MAAK;QACL,MAAK;QACL,WAAU"}
1
+ {"version":3,"file":"RequestTableRow.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","DataTableRow","_normalizeClass","_withCtx","_createVNode","DataTableCheckbox","DataTableCell","CodeInputLite","RequestTableFileList","RequestTableTooltip","_createCommentVNode","DataTableInputSelect","_createElementBlock","_Fragment","_createElementVNode","_toDisplayString"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableRow.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarButton } from '@scalar/components/button'\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarIconButton } from '@scalar/components/icon-button'\nimport { ScalarIconGlobe, ScalarIconTrash } from '@scalar/icons'\nimport type { ApiReferenceEvents } from '@scalar/workspace-store/events'\nimport { isFileSchema } from '@scalar/workspace-store/helpers/is-file-schema'\nimport { unpackProxyObject } from '@scalar/workspace-store/helpers/unpack-proxy'\nimport { resolve } from '@scalar/workspace-store/resolve'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type {\n ParameterObject,\n SchemaObject,\n} from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\nimport { computed, ref, useTemplateRef, watch } from 'vue'\n\nimport { getFileName } from '@/v2/blocks/request-block/helpers/files'\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { CodeInputLite } from '@/v2/components/code-input'\nimport {\n DataTableCell,\n DataTableCheckbox,\n DataTableInputSelect,\n DataTableRow,\n} from '@/v2/components/data-table'\nimport { useLocalization } from '@/v2/features/localization'\n\nimport RequestTableTooltip from './RequestTableTooltip.vue'\nimport RequestTableFileList, {\n type RequestTableFile,\n} from './RequestTableFileList.vue'\n\nconst {\n data,\n environment,\n hasCheckboxDisabled,\n deferKeyUpdates,\n invalidParams,\n showUploadButton,\n allowUnknownFileUploads = true,\n} = defineProps<{\n data: TableRow\n /** Keep key edits local until blur when the row identity depends on its name. */\n deferKeyUpdates?: boolean\n hasCheckboxDisabled?: boolean\n invalidParams?: Set<string>\n label?: string\n environment: XScalarEnvironment\n showUploadButton?: boolean\n /** Unknown fields remain editable as files only in free-form multipart requests. */\n allowUnknownFileUploads?: boolean\n}>()\n\nconst emit = defineEmits<{\n (e: 'upsertRow', payload: TableRowUpsertPayload): void\n (e: 'deleteRow'): void\n (e: 'uploadFile'): void\n (e: 'removeFile', fileIndex?: number): void\n (e: 'updateFile', fileIndex: number, isDisabled: boolean): void\n (e: 'navigate', route: NonNullable<TableRow['globalRoute']>): void\n /** Select a value for a grouped global cookie preset. */\n (e: 'selectPreset', value: string): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst valueInput = useTemplateRef('valueInput')\nconst fileList = useTemplateRef('fileList')\ndefineExpose({\n focusValue: (): void => {\n if (data.files) {\n fileList.value?.focusUpload()\n } else {\n valueInput.value?.focus()\n }\n },\n})\n\nexport type TableRow = {\n /** The parameter or field name/key */\n name: string\n /** The parameter value, can be a string, file, or null */\n value: string | File | null\n /** Selected files grouped for display; source rows remain separate multipart parts. */\n files?: RequestTableFile[]\n /** Optional description for the parameter */\n description?: string\n /** Optional route for global parameters (e.g., cookies shared across workspace) */\n globalRoute?: ApiReferenceEvents['ui:navigate']\n /** Whether the parameter is disabled/inactive */\n isDisabled?: boolean\n /** Whether an optional parameter is disabled because it has no explicit x-disabled value */\n isDisabledByDefault?: boolean\n /** OpenAPI schema object with type, validation rules, examples, etc. */\n schema?: SchemaObject\n /** Explicit media type for this multipart field. */\n contentType?: string\n /** Preserve array values even while their JSON text is temporarily invalid. */\n isArray?: boolean\n /** Text representation used by array enum controls. */\n arrayEncoding?: 'json' | 'comma-separated'\n /** Whether the parameter is required */\n isRequired?: boolean\n /**\n * Whether the parameter is readonly and can not be modifies directly\n * User can still override the parameter which is going to show up with the linethrough style\n */\n isReadonly?: boolean\n /** Whether the parameter is overridden later on */\n isOverridden?: boolean\n /** Track the original parameter so we can update it */\n originalParameter?: ParameterObject\n /** Path to a value inside the original parameter example for expanded object parameters */\n sourceParameterValuePath?: string[]\n /**\n * Selectable values for a grouped global cookie preset. When set, the value cell renders a\n * dropdown to switch between predefined values (for example a `Culture` cookie with `PL`/`EN`)\n * instead of an editable input.\n */\n presetOptions?: string[]\n}\n\nexport type TableRowUpsertPayload = {\n name: string\n value: string | File\n isDisabled: boolean\n shouldRenameExpandedRow?: boolean\n}\n\n/**\n * Track local state for the row\n *\n * Now this is required because of the way we get default values from the schema.\n * If we have a default value in data.value, then we update isDisabled to true. We lose the default value since now\n * we have an example where value: ''. This is why we need to track the local state and update all of the params at the\n * same time.\n */\nconst name = ref<string>(data.name ?? '')\nconst value = ref<string | File>(unpackProxyObject(data.value) ?? '')\nconst isDisabled = ref<boolean>(data.isDisabled ?? false)\n\n// Keep the above state synced with the data prop\nwatch(\n () => data.name,\n (newName) => {\n // Do not overwrite a valid local name with an empty incoming prop — this\n // can happen when the placeholder row (appended by displayData) is briefly\n // mapped onto this component instance before Vue re-keys the list.\n if (!newName && name.value && !deferKeyUpdates) {\n return\n }\n name.value = newName ?? ''\n },\n)\nwatch(\n () => data.value,\n (newValue) => (value.value = unpackProxyObject(newValue) ?? ''),\n)\nwatch(\n () => data.isDisabled,\n (newIsDisabled) => (isDisabled.value = newIsDisabled ?? false),\n)\n\n/** Check if the value is a File instance */\nconst isFile = computed(() => value.value instanceof File)\n\n/** Whether this row’s schema accepts a file part. */\nconst canUploadFile = computed<boolean>(() =>\n data.schema\n ? isFileSchema(data.schema, true, data.contentType)\n : allowUnknownFileUploads,\n)\n\nconst fileUploadLabel = computed<string>(() =>\n translate(\n data.schema && isArraySchema(data.schema)\n ? 'apiClient.requestTableRow.selectFiles'\n : 'apiClient.requestTableRow.selectFile',\n ),\n)\n\nconst hasMixedFileSelection = computed<boolean>(() =>\n Boolean(\n data.files?.some((file) => file.isDisabled) &&\n data.files.some((file) => !file.isDisabled),\n ),\n)\n\n/** Display value handles File instances and shows filename instead */\nconst displayValue = computed(\n () =>\n (isFile.value\n ? getFileName(value.value as File)\n : (value.value as string)) ?? '',\n)\n\nconst defaultValue = computed(() => data.schema?.default as string)\n\n/** See if we can extract enum values from the schema */\nconst enumValue = computed<unknown[]>(() => {\n if (!data.schema) {\n return []\n }\n\n // Grab the enum from the schema\n if (data.schema.enum) {\n return data.schema.enum.map((item) => String(item))\n }\n\n // Grab the enum from the items schema\n if ('items' in data.schema) {\n const resolved = resolve.schema(data.schema.items)\n if (resolved?.enum) {\n return data.arrayEncoding === 'json'\n ? resolved.enum\n : resolved.enum.map((item) => String(item))\n }\n }\n\n return []\n})\n\nconst typeValue = computed(() =>\n data.schema && 'type' in data.schema ? data.schema.type : undefined,\n)\n\nconst validationResult = computed(() =>\n validateParameter(data.schema, value.value),\n)\n\n/** Handle row updates while preserving existing properties */\nconst handleUpdateRow = (\n payload: Partial<{ name: string; value: string; isDisabled: boolean }>,\n options: { shouldRenameExpandedRow?: boolean; commitKey?: boolean } = {},\n): void => {\n // Update our local state\n if (payload.name !== undefined) {\n name.value = payload.name\n }\n if (payload.value !== undefined) {\n value.value = payload.value\n\n // Optional parameters start unchecked, but entering a value expresses intent to send it.\n // Explicit x-disabled values stay unchanged so a deliberate opt-out is preserved.\n if (data.isDisabledByDefault) {\n isDisabled.value = false\n }\n }\n\n // Is disabled should only be updated when explicitly provided in the payload\n if (payload.isDisabled !== undefined) {\n isDisabled.value = payload.isDisabled\n }\n\n if (\n payload.name !== undefined &&\n (deferKeyUpdates || data.sourceParameterValuePath) &&\n !options.shouldRenameExpandedRow &&\n !options.commitKey\n ) {\n return\n }\n\n // Emit all of the local state\n emit('upsertRow', {\n name: name.value,\n value: value.value,\n isDisabled: isDisabled.value,\n ...(options.shouldRenameExpandedRow\n ? { shouldRenameExpandedRow: true }\n : {}),\n })\n}\n\n/**\n * Commit a key edit when the input loses focus. Body and expanded-object rows defer their rename to blur (see\n * handleUpdateRow), so we only emit when the key actually changed. Focusing and blurring the field\n * without typing should not re-emit the row or silently reset its disabled state. The current\n * disabled state is passed through so a renamed row keeps it.\n */\nconst handleKeyBlur = (newName: string): void => {\n if (newName === data.name) {\n return\n }\n // Do not emit an update that would blank the parameter name — this can fire\n // when CodeInputLite blurs before it has rendered its initial value.\n if (!newName && data.name && (!deferKeyUpdates || name.value !== '')) {\n return\n }\n\n handleUpdateRow(\n { name: newName, isDisabled: isDisabled.value },\n {\n shouldRenameExpandedRow: Boolean(data.sourceParameterValuePath),\n commitKey: true,\n },\n )\n}\n\n/** Save a pending body key before the send shortcut reaches the request handler. */\nconst handleKeydown = (event: KeyboardEvent): void => {\n if (\n deferKeyUpdates &&\n event.key === 'Enter' &&\n (event.metaKey || event.ctrlKey)\n ) {\n handleKeyBlur(name.value)\n }\n}\n</script>\n\n<template>\n <DataTableRow\n :id=\"data.name\"\n :class=\"{\n alert: validationResult.ok === false,\n error: validationResult.ok === false && invalidParams?.has(data.name),\n }\">\n <DataTableCheckbox\n :ariaLabel=\"\n translate('apiClient.requestTableRow.include', {\n name: data.name || translate('apiClient.requestTableRow.row'),\n })\n \"\n class=\"!border-r\"\n :class=\"{ 'max-h-none': data.files }\"\n :disabled=\"hasCheckboxDisabled ?? false\"\n :indeterminate=\"hasMixedFileSelection\"\n :modelValue=\"!isDisabled\"\n @update:modelValue=\"(v) => handleUpdateRow({ isDisabled: !v })\" />\n\n <!-- Name -->\n <DataTableCell :class=\"{ 'max-h-none': data.files }\">\n <CodeInputLite\n :aria-label=\"\n translate('apiClient.requestTableRow.keyLabel', { name: label ?? '' })\n \"\n :disabled=\"data.isReadonly\"\n :environment=\"environment\"\n :modelValue=\"name\"\n :placeholder=\"translate('apiClient.requestTableRow.key')\"\n :required=\"Boolean(data.isRequired)\"\n @blur=\"(v) => handleKeyBlur(v)\"\n @keydown.capture=\"handleKeydown\"\n @navigate=\"(route) => emit('navigate', route)\"\n @update:modelValue=\"(v) => handleUpdateRow({ name: v })\" />\n </DataTableCell>\n\n <!-- Value -->\n <DataTableCell\n v-if=\"data.files\"\n class=\"col-span-2 max-h-none\"\n :colspan=\"2\">\n <RequestTableFileList\n ref=\"fileList\"\n :disabled=\"data.isReadonly\"\n :files=\"data.files\"\n :name=\"name\"\n @removeFile=\"(index) => emit('removeFile', index)\"\n @updateFile=\"(index, disabled) => emit('updateFile', index, disabled)\"\n @uploadFile=\"emit('uploadFile')\">\n <RequestTableTooltip\n v-if=\"data.schema\"\n :description=\"data.description\"\n :schema=\"data.schema\"\n :value=\"value\" />\n </RequestTableFileList>\n </DataTableCell>\n <DataTableCell v-else>\n <!-- Preset switcher for grouped global cookies that share a name -->\n <DataTableInputSelect\n v-if=\"data.presetOptions?.length\"\n :canAddCustomValue=\"false\"\n :modelValue=\"displayValue\"\n :value=\"data.presetOptions\"\n @update:modelValue=\"(v) => emit('selectPreset', v)\" />\n <CodeInputLite\n v-else\n ref=\"valueInput\"\n :aria-label=\"\n translate('apiClient.requestTableRow.valueLabel', {\n name: label ?? '',\n })\n \"\n :arrayEncoding=\"data.arrayEncoding\"\n class=\"pr-6 group-hover:pr-10 group-has-[.code-input-lite__editor:focus]:pr-10\"\n :default=\"defaultValue\"\n :disabled=\"data.isReadonly\"\n :enum=\"enumValue\"\n :environment=\"environment\"\n :examples=\"\n data.schema?.examples?.map((example) => String(example)) ?? []\n \"\n :linethrough=\"data.isOverridden\"\n :modelValue=\"displayValue\"\n :placeholder=\"translate('apiClient.requestTableRow.value')\"\n :type=\"typeValue\"\n withFakeData\n @navigate=\"(route) => emit('navigate', route)\"\n @update:modelValue=\"(v) => handleUpdateRow({ value: v })\">\n <template #icon>\n <ScalarButton\n v-if=\"\n Boolean(data.name || value) &&\n !data.isRequired &&\n data.isReadonly !== true\n \"\n :aria-label=\"\n translate('apiClient.requestTableRow.deleteRow', {\n name: data.name || translate('apiClient.requestTableRow.row'),\n })\n \"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 hidden h-fit rounded p-1 group-hover:flex group-has-[.code-input-lite__editor:focus]:flex\"\n size=\"sm\"\n variant=\"ghost\"\n @click=\"emit('deleteRow')\">\n <ScalarIconTrash class=\"size-3.5\" />\n </ScalarButton>\n\n <ScalarIconButton\n v-if=\"data.globalRoute !== undefined\"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 z-context -mr-0.5 h-fit\"\n :icon=\"ScalarIconGlobe\"\n :label=\"translate('apiClient.requestTableRow.globalCookieHint')\"\n size=\"xs\"\n tooltip=\"top\"\n variant=\"ghost\"\n @click=\"emit('navigate', data.globalRoute)\" />\n\n <RequestTableTooltip\n v-if=\"data.isReadonly\"\n :description=\"translate('apiClient.requestTableRow.readOnlyHint')\"\n :value=\"null\" />\n <RequestTableTooltip\n v-else-if=\"data.schema\"\n :description=\"data.description\"\n :schema=\"data.schema\"\n :value />\n </template>\n </CodeInputLite>\n </DataTableCell>\n\n <!-- File upload -->\n <DataTableCell\n v-if=\"showUploadButton && !data.files\"\n class=\"group/upload flex items-center justify-center whitespace-nowrap\">\n <template v-if=\"isFile\">\n <div\n class=\"text-c-2 flex w-full max-w-[100%] items-center justify-center overflow-hidden p-1\">\n <span\n class=\"truncate\"\n :title=\"displayValue\"\n >{{ displayValue }}</span\n >\n </div>\n <button\n class=\"bg-b-2 mt-1 block rounded p-0.5 text-center text-xs font-medium md:pointer-events-none md:absolute md:inset-x-1 md:top-1/2 md:mt-0 md:-translate-y-1/2 md:opacity-0 md:group-hover/upload:pointer-events-auto md:group-hover/upload:opacity-100\"\n type=\"button\"\n @click=\"emit('removeFile')\">\n {{ translate('apiClient.requestTableRow.delete') }}\n </button>\n </template>\n <template v-else-if=\"canUploadFile\">\n <div class=\"p-0.5\">\n <ScalarButton\n :aria-label=\"\n translate('apiClient.requestTableRow.uploadFor', {\n action: fileUploadLabel,\n name: name || translate('apiClient.requestTableRow.row'),\n })\n \"\n class=\"bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none\"\n size=\"sm\"\n variant=\"outlined\"\n @click=\"emit('uploadFile')\">\n <span>{{ fileUploadLabel }}</span>\n <ScalarIcon\n class=\"ml-1\"\n icon=\"Upload\"\n size=\"xs\"\n thickness=\"2.5\" />\n </ScalarButton>\n </div>\n </template>\n </DataTableCell>\n </DataTableRow>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDA,MAAM,OAAO;EAWb,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,aAAa,eAAe,YAAY;EAC9C,MAAM,WAAW,eAAe,UAAU;EAC1C,SAAa,EACX,kBAAwB;GACtB,IAAI,QAAA,KAAK,OACP,SAAS,OAAO,YAAY;QAE5B,WAAW,OAAO,MAAM;EAE5B,EACF,CAAC;EA6DD,MAAM,OAAO,IAAY,QAAA,KAAK,QAAQ,EAAE;EACxC,MAAM,QAAQ,IAAmB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AAA,GAAA;;MAvCd,OAAM;;MACN,SAAAH,cAeW,CAfK,OAAA,SAAhBL,UAAA,GAAAc,mBAeWC,UAAA,EAAA,KAAA,EAAA,GAAA,CAdTC,mBAOM,OAPN,YAOM,CALJA,mBAIC,QAAA;OAHC,OAAM;OACL,OAAO,aAAA;MACJ,GAAAC,gBAAA,aAAA,KAAY,GAAA,GAAA,UAAA,C,IAGpBD,mBAKS,UAAA;OAJP,OAAM;OACN,MAAK;OACJ,SAAK,OAAA,QAAA,OAAA,OAAA,WAAE,KAAI,YAAA;MACT,GAAAC,gBAAAf,MAAA,SAAA,CAAS,CAAA,kCAAA,CAAA,GAAA,CAAA,C,UAGK,cAAA,SACnBF,UAAA,GAAAc,mBAmBM,OAnBN,YAmBM,CAlBJR,YAiBeJ,MAAA,YAAA,GAAA;OAhBZ,cAA2BA,MAAA,SAAA,CAAS,CAAA,uCAAA;QAAkE,QAAA,gBAAA;QAAuC,MAAA,KAAA,SAAQA,MAAA,SAAA,CAAS,CAAA,+BAAA;;OAM/J,OAAM;OACN,MAAK;OACL,SAAQ;OACP,SAAK,OAAA,QAAA,OAAA,OAAA,WAAE,KAAI,YAAA;;OACZ,SAAAG,cAAkC,CAAlCW,mBAAkC,QAAA,MAAAC,gBAAzB,gBAAA,KAAe,GAAA,CAAA,GACxBX,YAIoBJ,MAAA,UAAA,GAAA;QAHlB,OAAM;QACN,MAAK;QACL,MAAK;QACL,WAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTableTooltip.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"names":[],"mappings":"AAyFA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAMhG,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC;AA0LF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"RequestTableTooltip.vue.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"names":[],"mappings":"AAoGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAMhG,KAAK,WAAW,GAAG;IACjB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAC;AA2LF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTableTooltip.vue.js","names":["_sfc_main"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarPopover } from '@scalar/components/popover'\nimport { ScalarIconInfo, ScalarIconWarning } from '@scalar/icons'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { schema, value, description } = defineProps<{\n schema?: SchemaObject\n value: string | File | null\n description?: string\n}>()\n\nconst { translate } = useLocalization()\n\nconst invalidParameterMessage = computed(() => validateParameter(schema, value))\nconst isInvalid = computed(() => invalidParameterMessage.value.ok === false)\n</script>\n<template>\n <ScalarPopover\n :offset=\"4\"\n placement=\"left\"\n teleport>\n <button\n :aria-label=\"\n isInvalid\n ? translate('apiClient.requestTableTooltip.invalid')\n : translate('apiClient.requestTableTooltip.moreInformation')\n \"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 rounded p-1\"\n :role=\"isInvalid ? 'alert' : 'none'\"\n type=\"button\">\n <ScalarIconWarning\n v-if=\"isInvalid\"\n class=\"text-orange size-3.5 brightness-90 hover:brightness-75\" />\n <ScalarIconInfo\n v-else\n class=\"text-c-2 hover:text-c-1 size-3.5\" />\n </button>\n <template #popover>\n <div\n class=\"text-xxs text-c-1 grid w-fit max-w-xs min-w-0 gap-1.5 rounded px-1.5 pt-2 pb-1.5 leading-none break-words\"\n data-testid=\"request-table-tooltip-content\">\n <div\n v-if=\"invalidParameterMessage.ok === false\"\n class=\"text-error-1\">\n {{ invalidParameterMessage.message }}\n </div>\n <div\n v-else-if=\"\n schema &&\n ('type' in schema ||\n 'format' in schema ||\n 'minimum' in schema ||\n 'maximum' in schema ||\n 'default' in schema)\n \"\n class=\"schema text-c-2 truncate *:not-first:before:content-['_·_']\">\n <span v-if=\"'type' in schema\">{{ schema.type }}</span>\n <span v-if=\"'format' in schema\">{{ schema.format }}</span>\n <span v-if=\"'minimum' in schema\"\n >{{ translate('apiClient.requestTableTooltip.min') }}\n {{ schema.minimum }}</span\n >\n <span v-if=\"'maximum' in schema\"\n >{{ translate('apiClient.requestTableTooltip.max') }}\n {{ schema.maximum }}</span\n >\n <span v-if=\"'default' in schema\"\n >{{ translate('apiClient.requestTableTooltip.default') }}\n {{ schema.default }}</span\n >\n </div>\n <ScalarMarkdown\n v-if=\"description && !isInvalid\"\n :value=\"description\" />\n </div>\n </template>\n </ScalarPopover>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"RequestTableTooltip.vue.js","names":["_sfc_main"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarPopover } from '@scalar/components/popover'\nimport { ScalarIconInfo, ScalarIconWarning } from '@scalar/icons'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, toDisplayString } from 'vue'\n\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { schema, value, description } = defineProps<{\n schema?: SchemaObject\n value: string | File | null\n description?: string\n}>()\n\nconst { translate } = useLocalization()\n\nconst invalidParameterMessage = computed(() => validateParameter(schema, value))\nconst isInvalid = computed(() => invalidParameterMessage.value.ok === false)\nconst schemaDetails = computed<string[]>(() => {\n if (!schema) {\n return []\n }\n\n const type = 'type' in schema ? schema.type : undefined\n\n return [\n Array.isArray(type) ? type.join(' | ') : (type ?? ''),\n 'format' in schema ? (schema.format ?? '') : '',\n 'minimum' in schema && schema.minimum !== undefined\n ? `${translate('apiClient.requestTableTooltip.min')} ${schema.minimum}`\n : '',\n 'maximum' in schema && schema.maximum !== undefined\n ? `${translate('apiClient.requestTableTooltip.max')} ${schema.maximum}`\n : '',\n 'default' in schema && schema.default !== undefined\n ? `${translate('apiClient.requestTableTooltip.default')} ${toDisplayString(schema.default)}`\n : '',\n ].filter((detail) => detail.trim().length > 0)\n})\nconst hasDescription = computed<boolean>(() => Boolean(description?.trim()))\nconst hasContent = computed<boolean>(\n () =>\n isInvalid.value || schemaDetails.value.length > 0 || hasDescription.value,\n)\n</script>\n<template>\n <ScalarPopover\n v-if=\"hasContent\"\n :offset=\"4\"\n placement=\"left\"\n teleport>\n <button\n :aria-label=\"\n isInvalid\n ? translate('apiClient.requestTableTooltip.invalid')\n : translate('apiClient.requestTableTooltip.moreInformation')\n \"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 rounded p-1\"\n :role=\"isInvalid ? 'alert' : 'none'\"\n type=\"button\">\n <ScalarIconWarning\n v-if=\"isInvalid\"\n class=\"text-orange size-3.5 brightness-90 hover:brightness-75\" />\n <ScalarIconInfo\n v-else\n class=\"text-c-2 hover:text-c-1 size-3.5\" />\n </button>\n <template #popover>\n <div\n class=\"text-xxs text-c-1 grid w-fit max-w-xs min-w-0 gap-1.5 rounded p-1.5 leading-normal wrap-anywhere\"\n data-testid=\"request-table-tooltip-content\">\n <div\n v-if=\"invalidParameterMessage.ok === false\"\n class=\"text-error-1\">\n {{ invalidParameterMessage.message }}\n </div>\n <div\n v-else-if=\"schemaDetails.length\"\n class=\"schema text-c-2 *:not-first:before:content-['_·_']\">\n <span\n v-for=\"(detail, index) in schemaDetails\"\n :key=\"index\"\n >{{ detail }}</span\n >\n </div>\n <ScalarMarkdown\n v-if=\"hasDescription && !isInvalid\"\n :value=\"description\" />\n </div>\n </template>\n </ScalarPopover>\n</template>\n"],"mappings":""}
@@ -1,13 +1,13 @@
1
1
  import { useLocalization } from "../../../features/localization/index.js";
2
2
  import { validateParameter } from "../helpers/validate-parameter.js";
3
- import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, openBlock, toDisplayString, unref, withCtx } from "vue";
3
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
4
4
  import { ScalarIconInfo, ScalarIconWarning } from "@scalar/icons";
5
5
  import { ScalarMarkdown } from "@scalar/components/markdown";
6
6
  import { ScalarPopover } from "@scalar/components/popover";
7
7
  //#region src/v2/blocks/request-block/components/RequestTableTooltip.vue?vue&type=script&setup=true&lang.ts
8
8
  var _hoisted_1 = ["aria-label", "role"];
9
9
  var _hoisted_2 = {
10
- class: "text-xxs text-c-1 grid w-fit max-w-xs min-w-0 gap-1.5 rounded px-1.5 pt-2 pb-1.5 leading-none break-words",
10
+ class: "text-xxs text-c-1 grid w-fit max-w-xs min-w-0 gap-1.5 rounded p-1.5 leading-normal wrap-anywhere",
11
11
  "data-testid": "request-table-tooltip-content"
12
12
  };
13
13
  var _hoisted_3 = {
@@ -16,13 +16,8 @@ var _hoisted_3 = {
16
16
  };
17
17
  var _hoisted_4 = {
18
18
  key: 1,
19
- class: "schema text-c-2 truncate *:not-first:before:content-['_·_']"
19
+ class: "schema text-c-2 *:not-first:before:content-['_·_']"
20
20
  };
21
- var _hoisted_5 = { key: 0 };
22
- var _hoisted_6 = { key: 1 };
23
- var _hoisted_7 = { key: 2 };
24
- var _hoisted_8 = { key: 3 };
25
- var _hoisted_9 = { key: 4 };
26
21
  var RequestTableTooltip_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
27
22
  __name: "RequestTableTooltip",
28
23
  props: {
@@ -34,19 +29,29 @@ var RequestTableTooltip_vue_vue_type_script_setup_true_lang_default = /*@__PURE_
34
29
  const { translate } = useLocalization();
35
30
  const invalidParameterMessage = computed(() => validateParameter(__props.schema, __props.value));
36
31
  const isInvalid = computed(() => invalidParameterMessage.value.ok === false);
32
+ const schemaDetails = computed(() => {
33
+ if (!__props.schema) return [];
34
+ const type = "type" in __props.schema ? __props.schema.type : void 0;
35
+ return [
36
+ Array.isArray(type) ? type.join(" | ") : type ?? "",
37
+ "format" in __props.schema ? __props.schema.format ?? "" : "",
38
+ "minimum" in __props.schema && __props.schema.minimum !== void 0 ? `${translate("apiClient.requestTableTooltip.min")} ${__props.schema.minimum}` : "",
39
+ "maximum" in __props.schema && __props.schema.maximum !== void 0 ? `${translate("apiClient.requestTableTooltip.max")} ${__props.schema.maximum}` : "",
40
+ "default" in __props.schema && __props.schema.default !== void 0 ? `${translate("apiClient.requestTableTooltip.default")} ${toDisplayString(__props.schema.default)}` : ""
41
+ ].filter((detail) => detail.trim().length > 0);
42
+ });
43
+ const hasDescription = computed(() => Boolean(__props.description?.trim()));
44
+ const hasContent = computed(() => isInvalid.value || schemaDetails.value.length > 0 || hasDescription.value);
37
45
  return (_ctx, _cache) => {
38
- return openBlock(), createBlock(unref(ScalarPopover), {
46
+ return hasContent.value ? (openBlock(), createBlock(unref(ScalarPopover), {
47
+ key: 0,
39
48
  offset: 4,
40
49
  placement: "left",
41
50
  teleport: ""
42
51
  }, {
43
- popover: withCtx(() => [createElementVNode("div", _hoisted_2, [invalidParameterMessage.value.ok === false ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(invalidParameterMessage.value.message), 1)) : __props.schema && ("type" in __props.schema || "format" in __props.schema || "minimum" in __props.schema || "maximum" in __props.schema || "default" in __props.schema) ? (openBlock(), createElementBlock("div", _hoisted_4, [
44
- "type" in __props.schema ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(__props.schema.type), 1)) : createCommentVNode("", true),
45
- "format" in __props.schema ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(__props.schema.format), 1)) : createCommentVNode("", true),
46
- "minimum" in __props.schema ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(unref(translate)("apiClient.requestTableTooltip.min")) + " " + toDisplayString(__props.schema.minimum), 1)) : createCommentVNode("", true),
47
- "maximum" in __props.schema ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(unref(translate)("apiClient.requestTableTooltip.max")) + " " + toDisplayString(__props.schema.maximum), 1)) : createCommentVNode("", true),
48
- "default" in __props.schema ? (openBlock(), createElementBlock("span", _hoisted_9, toDisplayString(unref(translate)("apiClient.requestTableTooltip.default")) + " " + toDisplayString(__props.schema.default), 1)) : createCommentVNode("", true)
49
- ])) : createCommentVNode("", true), __props.description && !isInvalid.value ? (openBlock(), createBlock(unref(ScalarMarkdown), {
52
+ popover: withCtx(() => [createElementVNode("div", _hoisted_2, [invalidParameterMessage.value.ok === false ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(invalidParameterMessage.value.message), 1)) : schemaDetails.value.length ? (openBlock(), createElementBlock("div", _hoisted_4, [(openBlock(true), createElementBlock(Fragment, null, renderList(schemaDetails.value, (detail, index) => {
53
+ return openBlock(), createElementBlock("span", { key: index }, toDisplayString(detail), 1);
54
+ }), 128))])) : createCommentVNode("", true), hasDescription.value && !isInvalid.value ? (openBlock(), createBlock(unref(ScalarMarkdown), {
50
55
  key: 2,
51
56
  value: __props.description
52
57
  }, null, 8, ["value"])) : createCommentVNode("", true)])]),
@@ -63,7 +68,7 @@ var RequestTableTooltip_vue_vue_type_script_setup_true_lang_default = /*@__PURE_
63
68
  class: "text-c-2 hover:text-c-1 size-3.5"
64
69
  }))], 8, _hoisted_1)]),
65
70
  _: 1
66
- });
71
+ })) : createCommentVNode("", true);
67
72
  };
68
73
  }
69
74
  });
@@ -1 +1 @@
1
- {"version":3,"file":"RequestTableTooltip.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_withCtx","_createElementVNode","_createElementBlock","_toDisplayString","_createCommentVNode"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarPopover } from '@scalar/components/popover'\nimport { ScalarIconInfo, ScalarIconWarning } from '@scalar/icons'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed } from 'vue'\n\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { schema, value, description } = defineProps<{\n schema?: SchemaObject\n value: string | File | null\n description?: string\n}>()\n\nconst { translate } = useLocalization()\n\nconst invalidParameterMessage = computed(() => validateParameter(schema, value))\nconst isInvalid = computed(() => invalidParameterMessage.value.ok === false)\n</script>\n<template>\n <ScalarPopover\n :offset=\"4\"\n placement=\"left\"\n teleport>\n <button\n :aria-label=\"\n isInvalid\n ? translate('apiClient.requestTableTooltip.invalid')\n : translate('apiClient.requestTableTooltip.moreInformation')\n \"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 rounded p-1\"\n :role=\"isInvalid ? 'alert' : 'none'\"\n type=\"button\">\n <ScalarIconWarning\n v-if=\"isInvalid\"\n class=\"text-orange size-3.5 brightness-90 hover:brightness-75\" />\n <ScalarIconInfo\n v-else\n class=\"text-c-2 hover:text-c-1 size-3.5\" />\n </button>\n <template #popover>\n <div\n class=\"text-xxs text-c-1 grid w-fit max-w-xs min-w-0 gap-1.5 rounded px-1.5 pt-2 pb-1.5 leading-none break-words\"\n data-testid=\"request-table-tooltip-content\">\n <div\n v-if=\"invalidParameterMessage.ok === false\"\n class=\"text-error-1\">\n {{ invalidParameterMessage.message }}\n </div>\n <div\n v-else-if=\"\n schema &&\n ('type' in schema ||\n 'format' in schema ||\n 'minimum' in schema ||\n 'maximum' in schema ||\n 'default' in schema)\n \"\n class=\"schema text-c-2 truncate *:not-first:before:content-['_·_']\">\n <span v-if=\"'type' in schema\">{{ schema.type }}</span>\n <span v-if=\"'format' in schema\">{{ schema.format }}</span>\n <span v-if=\"'minimum' in schema\"\n >{{ translate('apiClient.requestTableTooltip.min') }}\n {{ schema.minimum }}</span\n >\n <span v-if=\"'maximum' in schema\"\n >{{ translate('apiClient.requestTableTooltip.max') }}\n {{ schema.maximum }}</span\n >\n <span v-if=\"'default' in schema\"\n >{{ translate('apiClient.requestTableTooltip.default') }}\n {{ schema.default }}</span\n >\n </div>\n <ScalarMarkdown\n v-if=\"description && !isInvalid\"\n :value=\"description\" />\n </div>\n </template>\n </ScalarPopover>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,0BAA0B,eAAe,kBAAkB,QAAA,QAAQ,QAAA,KAAK,CAAC;EAC/E,MAAM,YAAY,eAAe,wBAAwB,MAAM,OAAO,KAAK;;GAGzE,OAAAA,UAAA,GAAAC,YA2DgBC,MAAA,aAAA,GAAA;IA1Db,QAAQ;IACT,WAAU;IACV,UAAA;;IAiBW,SAAOC,cAqCV,CApCNC,mBAoCM,OApCN,YAoCM,CAhCI,wBAAA,MAAwB,OAAE,SADlCJ,UAAA,GAAAK,mBAIM,OAJN,YAIMC,gBADD,wBAAA,MAAwB,OAAO,GAAA,CAAA,KAGV,QAAA,WAAiC,UAAA,QAAA,UAAoC,YAAA,QAAA,UAAqC,aAAA,QAAA,UAAqC,aAAA,QAAA,UAAqC,aAAA,QAAA,WAD9MN,UAAA,GAAAK,mBAwBM,OAxBN,YAwBM;KAdkB,UAAA,QAAA,UAAtBL,UAAA,GAAAK,mBAAsD,QAAA,YAAAC,gBAArB,QAAA,OAAO,IAAI,GAAA,CAAA,K;KACpB,YAAA,QAAA,UAAxBN,UAAA,GAAAK,mBAA0D,QAAA,YAAAC,gBAAvB,QAAA,OAAO,MAAM,GAAA,CAAA,K;KACvB,aAAA,QAAA,UAAzBN,UAAA,GAAAK,mBAGC,QAAA,YAAAC,gBAFKJ,MAAA,SAAA,CAAS,CAAA,mCAAA,CAAA,IAAwC,MACrDI,gBAAG,QAAA,OAAO,OAAO,GAAA,CAAA,K;KAEM,aAAA,QAAA,UAAzBN,UAAA,GAAAK,mBAGC,QAAA,YAAAC,gBAFKJ,MAAA,SAAA,CAAS,CAAA,mCAAA,CAAA,IAAwC,MACrDI,gBAAG,QAAA,OAAO,OAAO,GAAA,CAAA,K;KAEM,aAAA,QAAA,UAAzBN,UAAA,GAAAK,mBAGC,QAAA,YAAAC,gBAFKJ,MAAA,SAAA,CAAS,CAAA,uCAAA,CAAA,IAA4C,MACzDI,gBAAG,QAAA,OAAO,OAAO,GAAA,CAAA,K;I,oCAIb,QAAA,eAAW,CAAK,UAAA,SADxBN,UAAA,GAAAC,YAEyBC,MAAA,cAAA,GAAA;;KAAtB,OAAO,QAAA;;IApDd,SAAAC,cAeS,CAfTC,mBAeS,UAAA;KAdN,cAAqB,UAAA,QAAsBF,MAAA,SAAA,CAAS,CAAA,uCAAA,IAAsDA,MAAA,SAAA,CAAS,CAAA,+CAAA;KAKpH,OAAM;KACL,MAAM,UAAA,QAAS,UAAA;KAChB,MAAK;I,IAEG,UAAA,SADRF,UAAA,GAAAC,YAEmEC,MAAA,iBAAA,GAAA;;KAAjE,OAAM;I,OACRF,UAAA,GAAAC,YAE6CC,MAAA,cAAA,GAAA;;KAA3C,OAAM"}
1
+ {"version":3,"file":"RequestTableTooltip.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_unref","_withCtx","_createElementVNode","_createElementBlock","_toDisplayString","_Fragment","_renderList","_createCommentVNode"],"sources":["../../../../../src/v2/blocks/request-block/components/RequestTableTooltip.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarMarkdown } from '@scalar/components/markdown'\nimport { ScalarPopover } from '@scalar/components/popover'\nimport { ScalarIconInfo, ScalarIconWarning } from '@scalar/icons'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport { computed, toDisplayString } from 'vue'\n\nimport { validateParameter } from '@/v2/blocks/request-block/helpers/validate-parameter'\nimport { useLocalization } from '@/v2/features/localization'\n\nconst { schema, value, description } = defineProps<{\n schema?: SchemaObject\n value: string | File | null\n description?: string\n}>()\n\nconst { translate } = useLocalization()\n\nconst invalidParameterMessage = computed(() => validateParameter(schema, value))\nconst isInvalid = computed(() => invalidParameterMessage.value.ok === false)\nconst schemaDetails = computed<string[]>(() => {\n if (!schema) {\n return []\n }\n\n const type = 'type' in schema ? schema.type : undefined\n\n return [\n Array.isArray(type) ? type.join(' | ') : (type ?? ''),\n 'format' in schema ? (schema.format ?? '') : '',\n 'minimum' in schema && schema.minimum !== undefined\n ? `${translate('apiClient.requestTableTooltip.min')} ${schema.minimum}`\n : '',\n 'maximum' in schema && schema.maximum !== undefined\n ? `${translate('apiClient.requestTableTooltip.max')} ${schema.maximum}`\n : '',\n 'default' in schema && schema.default !== undefined\n ? `${translate('apiClient.requestTableTooltip.default')} ${toDisplayString(schema.default)}`\n : '',\n ].filter((detail) => detail.trim().length > 0)\n})\nconst hasDescription = computed<boolean>(() => Boolean(description?.trim()))\nconst hasContent = computed<boolean>(\n () =>\n isInvalid.value || schemaDetails.value.length > 0 || hasDescription.value,\n)\n</script>\n<template>\n <ScalarPopover\n v-if=\"hasContent\"\n :offset=\"4\"\n placement=\"left\"\n teleport>\n <button\n :aria-label=\"\n isInvalid\n ? translate('apiClient.requestTableTooltip.invalid')\n : translate('apiClient.requestTableTooltip.moreInformation')\n \"\n class=\"text-c-2 hover:text-c-1 hover:bg-b-2 rounded p-1\"\n :role=\"isInvalid ? 'alert' : 'none'\"\n type=\"button\">\n <ScalarIconWarning\n v-if=\"isInvalid\"\n class=\"text-orange size-3.5 brightness-90 hover:brightness-75\" />\n <ScalarIconInfo\n v-else\n class=\"text-c-2 hover:text-c-1 size-3.5\" />\n </button>\n <template #popover>\n <div\n class=\"text-xxs text-c-1 grid w-fit max-w-xs min-w-0 gap-1.5 rounded p-1.5 leading-normal wrap-anywhere\"\n data-testid=\"request-table-tooltip-content\">\n <div\n v-if=\"invalidParameterMessage.ok === false\"\n class=\"text-error-1\">\n {{ invalidParameterMessage.message }}\n </div>\n <div\n v-else-if=\"schemaDetails.length\"\n class=\"schema text-c-2 *:not-first:before:content-['_·_']\">\n <span\n v-for=\"(detail, index) in schemaDetails\"\n :key=\"index\"\n >{{ detail }}</span\n >\n </div>\n <ScalarMarkdown\n v-if=\"hasDescription && !isInvalid\"\n :value=\"description\" />\n </div>\n </template>\n </ScalarPopover>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,EAAE,cAAc,gBAAgB;EAEtC,MAAM,0BAA0B,eAAe,kBAAkB,QAAA,QAAQ,QAAA,KAAK,CAAC;EAC/E,MAAM,YAAY,eAAe,wBAAwB,MAAM,OAAO,KAAK;EAC3E,MAAM,gBAAgB,eAAyB;GAC7C,IAAI,CAAC,QAAA,QACH,OAAO,CAAC;GAGV,MAAM,OAAO,UAAU,QAAA,SAAS,QAAA,OAAO,OAAO,KAAA;GAE9C,OAAO;IACL,MAAM,QAAQ,IAAI,IAAI,KAAK,KAAK,KAAK,IAAK,QAAQ;IAClD,YAAY,QAAA,SAAU,QAAA,OAAO,UAAU,KAAM;IAC7C,aAAa,QAAA,UAAU,QAAA,OAAO,YAAY,KAAA,IACtC,GAAG,UAAU,mCAAmC,EAAE,GAAG,QAAA,OAAO,YAC5D;IACJ,aAAa,QAAA,UAAU,QAAA,OAAO,YAAY,KAAA,IACtC,GAAG,UAAU,mC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AAM;I,OACRF,UAAA,GAAAC,YAE6CC,MAAA,cAAA,GAAA;;KAA3C,OAAM"}
@@ -0,0 +1,9 @@
1
+ import type { TableRow } from '../components/RequestTableRow.vue.js';
2
+ /** A visible field with the source rows used to serialize its multipart parts. */
3
+ export type FormBodyField = {
4
+ data: TableRow;
5
+ sourceIndices: number[];
6
+ };
7
+ /** Group uploaded files for array fields without changing stored values or multipart serialization. */
8
+ export declare const groupFormBodyFiles: (rows: TableRow[]) => FormBodyField[];
9
+ //# sourceMappingURL=group-form-body-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group-form-body-files.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/request-block/helpers/group-form-body-files.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAEjE,kFAAkF;AAClF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,QAAQ,CAAA;IACd,aAAa,EAAE,MAAM,EAAE,CAAA;CACxB,CAAA;AAgCD,uGAAuG;AACvG,eAAO,MAAM,kBAAkB,GAAI,MAAM,QAAQ,EAAE,KAAG,aAAa,EA6BlE,CAAA"}
@@ -0,0 +1,60 @@
1
+ import { isArraySchema } from "@scalar/workspace-store/schemas/v3.2/strict/type-guards";
2
+ import { isFileSchema } from "@scalar/workspace-store/helpers/is-file-schema";
3
+ import { resolveSchemaWithAnnotations } from "@scalar/workspace-store/helpers/resolve-schema-with-annotations";
4
+ //#region src/v2/blocks/request-block/helpers/group-form-body-files.ts
5
+ /** Empty fields must keep text editing unless every non-null alternative requires a file. */
6
+ var requiresFile = (input, contentType, ancestors = /* @__PURE__ */ new Set()) => {
7
+ if (!input || ancestors.has(input)) return false;
8
+ const schema = resolveSchemaWithAnnotations(input);
9
+ if (!schema || !isFileSchema(schema, false, contentType)) return false;
10
+ const seen = /* @__PURE__ */ new Set([...ancestors, input]);
11
+ if ("type" in schema || "format" in schema && schema.format === "binary") return true;
12
+ const alternatives = schema.oneOf ?? schema.anyOf;
13
+ if (alternatives?.length) return alternatives.every((member) => {
14
+ const resolved = resolveSchemaWithAnnotations(member);
15
+ return resolved && "type" in resolved && resolved.type === "null" || requiresFile(member, contentType, seen);
16
+ });
17
+ if (schema.allOf?.length) return schema.allOf.some((member) => requiresFile(member, contentType, seen));
18
+ return true;
19
+ };
20
+ /** Group uploaded files for array fields without changing stored values or multipart serialization. */
21
+ var groupFormBodyFiles = (rows) => {
22
+ const fields = [];
23
+ const fileFields = /* @__PURE__ */ new Map();
24
+ rows.forEach((row, index) => {
25
+ const isFileArray = row.schema && isArraySchema(row.schema) && (row.value instanceof File || requiresFile(row.schema.items, row.contentType));
26
+ const canGroup = row.value instanceof File || row.value === "" || row.value === "[]" || row.value === null;
27
+ if (!isFileArray || !canGroup) {
28
+ fields.push({
29
+ data: row,
30
+ sourceIndices: [index]
31
+ });
32
+ return;
33
+ }
34
+ const field = fileFields.get(row.name) ?? {
35
+ data: {
36
+ ...row,
37
+ files: []
38
+ },
39
+ sourceIndices: []
40
+ };
41
+ if (!fileFields.has(row.name)) {
42
+ fields.push(field);
43
+ fileFields.set(row.name, field);
44
+ }
45
+ field.sourceIndices.push(index);
46
+ if (row.value instanceof File) {
47
+ field.data.files?.push({
48
+ file: row.value,
49
+ index,
50
+ isDisabled: row.isDisabled ?? false
51
+ });
52
+ field.data.isDisabled = field.data.files?.every((file) => file.isDisabled) ?? false;
53
+ }
54
+ });
55
+ return fields;
56
+ };
57
+ //#endregion
58
+ export { groupFormBodyFiles };
59
+
60
+ //# sourceMappingURL=group-form-body-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group-form-body-files.js","names":[],"sources":["../../../../../src/v2/blocks/request-block/helpers/group-form-body-files.ts"],"sourcesContent":["import { isFileSchema } from '@scalar/workspace-store/helpers/is-file-schema'\nimport { resolveSchemaWithAnnotations } from '@scalar/workspace-store/helpers/resolve-schema-with-annotations'\nimport type { SchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/openapi-document'\nimport type { MaybeRefSchemaObject } from '@scalar/workspace-store/schemas/v3.2/strict/schema'\nimport { isArraySchema } from '@scalar/workspace-store/schemas/v3.2/strict/type-guards'\n\nimport type { TableRow } from '../components/RequestTableRow.vue'\n\n/** A visible field with the source rows used to serialize its multipart parts. */\nexport type FormBodyField = {\n data: TableRow\n sourceIndices: number[]\n}\n\n/** Empty fields must keep text editing unless every non-null alternative requires a file. */\nconst requiresFile = (\n input: MaybeRefSchemaObject | undefined,\n contentType?: string,\n ancestors = new Set<MaybeRefSchemaObject>(),\n): boolean => {\n if (!input || ancestors.has(input)) {\n return false\n }\n const schema: SchemaObject | undefined = resolveSchemaWithAnnotations(input)\n if (!schema || !isFileSchema(schema, false, contentType)) {\n return false\n }\n const seen = new Set([...ancestors, input])\n if ('type' in schema || ('format' in schema && schema.format === 'binary')) {\n return true\n }\n const alternatives = schema.oneOf ?? schema.anyOf\n if (alternatives?.length) {\n return alternatives.every((member) => {\n const resolved = resolveSchemaWithAnnotations(member)\n return (resolved && 'type' in resolved && resolved.type === 'null') || requiresFile(member, contentType, seen)\n })\n }\n if (schema.allOf?.length) {\n return schema.allOf.some((member) => requiresFile(member, contentType, seen))\n }\n return true\n}\n\n/** Group uploaded files for array fields without changing stored values or multipart serialization. */\nexport const groupFormBodyFiles = (rows: TableRow[]): FormBodyField[] => {\n const fields: FormBodyField[] = []\n const fileFields = new Map<string, FormBodyField>()\n\n rows.forEach((row, index) => {\n const isFileArray =\n row.schema &&\n isArraySchema(row.schema) &&\n (row.value instanceof File || requiresFile(row.schema.items, row.contentType))\n // Preserve editable example values, such as variable expressions, until files are selected.\n const canGroup = row.value instanceof File || row.value === '' || row.value === '[]' || row.value === null\n if (!isFileArray || !canGroup) {\n fields.push({ data: row, sourceIndices: [index] })\n return\n }\n\n const field: FormBodyField = fileFields.get(row.name) ?? { data: { ...row, files: [] }, sourceIndices: [] }\n if (!fileFields.has(row.name)) {\n fields.push(field)\n fileFields.set(row.name, field)\n }\n field.sourceIndices.push(index)\n if (row.value instanceof File) {\n field.data.files?.push({ file: row.value, index, isDisabled: row.isDisabled ?? false })\n field.data.isDisabled = field.data.files?.every((file) => file.isDisabled) ?? false\n }\n })\n\n return fields\n}\n"],"mappings":";;;;;AAeA,IAAM,gBACJ,OACA,aACA,4BAAY,IAAI,IAA0B,MAC9B;CACZ,IAAI,CAAC,SAAS,UAAU,IAAI,KAAK,GAC/B,OAAO;CAET,MAAM,SAAmC,6BAA6B,KAAK;CAC3E,IAAI,CAAC,UAAU,CAAC,aAAa,QAAQ,OAAO,WAAW,GACrD,OAAO;CAET,MAAM,uBAAO,IAAI,IAAI,CAAC,GAAG,WAAW,KAAK,CAAC;CAC1C,IAAI,UAAU,UAAW,YAAY,UAAU,OAAO,WAAW,UAC/D,OAAO;CAET,MAAM,eAAe,OAAO,SAAS,OAAO;CAC5C,IAAI,cAAc,QAChB,OAAO,aAAa,OAAO,WAAW;EACpC,MAAM,WAAW,6BAA6B,MAAM;EACpD,OAAQ,YAAY,UAAU,YAAY,SAAS,SAAS,UAAW,aAAa,QAAQ,aAAa,IAAI;CAC/G,CAAC;CAEH,IAAI,OAAO,OAAO,QAChB,OAAO,OAAO,MAAM,MAAM,WAAW,aAAa,QAAQ,aAAa,IAAI,CAAC;CAE9E,OAAO;AACT;;AAGA,IAAa,sBAAsB,SAAsC;CACvE,MAAM,SAA0B,CAAC;CACjC,MAAM,6BAAa,IAAI,IAA2B;CAElD,KAAK,SAAS,KAAK,UAAU;EAC3B,MAAM,cACJ,IAAI,UACJ,cAAc,IAAI,MAAM,MACvB,IAAI,iBAAiB,QAAQ,aAAa,IAAI,OAAO,OAAO,IAAI,WAAW;EAE9E,MAAM,WAAW,IAAI,iBAAiB,QAAQ,IAAI,UAAU,MAAM,IAAI,UAAU,QAAQ,IAAI,UAAU;EACtG,IAAI,CAAC,eAAe,CAAC,UAAU;GAC7B,OAAO,KAAK;IAAE,MAAM;IAAK,eAAe,CAAC,KAAK;GAAE,CAAC;GACjD;EACF;EAEA,MAAM,QAAuB,WAAW,IAAI,IAAI,IAAI,KAAK;GAAE,MAAM;IAAE,GAAG;IAAK,OAAO,CAAC;GAAE;GAAG,eAAe,CAAC;EAAE;EAC1G,IAAI,CAAC,WAAW,IAAI,IAAI,IAAI,GAAG;GAC7B,OAAO,KAAK,KAAK;GACjB,WAAW,IAAI,IAAI,MAAM,KAAK;EAChC;EACA,MAAM,cAAc,KAAK,KAAK;EAC9B,IAAI,IAAI,iBAAiB,MAAM;GAC7B,MAAM,KAAK,OAAO,KAAK;IAAE,MAAM,IAAI;IAAO;IAAO,YAAY,IAAI,cAAc;GAAM,CAAC;GACtF,MAAM,KAAK,aAAa,MAAM,KAAK,OAAO,OAAO,SAAS,KAAK,UAAU,KAAK;EAChF;CACF,CAAC;CAED,OAAO;AACT"}
@@ -1,7 +1,7 @@
1
1
  import { OpenIDConnectDiscoverySchema } from "./fetch-openid-connect-discovery.js";
2
2
  import { isAllowedOAuthUrl } from "@scalar/helpers/url/is-allowed-oauth-url";
3
3
  import { redirectToProxy } from "@scalar/helpers/url/redirect-to-proxy";
4
- import { coerceValue } from "@scalar/workspace-store/schemas/typebox-coerce";
4
+ import { coerce } from "@scalar/validation";
5
5
  //#region src/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.ts
6
6
  /** Fetches the exact RFC8414 metadata URL, without applying OIDC issuer URL conventions. */
7
7
  var fetchOAuth2Metadata = async (url, proxyUrl, customFetch = fetch) => {
@@ -10,7 +10,7 @@ var fetchOAuth2Metadata = async (url, proxyUrl, customFetch = fetch) => {
10
10
  if (!isAllowedOAuthUrl(metadataUrl)) return [/* @__PURE__ */ new Error("OAuth2 metadata URL must use HTTPS or HTTP for local development URLs"), null];
11
11
  const response = await customFetch(redirectToProxy(proxyUrl, metadataUrl.href));
12
12
  if (!response.ok) return [/* @__PURE__ */ new Error(`Failed to fetch OAuth2 metadata: ${response.status} ${response.statusText}`), null];
13
- const data = coerceValue(OpenIDConnectDiscoverySchema, await response.json());
13
+ const data = coerce(OpenIDConnectDiscoverySchema, await response.json());
14
14
  if (!data.authorization_endpoint && !data.token_endpoint && !data.device_authorization_endpoint) return [/* @__PURE__ */ new Error("Invalid OAuth2 metadata: missing or invalid endpoints"), null];
15
15
  for (const endpoint of [
16
16
  data.authorization_endpoint,
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-oauth2-metadata.js","names":["AuthorizationServerMetadataSchema"],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.ts"],"sourcesContent":["import type { ErrorResponse } from '@scalar/helpers/errors/normalize-error'\nimport { isAllowedOAuthUrl } from '@scalar/helpers/url/is-allowed-oauth-url'\nimport { redirectToProxy } from '@scalar/helpers/url/redirect-to-proxy'\nimport { coerceValue } from '@scalar/workspace-store/schemas/typebox-coerce'\n\nimport type { CustomFetch } from '@/v2/blocks/operation-block/helpers/send-request'\n\n// RFC 8414 and OIDC share these consumed fields; this alias does not imply OIDC issuer semantics.\nimport {\n type OpenIDConnectDiscovery as AuthorizationServerMetadata,\n OpenIDConnectDiscoverySchema as AuthorizationServerMetadataSchema,\n} from './fetch-openid-connect-discovery'\n\n/** Fetches the exact RFC8414 metadata URL, without applying OIDC issuer URL conventions. */\nexport const fetchOAuth2Metadata = async (\n url: string,\n proxyUrl: string,\n customFetch: CustomFetch = fetch,\n): Promise<ErrorResponse<AuthorizationServerMetadata>> => {\n try {\n const metadataUrl = new URL(url.trim())\n if (!isAllowedOAuthUrl(metadataUrl)) {\n return [new Error('OAuth2 metadata URL must use HTTPS or HTTP for local development URLs'), null]\n }\n const response = await customFetch(redirectToProxy(proxyUrl, metadataUrl.href))\n if (!response.ok) {\n return [new Error(`Failed to fetch OAuth2 metadata: ${response.status} ${response.statusText}`), null]\n }\n const data = coerceValue(AuthorizationServerMetadataSchema, await response.json())\n if (!data.authorization_endpoint && !data.token_endpoint && !data.device_authorization_endpoint) {\n return [new Error('Invalid OAuth2 metadata: missing or invalid endpoints'), null]\n }\n for (const endpoint of [data.authorization_endpoint, data.token_endpoint, data.device_authorization_endpoint]) {\n if (endpoint && !isAllowedOAuthUrl(new URL(endpoint))) {\n return [new Error('OAuth2 metadata endpoints must use HTTPS or HTTP for local development URLs'), null]\n }\n }\n return [null, data]\n } catch (error) {\n return [error instanceof Error ? error : new Error('Failed to fetch OAuth2 metadata'), null]\n }\n}\n"],"mappings":";;;;;;AAcA,IAAa,sBAAsB,OACjC,KACA,UACA,cAA2B,UAC6B;CACxD,IAAI;EACF,MAAM,cAAc,IAAI,IAAI,IAAI,KAAK,CAAC;EACtC,IAAI,CAAC,kBAAkB,WAAW,GAChC,OAAO,iBAAC,IAAI,MAAM,uEAAuE,GAAG,IAAI;EAElG,MAAM,WAAW,MAAM,YAAY,gBAAgB,UAAU,YAAY,IAAI,CAAC;EAC9E,IAAI,CAAC,SAAS,IACZ,OAAO,iBAAC,IAAI,MAAM,oCAAoC,SAAS,OAAO,GAAG,SAAS,YAAY,GAAG,IAAI;EAEvG,MAAM,OAAO,YAAYA,8BAAmC,MAAM,SAAS,KAAK,CAAC;EACjF,IAAI,CAAC,KAAK,0BAA0B,CAAC,KAAK,kBAAkB,CAAC,KAAK,+BAChE,OAAO,iBAAC,IAAI,MAAM,uDAAuD,GAAG,IAAI;EAElF,KAAK,MAAM,YAAY;GAAC,KAAK;GAAwB,KAAK;GAAgB,KAAK;EAA6B,GAC1G,IAAI,YAAY,CAAC,kBAAkB,IAAI,IAAI,QAAQ,CAAC,GAClD,OAAO,iBAAC,IAAI,MAAM,6EAA6E,GAAG,IAAI;EAG1G,OAAO,CAAC,MAAM,IAAI;CACpB,SAAS,OAAO;EACd,OAAO,CAAC,iBAAiB,QAAQ,wBAAQ,IAAI,MAAM,iCAAiC,GAAG,IAAI;CAC7F;AACF"}
1
+ {"version":3,"file":"fetch-oauth2-metadata.js","names":["AuthorizationServerMetadataSchema"],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/fetch-oauth2-metadata.ts"],"sourcesContent":["import type { ErrorResponse } from '@scalar/helpers/errors/normalize-error'\nimport { isAllowedOAuthUrl } from '@scalar/helpers/url/is-allowed-oauth-url'\nimport { redirectToProxy } from '@scalar/helpers/url/redirect-to-proxy'\nimport { coerce } from '@scalar/validation'\n\nimport type { CustomFetch } from '@/v2/blocks/operation-block/helpers/send-request'\n\n// RFC 8414 and OIDC share these consumed fields; this alias does not imply OIDC issuer semantics.\nimport {\n type OpenIDConnectDiscovery as AuthorizationServerMetadata,\n OpenIDConnectDiscoverySchema as AuthorizationServerMetadataSchema,\n} from './fetch-openid-connect-discovery'\n\n/** Fetches the exact RFC8414 metadata URL, without applying OIDC issuer URL conventions. */\nexport const fetchOAuth2Metadata = async (\n url: string,\n proxyUrl: string,\n customFetch: CustomFetch = fetch,\n): Promise<ErrorResponse<AuthorizationServerMetadata>> => {\n try {\n const metadataUrl = new URL(url.trim())\n if (!isAllowedOAuthUrl(metadataUrl)) {\n return [new Error('OAuth2 metadata URL must use HTTPS or HTTP for local development URLs'), null]\n }\n const response = await customFetch(redirectToProxy(proxyUrl, metadataUrl.href))\n if (!response.ok) {\n return [new Error(`Failed to fetch OAuth2 metadata: ${response.status} ${response.statusText}`), null]\n }\n const data = coerce(AuthorizationServerMetadataSchema, await response.json())\n if (!data.authorization_endpoint && !data.token_endpoint && !data.device_authorization_endpoint) {\n return [new Error('Invalid OAuth2 metadata: missing or invalid endpoints'), null]\n }\n for (const endpoint of [data.authorization_endpoint, data.token_endpoint, data.device_authorization_endpoint]) {\n if (endpoint && !isAllowedOAuthUrl(new URL(endpoint))) {\n return [new Error('OAuth2 metadata endpoints must use HTTPS or HTTP for local development URLs'), null]\n }\n }\n return [null, data]\n } catch (error) {\n return [error instanceof Error ? error : new Error('Failed to fetch OAuth2 metadata'), null]\n }\n}\n"],"mappings":";;;;;;AAcA,IAAa,sBAAsB,OACjC,KACA,UACA,cAA2B,UAC6B;CACxD,IAAI;EACF,MAAM,cAAc,IAAI,IAAI,IAAI,KAAK,CAAC;EACtC,IAAI,CAAC,kBAAkB,WAAW,GAChC,OAAO,iBAAC,IAAI,MAAM,uEAAuE,GAAG,IAAI;EAElG,MAAM,WAAW,MAAM,YAAY,gBAAgB,UAAU,YAAY,IAAI,CAAC;EAC9E,IAAI,CAAC,SAAS,IACZ,OAAO,iBAAC,IAAI,MAAM,oCAAoC,SAAS,OAAO,GAAG,SAAS,YAAY,GAAG,IAAI;EAEvG,MAAM,OAAO,OAAOA,8BAAmC,MAAM,SAAS,KAAK,CAAC;EAC5E,IAAI,CAAC,KAAK,0BAA0B,CAAC,KAAK,kBAAkB,CAAC,KAAK,+BAChE,OAAO,iBAAC,IAAI,MAAM,uDAAuD,GAAG,IAAI;EAElF,KAAK,MAAM,YAAY;GAAC,KAAK;GAAwB,KAAK;GAAgB,KAAK;EAA6B,GAC1G,IAAI,YAAY,CAAC,kBAAkB,IAAI,IAAI,QAAQ,CAAC,GAClD,OAAO,iBAAC,IAAI,MAAM,6EAA6E,GAAG,IAAI;EAG1G,OAAO,CAAC,MAAM,IAAI;CACpB,SAAS,OAAO;EACd,OAAO,CAAC,iBAAiB,QAAQ,wBAAQ,IAAI,MAAM,iCAAiC,GAAG,IAAI;CAC7F;AACF"}
@@ -1,5 +1,5 @@
1
1
  import type { ErrorResponse } from '@scalar/helpers/errors/normalize-error';
2
- import { type Static } from '@scalar/typebox';
2
+ import { type Static } from '@scalar/validation';
3
3
  import type { CustomFetch } from '../../operation-block/helpers/send-request.js';
4
4
  /**
5
5
  * OpenID Connect Discovery Document (subset)
@@ -7,19 +7,19 @@ import type { CustomFetch } from '../../operation-block/helpers/send-request.js'
7
7
  *
8
8
  * @see https://openid.net/specs/openid-connect-discovery-1_0.html
9
9
  */
10
- export declare const OpenIDConnectDiscoverySchema: import("@scalar/typebox").TObject<{
10
+ export declare const OpenIDConnectDiscoverySchema: import("@scalar/validation").ObjectSchema<{
11
11
  /** URL of the OAuth 2.0 Authorization Endpoint */
12
- authorization_endpoint: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
12
+ authorization_endpoint: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
13
13
  /** RFC8628 device authorization endpoint. */
14
- device_authorization_endpoint: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
14
+ device_authorization_endpoint: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
15
15
  /** URL of the OAuth 2.0 Token Endpoint */
16
- token_endpoint: import("@scalar/typebox").TOptional<import("@scalar/typebox").TString>;
16
+ token_endpoint: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
17
17
  /** List of OAuth 2.0 scope values that this server supports */
18
- scopes_supported: import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TString>>;
18
+ scopes_supported: import("@scalar/validation").OptionalSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").StringSchema>>;
19
19
  /** List of OAuth 2.0 grant type values that this server supports */
20
- grant_types_supported: import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TString>>;
20
+ grant_types_supported: import("@scalar/validation").OptionalSchema<import("@scalar/validation").EvaluateSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").StringSchema>>>;
21
21
  /** Supported PKCE code challenge methods (RFC 7636) */
22
- code_challenge_methods_supported: import("@scalar/typebox").TOptional<import("@scalar/typebox").TArray<import("@scalar/typebox").TString>>;
22
+ code_challenge_methods_supported: import("@scalar/validation").OptionalSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").StringSchema>>;
23
23
  }>;
24
24
  export type OpenIDConnectDiscovery = Static<typeof OpenIDConnectDiscoverySchema>;
25
25
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-openid-connect-discovery.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAE3E,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,iBAAiB,CAAA;AAGnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAA;AAEnF;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B;IACvC,kDAAkD;;IAElD,6CAA6C;;IAE7C,0CAA0C;;IAE1C,+DAA+D;;IAE/D,oEAAoE;;IAEpE,uDAAuD;;EAEvD,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEhF;;;GAGG;AACH,eAAO,MAAM,YAAY,WAAW,CAAA;AAEpC;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,GACtC,KAAK,MAAM,EACX,UAAU,MAAM,EAChB,cAAa,WAAmB,KAC/B,OAAO,CAAC,aAAa,CAAC,sBAAsB,CAAC,CA2C/C,CAAA"}
1
+ {"version":3,"file":"fetch-openid-connect-discovery.d.ts","sourceRoot":"","sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAE3E,OAAO,EAAE,KAAK,MAAM,EAAqD,MAAM,oBAAoB,CAAA;AAEnG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAA;AAEnF;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B;IACvC,kDAAkD;;IAElD,6CAA6C;;IAE7C,0CAA0C;;IAE1C,+DAA+D;;IAE/D,oEAAoE;;IAOpE,uDAAuD;;EAEvD,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEhF;;;GAGG;AACH,eAAO,MAAM,YAAY,WAAW,CAAA;AAEpC;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,GACtC,KAAK,MAAM,EACX,UAAU,MAAM,EAChB,cAAa,WAAmB,KAC/B,OAAO,CAAC,aAAa,CAAC,sBAAsB,CAAC,CA2C/C,CAAA"}
@@ -1,6 +1,5 @@
1
1
  import { redirectToProxy } from "@scalar/helpers/url/redirect-to-proxy";
2
- import { coerceValue } from "@scalar/workspace-store/schemas/typebox-coerce";
3
- import { Type } from "@scalar/typebox";
2
+ import { array, coerce, evaluate, object, optional, string } from "@scalar/validation";
4
3
  //#region src/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.ts
5
4
  /**
6
5
  * OpenID Connect Discovery Document (subset)
@@ -8,19 +7,19 @@ import { Type } from "@scalar/typebox";
8
7
  *
9
8
  * @see https://openid.net/specs/openid-connect-discovery-1_0.html
10
9
  */
11
- var OpenIDConnectDiscoverySchema = Type.Object({
10
+ var OpenIDConnectDiscoverySchema = object({
12
11
  /** URL of the OAuth 2.0 Authorization Endpoint */
13
- authorization_endpoint: Type.Optional(Type.String()),
12
+ authorization_endpoint: optional(string()),
14
13
  /** RFC8628 device authorization endpoint. */
15
- device_authorization_endpoint: Type.Optional(Type.String()),
14
+ device_authorization_endpoint: optional(string()),
16
15
  /** URL of the OAuth 2.0 Token Endpoint */
17
- token_endpoint: Type.Optional(Type.String()),
16
+ token_endpoint: optional(string()),
18
17
  /** List of OAuth 2.0 scope values that this server supports */
19
- scopes_supported: Type.Optional(Type.Array(Type.String())),
18
+ scopes_supported: optional(array(string())),
20
19
  /** List of OAuth 2.0 grant type values that this server supports */
21
- grant_types_supported: Type.Optional(Type.Array(Type.String())),
20
+ grant_types_supported: optional(evaluate((value) => Array.isArray(value) ? value.filter((item) => typeof item === "string" && item.length > 0) : value, array(string()))),
22
21
  /** Supported PKCE code challenge methods (RFC 7636) */
23
- code_challenge_methods_supported: Type.Optional(Type.Array(Type.String()))
22
+ code_challenge_methods_supported: optional(array(string()))
24
23
  });
25
24
  /**
26
25
  * Fetches the OpenID Connect discovery document from the specified URL.
@@ -39,7 +38,7 @@ var fetchOpenIDConnectDiscovery = async (url, proxyUrl, customFetch = fetch) =>
39
38
  if (!discoveryUrl.includes("/.well-known/openid-configuration")) discoveryUrl = `${discoveryUrl}/.well-known/openid-configuration`;
40
39
  const response = await customFetch(redirectToProxy(proxyUrl, discoveryUrl));
41
40
  if (!response.ok) return [/* @__PURE__ */ new Error(`Failed to fetch OpenID Connect discovery document: ${response.status} ${response.statusText}`), null];
42
- const data = coerceValue(OpenIDConnectDiscoverySchema, await response.json());
41
+ const data = coerce(OpenIDConnectDiscoverySchema, await response.json());
43
42
  if (!data.authorization_endpoint && !data.token_endpoint) return [/* @__PURE__ */ new Error("Invalid OpenID Connect discovery document: missing required endpoints"), null];
44
43
  return [null, data];
45
44
  } catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-openid-connect-discovery.js","names":[],"sources":["../../../../../src/v2/blocks/scalar-auth-selector-block/helpers/fetch-openid-connect-discovery.ts"],"sourcesContent":["import type { ErrorResponse } from '@scalar/helpers/errors/normalize-error'\nimport { redirectToProxy } from '@scalar/helpers/url/redirect-to-proxy'\nimport { type Static, Type } from '@scalar/typebox'\nimport { coerceValue } from '@scalar/workspace-store/schemas/typebox-coerce'\n\nimport type { CustomFetch } from '@/v2/blocks/operation-block/helpers/send-request'\n\n/**\n * OpenID Connect Discovery Document (subset)\n * Represents the metadata fields consumed by the auth selector flow conversion.\n *\n * @see https://openid.net/specs/openid-connect-discovery-1_0.html\n */\nexport const OpenIDConnectDiscoverySchema = Type.Object({\n /** URL of the OAuth 2.0 Authorization Endpoint */\n authorization_endpoint: Type.Optional(Type.String()),\n /** RFC8628 device authorization endpoint. */\n device_authorization_endpoint: Type.Optional(Type.String()),\n /** URL of the OAuth 2.0 Token Endpoint */\n token_endpoint: Type.Optional(Type.String()),\n /** List of OAuth 2.0 scope values that this server supports */\n scopes_supported: Type.Optional(Type.Array(Type.String())),\n /** List of OAuth 2.0 grant type values that this server supports */\n grant_types_supported: Type.Optional(Type.Array(Type.String())),\n /** Supported PKCE code challenge methods (RFC 7636) */\n code_challenge_methods_supported: Type.Optional(Type.Array(Type.String())),\n})\n\nexport type OpenIDConnectDiscovery = Static<typeof OpenIDConnectDiscoverySchema>\n\n/**\n * The required scope for OpenID Connect requests.\n * If this scope is present, the request is an OIDC request; otherwise, it is a standard OAuth 2.0 request.\n */\nexport const OPENID_SCOPE = 'openid'\n\n/**\n * Fetches the OpenID Connect discovery document from the specified URL.\n * Supports both full discovery URLs and issuer URLs.\n *\n * @param url - The OpenID Connect discovery URL or issuer URL\n * @param proxyUrl - Optional CORS proxy to route the request through\n * @param customFetch - Fetch used for the discovery request; the desktop app passes an IPC-backed fetch so it leaves the renderer's network stack.\n * @returns The discovery document or an error\n */\nexport const fetchOpenIDConnectDiscovery = async (\n url: string,\n proxyUrl: string,\n customFetch: CustomFetch = fetch,\n): Promise<ErrorResponse<OpenIDConnectDiscovery>> => {\n try {\n // If the URL does not end with the well-known path, append it\n let discoveryUrl = url.trim()\n\n if (!discoveryUrl) {\n return [new Error('URL cannot be empty'), null]\n }\n\n // Remove trailing slash if present\n if (discoveryUrl.endsWith('/')) {\n discoveryUrl = discoveryUrl.slice(0, -1)\n }\n\n // If the URL does not already include the well-known path, append it\n if (!discoveryUrl.includes('/.well-known/openid-configuration')) {\n discoveryUrl = `${discoveryUrl}/.well-known/openid-configuration`\n }\n\n const proxiedUrl = redirectToProxy(proxyUrl, discoveryUrl)\n const response = await customFetch(proxiedUrl)\n\n if (!response.ok) {\n return [\n new Error(`Failed to fetch OpenID Connect discovery document: ${response.status} ${response.statusText}`),\n null,\n ]\n }\n\n const data = coerceValue(OpenIDConnectDiscoverySchema, await response.json())\n\n // Validate that we have the essential fields\n if (!data.authorization_endpoint && !data.token_endpoint) {\n return [new Error('Invalid OpenID Connect discovery document: missing required endpoints'), null]\n }\n\n return [null, data]\n } catch (error) {\n if (error instanceof Error) {\n return [error, null]\n }\n return [new Error('Failed to fetch OpenID Connect discovery document'), null]\n }\n}\n"],"mappings":";;;;;;;;;;AAaA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-auth-selector-block/helpers/fetch-openid-connect-discovery.ts"],"sourcesContent":["import type { ErrorResponse } from '@scalar/helpers/errors/normalize-error'\nimport { redirectToProxy } from '@scalar/helpers/url/redirect-to-proxy'\nimport { type Static, array, coerce, evaluate, object, optional, string } from '@scalar/validation'\n\nimport type { CustomFetch } from '@/v2/blocks/operation-block/helpers/send-request'\n\n/**\n * OpenID Connect Discovery Document (subset)\n * Represents the metadata fields consumed by the auth selector flow conversion.\n *\n * @see https://openid.net/specs/openid-connect-discovery-1_0.html\n */\nexport const OpenIDConnectDiscoverySchema = object({\n /** URL of the OAuth 2.0 Authorization Endpoint */\n authorization_endpoint: optional(string()),\n /** RFC8628 device authorization endpoint. */\n device_authorization_endpoint: optional(string()),\n /** URL of the OAuth 2.0 Token Endpoint */\n token_endpoint: optional(string()),\n /** List of OAuth 2.0 scope values that this server supports */\n scopes_supported: optional(array(string())),\n /** List of OAuth 2.0 grant type values that this server supports */\n grant_types_supported: optional(\n evaluate(\n (value) => (Array.isArray(value) ? value.filter((item) => typeof item === 'string' && item.length > 0) : value),\n array(string()),\n ),\n ),\n /** Supported PKCE code challenge methods (RFC 7636) */\n code_challenge_methods_supported: optional(array(string())),\n})\n\nexport type OpenIDConnectDiscovery = Static<typeof OpenIDConnectDiscoverySchema>\n\n/**\n * The required scope for OpenID Connect requests.\n * If this scope is present, the request is an OIDC request; otherwise, it is a standard OAuth 2.0 request.\n */\nexport const OPENID_SCOPE = 'openid'\n\n/**\n * Fetches the OpenID Connect discovery document from the specified URL.\n * Supports both full discovery URLs and issuer URLs.\n *\n * @param url - The OpenID Connect discovery URL or issuer URL\n * @param proxyUrl - Optional CORS proxy to route the request through\n * @param customFetch - Fetch used for the discovery request; the desktop app passes an IPC-backed fetch so it leaves the renderer's network stack.\n * @returns The discovery document or an error\n */\nexport const fetchOpenIDConnectDiscovery = async (\n url: string,\n proxyUrl: string,\n customFetch: CustomFetch = fetch,\n): Promise<ErrorResponse<OpenIDConnectDiscovery>> => {\n try {\n // If the URL does not end with the well-known path, append it\n let discoveryUrl = url.trim()\n\n if (!discoveryUrl) {\n return [new Error('URL cannot be empty'), null]\n }\n\n // Remove trailing slash if present\n if (discoveryUrl.endsWith('/')) {\n discoveryUrl = discoveryUrl.slice(0, -1)\n }\n\n // If the URL does not already include the well-known path, append it\n if (!discoveryUrl.includes('/.well-known/openid-configuration')) {\n discoveryUrl = `${discoveryUrl}/.well-known/openid-configuration`\n }\n\n const proxiedUrl = redirectToProxy(proxyUrl, discoveryUrl)\n const response = await customFetch(proxiedUrl)\n\n if (!response.ok) {\n return [\n new Error(`Failed to fetch OpenID Connect discovery document: ${response.status} ${response.statusText}`),\n null,\n ]\n }\n\n const data = coerce(OpenIDConnectDiscoverySchema, await response.json())\n\n // Validate that we have the essential fields\n if (!data.authorization_endpoint && !data.token_endpoint) {\n return [new Error('Invalid OpenID Connect discovery document: missing required endpoints'), null]\n }\n\n return [null, data]\n } catch (error) {\n if (error instanceof Error) {\n return [error, null]\n }\n return [new Error('Failed to fetch OpenID Connect discovery document'), null]\n }\n}\n"],"mappings":";;;;;;;;;AAYA,IAAa,+BAA+B,OAAO;;CAEjD,wBAAwB,SAAS,OAAO,CAAC;;CAEzC,+BAA+B,SAAS,OAAO,CAAC;;CAEhD,gBAAgB,SAAS,OAAO,CAAC;;CAEjC,kBAAkB,SAAS,MAAM,OAAO,CAAC,CAAC;;CAE1C,uBAAuB,SACrB,UACG,UAAW,MAAM,QAAQ,KAAK,IAAI,MAAM,QAAQ,SAAS,OAAO,SAAS,YAAY,KAAK,SAAS,CAAC,IAAI,OACzG,MAAM,OAAO,CAAC,CAChB,CACF;;CAEA,kCAAkC,SAAS,MAAM,OAAO,CAAC,CAAC;AAC5D,CAAC;;;;;;;;;;AAmBD,IAAa,8BAA8B,OACzC,KACA,UACA,cAA2B,UACwB;CACnD,IAAI;EAEF,IAAI,eAAe,IAAI,KAAK;EAE5B,IAAI,CAAC,cACH,OAAO,iBAAC,IAAI,MAAM,qBAAqB,GAAG,IAAI;EAIhD,IAAI,aAAa,SAAS,GAAG,GAC3B,eAAe,aAAa,MAAM,GAAG,EAAE;EAIzC,IAAI,CAAC,aAAa,SAAS,mCAAmC,GAC5D,eAAe,GAAG,aAAa;EAIjC,MAAM,WAAW,MAAM,YADJ,gBAAgB,UAAU,YACV,CAAU;EAE7C,IAAI,CAAC,SAAS,IACZ,OAAO,iBACL,IAAI,MAAM,sDAAsD,SAAS,OAAO,GAAG,SAAS,YAAY,GACxG,IACF;EAGF,MAAM,OAAO,OAAO,8BAA8B,MAAM,SAAS,KAAK,CAAC;EAGvE,IAAI,CAAC,KAAK,0BAA0B,CAAC,KAAK,gBACxC,OAAO,iBAAC,IAAI,MAAM,uEAAuE,GAAG,IAAI;EAGlG,OAAO,CAAC,MAAM,IAAI;CACpB,SAAS,OAAO;EACd,IAAI,iBAAiB,OACnB,OAAO,CAAC,OAAO,IAAI;EAErB,OAAO,iBAAC,IAAI,MAAM,mDAAmD,GAAG,IAAI;CAC9E;AACF"}
@@ -1,5 +1,5 @@
1
- import { coerceValue } from "@scalar/workspace-store/schemas/typebox-coerce";
2
1
  import { OpenIDConnectSchema } from "@scalar/workspace-store/entities/auth";
2
+ import { coerceValue } from "@scalar/workspace-store/schemas/typebox-coerce";
3
3
  //#region src/v2/blocks/scalar-auth-selector-block/helpers/openid-discovery-to-flows.ts
4
4
  /** Takes in an open ID Connect discovery response and converts it into an oauth flow to be used for authorization */
5
5
  var openIDDiscoveryToFlows = (discovery) => {
@@ -1,6 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  modelValue: boolean;
3
3
  disabled?: boolean;
4
+ indeterminate?: boolean;
4
5
  align?: 'left' | 'center';
5
6
  ariaLabel?: string;
6
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableCheckbox.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableCheckbox.vue"],"names":[],"mappings":"AAqEA,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC;AAmHJ,QAAA,MAAM,YAAY;;;;;WArHN,MAAM,GAAG,QAAQ;6EAyH3B,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"DataTableCheckbox.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/data-table/DataTableCheckbox.vue"],"names":[],"mappings":"AA8EA,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC;AAsIJ,QAAA,MAAM,YAAY;;;;;WAxIN,MAAM,GAAG,QAAQ;6EA4I3B,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableCheckbox.vue.js","names":["_sfc_main"],"sources":["../../../../src/v2/components/data-table/DataTableCheckbox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { cva } from '@scalar/use-hooks/useBindCx'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nimport DataTableCell from './DataTableCell.vue'\n\nwithDefaults(\n defineProps<{\n modelValue: boolean\n disabled?: boolean\n align?: 'left' | 'center'\n ariaLabel?: string\n }>(),\n {\n align: 'center',\n },\n)\n\ndefineEmits<{\n (e: 'update:modelValue', v: boolean): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst variants = cva({\n base: 'w-8 h-8 flex items-center justify-center text-b-2 peer-checked:text-c-1 pointer-events-none absolute',\n variants: {\n align: {\n left: 'left-0',\n center: 'centered',\n },\n },\n})\n</script>\n<template>\n <DataTableCell class=\"group/cell relative flex min-w-8\">\n <input\n :aria-label=\"ariaLabel ?? translate('apiClient.dataTableCheckbox.toggle')\"\n :checked=\"modelValue\"\n class=\"peer absolute inset-0 size-full cursor-pointer opacity-0 disabled:cursor-default\"\n :disabled=\"Boolean(disabled)\"\n type=\"checkbox\"\n @change=\"(e: any) => $emit('update:modelValue', e.target.checked)\" />\n <div :class=\"variants({ align })\">\n <div\n class=\"absolute m-auto size-3/4 rounded border-[1px] opacity-0\"\n :class=\"\n !disabled &&\n 'group-has-[:focus-visible]/cell:border-c-accent group-hover:opacity-100 group-has-[:focus-visible]/cell:opacity-100'\n \" />\n <ScalarIcon\n icon=\"Checkmark\"\n size=\"xs\"\n thickness=\"2.5\" />\n </div>\n </DataTableCell>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"DataTableCheckbox.vue.js","names":["_sfc_main"],"sources":["../../../../src/v2/components/data-table/DataTableCheckbox.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon } from '@scalar/components/icon'\nimport { ScalarIconMinus } from '@scalar/icons'\nimport { cva } from '@scalar/use-hooks/useBindCx'\n\nimport { useLocalization } from '@/v2/features/localization'\n\nimport DataTableCell from './DataTableCell.vue'\n\nwithDefaults(\n defineProps<{\n modelValue: boolean\n disabled?: boolean\n indeterminate?: boolean\n align?: 'left' | 'center'\n ariaLabel?: string\n }>(),\n {\n align: 'center',\n },\n)\n\ndefineEmits<{\n (e: 'update:modelValue', v: boolean): void\n}>()\n\nconst { translate } = useLocalization()\n\nconst variants = cva({\n base: 'w-8 h-8 flex items-center justify-center text-b-2 peer-checked:text-c-1 pointer-events-none absolute',\n variants: {\n align: {\n left: 'left-0',\n center: 'centered',\n },\n },\n})\n</script>\n<template>\n <DataTableCell class=\"group/cell relative flex min-w-8\">\n <input\n :aria-checked=\"indeterminate ? 'mixed' : modelValue\"\n :aria-label=\"ariaLabel ?? translate('apiClient.dataTableCheckbox.toggle')\"\n :checked=\"modelValue\"\n class=\"peer absolute inset-0 size-full cursor-pointer opacity-0 disabled:cursor-default\"\n :disabled=\"Boolean(disabled)\"\n :indeterminate=\"indeterminate\"\n type=\"checkbox\"\n @change=\"(e: any) => $emit('update:modelValue', e.target.checked)\" />\n <div :class=\"variants({ align })\">\n <div\n class=\"absolute m-auto size-3/4 rounded border-[1px] opacity-0\"\n :class=\"\n !disabled &&\n 'group-has-[:focus-visible]/cell:border-c-accent group-hover:opacity-100 group-has-[:focus-visible]/cell:opacity-100'\n \" />\n <ScalarIconMinus\n v-if=\"indeterminate\"\n class=\"text-c-1 size-3\" />\n <ScalarIcon\n v-else\n icon=\"Checkmark\"\n size=\"xs\"\n thickness=\"2.5\" />\n </div>\n </DataTableCell>\n</template>\n"],"mappings":""}