@blogmcp/sdk 0.6.1 → 0.7.1
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/consultations/channel-text.d.ts +118 -0
- package/dist/consultations/channel-text.js +40 -0
- package/dist/consultations/index.d.ts +28 -0
- package/dist/consultations/index.js +60 -0
- package/dist/consultations/messages.cs.d.ts +149 -0
- package/dist/consultations/messages.cs.js +143 -0
- package/dist/consultations/messages.d.ts +34 -0
- package/dist/consultations/messages.en.d.ts +143 -0
- package/dist/consultations/messages.en.js +141 -0
- package/dist/consultations/messages.js +48 -0
- package/dist/consultations/outcome.d.ts +121 -0
- package/dist/consultations/outcome.js +161 -0
- package/dist/consultations/public-config.d.ts +71 -0
- package/dist/consultations/public-config.js +104 -0
- package/dist/consultations/reader.d.ts +83 -0
- package/dist/consultations/reader.js +128 -0
- package/dist/consultations/routes.d.ts +214 -0
- package/dist/consultations/routes.js +149 -0
- package/dist/consultations/server/client-ip.d.ts +50 -0
- package/dist/consultations/server/client-ip.js +44 -0
- package/dist/consultations/server/contact.d.ts +23 -0
- package/dist/consultations/server/contact.js +138 -0
- package/dist/consultations/server/context.d.ts +246 -0
- package/dist/consultations/server/context.js +152 -0
- package/dist/consultations/server/cookie.d.ts +60 -0
- package/dist/consultations/server/cookie.js +57 -0
- package/dist/consultations/server/env.d.ts +20 -0
- package/dist/consultations/server/env.js +35 -0
- package/dist/consultations/server/http.d.ts +59 -0
- package/dist/consultations/server/http.js +64 -0
- package/dist/consultations/server/index.d.ts +37 -0
- package/dist/consultations/server/index.js +19 -0
- package/dist/consultations/server/origin.d.ts +39 -0
- package/dist/consultations/server/origin.js +31 -0
- package/dist/consultations/server/server.d.ts +106 -0
- package/dist/consultations/server/server.js +122 -0
- package/dist/consultations/server/session.d.ts +38 -0
- package/dist/consultations/server/session.js +210 -0
- package/dist/consultations/server/transport.d.ts +69 -0
- package/dist/consultations/server/transport.js +117 -0
- package/dist/consultations/server/turnstile.d.ts +44 -0
- package/dist/consultations/server/turnstile.js +31 -0
- package/dist/consultations/site.d.ts +100 -0
- package/dist/consultations/site.js +60 -0
- package/dist/consultations/submit-new.d.ts +103 -0
- package/dist/consultations/submit-new.js +72 -0
- package/dist/core/auth.d.ts +2 -2
- package/dist/core/auth.js +21 -21
- package/dist/core/client.d.ts +25 -4
- package/dist/core/client.js +35 -30
- package/dist/core/consultation-adapter.d.ts +2 -2
- package/dist/core/consultations.d.ts +1 -1
- package/dist/core/errors.d.ts +1 -1
- package/dist/core/errors.js +16 -15
- package/dist/core/index.d.ts +31 -31
- package/dist/core/index.js +35 -34
- package/dist/core/markdown.d.ts +1 -1
- package/dist/core/queries.d.ts +4 -1
- package/dist/core/queries.js +131 -86
- package/dist/core/review/format.d.ts +1 -1
- package/dist/core/review/index.d.ts +2 -2
- package/dist/core/seo.d.ts +1 -1
- package/dist/core/translations/cs.json.js +1 -1
- package/dist/core/translations/en.json.js +1 -1
- package/dist/core/types.d.ts +50 -1
- package/dist/core/view-model.d.ts +12 -2
- package/dist/core/view-model.js +40 -34
- package/dist/{packages/tripmap-core/node_modules → node_modules}/pmtiles/dist/esm/index.js +1 -1
- package/dist/nuxt/composables/useAsyncKb.d.ts +4 -4
- package/dist/nuxt/index.d.ts +1 -1
- package/dist/packages/tripmap-core/dist/engine.js +3 -3
- package/dist/packages/tripmap-core/dist/generated/maplibre-worker.bundle.js +1 -1
- package/dist/react/KbMdxContent.d.ts +1 -1
- package/dist/react/context.d.ts +4 -4
- package/dist/react/hooks/useImageRenderer.d.ts +1 -1
- package/dist/react/hooks/useKbClient.d.ts +1 -1
- package/dist/react/hooks/useKbContext.d.ts +1 -1
- package/dist/react/hooks/useKbI18n.d.ts +1 -1
- package/dist/react/hooks/useKbLanguage.d.ts +1 -1
- package/dist/react/hooks/useKbSearch.d.ts +1 -1
- package/dist/react/hooks/useMdxContent.d.ts +1 -1
- package/dist/react/index.d.ts +15 -15
- package/dist/react/provider.d.ts +2 -2
- package/dist/react/server/index.d.ts +2 -2
- package/dist/vue/components/KbAccessGate.vue.d.ts +4 -1
- package/dist/vue/components/KbAccessGate.vue.js +42 -32
- package/dist/vue/components/KbArticleCard.vue.d.ts +3 -1
- package/dist/vue/components/KbArticleCard.vue.js +67 -39
- package/dist/vue/composables/useArticles.d.ts +1 -1
- package/dist/vue/composables/useImageRenderer.d.ts +1 -1
- package/dist/vue/composables/useKbAuth.d.ts +1 -1
- package/dist/vue/composables/useKbClient.d.ts +1 -1
- package/dist/vue/composables/useKbComments.d.ts +1 -1
- package/dist/vue/composables/useKbI18n.d.ts +1 -1
- package/dist/vue/composables/useKbLanguage.d.ts +1 -1
- package/dist/vue/composables/useNavigation.d.ts +1 -1
- package/dist/vue/composables/useSearch.d.ts +1 -1
- package/dist/vue/composables/useTags.d.ts +1 -1
- package/dist/vue/index.d.ts +19 -19
- package/dist/vue/plugin.d.ts +4 -4
- package/package.json +15 -5
- package/src/consultations/channel-text.ts +168 -0
- package/src/consultations/index.ts +87 -0
- package/src/consultations/messages.cs.ts +175 -0
- package/src/consultations/messages.en.ts +171 -0
- package/src/consultations/messages.ts +91 -0
- package/src/consultations/outcome.ts +278 -0
- package/src/consultations/public-config.ts +246 -0
- package/src/consultations/reader.ts +281 -0
- package/src/consultations/routes.ts +341 -0
- package/src/consultations/server/client-ip.ts +106 -0
- package/src/consultations/server/contact.ts +267 -0
- package/src/consultations/server/context.ts +403 -0
- package/src/consultations/server/cookie.ts +129 -0
- package/src/consultations/server/env.ts +66 -0
- package/src/consultations/server/http.ts +148 -0
- package/src/consultations/server/index.ts +55 -0
- package/src/consultations/server/origin.ts +71 -0
- package/src/consultations/server/server.ts +322 -0
- package/src/consultations/server/session.ts +414 -0
- package/src/consultations/server/transport.ts +196 -0
- package/src/consultations/server/turnstile.ts +98 -0
- package/src/consultations/site.ts +183 -0
- package/src/consultations/submit-new.ts +266 -0
- package/src/core/auth.ts +5 -1
- package/src/core/client.ts +32 -1
- package/src/core/errors.ts +5 -2
- package/src/core/index.ts +3 -0
- package/src/core/queries.ts +56 -0
- package/src/core/translations/cs.json +2 -1
- package/src/core/translations/en.json +2 -1
- package/src/core/types.ts +51 -0
- package/src/core/view-model.ts +18 -0
- package/src/vue/components/KbAccessGate.vue +14 -1
- package/src/vue/components/KbArticleCard.vue +25 -0
- /package/dist/{packages/tripmap-core/node_modules → node_modules}/maplibre-gl/dist/maplibre-gl-shared.js +0 -0
- /package/dist/{packages/tripmap-core/node_modules → node_modules}/maplibre-gl/dist/maplibre-gl.js +0 -0
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* resolution) computed once in pure code so the Nuxt and Next.js blogs render
|
|
6
6
|
* identical data and only differ in template markup.
|
|
7
7
|
*/
|
|
8
|
-
import type { Article, AccessLevel } from './types';
|
|
9
|
-
import { type SeoConfig } from './seo';
|
|
8
|
+
import type { Article, AccessLevel } from './types.js';
|
|
9
|
+
import { type SeoConfig } from './seo.js';
|
|
10
10
|
/**
|
|
11
11
|
* Normalize a date value to an ISO 8601 string for `<time datetime>` and
|
|
12
12
|
* machine-readable SEO fields. The KB list API (`accessibleKbArticles`) can
|
|
@@ -25,6 +25,12 @@ export declare function formatArticleDate(iso: string, locale: string): string;
|
|
|
25
25
|
* must gate identically, so this is single-sourced.
|
|
26
26
|
*/
|
|
27
27
|
export declare function resolveArticleAccessLevel(accessRights: string[] | null | undefined): AccessLevel;
|
|
28
|
+
/**
|
|
29
|
+
* The lowest tier that opens a locked article (premium before partners) — what a locked
|
|
30
|
+
* card asks the reader for. Mirrors the KB API's rule; null when a public reader can open
|
|
31
|
+
* it or nobody outside the team can.
|
|
32
|
+
*/
|
|
33
|
+
export declare function lockedRequiredAccess(access: string[] | null | undefined): 'premium' | 'partners' | null;
|
|
28
34
|
/** Render-ready view model for an article card / list item. */
|
|
29
35
|
export interface ArticleListItemVM {
|
|
30
36
|
slug: string;
|
|
@@ -43,6 +49,10 @@ export interface ArticleListItemVM {
|
|
|
43
49
|
slug: string;
|
|
44
50
|
href: string;
|
|
45
51
|
}[];
|
|
52
|
+
/** The reader may not open the article (listed with `includeLocked`): show a lock. */
|
|
53
|
+
locked: boolean;
|
|
54
|
+
/** For a locked article, the tier that opens it; null otherwise. */
|
|
55
|
+
requiredAccess: 'premium' | 'partners' | null;
|
|
46
56
|
}
|
|
47
57
|
export interface BuildArticleListItemOptions {
|
|
48
58
|
article: Article;
|
package/dist/core/view-model.js
CHANGED
|
@@ -1,47 +1,53 @@
|
|
|
1
|
-
import { ACCESS_LEVEL_ORDER as
|
|
2
|
-
import { localizedHref as
|
|
3
|
-
function
|
|
4
|
-
if (!
|
|
5
|
-
const
|
|
6
|
-
return Number.isNaN(
|
|
1
|
+
import { ACCESS_LEVEL_ORDER as o } from "./types.js";
|
|
2
|
+
import { localizedHref as c } from "./seo.js";
|
|
3
|
+
function a(t) {
|
|
4
|
+
if (!t) return null;
|
|
5
|
+
const e = new Date(t);
|
|
6
|
+
return Number.isNaN(e.getTime()) ? t : e.toISOString();
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
return new Date(
|
|
8
|
+
function d(t, e) {
|
|
9
|
+
const r = e === "cs" ? "cs-CZ" : "en-US";
|
|
10
|
+
return new Date(t).toLocaleDateString(r, {
|
|
11
11
|
year: "numeric",
|
|
12
12
|
month: "long",
|
|
13
13
|
day: "numeric"
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
if (!
|
|
18
|
-
let
|
|
19
|
-
for (const
|
|
20
|
-
const
|
|
21
|
-
|
|
16
|
+
function g(t) {
|
|
17
|
+
if (!t || t.length === 0) return "public";
|
|
18
|
+
let e = 0;
|
|
19
|
+
for (const r of t) {
|
|
20
|
+
const n = o.indexOf(r);
|
|
21
|
+
n > e && (e = n);
|
|
22
22
|
}
|
|
23
|
-
return
|
|
23
|
+
return o[e] ?? "public";
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
25
|
+
function f(t) {
|
|
26
|
+
return !t || t.includes("public") ? null : t.includes("premium") ? "premium" : t.includes("partners") ? "partners" : null;
|
|
27
|
+
}
|
|
28
|
+
function A(t) {
|
|
29
|
+
const { article: e, config: r, locale: n } = t, u = e.slug || e.filename.replace(/\.(md|mdx)$/, ""), l = e.publishedAt || e.updatedAt || null, s = a(l);
|
|
27
30
|
return {
|
|
28
|
-
slug:
|
|
29
|
-
href:
|
|
30
|
-
title:
|
|
31
|
-
description:
|
|
32
|
-
image:
|
|
33
|
-
isoDate:
|
|
34
|
-
formattedDate:
|
|
35
|
-
tags: (
|
|
36
|
-
label:
|
|
37
|
-
slug:
|
|
38
|
-
href:
|
|
39
|
-
}))
|
|
31
|
+
slug: u,
|
|
32
|
+
href: c(`/articles/${u}`, n, r),
|
|
33
|
+
title: e.title || "",
|
|
34
|
+
description: e.description ?? null,
|
|
35
|
+
image: e.featuredImageUrl ?? null,
|
|
36
|
+
isoDate: s,
|
|
37
|
+
formattedDate: l ? d(l, n) : null,
|
|
38
|
+
tags: (e.tags || []).map((i) => ({
|
|
39
|
+
label: i,
|
|
40
|
+
slug: i,
|
|
41
|
+
href: c(`/topics/${i}`, n, r)
|
|
42
|
+
})),
|
|
43
|
+
locked: e.locked === !0,
|
|
44
|
+
requiredAccess: e.locked === !0 ? f(e.access) : null
|
|
40
45
|
};
|
|
41
46
|
}
|
|
42
47
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
A as buildArticleListItem,
|
|
49
|
+
d as formatArticleDate,
|
|
50
|
+
f as lockedRequiredAccess,
|
|
51
|
+
g as resolveArticleAccessLevel,
|
|
52
|
+
a as toIsoDate
|
|
47
53
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { decompressSync as k } from "
|
|
1
|
+
import { decompressSync as k } from "../../../fflate/esm/browser.js";
|
|
2
2
|
var K = Object.defineProperty, F = Math.pow, h = (i, t) => K(i, "name", { value: t, configurable: !0 }), g = (i, t, e) => new Promise((r, n) => {
|
|
3
3
|
var s = (l) => {
|
|
4
4
|
try {
|
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
* const { articles, totalCount } = await useAsyncArticleList('home', { status: 'published' })
|
|
9
9
|
*/
|
|
10
10
|
import type { Ref } from 'vue';
|
|
11
|
-
import type { ArticleListParams } from '../../vue/composables/useArticles';
|
|
11
|
+
import type { ArticleListParams } from '../../vue/composables/useArticles.js';
|
|
12
12
|
/**
|
|
13
13
|
* SSR-hydrated article list.
|
|
14
14
|
*
|
|
15
15
|
* Wraps useArticleList with Nuxt's useAsyncData.
|
|
16
16
|
*/
|
|
17
|
-
export declare function useAsyncArticleList(key: string, params?: ArticleListParams, watchDeps?: unknown[]): Promise<import("../../vue").UseArticleListReturn>;
|
|
17
|
+
export declare function useAsyncArticleList(key: string, params?: ArticleListParams, watchDeps?: unknown[]): Promise<import("../../vue/index.js").UseArticleListReturn>;
|
|
18
18
|
/**
|
|
19
19
|
* SSR-hydrated single article.
|
|
20
20
|
*
|
|
21
21
|
* Wraps useArticle with Nuxt's useAsyncData.
|
|
22
22
|
*/
|
|
23
|
-
export declare function useAsyncArticle(key: string, filename: Ref<string> | string, languageCode: Ref<string> | string, watchDeps?: unknown[]): Promise<import("../../vue").UseArticleReturn>;
|
|
23
|
+
export declare function useAsyncArticle(key: string, filename: Ref<string> | string, languageCode: Ref<string> | string, watchDeps?: unknown[]): Promise<import("../../vue/index.js").UseArticleReturn>;
|
|
24
24
|
/**
|
|
25
25
|
* SSR-hydrated navigation menu.
|
|
26
26
|
*
|
|
@@ -29,4 +29,4 @@ export declare function useAsyncArticle(key: string, filename: Ref<string> | str
|
|
|
29
29
|
export declare function useAsyncNavigation(key: string, params?: {
|
|
30
30
|
scope?: string;
|
|
31
31
|
locale?: string;
|
|
32
|
-
}, watchDeps?: unknown[]): Promise<import("../../vue").UseNavigationReturn>;
|
|
32
|
+
}, watchDeps?: unknown[]): Promise<import("../../vue/index.js").UseNavigationReturn>;
|
package/dist/nuxt/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { useAsyncArticleList, useAsyncArticle, useAsyncNavigation, } from './composables/useAsyncKb';
|
|
1
|
+
export { useAsyncArticleList, useAsyncArticle, useAsyncNavigation, } from './composables/useAsyncKb.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Map as be, NavigationControl as we, FullscreenControl as ve, GeolocateControl as xe, Popup as Ce, setWorkerUrl as Ee, Marker as Le } from "
|
|
2
|
-
import { Protocol as ke } from "
|
|
1
|
+
import { Map as be, NavigationControl as we, FullscreenControl as ve, GeolocateControl as xe, Popup as Ce, setWorkerUrl as Ee, Marker as Le } from "../../../node_modules/maplibre-gl/dist/maplibre-gl.js";
|
|
2
|
+
import { Protocol as ke } from "../../../node_modules/pmtiles/dist/esm/index.js";
|
|
3
3
|
import { ImagePreloader as Me } from "./preload.js";
|
|
4
4
|
import { mapyRouteUrl as Ne, googleMapsRouteUrl as _e, buildGpx as Se, gpxFileName as Ae } from "./export.js";
|
|
5
5
|
import { Lightbox as De } from "./lightbox.js";
|
|
@@ -15,7 +15,7 @@ import { createPopupContent as qe, setMarkerActive as W, MarkerPool as $e, creat
|
|
|
15
15
|
import { formatTimeHHMM as Ze, lineNodes as Ve } from "./nodes.js";
|
|
16
16
|
import { startPlayback as Ye } from "./playback.js";
|
|
17
17
|
import { watchSystemTheme as Je, resolveTheme as Z, carryTripMapLayers as Ke } from "./theme.js";
|
|
18
|
-
import { Mn as Qe } from "
|
|
18
|
+
import { Mn as Qe } from "../../../node_modules/maplibre-gl/dist/maplibre-gl-shared.js";
|
|
19
19
|
const w = "tripmap-nodes", V = "tripmap-line", Xe = "tripmap-line-layer", et = "tripmap-nodes-anchor", tt = 17;
|
|
20
20
|
let ae = !1;
|
|
21
21
|
function rt() {
|