@scalar/api-reference 1.49.8 → 1.51.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 (95) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/browser/standalone.js +192 -190
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/ApiReference.vue.d.ts.map +1 -1
  5. package/dist/components/ApiReference.vue.js +1 -1
  6. package/dist/components/ApiReference.vue.js.map +1 -1
  7. package/dist/components/ApiReference.vue.script.js +50 -15
  8. package/dist/components/ApiReference.vue.script.js.map +1 -1
  9. package/dist/components/Content/Auth/Auth.vue.d.ts +1 -1
  10. package/dist/components/Content/Auth/Auth.vue.d.ts.map +1 -1
  11. package/dist/components/Content/Auth/Auth.vue.js.map +1 -1
  12. package/dist/components/Content/Auth/Auth.vue.script.js +3 -14
  13. package/dist/components/Content/Auth/Auth.vue.script.js.map +1 -1
  14. package/dist/components/Content/Content.vue.d.ts +1 -0
  15. package/dist/components/Content/Content.vue.d.ts.map +1 -1
  16. package/dist/components/Content/Content.vue.js.map +1 -1
  17. package/dist/components/Content/Content.vue.script.js +7 -8
  18. package/dist/components/Content/Content.vue.script.js.map +1 -1
  19. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts +1 -1
  20. package/dist/components/Content/Operations/TraversedEntry.vue.d.ts.map +1 -1
  21. package/dist/components/Content/Operations/TraversedEntry.vue.js.map +1 -1
  22. package/dist/components/Content/Operations/TraversedEntry.vue.script.js +1 -1
  23. package/dist/components/Content/Operations/TraversedEntry.vue.script.js.map +1 -1
  24. package/dist/components/Content/Tags/components/ClassicLayout.vue.d.ts.map +1 -1
  25. package/dist/components/Content/Tags/components/ClassicLayout.vue.js +1 -1
  26. package/dist/components/Content/Tags/components/ClassicLayout.vue.js.map +1 -1
  27. package/dist/components/Content/Tags/components/ClassicLayout.vue.script.js +9 -5
  28. package/dist/components/Content/Tags/components/ClassicLayout.vue.script.js.map +1 -1
  29. package/dist/features/Operation/Operation.vue.d.ts +1 -1
  30. package/dist/features/Operation/Operation.vue.d.ts.map +1 -1
  31. package/dist/features/Operation/Operation.vue.js.map +1 -1
  32. package/dist/features/Operation/Operation.vue.script.js +1 -1
  33. package/dist/features/Operation/Operation.vue.script.js.map +1 -1
  34. package/dist/features/Operation/helpers/filter-selected-security.d.ts +2 -1
  35. package/dist/features/Operation/helpers/filter-selected-security.d.ts.map +1 -1
  36. package/dist/features/Operation/helpers/filter-selected-security.js +1 -2
  37. package/dist/features/Operation/helpers/filter-selected-security.js.map +1 -1
  38. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts +1 -1
  39. package/dist/features/Operation/layouts/ClassicLayout.vue.d.ts.map +1 -1
  40. package/dist/features/Operation/layouts/ClassicLayout.vue.js +1 -1
  41. package/dist/features/Operation/layouts/ClassicLayout.vue.js.map +1 -1
  42. package/dist/features/Operation/layouts/ClassicLayout.vue.script.js.map +1 -1
  43. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts +1 -1
  44. package/dist/features/Operation/layouts/ModernLayout.vue.d.ts.map +1 -1
  45. package/dist/features/Operation/layouts/ModernLayout.vue.js +1 -1
  46. package/dist/features/Operation/layouts/ModernLayout.vue.js.map +1 -1
  47. package/dist/features/Operation/layouts/ModernLayout.vue.script.js.map +1 -1
  48. package/dist/features/Search/helpers/create-fuse-instance.d.ts.map +1 -1
  49. package/dist/features/Search/helpers/create-fuse-instance.js +4 -0
  50. package/dist/features/Search/helpers/create-fuse-instance.js.map +1 -1
  51. package/dist/features/Search/helpers/create-search-index.d.ts.map +1 -1
  52. package/dist/features/Search/helpers/create-search-index.js +41 -4
  53. package/dist/features/Search/helpers/create-search-index.js.map +1 -1
  54. package/dist/features/Search/types.d.ts +1 -0
  55. package/dist/features/Search/types.d.ts.map +1 -1
  56. package/dist/features/example-responses/ExampleResponse.vue.d.ts.map +1 -1
  57. package/dist/features/example-responses/ExampleResponse.vue.js +1 -1
  58. package/dist/features/example-responses/ExampleResponse.vue.js.map +1 -1
  59. package/dist/features/example-responses/ExampleResponse.vue.script.js +2 -1
  60. package/dist/features/example-responses/ExampleResponse.vue.script.js.map +1 -1
  61. package/dist/features/example-responses/ExampleResponses.vue.js +1 -1
  62. package/dist/features/example-responses/ExampleResponses.vue.js.map +1 -1
  63. package/dist/features/example-responses/ExampleResponses.vue.script.js +1 -1
  64. package/dist/features/example-responses/ExampleResponses.vue.script.js.map +1 -1
  65. package/dist/features/external-docs/ExternalDocs.vue.d.ts +2 -2
  66. package/dist/features/external-docs/ExternalDocs.vue.d.ts.map +1 -1
  67. package/dist/features/external-docs/ExternalDocs.vue.js.map +1 -1
  68. package/dist/features/external-docs/ExternalDocs.vue.script.js.map +1 -1
  69. package/dist/features/info-object/Contact.vue.d.ts +2 -2
  70. package/dist/features/info-object/Contact.vue.d.ts.map +1 -1
  71. package/dist/features/info-object/Contact.vue.js.map +1 -1
  72. package/dist/features/info-object/Contact.vue.script.js.map +1 -1
  73. package/dist/features/info-object/License.vue.d.ts +2 -2
  74. package/dist/features/info-object/License.vue.d.ts.map +1 -1
  75. package/dist/features/info-object/License.vue.js.map +1 -1
  76. package/dist/features/info-object/License.vue.script.js.map +1 -1
  77. package/dist/features/info-object/TermsOfService.vue.d.ts +2 -2
  78. package/dist/features/info-object/TermsOfService.vue.d.ts.map +1 -1
  79. package/dist/features/info-object/TermsOfService.vue.js.map +1 -1
  80. package/dist/features/info-object/TermsOfService.vue.script.js.map +1 -1
  81. package/dist/helpers/openapi.d.ts +2 -5
  82. package/dist/helpers/openapi.d.ts.map +1 -1
  83. package/dist/helpers/openapi.js +25 -19
  84. package/dist/helpers/openapi.js.map +1 -1
  85. package/dist/helpers/safe-deep-clone.d.ts +17 -0
  86. package/dist/helpers/safe-deep-clone.d.ts.map +1 -0
  87. package/dist/helpers/safe-deep-clone.js +25 -0
  88. package/dist/helpers/safe-deep-clone.js.map +1 -0
  89. package/dist/helpers/storage.d.ts +5 -5
  90. package/dist/style.css +321 -364
  91. package/package.json +20 -21
  92. package/dist/components/Content/Auth/helpers/get-default-security.d.ts +0 -18
  93. package/dist/components/Content/Auth/helpers/get-default-security.d.ts.map +0 -1
  94. package/dist/components/Content/Auth/helpers/get-default-security.js +0 -64
  95. package/dist/components/Content/Auth/helpers/get-default-security.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Contact.vue.js","names":[],"sources":["../../../src/features/info-object/Contact.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { cva } from '@scalar/components'\nimport { ScalarIconEnvelopeSimple } from '@scalar/icons'\nimport { type OpenAPIV3_1 } from '@scalar/openapi-types'\n\nconst variants = cva({\n base: 'text-c-1 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 group-last:mr-0 xl:border-none',\n variants: {\n link: {\n true: 'no-underline hover:bg-b-2',\n },\n },\n})\n\ndefineProps<{\n value?: OpenAPIV3_1.ContactObject\n}>()\n</script>\n\n<template>\n <template v-if=\"value\">\n <div\n class=\"group flex items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n v-if=\"value?.email\"\n :class=\"variants({ link: true })\"\n :href=\"`mailto:${value?.email}`\">\n <ScalarIconEnvelopeSimple\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{ value.name }}</span>\n </a>\n <span\n v-else-if=\"value?.name\"\n :class=\"variants({ link: false })\">\n {{ value.name }}\n </span>\n </div>\n </template>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"Contact.vue.js","names":[],"sources":["../../../src/features/info-object/Contact.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { cva } from '@scalar/components'\nimport { ScalarIconEnvelopeSimple } from '@scalar/icons'\nimport type { ContactObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nconst variants = cva({\n base: 'text-c-1 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 group-last:mr-0 xl:border-none',\n variants: {\n link: {\n true: 'no-underline hover:bg-b-2',\n },\n },\n})\n\ndefineProps<{\n value?: ContactObject\n}>()\n</script>\n\n<template>\n <template v-if=\"value\">\n <div\n class=\"group flex items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n v-if=\"value?.email\"\n :class=\"variants({ link: true })\"\n :href=\"`mailto:${value?.email}`\">\n <ScalarIconEnvelopeSimple\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{ value.name }}</span>\n </a>\n <span\n v-else-if=\"value?.name\"\n :class=\"variants({ link: false })\">\n {{ value.name }}\n </span>\n </div>\n </template>\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Contact.vue.script.js","names":[],"sources":["../../../src/features/info-object/Contact.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { cva } from '@scalar/components'\nimport { ScalarIconEnvelopeSimple } from '@scalar/icons'\nimport { type OpenAPIV3_1 } from '@scalar/openapi-types'\n\nconst variants = cva({\n base: 'text-c-1 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 group-last:mr-0 xl:border-none',\n variants: {\n link: {\n true: 'no-underline hover:bg-b-2',\n },\n },\n})\n\ndefineProps<{\n value?: OpenAPIV3_1.ContactObject\n}>()\n</script>\n\n<template>\n <template v-if=\"value\">\n <div\n class=\"group flex items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n v-if=\"value?.email\"\n :class=\"variants({ link: true })\"\n :href=\"`mailto:${value?.email}`\">\n <ScalarIconEnvelopeSimple\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{ value.name }}</span>\n </a>\n <span\n v-else-if=\"value?.name\"\n :class=\"variants({ link: false })\">\n {{ value.name }}\n </span>\n </div>\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAKA,MAAM,WAAW,IAAI;GACnB,MAAM;GACN,UAAU,EACR,MAAM,EACJ,MAAM,6BACP,EACF;GACF,CAAA;;UAQiB,QAAA,SAAA,WAAA,EACd,mBAgBM,OAhBN,YAgBM,CAbI,QAAA,OAAO,SAAA,WAAA,EADf,mBAQI,KAAA;;IAND,OAAK,eAAE,MAAA,SAAQ,CAAA,EAAA,MAAA,MAAA,CAAA,CAAA;IACf,MAAI,UAAY,QAAA,OAAO;OACxB,YAEgC,MAAA,yBAAA,EAAA;IAD9B,QAAO;IACP,OAAM;OACR,mBAAuD,QAAvD,YAAuD,gBAApB,QAAA,MAAM,KAAI,EAAA,EAAA,CAAA,EAAA,IAAA,WAAA,IAGlC,QAAA,OAAO,QAAA,WAAA,EADpB,mBAIO,QAAA;;IAFJ,OAAK,eAAE,MAAA,SAAQ,CAAA,EAAA,MAAA,OAAA,CAAA,CAAA;sBACb,QAAA,MAAM,KAAI,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
1
+ {"version":3,"file":"Contact.vue.script.js","names":[],"sources":["../../../src/features/info-object/Contact.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { cva } from '@scalar/components'\nimport { ScalarIconEnvelopeSimple } from '@scalar/icons'\nimport type { ContactObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\nconst variants = cva({\n base: 'text-c-1 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 group-last:mr-0 xl:border-none',\n variants: {\n link: {\n true: 'no-underline hover:bg-b-2',\n },\n },\n})\n\ndefineProps<{\n value?: ContactObject\n}>()\n</script>\n\n<template>\n <template v-if=\"value\">\n <div\n class=\"group flex items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n v-if=\"value?.email\"\n :class=\"variants({ link: true })\"\n :href=\"`mailto:${value?.email}`\">\n <ScalarIconEnvelopeSimple\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{ value.name }}</span>\n </a>\n <span\n v-else-if=\"value?.name\"\n :class=\"variants({ link: false })\">\n {{ value.name }}\n </span>\n </div>\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;EAKA,MAAM,WAAW,IAAI;GACnB,MAAM;GACN,UAAU,EACR,MAAM,EACJ,MAAM,6BACP,EACF;GACF,CAAA;;UAQiB,QAAA,SAAA,WAAA,EACd,mBAgBM,OAhBN,YAgBM,CAbI,QAAA,OAAO,SAAA,WAAA,EADf,mBAQI,KAAA;;IAND,OAAK,eAAE,MAAA,SAAQ,CAAA,EAAA,MAAA,MAAA,CAAA,CAAA;IACf,MAAI,UAAY,QAAA,OAAO;OACxB,YAEgC,MAAA,yBAAA,EAAA;IAD9B,QAAO;IACP,OAAM;OACR,mBAAuD,QAAvD,YAAuD,gBAApB,QAAA,MAAM,KAAI,EAAA,EAAA,CAAA,EAAA,IAAA,WAAA,IAGlC,QAAA,OAAO,QAAA,WAAA,EADpB,mBAIO,QAAA;;IAFJ,OAAK,eAAE,MAAA,SAAQ,CAAA,EAAA,MAAA,OAAA,CAAA,CAAA;sBACb,QAAA,MAAM,KAAI,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
@@ -1,6 +1,6 @@
1
- import { type OpenAPIV3_1 } from '@scalar/openapi-types';
1
+ import type { LicenseObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
2
  type __VLS_Props = {
3
- value?: OpenAPIV3_1.LicenseObject;
3
+ value?: LicenseObject;
4
4
  };
5
5
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
6
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"License.vue.d.ts","sourceRoot":"","sources":["../../../src/features/info-object/License.vue"],"names":[],"mappings":"AAqCA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,WAAW,CAAC,aAAa,CAAA;CAClC,CAAC;AAoGF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"License.vue.d.ts","sourceRoot":"","sources":["../../../src/features/info-object/License.vue"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8DAA8D,CAAA;AAEjG,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB,CAAC;AAoGF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"License.vue.js","names":[],"sources":["../../../src/features/info-object/License.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconGavel } from '@scalar/icons'\nimport { type OpenAPIV3_1 } from '@scalar/openapi-types'\n\ndefineProps<{\n value?: OpenAPIV3_1.LicenseObject\n}>()\n</script>\n\n<template>\n <div\n class=\"group flex h-fit items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n class=\"text-c-1 hover:bg-b-2 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 no-underline group-last:mr-0 xl:border-none\"\n v-if=\"value?.url\"\n :href=\"value.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <ScalarIconGavel\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{\n value?.name || value.identifier || value.url\n }}</span>\n </a>\n <template v-else>\n <ScalarIconGavel\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{ value?.name }}</span>\n </template>\n </div>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"License.vue.js","names":[],"sources":["../../../src/features/info-object/License.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconGavel } from '@scalar/icons'\nimport type { LicenseObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\ndefineProps<{\n value?: LicenseObject\n}>()\n</script>\n\n<template>\n <div\n class=\"group flex h-fit items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n class=\"text-c-1 hover:bg-b-2 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 no-underline group-last:mr-0 xl:border-none\"\n v-if=\"value?.url\"\n :href=\"value.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <ScalarIconGavel\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{\n value?.name || value.identifier || value.url\n }}</span>\n </a>\n <template v-else>\n <ScalarIconGavel\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{ value?.name }}</span>\n </template>\n </div>\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"License.vue.script.js","names":[],"sources":["../../../src/features/info-object/License.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconGavel } from '@scalar/icons'\nimport { type OpenAPIV3_1 } from '@scalar/openapi-types'\n\ndefineProps<{\n value?: OpenAPIV3_1.LicenseObject\n}>()\n</script>\n\n<template>\n <div\n class=\"group flex h-fit items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n class=\"text-c-1 hover:bg-b-2 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 no-underline group-last:mr-0 xl:border-none\"\n v-if=\"value?.url\"\n :href=\"value.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <ScalarIconGavel\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{\n value?.name || value.identifier || value.url\n }}</span>\n </a>\n <template v-else>\n <ScalarIconGavel\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{ value?.name }}</span>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;uBAUE,mBAqBM,OArBN,YAqBM,CAjBI,QAAA,OAAO,OAAA,WAAA,EAFf,mBAYI,KAAA;;IAXF,OAAM;IAEL,MAAM,QAAA,MAAM;IACb,QAAO;IACP,KAAI;OACJ,YAEgC,MAAA,gBAAA,EAAA;IAD9B,QAAO;IACP,OAAM;OACR,mBAES,QAFT,YAES,gBADP,QAAA,OAAO,QAAQ,QAAA,MAAM,cAAc,QAAA,MAAM,IAAG,EAAA,EAAA,CAAA,EAAA,GAAA,WAAA,KAAA,WAAA,EAGhD,mBAKW,UAAA,EAAA,KAAA,GAAA,EAAA,CAJT,YAEgC,MAAA,gBAAA,EAAA;IAD9B,QAAO;IACP,OAAM;OACR,mBAAwD,QAAxD,YAAwD,gBAArB,QAAA,OAAO,KAAI,EAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA"}
1
+ {"version":3,"file":"License.vue.script.js","names":[],"sources":["../../../src/features/info-object/License.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconGavel } from '@scalar/icons'\nimport type { LicenseObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\ndefineProps<{\n value?: LicenseObject\n}>()\n</script>\n\n<template>\n <div\n class=\"group flex h-fit items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n class=\"text-c-1 hover:bg-b-2 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 no-underline group-last:mr-0 xl:border-none\"\n v-if=\"value?.url\"\n :href=\"value.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <ScalarIconGavel\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{\n value?.name || value.identifier || value.url\n }}</span>\n </a>\n <template v-else>\n <ScalarIconGavel\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">{{ value?.name }}</span>\n </template>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;uBAUE,mBAqBM,OArBN,YAqBM,CAjBI,QAAA,OAAO,OAAA,WAAA,EAFf,mBAYI,KAAA;;IAXF,OAAM;IAEL,MAAM,QAAA,MAAM;IACb,QAAO;IACP,KAAI;OACJ,YAEgC,MAAA,gBAAA,EAAA;IAD9B,QAAO;IACP,OAAM;OACR,mBAES,QAFT,YAES,gBADP,QAAA,OAAO,QAAQ,QAAA,MAAM,cAAc,QAAA,MAAM,IAAG,EAAA,EAAA,CAAA,EAAA,GAAA,WAAA,KAAA,WAAA,EAGhD,mBAKW,UAAA,EAAA,KAAA,GAAA,EAAA,CAJT,YAEgC,MAAA,gBAAA,EAAA;IAD9B,QAAO;IACP,OAAM;OACR,mBAAwD,QAAxD,YAAwD,gBAArB,QAAA,OAAO,KAAI,EAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA"}
@@ -1,6 +1,6 @@
1
- import { type OpenAPIV3_1 } from '@scalar/openapi-types';
1
+ import type { InfoObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
2
2
  type __VLS_Props = {
3
- value?: OpenAPIV3_1.InfoObject['termsOfService'];
3
+ value?: InfoObject['termsOfService'];
4
4
  };
5
5
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
6
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"TermsOfService.vue.d.ts","sourceRoot":"","sources":["../../../src/features/info-object/TermsOfService.vue"],"names":[],"mappings":"AA8BA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAA;CACjD,CAAC;AA0EF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"TermsOfService.vue.d.ts","sourceRoot":"","sources":["../../../src/features/info-object/TermsOfService.vue"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAA;AAE9F,KAAK,WAAW,GAAG;IACjB,KAAK,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAA;CACrC,CAAC;AA0EF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TermsOfService.vue.js","names":[],"sources":["../../../src/features/info-object/TermsOfService.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconScroll } from '@scalar/icons'\nimport { type OpenAPIV3_1 } from '@scalar/openapi-types'\n\ndefineProps<{\n value?: OpenAPIV3_1.InfoObject['termsOfService']\n}>()\n</script>\n\n<template>\n <template v-if=\"value\">\n <div\n class=\"group flex items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n class=\"text-c-1 hover:bg-b-2 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 no-underline group-last:mr-0 xl:border-none\"\n :href=\"value\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <ScalarIconScroll\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">Terms of Service</span>\n </a>\n </div>\n </template>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"TermsOfService.vue.js","names":[],"sources":["../../../src/features/info-object/TermsOfService.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconScroll } from '@scalar/icons'\nimport type { InfoObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\ndefineProps<{\n value?: InfoObject['termsOfService']\n}>()\n</script>\n\n<template>\n <template v-if=\"value\">\n <div\n class=\"group flex items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n class=\"text-c-1 hover:bg-b-2 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 no-underline group-last:mr-0 xl:border-none\"\n :href=\"value\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <ScalarIconScroll\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">Terms of Service</span>\n </a>\n </div>\n </template>\n</template>\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"TermsOfService.vue.script.js","names":[],"sources":["../../../src/features/info-object/TermsOfService.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconScroll } from '@scalar/icons'\nimport { type OpenAPIV3_1 } from '@scalar/openapi-types'\n\ndefineProps<{\n value?: OpenAPIV3_1.InfoObject['termsOfService']\n}>()\n</script>\n\n<template>\n <template v-if=\"value\">\n <div\n class=\"group flex items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n class=\"text-c-1 hover:bg-b-2 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 no-underline group-last:mr-0 xl:border-none\"\n :href=\"value\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <ScalarIconScroll\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">Terms of Service</span>\n </a>\n </div>\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;UAUkB,QAAA,SAAA,WAAA,EACd,mBAYM,OAZN,YAYM,CAVJ,mBASI,KAAA;IARF,OAAM;IACL,MAAM,QAAA;IACP,QAAO;IACP,KAAI;OACJ,YAEgC,MAAA,iBAAA,EAAA;IAD9B,QAAO;IACP,OAAM;iCACR,mBAAuD,QAAA,EAAjD,OAAM,qBAAmB,EAAC,oBAAgB,GAAA,EAAA,EAAA,GAAA,WAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
1
+ {"version":3,"file":"TermsOfService.vue.script.js","names":[],"sources":["../../../src/features/info-object/TermsOfService.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconScroll } from '@scalar/icons'\nimport type { InfoObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\n\ndefineProps<{\n value?: InfoObject['termsOfService']\n}>()\n</script>\n\n<template>\n <template v-if=\"value\">\n <div\n class=\"group flex items-center last:border-r-0 xl:border-r xl:first:ml-auto\">\n <a\n class=\"text-c-1 hover:bg-b-2 mr-2 flex min-h-7 min-w-7 items-center rounded-lg border px-2 py-1 no-underline group-last:mr-0 xl:border-none\"\n :href=\"value\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n <ScalarIconScroll\n weight=\"bold\"\n class=\"size-3 text-current\" />\n <span class=\"ml-1 empty:hidden\">Terms of Service</span>\n </a>\n </div>\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;UAUkB,QAAA,SAAA,WAAA,EACd,mBAYM,OAZN,YAYM,CAVJ,mBASI,KAAA;IARF,OAAM;IACL,MAAM,QAAA;IACP,QAAO;IACP,KAAI;OACJ,YAEgC,MAAA,iBAAA,EAAA;IAD9B,QAAO;IACP,OAAM;iCACR,mBAAuD,QAAA,EAAjD,OAAM,qBAAmB,EAAC,oBAAgB,GAAA,EAAA,EAAA,GAAA,WAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
@@ -1,5 +1,4 @@
1
- import type { OpenAPI } from '@scalar/openapi-types';
2
- import type { OperationObject, ParameterObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
1
+ import type { OpenApiDocument, OperationObject, ParameterObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
3
2
  /**
4
3
  * Extracts the request body from an operation.
5
4
  */
@@ -12,14 +11,12 @@ export declare function deepMerge(source: Record<any, any>, target: Record<any,
12
11
  * Creates an empty specification object.
13
12
  * The returning object has the same structure as a valid OpenAPI specification, but everything is empty.
14
13
  */
15
- export declare function createEmptySpecification(partialSpecification?: Partial<OpenAPI.Document>): OpenAPI.Document;
14
+ export declare function createEmptySpecification(partialSpecification?: Partial<OpenApiDocument>): OpenApiDocument;
16
15
  export type ParameterMap = {
17
16
  path: ParameterObject[];
18
17
  query: ParameterObject[];
19
18
  header: ParameterObject[];
20
19
  cookie: ParameterObject[];
21
- body: ParameterObject[];
22
- formData: ParameterObject[];
23
20
  };
24
21
  /**
25
22
  * This function creates a parameter map from an Operation Object, that's easier to consume.
@@ -1 +1 @@
1
- {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/helpers/openapi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAIpD,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EAGhB,MAAM,8DAA8D,CAAA;AAiFrE;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,eAAe,GAAG,MAAM,EAAE,GAAG,OAAO,CAYjF;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,oBAW3E;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAiBjF,OAAO,CAAC,QAAQ,CACvB;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,eAAe,EAAE,CAAA;IACvB,KAAK,EAAE,eAAe,EAAE,CAAA;IACxB,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,IAAI,EAAE,eAAe,EAAE,CAAA;IACvB,QAAQ,EAAE,eAAe,EAAE,CAAA;CAC5B,CAAA;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,eAAe,gBA2D5D"}
1
+ {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/helpers/openapi.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,eAAe,EAGhB,MAAM,8DAA8D,CAAA;AAkGrE;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,eAAe,GAAG,MAAM,EAAE,GAAG,OAAO,CAYjF;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,oBAW3E;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,mBA4BvF;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,eAAe,EAAE,CAAA;IACvB,KAAK,EAAE,eAAe,EAAE,CAAA;IACxB,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,MAAM,EAAE,eAAe,EAAE,CAAA;CAC1B,CAAA;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,eAAe,gBA4B5D"}
@@ -1,13 +1,19 @@
1
1
  import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref";
2
2
  import { isObjectSchema } from "@scalar/workspace-store/schemas/v3.1/strict/type-guards";
3
- import { isDereferenced } from "@scalar/openapi-types/helpers";
4
3
  //#region src/helpers/openapi.ts
4
+ var isSchemaObject = (value) => typeof value === "object" && value !== null;
5
+ var schemaTypeToString = (schema) => {
6
+ if (!("type" in schema)) return "";
7
+ if (typeof schema.type === "string") return schema.type;
8
+ return Array.isArray(schema.type) ? schema.type.join("|") : "";
9
+ };
5
10
  /**
6
11
  * Resolves a schema reference from workspace-store to a SchemaObject.
7
- * Bridges SchemaReferenceType (which uses '$ref-value': unknown) to NodeInput (which uses '$ref-value': SchemaObject).
12
+ * Returns undefined when a reference exists but has not been resolved yet.
8
13
  */
9
14
  function resolveSchemaRef(ref) {
10
- return getResolvedRef(ref);
15
+ if (typeof ref === "object" && ref !== null && "$ref" in ref) return isSchemaObject(ref["$ref-value"]) ? ref["$ref-value"] : void 0;
16
+ return ref;
11
17
  }
12
18
  /**
13
19
  * Formats a property object into a string.
@@ -19,9 +25,9 @@ function formatProperty(key, obj) {
19
25
  const propRef = obj.properties[key];
20
26
  if (!propRef) return output;
21
27
  const property = resolveSchemaRef(propRef);
22
- if (property && typeof property === "object" && "type" in property) {
23
- output += property.type ?? "";
24
- if ("description" in property && typeof property.description === "string") output += " " + property.description;
28
+ if (property) {
29
+ output += schemaTypeToString(property);
30
+ if ("description" in property && typeof property.description === "string") output += ` ${property.description}`;
25
31
  }
26
32
  return output;
27
33
  }
@@ -49,7 +55,7 @@ function recursiveLogger(obj) {
49
55
  const ref = nestedProperties[subKey];
50
56
  if (!ref) return;
51
57
  const nested = resolveSchemaRef(ref);
52
- const typeStr = nested && typeof nested === "object" && "type" in nested ? nested.type ?? "" : "";
58
+ const typeStr = nested ? schemaTypeToString(nested) : "";
53
59
  results.push(`${subKey} ${typeStr}`);
54
60
  });
55
61
  }
@@ -83,7 +89,8 @@ function deepMerge(source, target) {
83
89
  * The returning object has the same structure as a valid OpenAPI specification, but everything is empty.
84
90
  */
85
91
  function createEmptySpecification(partialSpecification) {
86
- return deepMerge(partialSpecification ?? {}, {
92
+ const emptySpecification = {
93
+ openapi: "3.1.0",
87
94
  info: {
88
95
  title: "",
89
96
  description: "",
@@ -96,8 +103,12 @@ function createEmptySpecification(partialSpecification) {
96
103
  contact: { email: "" }
97
104
  },
98
105
  servers: [],
99
- tags: []
100
- });
106
+ tags: [],
107
+ "x-scalar-original-document-hash": ""
108
+ };
109
+ if (!partialSpecification) return emptySpecification;
110
+ deepMerge(partialSpecification, emptySpecification);
111
+ return emptySpecification;
101
112
  }
102
113
  /**
103
114
  * This function creates a parameter map from an Operation Object, that's easier to consume.
@@ -109,20 +120,15 @@ function createParameterMap(operation) {
109
120
  path: [],
110
121
  query: [],
111
122
  header: [],
112
- cookie: [],
113
- body: [],
114
- formData: []
123
+ cookie: []
115
124
  };
116
- const parameters = operation.parameters ?? [];
117
- if (parameters) parameters.forEach((parameter) => {
118
- if (!isDereferenced(parameter)) return;
119
- if (typeof parameter === "object" && parameter !== null && "$ref" in parameter) return;
125
+ (operation.parameters ?? []).forEach((parameterRef) => {
126
+ const parameter = getResolvedRef(parameterRef);
127
+ if (!parameter) return;
120
128
  if (parameter.in === "path") map.path.push(parameter);
121
129
  else if (parameter.in === "query") map.query.push(parameter);
122
130
  else if (parameter.in === "header") map.header.push(parameter);
123
131
  else if (parameter.in === "cookie") map.cookie.push(parameter);
124
- else if (parameter.in === "body") map.body.push(parameter);
125
- else if (parameter.in === "formData") map.formData.push(parameter);
126
132
  });
127
133
  return map;
128
134
  }
@@ -1 +1 @@
1
- {"version":3,"file":"openapi.js","names":[],"sources":["../../src/helpers/openapi.ts"],"sourcesContent":["import type { OpenAPI } from '@scalar/openapi-types'\nimport { isDereferenced } from '@scalar/openapi-types/helpers'\nimport { type NodeInput, getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { MediaTypeObject } from '@scalar/workspace-store/schemas/v3.1/strict/media-type'\nimport type {\n OperationObject,\n ParameterObject,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isObjectSchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n/** Object schema shape with properties, used when logging request body. */\ntype ObjectSchemaWithProperties = {\n properties: Record<string, SchemaReferenceType<SchemaObject>>\n required?: string[]\n}\n\n/**\n * Resolves a schema reference from workspace-store to a SchemaObject.\n * Bridges SchemaReferenceType (which uses '$ref-value': unknown) to NodeInput (which uses '$ref-value': SchemaObject).\n */\nfunction resolveSchemaRef(ref: SchemaReferenceType<SchemaObject>): SchemaObject {\n return getResolvedRef(ref as NodeInput<SchemaObject>)\n}\n\n/**\n * Formats a property object into a string.\n */\nfunction formatProperty(key: string, obj: ObjectSchemaWithProperties): string {\n let output = key\n const isRequired = obj.required?.includes(key)\n output += isRequired ? ' REQUIRED ' : ' optional '\n const propRef = obj.properties[key]\n if (!propRef) return output\n const property = resolveSchemaRef(propRef)\n\n // Check existence before accessing\n if (property && typeof property === 'object' && 'type' in property) {\n output += (property as { type?: string }).type ?? ''\n if ('description' in property && typeof (property as { description?: string }).description === 'string') {\n output += ' ' + (property as { description: string }).description\n }\n }\n\n return output\n}\n\n/**\n * Recursively logs the properties of an object.\n */\nfunction recursiveLogger(obj: MediaTypeObject): string[] {\n const results: string[] = ['Body']\n const schema = getResolvedRef(obj?.schema)\n\n if (!schema || !isObjectSchema(schema) || !schema.properties) {\n return results\n }\n\n const properties = schema.properties\n const schemaWithProps: ObjectSchemaWithProperties = {\n properties,\n required: schema.required,\n }\n Object.keys(properties).forEach((key) => {\n if (!obj.schema) {\n return\n }\n\n results.push(formatProperty(key, schemaWithProps))\n\n const propRef = properties[key]\n if (!propRef) return\n const property = resolveSchemaRef(propRef)\n if (property && isObjectSchema(property) && property.properties) {\n const nestedProperties = property.properties\n Object.keys(nestedProperties).forEach((subKey) => {\n const ref = nestedProperties[subKey]\n if (!ref) return\n const nested = resolveSchemaRef(ref)\n const typeStr =\n nested && typeof nested === 'object' && 'type' in nested ? ((nested as { type?: string }).type ?? '') : ''\n results.push(`${subKey} ${typeStr}`)\n })\n }\n })\n\n return results\n}\n\n/**\n * Extracts the request body from an operation.\n */\nexport function extractRequestBody(operation: OperationObject): string[] | boolean {\n try {\n // TODO: Wait… there's more than just 'application/json' (https://github.com/scalar/scalar/issues/6427)\n const media = getResolvedRef(operation?.requestBody)?.content?.['application/json']\n if (!media) {\n throw new Error('Body not found')\n }\n\n return recursiveLogger(media)\n } catch (_error) {\n return false\n }\n}\n\n/**\n * Deep merge for objects\n */\nexport function deepMerge(source: Record<any, any>, target: Record<any, any>) {\n for (const [key, val] of Object.entries(source)) {\n if (val !== null && typeof val === 'object') {\n target[key] ??= new val.__proto__.constructor()\n deepMerge(val, target[key])\n } else if (typeof val !== 'undefined') {\n target[key] = val\n }\n }\n\n return target\n}\n\n/**\n * Creates an empty specification object.\n * The returning object has the same structure as a valid OpenAPI specification, but everything is empty.\n */\nexport function createEmptySpecification(partialSpecification?: Partial<OpenAPI.Document>) {\n return deepMerge(partialSpecification ?? {}, {\n info: {\n title: '',\n description: '',\n termsOfService: '',\n version: '',\n license: {\n name: '',\n url: '',\n },\n contact: {\n email: '',\n },\n },\n servers: [],\n tags: [],\n }) as OpenAPI.Document\n}\n\nexport type ParameterMap = {\n path: ParameterObject[]\n query: ParameterObject[]\n header: ParameterObject[]\n cookie: ParameterObject[]\n body: ParameterObject[]\n formData: ParameterObject[]\n}\n\n/**\n * This function creates a parameter map from an Operation Object, that's easier to consume.\n *\n * TODO: Isn't it easier to just stick to the OpenAPI structure, without transforming it?\n */\nexport function createParameterMap(operation: OperationObject) {\n const map: ParameterMap = {\n path: [],\n query: [],\n header: [],\n cookie: [],\n body: [],\n formData: [],\n }\n\n // TODO: They are not passed to the function, so we don't need to deal with them yet, but we should.\n // @see https://github.com/scalar/scalar/issues/6428\n // if (operation.pathParameters) {\n // operation.pathParameters.forEach((parameter: OpenAPIV3_1.ParameterObject) => {\n // if (parameter.in === 'path') {\n // map.path.push(parameter)\n // } else if (parameter.in === 'query') {\n // map.query.push(parameter)\n // } else if (parameter.in === 'header') {\n // map.header.push(parameter)\n // } else if (parameter.in === 'cookie') {\n // map.cookie.push(parameter)\n // } else if (parameter.in === 'body') {\n // map.body.push(parameter)\n // } else if (parameter.in === 'formData') {\n // map.formData.push(parameter)\n // }\n // })\n // }\n\n const parameters = operation.parameters ?? []\n\n if (parameters) {\n parameters.forEach((parameter) => {\n if (!isDereferenced<ParameterObject>(parameter)) {\n return\n }\n\n if (typeof parameter === 'object' && parameter !== null && '$ref' in parameter) {\n return\n }\n\n if (parameter.in === 'path') {\n map.path.push(parameter)\n } else if (parameter.in === 'query') {\n map.query.push(parameter)\n } else if (parameter.in === 'header') {\n map.header.push(parameter)\n } else if (parameter.in === 'cookie') {\n map.cookie.push(parameter)\n } else if (parameter.in === 'body') {\n map.body.push(parameter)\n } else if (parameter.in === 'formData') {\n map.formData.push(parameter)\n }\n })\n }\n\n return map\n}\n"],"mappings":";;;;;;;;AAsBA,SAAS,iBAAiB,KAAsD;AAC9E,QAAO,eAAe,IAA+B;;;;;AAMvD,SAAS,eAAe,KAAa,KAAyC;CAC5E,IAAI,SAAS;CACb,MAAM,aAAa,IAAI,UAAU,SAAS,IAAI;AAC9C,WAAU,aAAa,eAAe;CACtC,MAAM,UAAU,IAAI,WAAW;AAC/B,KAAI,CAAC,QAAS,QAAO;CACrB,MAAM,WAAW,iBAAiB,QAAQ;AAG1C,KAAI,YAAY,OAAO,aAAa,YAAY,UAAU,UAAU;AAClE,YAAW,SAA+B,QAAQ;AAClD,MAAI,iBAAiB,YAAY,OAAQ,SAAsC,gBAAgB,SAC7F,WAAU,MAAO,SAAqC;;AAI1D,QAAO;;;;;AAMT,SAAS,gBAAgB,KAAgC;CACvD,MAAM,UAAoB,CAAC,OAAO;CAClC,MAAM,SAAS,eAAe,KAAK,OAAO;AAE1C,KAAI,CAAC,UAAU,CAAC,eAAe,OAAO,IAAI,CAAC,OAAO,WAChD,QAAO;CAGT,MAAM,aAAa,OAAO;CAC1B,MAAM,kBAA8C;EAClD;EACA,UAAU,OAAO;EAClB;AACD,QAAO,KAAK,WAAW,CAAC,SAAS,QAAQ;AACvC,MAAI,CAAC,IAAI,OACP;AAGF,UAAQ,KAAK,eAAe,KAAK,gBAAgB,CAAC;EAElD,MAAM,UAAU,WAAW;AAC3B,MAAI,CAAC,QAAS;EACd,MAAM,WAAW,iBAAiB,QAAQ;AAC1C,MAAI,YAAY,eAAe,SAAS,IAAI,SAAS,YAAY;GAC/D,MAAM,mBAAmB,SAAS;AAClC,UAAO,KAAK,iBAAiB,CAAC,SAAS,WAAW;IAChD,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AO,cAAc,YAAY,cAAc,QAAQ,UAAU,UACnE;AAGF,MAAI,UAAU,OAAO,OACnB,KAAI,KAAK,KAAK,UAAU;WACf,UAAU,OAAO,QAC1B,KAAI,MAAM,KAAK,UAAU;WAChB,UAAU,OAAO,SAC1B,KAAI,OAAO,KAAK,UAAU;WACjB,UAAU,OAAO,SAC1B,KAAI,OAAO,KAAK,UAAU;WACjB,UAAU,OAAO,OAC1B,KAAI,KAAK,KAAK,UAAU;WACf,UAAU,OAAO,WAC1B,KAAI,SAAS,KAAK,UAAU;GAE9B;AAGJ,QAAO"}
1
+ {"version":3,"file":"openapi.js","names":[],"sources":["../../src/helpers/openapi.ts"],"sourcesContent":["import { getResolvedRef } from '@scalar/workspace-store/helpers/get-resolved-ref'\nimport type { MediaTypeObject } from '@scalar/workspace-store/schemas/v3.1/strict/media-type'\nimport type {\n OpenApiDocument,\n OperationObject,\n ParameterObject,\n SchemaObject,\n SchemaReferenceType,\n} from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport { isObjectSchema } from '@scalar/workspace-store/schemas/v3.1/strict/type-guards'\n\n/** Object schema shape with properties, used when logging request body. */\ntype ObjectSchemaWithProperties = {\n properties: Record<string, SchemaReferenceType<SchemaObject>>\n required?: string[]\n}\n\nconst isSchemaObject = (value: unknown): value is SchemaObject => typeof value === 'object' && value !== null\n\nconst schemaTypeToString = (schema: SchemaObject): string => {\n if (!('type' in schema)) {\n return ''\n }\n\n if (typeof schema.type === 'string') {\n return schema.type\n }\n\n return Array.isArray(schema.type) ? schema.type.join('|') : ''\n}\n\n/**\n * Resolves a schema reference from workspace-store to a SchemaObject.\n * Returns undefined when a reference exists but has not been resolved yet.\n */\nfunction resolveSchemaRef(ref: SchemaReferenceType<SchemaObject>): SchemaObject | undefined {\n if (typeof ref === 'object' && ref !== null && '$ref' in ref) {\n return isSchemaObject(ref['$ref-value']) ? ref['$ref-value'] : undefined\n }\n\n return ref\n}\n\n/**\n * Formats a property object into a string.\n */\nfunction formatProperty(key: string, obj: ObjectSchemaWithProperties): string {\n let output = key\n const isRequired = obj.required?.includes(key)\n output += isRequired ? ' REQUIRED ' : ' optional '\n const propRef = obj.properties[key]\n if (!propRef) return output\n const property = resolveSchemaRef(propRef)\n\n if (property) {\n output += schemaTypeToString(property)\n\n if ('description' in property && typeof property.description === 'string') {\n output += ` ${property.description}`\n }\n }\n\n return output\n}\n\n/**\n * Recursively logs the properties of an object.\n */\nfunction recursiveLogger(obj: MediaTypeObject): string[] {\n const results: string[] = ['Body']\n const schema = getResolvedRef(obj?.schema)\n\n if (!schema || !isObjectSchema(schema) || !schema.properties) {\n return results\n }\n\n const properties = schema.properties\n const schemaWithProps: ObjectSchemaWithProperties = {\n properties,\n required: schema.required,\n }\n Object.keys(properties).forEach((key) => {\n if (!obj.schema) {\n return\n }\n\n results.push(formatProperty(key, schemaWithProps))\n\n const propRef = properties[key]\n if (!propRef) return\n const property = resolveSchemaRef(propRef)\n if (property && isObjectSchema(property) && property.properties) {\n const nestedProperties = property.properties\n Object.keys(nestedProperties).forEach((subKey) => {\n const ref = nestedProperties[subKey]\n if (!ref) return\n const nested = resolveSchemaRef(ref)\n const typeStr = nested ? schemaTypeToString(nested) : ''\n results.push(`${subKey} ${typeStr}`)\n })\n }\n })\n\n return results\n}\n\n/**\n * Extracts the request body from an operation.\n */\nexport function extractRequestBody(operation: OperationObject): string[] | boolean {\n try {\n // TODO: Wait… there's more than just 'application/json' (https://github.com/scalar/scalar/issues/6427)\n const media = getResolvedRef(operation?.requestBody)?.content?.['application/json']\n if (!media) {\n throw new Error('Body not found')\n }\n\n return recursiveLogger(media)\n } catch (_error) {\n return false\n }\n}\n\n/**\n * Deep merge for objects\n */\nexport function deepMerge(source: Record<any, any>, target: Record<any, any>) {\n for (const [key, val] of Object.entries(source)) {\n if (val !== null && typeof val === 'object') {\n target[key] ??= new val.__proto__.constructor()\n deepMerge(val, target[key])\n } else if (typeof val !== 'undefined') {\n target[key] = val\n }\n }\n\n return target\n}\n\n/**\n * Creates an empty specification object.\n * The returning object has the same structure as a valid OpenAPI specification, but everything is empty.\n */\nexport function createEmptySpecification(partialSpecification?: Partial<OpenApiDocument>) {\n const emptySpecification = {\n openapi: '3.1.0',\n info: {\n title: '',\n description: '',\n termsOfService: '',\n version: '',\n license: {\n name: '',\n url: '',\n },\n contact: {\n email: '',\n },\n },\n servers: [],\n tags: [],\n 'x-scalar-original-document-hash': '',\n }\n\n if (!partialSpecification) {\n return emptySpecification as OpenApiDocument\n }\n\n deepMerge(partialSpecification, emptySpecification)\n\n return emptySpecification as OpenApiDocument\n}\n\nexport type ParameterMap = {\n path: ParameterObject[]\n query: ParameterObject[]\n header: ParameterObject[]\n cookie: ParameterObject[]\n}\n\n/**\n * This function creates a parameter map from an Operation Object, that's easier to consume.\n *\n * TODO: Isn't it easier to just stick to the OpenAPI structure, without transforming it?\n */\nexport function createParameterMap(operation: OperationObject) {\n const map: ParameterMap = {\n path: [],\n query: [],\n header: [],\n cookie: [],\n }\n\n const parameters = operation.parameters ?? []\n\n parameters.forEach((parameterRef) => {\n const parameter = getResolvedRef(parameterRef)\n if (!parameter) {\n return\n }\n\n if (parameter.in === 'path') {\n map.path.push(parameter)\n } else if (parameter.in === 'query') {\n map.query.push(parameter)\n } else if (parameter.in === 'header') {\n map.header.push(parameter)\n } else if (parameter.in === 'cookie') {\n map.cookie.push(parameter)\n }\n })\n\n return map\n}\n"],"mappings":";;;AAiBA,IAAM,kBAAkB,UAA0C,OAAO,UAAU,YAAY,UAAU;AAEzG,IAAM,sBAAsB,WAAiC;AAC3D,KAAI,EAAE,UAAU,QACd,QAAO;AAGT,KAAI,OAAO,OAAO,SAAS,SACzB,QAAO,OAAO;AAGhB,QAAO,MAAM,QAAQ,OAAO,KAAK,GAAG,OAAO,KAAK,KAAK,IAAI,GAAG;;;;;;AAO9D,SAAS,iBAAiB,KAAkE;AAC1F,KAAI,OAAO,QAAQ,YAAY,QAAQ,QAAQ,UAAU,IACvD,QAAO,eAAe,IAAI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the source.
3
+ *
4
+ * In the browser we use `structuredClone`, which preserves `Date`, `Map`, `Set`,
5
+ * typed arrays, and other structured types. During SSR there is no `window`, so
6
+ * we fall back to `JSON.parse(JSON.stringify(...))`, which only supports JSON
7
+ * values (functions, `undefined` in objects, symbols, etc. are dropped or altered).
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const copy = safeDeepClone(spec)
12
+ * copy.info.title = 'Draft'
13
+ * // original spec is unchanged
14
+ * ```
15
+ */
16
+ export declare const safeDeepClone: <T>(value: T) => T;
17
+ //# sourceMappingURL=safe-deep-clone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safe-deep-clone.d.ts","sourceRoot":"","sources":["../../src/helpers/safe-deep-clone.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,OAAO,CAAC,KAAG,CAK3C,CAAA"}
@@ -0,0 +1,25 @@
1
+ import { deepClone } from "@scalar/workspace-store/helpers/deep-clone";
2
+ //#region src/helpers/safe-deep-clone.ts
3
+ /**
4
+ * Deep-clones plain data for use where mutation must not affect the source.
5
+ *
6
+ * In the browser we use `structuredClone`, which preserves `Date`, `Map`, `Set`,
7
+ * typed arrays, and other structured types. During SSR there is no `window`, so
8
+ * we fall back to `JSON.parse(JSON.stringify(...))`, which only supports JSON
9
+ * values (functions, `undefined` in objects, symbols, etc. are dropped or altered).
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const copy = safeDeepClone(spec)
14
+ * copy.info.title = 'Draft'
15
+ * // original spec is unchanged
16
+ * ```
17
+ */
18
+ var safeDeepClone = (value) => {
19
+ if (typeof window === "undefined") return deepClone(value);
20
+ return window.structuredClone(value);
21
+ };
22
+ //#endregion
23
+ export { safeDeepClone };
24
+
25
+ //# sourceMappingURL=safe-deep-clone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safe-deep-clone.js","names":[],"sources":["../../src/helpers/safe-deep-clone.ts"],"sourcesContent":["import { deepClone } from '@scalar/workspace-store/helpers/deep-clone'\n\n/**\n * Deep-clones plain data for use where mutation must not affect the source.\n *\n * In the browser we use `structuredClone`, which preserves `Date`, `Map`, `Set`,\n * typed arrays, and other structured types. During SSR there is no `window`, so\n * we fall back to `JSON.parse(JSON.stringify(...))`, which only supports JSON\n * values (functions, `undefined` in objects, symbols, etc. are dropped or altered).\n *\n * @example\n * ```ts\n * const copy = safeDeepClone(spec)\n * copy.info.title = 'Draft'\n * // original spec is unchanged\n * ```\n */\nexport const safeDeepClone = <T>(value: T): T => {\n if (typeof window === 'undefined') {\n return deepClone(value)\n }\n return window.structuredClone(value) as T\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,IAAa,iBAAoB,UAAgB;AAC/C,KAAI,OAAO,WAAW,YACpB,QAAO,UAAU,MAAM;AAEzB,QAAO,OAAO,gBAAgB,MAAM"}
@@ -88,10 +88,10 @@ export declare const authStorage: () => {
88
88
  }) | undefined;
89
89
  }) | {
90
90
  implicit?: ({
91
+ refreshUrl: string;
91
92
  scopes: {
92
93
  [x: string]: string;
93
94
  };
94
- refreshUrl: string;
95
95
  } & {
96
96
  'x-scalar-security-query'?: {
97
97
  [x: string]: string;
@@ -118,10 +118,10 @@ export declare const authStorage: () => {
118
118
  'x-scalar-secret-redirect-uri': string;
119
119
  }) | undefined;
120
120
  password?: ({
121
+ refreshUrl: string;
121
122
  scopes: {
122
123
  [x: string]: string;
123
124
  };
124
- refreshUrl: string;
125
125
  } & {
126
126
  'x-scalar-security-query'?: {
127
127
  [x: string]: string;
@@ -155,10 +155,10 @@ export declare const authStorage: () => {
155
155
  'x-scalar-credentials-location'?: "body" | "header" | undefined;
156
156
  }) | undefined;
157
157
  clientCredentials?: ({
158
+ refreshUrl: string;
158
159
  scopes: {
159
160
  [x: string]: string;
160
161
  };
161
- refreshUrl: string;
162
162
  } & {
163
163
  'x-scalar-security-query'?: {
164
164
  [x: string]: string;
@@ -189,10 +189,10 @@ export declare const authStorage: () => {
189
189
  'x-scalar-credentials-location'?: "body" | "header" | undefined;
190
190
  }) | undefined;
191
191
  authorizationCode?: ({
192
+ refreshUrl: string;
192
193
  scopes: {
193
194
  [x: string]: string;
194
195
  };
195
- refreshUrl: string;
196
196
  } & {
197
197
  'x-scalar-security-query'?: {
198
198
  [x: string]: string;
@@ -208,8 +208,8 @@ export declare const authStorage: () => {
208
208
  } & {
209
209
  'x-scalar-secret-token-url'?: string | undefined;
210
210
  } & {
211
- tokenUrl: string;
212
211
  authorizationUrl: string;
212
+ tokenUrl: string;
213
213
  } & {
214
214
  'x-usePkce': "SHA-256" | "plain" | "no";
215
215
  } & {