@blogmcp/sdk 0.1.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.
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/_virtual/constants.js +4 -0
- package/dist/_virtual/index.js +2 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/_virtual/index3.js +2 -0
- package/dist/_virtual/re.js +4 -0
- package/dist/core/article-seo.d.ts +27 -0
- package/dist/core/article-seo.js +25 -0
- package/dist/core/auth.d.ts +34 -0
- package/dist/core/auth.js +89 -0
- package/dist/core/blog-config.d.ts +5 -0
- package/dist/core/blog-config.js +14 -0
- package/dist/core/client-types.d.ts +51 -0
- package/dist/core/client.d.ts +159 -0
- package/dist/core/client.js +82 -0
- package/dist/core/i18n.d.ts +29 -0
- package/dist/core/i18n.js +34 -0
- package/dist/core/index.d.ts +26 -0
- package/dist/core/index.js +67 -0
- package/dist/core/markdown.d.ts +69 -0
- package/dist/core/markdown.js +47 -0
- package/dist/core/navigation.d.ts +70 -0
- package/dist/core/navigation.js +71 -0
- package/dist/core/queries.d.ts +34 -0
- package/dist/core/queries.js +363 -0
- package/dist/core/retry.d.ts +9 -0
- package/dist/core/retry.js +14 -0
- package/dist/core/seo.d.ts +142 -0
- package/dist/core/seo.js +166 -0
- package/dist/core/theme.d.ts +41 -0
- package/dist/core/theme.js +60 -0
- package/dist/core/translations/cs.json.js +27 -0
- package/dist/core/translations/en.json.js +27 -0
- package/dist/core/types.d.ts +184 -0
- package/dist/core/types.js +9 -0
- package/dist/core/view-model.d.ts +53 -0
- package/dist/core/view-model.js +47 -0
- package/dist/node_modules/@braintree/sanitize-url/dist/constants.js +8 -0
- package/dist/node_modules/@braintree/sanitize-url/dist/index.js +60 -0
- package/dist/node_modules/dompurify/dist/purify.es.js +662 -0
- package/dist/node_modules/semver/classes/comparator.js +56 -0
- package/dist/node_modules/semver/classes/range.js +148 -0
- package/dist/node_modules/semver/classes/semver.js +169 -0
- package/dist/node_modules/semver/functions/clean.js +14 -0
- package/dist/node_modules/semver/functions/cmp.js +39 -0
- package/dist/node_modules/semver/functions/coerce.js +33 -0
- package/dist/node_modules/semver/functions/compare-build.js +14 -0
- package/dist/node_modules/semver/functions/compare-loose.js +11 -0
- package/dist/node_modules/semver/functions/compare.js +11 -0
- package/dist/node_modules/semver/functions/diff.js +24 -0
- package/dist/node_modules/semver/functions/eq.js +11 -0
- package/dist/node_modules/semver/functions/gt.js +11 -0
- package/dist/node_modules/semver/functions/gte.js +11 -0
- package/dist/node_modules/semver/functions/inc.js +21 -0
- package/dist/node_modules/semver/functions/lt.js +11 -0
- package/dist/node_modules/semver/functions/lte.js +11 -0
- package/dist/node_modules/semver/functions/major.js +11 -0
- package/dist/node_modules/semver/functions/minor.js +11 -0
- package/dist/node_modules/semver/functions/neq.js +11 -0
- package/dist/node_modules/semver/functions/parse.js +21 -0
- package/dist/node_modules/semver/functions/patch.js +11 -0
- package/dist/node_modules/semver/functions/prerelease.js +14 -0
- package/dist/node_modules/semver/functions/rcompare.js +11 -0
- package/dist/node_modules/semver/functions/rsort.js +11 -0
- package/dist/node_modules/semver/functions/satisfies.js +18 -0
- package/dist/node_modules/semver/functions/sort.js +11 -0
- package/dist/node_modules/semver/functions/valid.js +14 -0
- package/dist/node_modules/semver/index.js +97 -0
- package/dist/node_modules/semver/internal/constants.js +28 -0
- package/dist/node_modules/semver/internal/debug.js +8 -0
- package/dist/node_modules/semver/internal/identifiers.js +18 -0
- package/dist/node_modules/semver/internal/lrucache.js +32 -0
- package/dist/node_modules/semver/internal/parse-options.js +10 -0
- package/dist/node_modules/semver/internal/re.js +32 -0
- package/dist/node_modules/semver/ranges/gtr.js +11 -0
- package/dist/node_modules/semver/ranges/intersects.js +11 -0
- package/dist/node_modules/semver/ranges/ltr.js +11 -0
- package/dist/node_modules/semver/ranges/max-satisfying.js +22 -0
- package/dist/node_modules/semver/ranges/min-satisfying.js +22 -0
- package/dist/node_modules/semver/ranges/min-version.js +42 -0
- package/dist/node_modules/semver/ranges/outside.js +44 -0
- package/dist/node_modules/semver/ranges/simplify.js +24 -0
- package/dist/node_modules/semver/ranges/subset.js +94 -0
- package/dist/node_modules/semver/ranges/to-comparators.js +11 -0
- package/dist/node_modules/semver/ranges/valid.js +17 -0
- package/dist/nuxt/composables/useAsyncKb.d.ts +32 -0
- package/dist/nuxt/composables/useAsyncKb.js +34 -0
- package/dist/nuxt/index.d.ts +1 -0
- package/dist/nuxt/index.js +6 -0
- package/dist/packages/mdx-render-vue/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/packages/mdx-render-vue/dist/_virtual/constants.js +4 -0
- package/dist/packages/mdx-render-vue/dist/_virtual/index.js +5 -0
- package/dist/packages/mdx-render-vue/dist/_virtual/index2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/composables/useAudioPlayer.js +40 -0
- package/dist/packages/mdx-render-vue/dist/composables/useCallout.js +66 -0
- package/dist/packages/mdx-render-vue/dist/composables/useCodeBlock.js +62 -0
- package/dist/packages/mdx-render-vue/dist/composables/useGallery.js +68 -0
- package/dist/packages/mdx-render-vue/dist/composables/useMedia.js +9 -0
- package/dist/packages/mdx-render-vue/dist/composables/useYouTube.js +24 -0
- package/dist/packages/mdx-render-vue/dist/edit/AlertEdit.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/AlertEdit.vue2.js +16 -0
- package/dist/packages/mdx-render-vue/dist/edit/AudioPlayerEdit.vue.js +102 -0
- package/dist/packages/mdx-render-vue/dist/edit/AudioPlayerEdit.vue2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/BadgeEdit.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/BadgeEdit.vue2.js +11 -0
- package/dist/packages/mdx-render-vue/dist/edit/ButtonEdit.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/ButtonEdit.vue2.js +11 -0
- package/dist/packages/mdx-render-vue/dist/edit/CalloutEdit.vue.js +78 -0
- package/dist/packages/mdx-render-vue/dist/edit/CalloutEdit.vue2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/CardEdit.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/CardEdit.vue2.js +16 -0
- package/dist/packages/mdx-render-vue/dist/edit/CodeBlockEdit.vue.js +6 -0
- package/dist/packages/mdx-render-vue/dist/edit/CodeBlockEdit.vue2.js +74 -0
- package/dist/packages/mdx-render-vue/dist/edit/GalleryEdit.vue.js +56 -0
- package/dist/packages/mdx-render-vue/dist/edit/GalleryEdit.vue2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/IconEdit.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/IconEdit.vue2.js +11 -0
- package/dist/packages/mdx-render-vue/dist/edit/TooltipEdit.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/edit/TooltipEdit.vue2.js +20 -0
- package/dist/packages/mdx-render-vue/dist/edit/YouTubeEdit.vue.js +34 -0
- package/dist/packages/mdx-render-vue/dist/edit/YouTubeEdit.vue2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/factory.js +29 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/presence/use-presence-context.js +6 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/presence/use-presence.js +32 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow-tip.js +5 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow-tip.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow.js +5 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-arrow.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-content.js +5 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-content.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-context.js +5 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-context.vue_vue_type_script_setup_true_lang.js +12 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-positioner.js +5 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-positioner.vue_vue_type_script_setup_true_lang.js +19 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root-provider.js +5 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root-provider.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root.js +5 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-root.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-trigger.js +5 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip-trigger.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/tooltip.js +22 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/use-tooltip-context.js +6 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/components/tooltip/use-tooltip.js +29 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/providers/environment/use-environment-context.js +12 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/providers/locale/use-locale-context.js +11 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/clean-props.js +8 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/create-context.js +12 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/dynamic.js +25 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/unref-element.js +8 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/use-forward-expose.js +36 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@ark-ui/vue/dist/utils/use-render-strategy.js +5 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@braintree/sanitize-url/dist/constants.js +8 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@braintree/sanitize-url/dist/index.js +60 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +532 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +403 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +136 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +128 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@iconify/vue/dist/iconify.js +1192 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/anatomy/dist/create-anatomy.js +26 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/core/dist/create-machine.js +21 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/core/dist/merge-props.js +45 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/core/dist/scope.js +16 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/core/dist/state.js +136 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/core/dist/types.js +5 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/chunk-QZ7TP4HQ.js +4 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/computed-style.js +8 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/event.js +31 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/node.js +49 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/overflow.js +19 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/platform.js +16 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/query.js +6 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/raf.js +41 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/set.js +14 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/dom-query/dist/shared.js +7 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/focus-visible/dist/index.js +90 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/popper/dist/get-anchor.js +34 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/popper/dist/get-placement.js +187 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/popper/dist/get-styles.js +47 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/popper/dist/middleware.js +56 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/popper/dist/placement.js +7 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/presence/dist/presence.connect.js +16 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/presence/dist/presence.machine.js +147 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/tooltip/dist/tooltip.anatomy.js +6 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/tooltip/dist/tooltip.connect.js +119 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/tooltip/dist/tooltip.dom.js +15 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/tooltip/dist/tooltip.machine.js +375 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/tooltip/dist/tooltip.store.js +9 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/types/dist/prop-types.js +10 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/array.js +6 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/equal.js +27 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/functions.js +10 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/guard.js +15 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/object.js +13 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/store.js +25 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/utils/dist/warning.js +25 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/vue/dist/bindable.js +37 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/vue/dist/machine.js +205 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/vue/dist/normalize-props.js +30 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/vue/dist/refs.js +14 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/@zag-js/vue/dist/track.js +19 -0
- package/dist/packages/mdx-render-vue/dist/node_modules/dompurify/dist/purify.es.js +659 -0
- package/dist/packages/mdx-render-vue/dist/registry.js +154 -0
- package/dist/packages/mdx-render-vue/dist/render/alert/Alert.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/alert/Alert.vue2.js +37 -0
- package/dist/packages/mdx-render-vue/dist/render/audioplayer/AudioPlayerDefault.vue.js +102 -0
- package/dist/packages/mdx-render-vue/dist/render/audioplayer/AudioPlayerDefault.vue2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/badge/Badge.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/badge/Badge.vue2.js +25 -0
- package/dist/packages/mdx-render-vue/dist/render/button/Button.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/button/Button.vue2.js +37 -0
- package/dist/packages/mdx-render-vue/dist/render/callout/CalloutDefault.vue.js +79 -0
- package/dist/packages/mdx-render-vue/dist/render/callout/CalloutDefault.vue2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/callout/CalloutMinimal.vue.js +22 -0
- package/dist/packages/mdx-render-vue/dist/render/callout/CalloutMinimal.vue2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/card/Card.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/card/Card.vue2.js +24 -0
- package/dist/packages/mdx-render-vue/dist/render/codeblock/CodeBlockDefault.vue.js +6 -0
- package/dist/packages/mdx-render-vue/dist/render/codeblock/CodeBlockDefault.vue2.js +77 -0
- package/dist/packages/mdx-render-vue/dist/render/gallery/GalleryGrid.vue.js +103 -0
- package/dist/packages/mdx-render-vue/dist/render/gallery/GalleryGrid.vue2.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/gallery/GalleryLightbox.vue.js +6 -0
- package/dist/packages/mdx-render-vue/dist/render/gallery/GalleryLightbox.vue2.js +142 -0
- package/dist/packages/mdx-render-vue/dist/render/icon/Icon.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/icon/Icon.vue2.js +23 -0
- package/dist/packages/mdx-render-vue/dist/render/tooltip/Tooltip.vue.js +4 -0
- package/dist/packages/mdx-render-vue/dist/render/tooltip/Tooltip.vue2.js +54 -0
- package/dist/packages/mdx-render-vue/dist/render/youtube/YouTubeDefault.vue.js +69 -0
- package/dist/packages/mdx-render-vue/dist/render/youtube/YouTubeDefault.vue2.js +4 -0
- package/dist/packages/mdx-schema/dist/composables/useMdxParsing.js +139 -0
- package/dist/packages/mdx-schema/dist/metadata/index.js +415 -0
- package/dist/packages/mdx-schema/dist/prepareProps.js +46 -0
- package/dist/packages/mdx-schema/dist/styles/index.js +119 -0
- package/dist/packages/mdx-schema/dist/types/index.js +26 -0
- package/dist/packages/sanitize/dist/html.js +41 -0
- package/dist/react/KbMdxContent.d.ts +35 -0
- package/dist/react/KbMdxContent.js +102 -0
- package/dist/react/context.d.ts +11 -0
- package/dist/react/context.js +5 -0
- package/dist/react/hooks/useImageRenderer.d.ts +6 -0
- package/dist/react/hooks/useImageRenderer.js +9 -0
- package/dist/react/hooks/useKbClient.d.ts +3 -0
- package/dist/react/hooks/useKbClient.js +7 -0
- package/dist/react/hooks/useKbContext.d.ts +3 -0
- package/dist/react/hooks/useKbContext.js +11 -0
- package/dist/react/hooks/useKbI18n.d.ts +7 -0
- package/dist/react/hooks/useKbI18n.js +8 -0
- package/dist/react/hooks/useKbLanguage.d.ts +21 -0
- package/dist/react/hooks/useKbLanguage.js +63 -0
- package/dist/react/hooks/useKbSearch.d.ts +20 -0
- package/dist/react/hooks/useKbSearch.js +22 -0
- package/dist/react/hooks/useMdxContent.d.ts +18 -0
- package/dist/react/hooks/useMdxContent.js +11 -0
- package/dist/react/index.d.ts +21 -0
- package/dist/react/index.js +20 -0
- package/dist/react/provider.d.ts +25 -0
- package/dist/react/provider.js +29 -0
- package/dist/react/server/index.d.ts +38 -0
- package/dist/react/server/index.js +26 -0
- package/dist/sdk.css +1 -0
- package/dist/vue/components/KbAccessGate.vue.d.ts +36 -0
- package/dist/vue/components/KbAccessGate.vue.js +74 -0
- package/dist/vue/components/KbAccessGate.vue2.js +4 -0
- package/dist/vue/components/KbArticleCard.vue.d.ts +34 -0
- package/dist/vue/components/KbArticleCard.vue.js +87 -0
- package/dist/vue/components/KbArticleCard.vue2.js +4 -0
- package/dist/vue/components/KbMdxContent.vue.d.ts +5 -0
- package/dist/vue/components/KbMdxContent.vue.js +7 -0
- package/dist/vue/components/KbMdxContent.vue2.js +82 -0
- package/dist/vue/composables/useArticles.d.ts +30 -0
- package/dist/vue/composables/useArticles.js +36 -0
- package/dist/vue/composables/useImageRenderer.d.ts +6 -0
- package/dist/vue/composables/useImageRenderer.js +9 -0
- package/dist/vue/composables/useKbAuth.d.ts +27 -0
- package/dist/vue/composables/useKbAuth.js +83 -0
- package/dist/vue/composables/useKbClient.d.ts +6 -0
- package/dist/vue/composables/useKbClient.js +13 -0
- package/dist/vue/composables/useKbComments.d.ts +37 -0
- package/dist/vue/composables/useKbComments.js +160 -0
- package/dist/vue/composables/useKbI18n.d.ts +6 -0
- package/dist/vue/composables/useKbI18n.js +8 -0
- package/dist/vue/composables/useKbLanguage.d.ts +22 -0
- package/dist/vue/composables/useKbLanguage.js +63 -0
- package/dist/vue/composables/useNavigation.d.ts +18 -0
- package/dist/vue/composables/useNavigation.js +20 -0
- package/dist/vue/composables/useSearch.d.ts +21 -0
- package/dist/vue/composables/useSearch.js +20 -0
- package/dist/vue/composables/useTags.d.ts +17 -0
- package/dist/vue/composables/useTags.js +36 -0
- package/dist/vue/index.d.ts +22 -0
- package/dist/vue/index.js +36 -0
- package/dist/vue/plugin.d.ts +30 -0
- package/dist/vue/plugin.js +17 -0
- package/package.json +97 -0
- package/src/core/article-seo.ts +101 -0
- package/src/core/auth.ts +138 -0
- package/src/core/blog-config.ts +30 -0
- package/src/core/client-types.ts +58 -0
- package/src/core/client.ts +287 -0
- package/src/core/i18n.ts +84 -0
- package/src/core/index.ts +147 -0
- package/src/core/markdown.ts +178 -0
- package/src/core/navigation.ts +152 -0
- package/src/core/queries.ts +414 -0
- package/src/core/retry.ts +19 -0
- package/src/core/seo.ts +374 -0
- package/src/core/theme.ts +128 -0
- package/src/core/translations/cs.json +225 -0
- package/src/core/translations/en.json +225 -0
- package/src/core/types.ts +231 -0
- package/src/core/view-model.ts +98 -0
- package/src/nuxt/composables/useAsyncKb.ts +119 -0
- package/src/nuxt/index.ts +6 -0
- package/src/react/KbMdxContent.tsx +215 -0
- package/src/react/context.ts +25 -0
- package/src/react/hooks/useImageRenderer.ts +15 -0
- package/src/react/hooks/useKbClient.ts +9 -0
- package/src/react/hooks/useKbContext.ts +13 -0
- package/src/react/hooks/useKbI18n.ts +15 -0
- package/src/react/hooks/useKbLanguage.ts +105 -0
- package/src/react/hooks/useKbSearch.ts +50 -0
- package/src/react/hooks/useMdxContent.tsx +33 -0
- package/src/react/index.ts +31 -0
- package/src/react/provider.tsx +70 -0
- package/src/react/server/index.ts +70 -0
- package/src/vue/components/KbAccessGate.vue +86 -0
- package/src/vue/components/KbArticleCard.vue +102 -0
- package/src/vue/components/KbMdxContent.vue +211 -0
- package/src/vue/composables/useArticles.ts +78 -0
- package/src/vue/composables/useImageRenderer.ts +12 -0
- package/src/vue/composables/useKbAuth.ts +131 -0
- package/src/vue/composables/useKbClient.ts +17 -0
- package/src/vue/composables/useKbComments.ts +281 -0
- package/src/vue/composables/useKbI18n.ts +11 -0
- package/src/vue/composables/useKbLanguage.ts +103 -0
- package/src/vue/composables/useNavigation.ts +38 -0
- package/src/vue/composables/useSearch.ts +52 -0
- package/src/vue/composables/useTags.ts +64 -0
- package/src/vue/index.ts +27 -0
- package/src/vue/plugin.ts +73 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content text utilities for article SEO.
|
|
3
|
+
* Pure functions — no framework dependencies.
|
|
4
|
+
*
|
|
5
|
+
* These were previously duplicated between the SDK core and the Nuxt blog
|
|
6
|
+
* (`blog/app/utils/article-seo.ts`). The two copies had diverged (the blog copy
|
|
7
|
+
* was frontmatter-aware and trimmed its output; the core copy was not). This is
|
|
8
|
+
* the single canonical implementation that both the Vue and React blogs consume
|
|
9
|
+
* via `@blogmcp/sdk` — see `buildArticleSeo` in `./seo` for the higher-level
|
|
10
|
+
* SEO-model builder that uses `generateDescription`.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Remove the first `# …` heading from markdown content.
|
|
14
|
+
*
|
|
15
|
+
* Preserves any YAML frontmatter (`--- … ---`) that precedes it, and only
|
|
16
|
+
* strips the H1 when it is the very first non-blank line of the body (so H2+
|
|
17
|
+
* and mid-document H1s are kept). Output is trimmed.
|
|
18
|
+
*/
|
|
19
|
+
export declare function stripLeadingH1(content: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Strip markdown/MDX syntax and return a plain-text snippet for a meta
|
|
22
|
+
* description. Truncates on a word boundary at `maxLength` characters.
|
|
23
|
+
*
|
|
24
|
+
* Paired MDX components are removed together with their children (component
|
|
25
|
+
* internals are not prose); self-closing MDX components are removed entirely.
|
|
26
|
+
*/
|
|
27
|
+
export declare function generateDescription(content: string, maxLength?: number): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function a(s) {
|
|
2
|
+
if (!s) return "";
|
|
3
|
+
let r = s, e = "";
|
|
4
|
+
if (r.startsWith("---")) {
|
|
5
|
+
const n = r.indexOf("---", 3);
|
|
6
|
+
n !== -1 && (e = r.substring(0, n + 3), r = r.substring(n + 3));
|
|
7
|
+
}
|
|
8
|
+
const t = r.replace(/^[\s]*# [^\n]+\n?/, "");
|
|
9
|
+
return e ? (e + t).trim() : t.trim();
|
|
10
|
+
}
|
|
11
|
+
function c(s, r = 160) {
|
|
12
|
+
if (!s) return "";
|
|
13
|
+
let e = s;
|
|
14
|
+
if (e.startsWith("---")) {
|
|
15
|
+
const i = e.indexOf("---", 3);
|
|
16
|
+
i !== -1 && (e = e.substring(i + 3));
|
|
17
|
+
}
|
|
18
|
+
if (e = e.replace(/^[\s]*# [^\n]+\n?/, ""), e = e.replace(/<[A-Z][a-zA-Z]*[^>]*>[\s\S]*?<\/[A-Z][a-zA-Z]*>/g, "").replace(/<[A-Z][a-zA-Z]*[^>]*\/?>/g, "").replace(/!\[[^\]]*\]\([^)]*\)/g, "").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/<[^>]+>/g, "").replace(/^#{1,6}\s+/gm, "").replace(/(\*{1,3}|_{1,3})(.+?)\1/g, "$2").replace(/^>\s+/gm, "").replace(/^[-*_]{3,}\s*$/gm, "").replace(/```[\s\S]*?```/g, "").replace(/`([^`]+)`/g, "$1").replace(/\s+/g, " ").trim(), e.length <= r) return e;
|
|
19
|
+
const t = e.substring(0, r), n = t.lastIndexOf(" ");
|
|
20
|
+
return (n > 0 ? t.substring(0, n) : t) + "...";
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
c as generateDescription,
|
|
24
|
+
a as stripLeadingH1
|
|
25
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework-agnostic auth manager.
|
|
3
|
+
*
|
|
4
|
+
* Handles JWT token decode, access level checking, login/logout.
|
|
5
|
+
* Consumers provide their own TokenStorage implementation.
|
|
6
|
+
*/
|
|
7
|
+
import type { TokenStorage } from './client-types';
|
|
8
|
+
import type { AuthUser, AccessLevel } from './types';
|
|
9
|
+
export interface AuthManager {
|
|
10
|
+
getToken(): string | null;
|
|
11
|
+
getUser(): AuthUser | null;
|
|
12
|
+
isAuthenticated(): boolean;
|
|
13
|
+
accessLevel(): AccessLevel;
|
|
14
|
+
hasAccess(required: AccessLevel): boolean;
|
|
15
|
+
login(token: string, user?: AuthUser): void;
|
|
16
|
+
logout(): void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Decode user info from a JWT token payload (base64url-encoded).
|
|
20
|
+
* Returns null if the token is malformed.
|
|
21
|
+
*/
|
|
22
|
+
export declare function decodeJwtUser(token: string): AuthUser | null;
|
|
23
|
+
/**
|
|
24
|
+
* Check if a user's access level meets the required level.
|
|
25
|
+
*/
|
|
26
|
+
export declare function hasAccessLevel(userLevel: AccessLevel, requiredLevel: AccessLevel): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Create an auth manager with the given token storage.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createAuthManager(storage: TokenStorage): AuthManager;
|
|
31
|
+
/** In-memory token storage (for SSR or testing) */
|
|
32
|
+
export declare function createMemoryTokenStorage(): TokenStorage;
|
|
33
|
+
/** localStorage-based token storage (browser) */
|
|
34
|
+
export declare function createLocalStorageTokenStorage(key?: string): TokenStorage;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { ACCESS_LEVEL_ORDER as o } from "./types.js";
|
|
2
|
+
function c(e) {
|
|
3
|
+
try {
|
|
4
|
+
const t = e.split(".");
|
|
5
|
+
if (t.length !== 3) return null;
|
|
6
|
+
const n = JSON.parse(atob(t[1]));
|
|
7
|
+
return {
|
|
8
|
+
id: n.sub || n.userId || "",
|
|
9
|
+
email: n.email || "",
|
|
10
|
+
name: n.name,
|
|
11
|
+
accessLevel: n.accessLevel || "public"
|
|
12
|
+
};
|
|
13
|
+
} catch {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function u(e, t) {
|
|
18
|
+
const n = o.indexOf(e), r = o.indexOf(t);
|
|
19
|
+
return n >= r;
|
|
20
|
+
}
|
|
21
|
+
function s(e) {
|
|
22
|
+
let t = null;
|
|
23
|
+
const n = e.getToken();
|
|
24
|
+
return n && (t = c(n)), {
|
|
25
|
+
getToken() {
|
|
26
|
+
return e.getToken();
|
|
27
|
+
},
|
|
28
|
+
getUser() {
|
|
29
|
+
return t;
|
|
30
|
+
},
|
|
31
|
+
isAuthenticated() {
|
|
32
|
+
return e.getToken() !== null;
|
|
33
|
+
},
|
|
34
|
+
accessLevel() {
|
|
35
|
+
return t?.accessLevel || "public";
|
|
36
|
+
},
|
|
37
|
+
hasAccess(r) {
|
|
38
|
+
return u(this.accessLevel(), r);
|
|
39
|
+
},
|
|
40
|
+
login(r, l) {
|
|
41
|
+
e.setToken(r), t = l || c(r);
|
|
42
|
+
},
|
|
43
|
+
logout() {
|
|
44
|
+
e.removeToken(), t = null;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function i() {
|
|
49
|
+
let e = null;
|
|
50
|
+
return {
|
|
51
|
+
getToken: () => e,
|
|
52
|
+
setToken: (t) => {
|
|
53
|
+
e = t;
|
|
54
|
+
},
|
|
55
|
+
removeToken: () => {
|
|
56
|
+
e = null;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function g(e = "kb_blog_token") {
|
|
61
|
+
return {
|
|
62
|
+
getToken: () => {
|
|
63
|
+
try {
|
|
64
|
+
return localStorage.getItem(e);
|
|
65
|
+
} catch {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
setToken: (t) => {
|
|
70
|
+
try {
|
|
71
|
+
localStorage.setItem(e, t);
|
|
72
|
+
} catch {
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
removeToken: () => {
|
|
76
|
+
try {
|
|
77
|
+
localStorage.removeItem(e);
|
|
78
|
+
} catch {
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
s as createAuthManager,
|
|
85
|
+
g as createLocalStorageTokenStorage,
|
|
86
|
+
i as createMemoryTokenStorage,
|
|
87
|
+
c as decodeJwtUser,
|
|
88
|
+
u as hasAccessLevel
|
|
89
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function y(c, s) {
|
|
2
|
+
const o = { ...c };
|
|
3
|
+
for (const r of Object.keys(s)) {
|
|
4
|
+
const t = o[r], e = s[r];
|
|
5
|
+
t && e && typeof t == "object" && !Array.isArray(t) && typeof e == "object" && !Array.isArray(e) ? o[r] = y(
|
|
6
|
+
t,
|
|
7
|
+
e
|
|
8
|
+
) : e !== void 0 && (o[r] = e);
|
|
9
|
+
}
|
|
10
|
+
return o;
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
y as deepMerge
|
|
14
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client configuration and interface types for the KB SDK.
|
|
3
|
+
*
|
|
4
|
+
* The core principle: consumers provide their own fetch implementation
|
|
5
|
+
* and token storage, making the SDK framework-agnostic.
|
|
6
|
+
*/
|
|
7
|
+
/** Function that performs HTTP requests. Compatible with native fetch, $fetch, axios, etc. */
|
|
8
|
+
export type Fetcher = (url: string, init: {
|
|
9
|
+
method: string;
|
|
10
|
+
headers: Record<string, string>;
|
|
11
|
+
body: string;
|
|
12
|
+
}) => Promise<{
|
|
13
|
+
data?: unknown;
|
|
14
|
+
errors?: Array<{
|
|
15
|
+
message: string;
|
|
16
|
+
}>;
|
|
17
|
+
}>;
|
|
18
|
+
/** Pluggable token storage. Implement for localStorage, cookies, or custom stores. */
|
|
19
|
+
export interface TokenStorage {
|
|
20
|
+
getToken(): string | null;
|
|
21
|
+
setToken(token: string): void;
|
|
22
|
+
removeToken(): void;
|
|
23
|
+
}
|
|
24
|
+
/** Configuration for createKbClient */
|
|
25
|
+
export interface KbClientConfig {
|
|
26
|
+
/** GraphQL endpoint URL (e.g., 'https://api.example.com/graphql') */
|
|
27
|
+
endpoint: string;
|
|
28
|
+
/** Optional: different endpoint for server-side (SSR). Falls back to endpoint. */
|
|
29
|
+
serverEndpoint?: string;
|
|
30
|
+
/** Custom fetch implementation. Defaults to native fetch wrapper. */
|
|
31
|
+
fetcher?: Fetcher;
|
|
32
|
+
/** Token storage implementation. Defaults to in-memory. */
|
|
33
|
+
tokenStorage?: TokenStorage;
|
|
34
|
+
/** Whether currently running on server (for endpoint selection). Defaults to false. */
|
|
35
|
+
isServer?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/** Generates HTML for images in markdown content. Pluggable for IPX, Cloudinary, etc. */
|
|
38
|
+
export type ImageHtmlRenderer = (href: string, alt: string, title?: string | null) => string;
|
|
39
|
+
/**
|
|
40
|
+
* HTML sanitizer function — takes dirty HTML, returns clean HTML.
|
|
41
|
+
*
|
|
42
|
+
* Mirror of `@blogmcp/sanitize`'s `SanitizeFn` type; defined here (not
|
|
43
|
+
* imported) so the SDK core has zero dependency on the sanitize package.
|
|
44
|
+
* Headless consumers either:
|
|
45
|
+
* - pass `sanitizeHtml` from `@blogmcp/sanitize` (our default policy), or
|
|
46
|
+
* - pass their own implementation matching this signature, or
|
|
47
|
+
* - omit the option and own the trust contract at their downstream renderer.
|
|
48
|
+
*
|
|
49
|
+
* See `competitor-monitor/docs/internal/sanitization-trust-contract.md`.
|
|
50
|
+
*/
|
|
51
|
+
export type SanitizeFn = (html: string) => string;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework-agnostic GraphQL client for the Knowledge Base API.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* const client = createKbClient({ endpoint: 'https://api.example.com/graphql' })
|
|
6
|
+
* const data = await client.articles.list({ status: 'published', limit: 10 })
|
|
7
|
+
*/
|
|
8
|
+
import type { KbClientConfig } from './client-types';
|
|
9
|
+
import type { Article, ArticleWithTranslation, Tag, LocalizedTag, Language, SearchResult, KBContextChunk, Translation, Comment, CommentsConnection, CommentResult, AuthResult, RegisterResult, UpdateProfileResult, ReportSettings, UpdateReportSettingsInput } from './types';
|
|
10
|
+
import type { NavNode } from './navigation';
|
|
11
|
+
export interface KbClient {
|
|
12
|
+
articles: {
|
|
13
|
+
list(params?: {
|
|
14
|
+
status?: string;
|
|
15
|
+
/** Filter to articles carrying these tag slugs (combined per tagMode). */
|
|
16
|
+
tags?: string[];
|
|
17
|
+
/** 'all' = AND (must have every tag); 'any' = OR (default). */
|
|
18
|
+
tagMode?: 'all' | 'any';
|
|
19
|
+
limit?: number;
|
|
20
|
+
offset?: number;
|
|
21
|
+
}): Promise<{
|
|
22
|
+
accessibleKbArticles: {
|
|
23
|
+
articles: Article[];
|
|
24
|
+
totalCount: number;
|
|
25
|
+
};
|
|
26
|
+
}>;
|
|
27
|
+
getWithTranslation(filename: string, languageCode: string): Promise<{
|
|
28
|
+
articleWithTranslation: ArticleWithTranslation | null;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Resolve a retired article slug to the article's current slug (no
|
|
32
|
+
* extension), or null if the slug was never an alias. Backs the blog
|
|
33
|
+
* 301-redirect after a rename.
|
|
34
|
+
*/
|
|
35
|
+
resolveAlias(filename: string): Promise<{
|
|
36
|
+
articleAliasTarget: string | null;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
search: {
|
|
40
|
+
query(params: {
|
|
41
|
+
query: string;
|
|
42
|
+
tags?: string[];
|
|
43
|
+
contentType?: string;
|
|
44
|
+
limit?: number;
|
|
45
|
+
minSimilarity?: number;
|
|
46
|
+
}): Promise<{
|
|
47
|
+
searchKnowledgeBase: SearchResult[];
|
|
48
|
+
}>;
|
|
49
|
+
getContext(query: string, maxChunks?: number): Promise<{
|
|
50
|
+
getKBContext: {
|
|
51
|
+
chunks: KBContextChunk[];
|
|
52
|
+
totalChunks: number;
|
|
53
|
+
};
|
|
54
|
+
}>;
|
|
55
|
+
};
|
|
56
|
+
tags: {
|
|
57
|
+
list(): Promise<{
|
|
58
|
+
accessibleKbTags: {
|
|
59
|
+
tags: Tag[];
|
|
60
|
+
totalCount: number;
|
|
61
|
+
};
|
|
62
|
+
}>;
|
|
63
|
+
listLocalized(languageCode: string): Promise<{
|
|
64
|
+
localizedTags: LocalizedTag[];
|
|
65
|
+
}>;
|
|
66
|
+
};
|
|
67
|
+
languages: {
|
|
68
|
+
list(): Promise<{
|
|
69
|
+
kbLanguages: Language[];
|
|
70
|
+
}>;
|
|
71
|
+
};
|
|
72
|
+
navigation: {
|
|
73
|
+
get(params?: {
|
|
74
|
+
scope?: string;
|
|
75
|
+
locale?: string;
|
|
76
|
+
}): Promise<{
|
|
77
|
+
kbNavigation: NavNode[];
|
|
78
|
+
}>;
|
|
79
|
+
};
|
|
80
|
+
translations: {
|
|
81
|
+
list(sourceFilename: string): Promise<{
|
|
82
|
+
listArticleTranslations: Translation[];
|
|
83
|
+
}>;
|
|
84
|
+
get(sourceFilename: string, languageCode: string): Promise<{
|
|
85
|
+
getTranslation: Translation;
|
|
86
|
+
}>;
|
|
87
|
+
};
|
|
88
|
+
comments: {
|
|
89
|
+
list(articleId: string, languageCode: string): Promise<{
|
|
90
|
+
articleComments: CommentsConnection;
|
|
91
|
+
}>;
|
|
92
|
+
get(commentId: string, languageCode: string): Promise<{
|
|
93
|
+
comment: Comment | null;
|
|
94
|
+
}>;
|
|
95
|
+
create(params: {
|
|
96
|
+
articleId: string;
|
|
97
|
+
content: string;
|
|
98
|
+
sourceLanguageCode: string;
|
|
99
|
+
parentCommentId?: string;
|
|
100
|
+
}): Promise<{
|
|
101
|
+
createComment: CommentResult;
|
|
102
|
+
}>;
|
|
103
|
+
update(commentId: string, content: string): Promise<{
|
|
104
|
+
updateComment: CommentResult;
|
|
105
|
+
}>;
|
|
106
|
+
delete(commentId: string): Promise<{
|
|
107
|
+
deleteComment: CommentResult;
|
|
108
|
+
}>;
|
|
109
|
+
};
|
|
110
|
+
auth: {
|
|
111
|
+
login(email: string, password: string): Promise<{
|
|
112
|
+
login: AuthResult;
|
|
113
|
+
}>;
|
|
114
|
+
register(email: string, password: string, name?: string): Promise<{
|
|
115
|
+
register: RegisterResult;
|
|
116
|
+
}>;
|
|
117
|
+
verifyEmail(token: string): Promise<{
|
|
118
|
+
verifyEmail: {
|
|
119
|
+
success: boolean;
|
|
120
|
+
error?: string;
|
|
121
|
+
};
|
|
122
|
+
}>;
|
|
123
|
+
forgotPassword(email: string): Promise<{
|
|
124
|
+
forgotPassword: RegisterResult;
|
|
125
|
+
}>;
|
|
126
|
+
resetPassword(token: string, password: string): Promise<{
|
|
127
|
+
resetPassword: {
|
|
128
|
+
success: boolean;
|
|
129
|
+
error?: string;
|
|
130
|
+
};
|
|
131
|
+
}>;
|
|
132
|
+
resendVerification(email: string): Promise<{
|
|
133
|
+
resendVerification: RegisterResult;
|
|
134
|
+
}>;
|
|
135
|
+
changePassword(currentPassword: string, newPassword: string): Promise<{
|
|
136
|
+
changePassword: {
|
|
137
|
+
success: boolean;
|
|
138
|
+
error?: string;
|
|
139
|
+
};
|
|
140
|
+
}>;
|
|
141
|
+
updateProfile(input: {
|
|
142
|
+
name?: string | null;
|
|
143
|
+
email?: string | null;
|
|
144
|
+
}): Promise<{
|
|
145
|
+
updateMyProfile: UpdateProfileResult;
|
|
146
|
+
}>;
|
|
147
|
+
};
|
|
148
|
+
reportSettings: {
|
|
149
|
+
get(): Promise<{
|
|
150
|
+
myReportSettings: ReportSettings;
|
|
151
|
+
}>;
|
|
152
|
+
update(input: UpdateReportSettingsInput): Promise<{
|
|
153
|
+
updateMyReportSettings: ReportSettings;
|
|
154
|
+
}>;
|
|
155
|
+
};
|
|
156
|
+
/** Raw GraphQL execution for escape hatch */
|
|
157
|
+
executeGraphQL<T = unknown>(query: string, variables?: Record<string, unknown>): Promise<T>;
|
|
158
|
+
}
|
|
159
|
+
export declare function createKbClient(config: KbClientConfig): KbClient;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { UPDATE_MY_PROFILE as i, UPDATE_MY_REPORT_SETTINGS as A, MY_REPORT_SETTINGS as S, CHANGE_PASSWORD as _, RESEND_VERIFICATION as l, RESET_PASSWORD as c, FORGOT_PASSWORD as R, VERIFY_EMAIL as d, REGISTER as I, LOGIN as O, DELETE_COMMENT as C, UPDATE_COMMENT as N, CREATE_COMMENT as L, GET_COMMENT as u, ARTICLE_COMMENTS as h, GET_TRANSLATION as p, ARTICLE_TRANSLATIONS as G, KB_NAVIGATION as g, KB_LANGUAGES as m, LOCALIZED_TAGS as M, ACCESSIBLE_TAGS as P, GET_KB_CONTEXT as f, SEARCH_KNOWLEDGE_BASE as D, ARTICLE_ALIAS_TARGET as y, ARTICLE_WITH_TRANSLATION as w, ACCESSIBLE_ARTICLES as B } from "./queries.js";
|
|
2
|
+
import { createMemoryTokenStorage as k } from "./auth.js";
|
|
3
|
+
function v() {
|
|
4
|
+
return async (n, o) => (await fetch(n, {
|
|
5
|
+
method: o.method,
|
|
6
|
+
headers: o.headers,
|
|
7
|
+
body: o.body
|
|
8
|
+
})).json();
|
|
9
|
+
}
|
|
10
|
+
async function x(n, o, a) {
|
|
11
|
+
const E = {
|
|
12
|
+
"Content-Type": "application/json"
|
|
13
|
+
}, s = n.tokenStorage.getToken();
|
|
14
|
+
s && (E.Authorization = `Bearer ${s}`);
|
|
15
|
+
const t = await n.fetcher(n.endpoint, {
|
|
16
|
+
method: "POST",
|
|
17
|
+
headers: E,
|
|
18
|
+
body: JSON.stringify({ query: o, variables: a })
|
|
19
|
+
});
|
|
20
|
+
if (t.errors?.length)
|
|
21
|
+
throw new Error(t.errors[0].message);
|
|
22
|
+
return t.data;
|
|
23
|
+
}
|
|
24
|
+
function K(n) {
|
|
25
|
+
const o = n.fetcher || v(), a = n.tokenStorage || k(), s = { endpoint: n.isServer && n.serverEndpoint ? n.serverEndpoint : n.endpoint, fetcher: o, tokenStorage: a };
|
|
26
|
+
function t(e, r) {
|
|
27
|
+
return x(s, e, r);
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
articles: {
|
|
31
|
+
list: (e) => t(B, e),
|
|
32
|
+
getWithTranslation: (e, r) => t(w, { filename: e, languageCode: r }),
|
|
33
|
+
resolveAlias: (e) => t(y, { filename: e })
|
|
34
|
+
},
|
|
35
|
+
search: {
|
|
36
|
+
query: (e) => t(D, e),
|
|
37
|
+
getContext: (e, r) => t(f, { query: e, maxChunks: r })
|
|
38
|
+
},
|
|
39
|
+
tags: {
|
|
40
|
+
list: () => t(P),
|
|
41
|
+
listLocalized: (e) => t(M, { languageCode: e })
|
|
42
|
+
},
|
|
43
|
+
languages: {
|
|
44
|
+
list: () => t(m)
|
|
45
|
+
},
|
|
46
|
+
navigation: {
|
|
47
|
+
get: (e) => t(g, e ?? {})
|
|
48
|
+
},
|
|
49
|
+
translations: {
|
|
50
|
+
list: (e) => t(G, { sourceFilename: e }),
|
|
51
|
+
get: (e, r) => t(p, { sourceFilename: e, languageCode: r })
|
|
52
|
+
},
|
|
53
|
+
comments: {
|
|
54
|
+
list: (e, r) => t(h, { articleId: e, languageCode: r }),
|
|
55
|
+
get: (e, r) => t(u, { commentId: e, languageCode: r }),
|
|
56
|
+
create: (e) => t(L, e),
|
|
57
|
+
update: (e, r) => t(N, { commentId: e, content: r }),
|
|
58
|
+
delete: (e) => t(C, { commentId: e })
|
|
59
|
+
},
|
|
60
|
+
auth: {
|
|
61
|
+
login: (e, r) => t(O, { email: e, password: r }),
|
|
62
|
+
register: (e, r, T) => t(I, { email: e, password: r, name: T }),
|
|
63
|
+
verifyEmail: (e) => t(d, { token: e }),
|
|
64
|
+
forgotPassword: (e) => t(R, { email: e }),
|
|
65
|
+
resetPassword: (e, r) => t(c, { token: e, password: r }),
|
|
66
|
+
resendVerification: (e) => t(l, { email: e }),
|
|
67
|
+
changePassword: (e, r) => t(_, { currentPassword: e, newPassword: r }),
|
|
68
|
+
updateProfile: (e) => t(i, {
|
|
69
|
+
name: e.name ?? null,
|
|
70
|
+
email: e.email ?? null
|
|
71
|
+
})
|
|
72
|
+
},
|
|
73
|
+
reportSettings: {
|
|
74
|
+
get: () => t(S),
|
|
75
|
+
update: (e) => t(A, e)
|
|
76
|
+
},
|
|
77
|
+
executeGraphQL: t
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
K as createKbClient
|
|
82
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* i18n utilities for the blog SDK.
|
|
3
|
+
*
|
|
4
|
+
* Ships default Czech and English translations.
|
|
5
|
+
* Consumers can override specific keys or provide entirely custom translations.
|
|
6
|
+
*/
|
|
7
|
+
import csDefaults from './translations/cs.json';
|
|
8
|
+
import enDefaults from './translations/en.json';
|
|
9
|
+
export { csDefaults as csTranslations, enDefaults as enTranslations };
|
|
10
|
+
export type TranslationMap = Record<string, unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* Merge default translations with consumer overrides.
|
|
13
|
+
* Override keys take precedence; missing keys fall back to defaults.
|
|
14
|
+
*/
|
|
15
|
+
export declare function mergeTranslations(defaults: TranslationMap, overrides: TranslationMap): TranslationMap;
|
|
16
|
+
/** Translation function type — compatible with vue-i18n's t() */
|
|
17
|
+
export type TranslateFn = (key: string, params?: Record<string, unknown>) => string;
|
|
18
|
+
/**
|
|
19
|
+
* Create a standalone translation function.
|
|
20
|
+
*
|
|
21
|
+
* @param locale - 'cs' or 'en' (or any code with provided translations)
|
|
22
|
+
* @param overrides - Optional overrides merged on top of defaults
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* const t = createKbI18n('en')
|
|
26
|
+
* t('comments.title') // → "Comments"
|
|
27
|
+
* t('articles.browseCollection', { count: 42 }) // → "Browse our collection of 42 articles"
|
|
28
|
+
*/
|
|
29
|
+
export declare function createKbI18n(locale: string, overrides?: TranslationMap): TranslateFn;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import c from "./translations/cs.json.js";
|
|
2
|
+
import f from "./translations/en.json.js";
|
|
3
|
+
import { deepMerge as i } from "./blog-config.js";
|
|
4
|
+
function l(r, t) {
|
|
5
|
+
return i(r, t);
|
|
6
|
+
}
|
|
7
|
+
function a(r, t) {
|
|
8
|
+
const e = t.split(".");
|
|
9
|
+
let n = r;
|
|
10
|
+
for (const o of e) {
|
|
11
|
+
if (n == null || typeof n != "object") return t;
|
|
12
|
+
n = n[o];
|
|
13
|
+
}
|
|
14
|
+
return typeof n == "string" ? n : t;
|
|
15
|
+
}
|
|
16
|
+
function p(r, t) {
|
|
17
|
+
return t ? r.replace(
|
|
18
|
+
/\{(\w+)\}/g,
|
|
19
|
+
(e, n) => t[n] != null ? String(t[n]) : `{${n}}`
|
|
20
|
+
) : r;
|
|
21
|
+
}
|
|
22
|
+
function b(r, t) {
|
|
23
|
+
const e = r === "cs" ? c : f, n = t ? l(e, t) : e;
|
|
24
|
+
return (o, s) => {
|
|
25
|
+
const u = a(n, o);
|
|
26
|
+
return p(u, s);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
b as createKbI18n,
|
|
31
|
+
c as csTranslations,
|
|
32
|
+
f as enTranslations,
|
|
33
|
+
l as mergeTranslations
|
|
34
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type { Article, ArticleWithTranslation, MediaGeo, ContentImageGeo, Tag, LocalizedTag, SearchResult, KBContextChunk, Translation, Language, AccessLevel, Comment, CommentSubscriptionEvent, CommentsConnection, CommentResult, AuthUser, AuthResult, RegisterResult, UpdateProfileResult, ReportSettings, ReportPolicyValue, EmailNotificationFrequency, FeedbackNotificationFrequency, UpdateReportSettingsInput, PaginatedResponse, } from './types';
|
|
2
|
+
export { ACCESS_LEVEL_ORDER } from './types';
|
|
3
|
+
export type { KbClientConfig, Fetcher, TokenStorage, ImageHtmlRenderer, SanitizeFn, } from './client-types';
|
|
4
|
+
export type { KbClient } from './client';
|
|
5
|
+
export { createKbClient } from './client';
|
|
6
|
+
export type { NavNode, NavNodeType, NavBadge, NavGroupLink, NavNextPrev, FlatNavNode } from './navigation';
|
|
7
|
+
export { navWalk, findNavNode, navBreadcrumbs, navSiblings, navSubtree, navNextPrev, isNavigable, flattenNav, } from './navigation';
|
|
8
|
+
export type { AuthManager } from './auth';
|
|
9
|
+
export { createAuthManager, createMemoryTokenStorage, createLocalStorageTokenStorage, decodeJwtUser, hasAccessLevel, } from './auth';
|
|
10
|
+
export { stripLeadingH1, generateDescription } from './article-seo';
|
|
11
|
+
export { createMarkedInstance, defaultImageHtml, parseMarkdownSafe } from './markdown';
|
|
12
|
+
export type { CreateMarkedOptions } from './markdown';
|
|
13
|
+
export { deepMerge } from './blog-config';
|
|
14
|
+
export { retryWithBackoff } from './retry';
|
|
15
|
+
export { buildThemeCssVars, hexToRgb, hexToHsl, hslToRgb, lightenColor, darkenColor, rgbTriplet, } from './theme';
|
|
16
|
+
export type { ThemeColors } from './theme';
|
|
17
|
+
export { localizedHref, stripLocalePrefix, pageUrl, buildArticleSeo, buildListPageSeo, buildHomeSeo, } from './seo';
|
|
18
|
+
export type { SeoConfig, SeoModel, SeoHreflang, SeoOpenGraph, SeoTwitter, LocalePrefixStrategy, ArticleSeoSource, BuildArticleSeoOptions, BuildListPageSeoOptions, BuildHomeSeoOptions, } from './seo';
|
|
19
|
+
export { toIsoDate, formatArticleDate, resolveArticleAccessLevel, buildArticleListItem, } from './view-model';
|
|
20
|
+
export type { ArticleListItemVM, BuildArticleListItemOptions } from './view-model';
|
|
21
|
+
export { csTranslations, enTranslations, mergeTranslations, createKbI18n, } from './i18n';
|
|
22
|
+
export type { TranslateFn, TranslationMap } from './i18n';
|
|
23
|
+
export * as queries from './queries';
|
|
24
|
+
export { prepareProps } from '@blogmcp/mdx-schema/prepareProps';
|
|
25
|
+
export { getComponentMetadata, getComponentNames, componentMetadata, } from '@blogmcp/mdx-schema/metadata';
|
|
26
|
+
export type { ComponentMetadata, PropMetadata } from '@blogmcp/mdx-schema/metadata';
|