@blogmcp/sdk 0.3.2 → 0.6.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/core/client-types.d.ts +7 -1
- package/dist/core/client.d.ts +25 -1
- package/dist/core/client.js +38 -34
- package/dist/core/consultation-adapter.d.ts +90 -0
- package/dist/core/consultation-adapter.js +200 -0
- package/dist/core/consultations.d.ts +108 -0
- package/dist/core/consultations.js +95 -0
- package/dist/core/errors.d.ts +52 -0
- package/dist/core/errors.js +73 -0
- package/dist/core/index.d.ts +7 -1
- package/dist/core/index.js +80 -64
- package/dist/core/queries.d.ts +16 -1
- package/dist/core/queries.js +198 -61
- package/dist/core/review/format.d.ts +30 -0
- package/dist/core/review/format.js +78 -0
- package/dist/core/review/index.d.ts +6 -0
- package/dist/core/review/index.js +9 -0
- package/dist/core/review/types.d.ts +176 -0
- package/dist/core/review/types.js +9 -0
- package/dist/core/server-only.d.ts +12 -0
- package/dist/core/server-only.js +11 -0
- package/dist/core/types.d.ts +295 -0
- package/dist/packages/mdx-schema/dist/metadata/index.js +3 -3
- package/dist/packages/mdx-schema/dist/styles/index.js +7 -1
- package/dist/packages/mdx-schema/dist/tripmap.js +64 -51
- package/dist/packages/tripmap-core/dist/attribution.js +121 -6
- package/dist/packages/tripmap-core/dist/css.js +68 -16
- package/dist/packages/tripmap-core/dist/detail.js +10 -9
- package/dist/packages/tripmap-core/dist/engine.js +285 -247
- package/dist/packages/tripmap-core/dist/export.js +48 -46
- package/dist/packages/tripmap-core/dist/filmstrip.js +30 -17
- package/dist/packages/tripmap-core/dist/framing.js +30 -30
- package/dist/packages/tripmap-core/dist/generated/maplibre-worker.bundle.js +1 -1
- package/dist/packages/tripmap-core/dist/heading.js +8 -0
- package/dist/packages/tripmap-core/dist/href.js +18 -0
- package/dist/packages/tripmap-core/dist/index.js +32 -24
- package/dist/packages/tripmap-core/dist/lightbox.js +31 -29
- package/dist/packages/tripmap-core/dist/line.js +6 -6
- package/dist/packages/tripmap-core/dist/markers.js +47 -43
- package/dist/packages/tripmap-core/dist/nodes.js +56 -43
- package/dist/packages/tripmap-core/dist/playback.js +17 -17
- package/dist/packages/tripmap-core/dist/preload.js +14 -14
- package/dist/packages/tripmap-core/dist/theme.js +21 -21
- package/dist/{node_modules → packages/tripmap-core/node_modules}/maplibre-gl/dist/maplibre-gl.js +1890 -1720
- package/dist/{node_modules → packages/tripmap-core/node_modules}/pmtiles/dist/esm/index.js +1 -1
- package/package.json +8 -3
- package/src/core/client-types.ts +13 -2
- package/src/core/client.ts +40 -5
- package/src/core/consultation-adapter.ts +408 -0
- package/src/core/consultations.ts +224 -0
- package/src/core/errors.ts +145 -0
- package/src/core/index.ts +68 -0
- package/src/core/queries.ts +167 -3
- package/src/core/review/format.ts +138 -0
- package/src/core/review/index.ts +22 -0
- package/src/core/review/types.ts +168 -0
- package/src/core/server-only.ts +20 -0
- package/src/core/types.ts +337 -0
- /package/dist/{node_modules → packages/tripmap-core/node_modules}/maplibre-gl/dist/maplibre-gl-shared.js +0 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { KbGraphQLError as a } from "./errors.js";
|
|
2
|
+
import { WITHDRAW_MY_CONSULTATION_CONSENT as r, MY_CONSULTATION_CONSENT as S, REQUEST_MY_CONSULTATION_ERASURE as C, POST_MY_CONSULTATION_MESSAGE as l, CREATE_MY_CONSULTATION as u, MY_CONSULTATION as T, MY_CONSULTATIONS as N, CONSULTATION_PUBLIC_CONFIG as O, REQUEST_CONSULTATION_LINK as c, ATTACH_CONSULTATION_TO_MY_ACCOUNT as _, CLOSE_CONSULTATION_SESSION as E, REQUEST_CONSULTATION_ERASURE_BY_SESSION as I, POST_CONSULTATION_MESSAGE_BY_SESSION as A, CONSULTATION_BY_SESSION as d, EXCHANGE_CONSULTATION_LINK as L } from "./queries.js";
|
|
3
|
+
import { assertServerOnly as U } from "./server-only.js";
|
|
4
|
+
async function s(n, t) {
|
|
5
|
+
const e = (await n)?.[t];
|
|
6
|
+
if (e === void 0)
|
|
7
|
+
throw new a([{ message: `Malformed GraphQL response: data.${t} is missing` }]);
|
|
8
|
+
return e;
|
|
9
|
+
}
|
|
10
|
+
function f(n) {
|
|
11
|
+
return {
|
|
12
|
+
publicConfig: (t) => s(n(O, { locale: t }), "consultationPublicConfig"),
|
|
13
|
+
mine: (t) => s(
|
|
14
|
+
n(N, { limit: t?.limit, offset: t?.offset }),
|
|
15
|
+
"myConsultations"
|
|
16
|
+
),
|
|
17
|
+
get: (t) => s(n(T, { id: t }), "myConsultation"),
|
|
18
|
+
create: (t) => s(
|
|
19
|
+
n(u, {
|
|
20
|
+
// Only the fields of CreateMyConsultationInput: an unknown key would
|
|
21
|
+
// fail GraphQL input coercion for the whole request.
|
|
22
|
+
input: {
|
|
23
|
+
body: t.body,
|
|
24
|
+
languageCode: t.languageCode,
|
|
25
|
+
consent: t.consent ? { version: t.consent.version, locale: t.consent.locale } : void 0,
|
|
26
|
+
notice: t.notice ? { version: t.notice.version, locale: t.notice.locale } : void 0,
|
|
27
|
+
clientRequestId: t.clientRequestId
|
|
28
|
+
}
|
|
29
|
+
}),
|
|
30
|
+
"createMyConsultation"
|
|
31
|
+
),
|
|
32
|
+
post: (t, o) => s(
|
|
33
|
+
n(l, {
|
|
34
|
+
consultationId: t,
|
|
35
|
+
body: o.body,
|
|
36
|
+
clientRequestId: o.clientRequestId
|
|
37
|
+
}),
|
|
38
|
+
"postMyConsultationMessage"
|
|
39
|
+
),
|
|
40
|
+
requestErasure: (t) => s(n(C, { consultationId: t }), "requestMyConsultationErasure"),
|
|
41
|
+
consent: (t) => s(n(S, { locale: t }), "myConsultationConsent"),
|
|
42
|
+
withdrawConsent: () => s(n(r, {}), "withdrawMyConsultationConsent")
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const y = "a consultation session or link token must never reach page JavaScript.";
|
|
46
|
+
function q(n) {
|
|
47
|
+
const t = (o, e) => async (...i) => (U(`consultationSession.${o}`, y), e(...i));
|
|
48
|
+
return {
|
|
49
|
+
exchange: t(
|
|
50
|
+
"exchange",
|
|
51
|
+
(o) => s(n(L, { token: o }), "exchangeConsultationLink")
|
|
52
|
+
),
|
|
53
|
+
get: t(
|
|
54
|
+
"get",
|
|
55
|
+
(o) => s(n(d, { session: o }), "consultationBySession")
|
|
56
|
+
),
|
|
57
|
+
post: t(
|
|
58
|
+
"post",
|
|
59
|
+
(o, e) => s(
|
|
60
|
+
n(A, {
|
|
61
|
+
session: o,
|
|
62
|
+
body: e.body,
|
|
63
|
+
clientRequestId: e.clientRequestId
|
|
64
|
+
}),
|
|
65
|
+
"postConsultationMessageBySession"
|
|
66
|
+
)
|
|
67
|
+
),
|
|
68
|
+
requestErasure: t(
|
|
69
|
+
"requestErasure",
|
|
70
|
+
(o) => s(
|
|
71
|
+
n(I, { session: o }),
|
|
72
|
+
"requestConsultationErasureBySession"
|
|
73
|
+
)
|
|
74
|
+
),
|
|
75
|
+
close: t(
|
|
76
|
+
"close",
|
|
77
|
+
(o) => s(n(E, { session: o }), "closeConsultationSession")
|
|
78
|
+
),
|
|
79
|
+
attach: t(
|
|
80
|
+
"attach",
|
|
81
|
+
(o) => s(
|
|
82
|
+
n(_, { session: o }),
|
|
83
|
+
"attachConsultationToMyAccount"
|
|
84
|
+
)
|
|
85
|
+
),
|
|
86
|
+
requestLink: t(
|
|
87
|
+
"requestLink",
|
|
88
|
+
(o) => s(n(c, { email: o }), "requestConsultationLink")
|
|
89
|
+
)
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
q as createConsultationSessionApi,
|
|
94
|
+
f as createConsultationsApi
|
|
95
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Errors raised by the KB SDK.
|
|
3
|
+
*
|
|
4
|
+
* `KbGraphQLError` is thrown for every GraphQL error the KB API returns. It is
|
|
5
|
+
* an `Error` subclass that keeps the server's message, so code written against
|
|
6
|
+
* SDK 0.3 (`catch (e) { e.message }`) keeps working; new code reads the
|
|
7
|
+
* machine-readable `code` from `errors[0].extensions.code` instead of parsing
|
|
8
|
+
* the message.
|
|
9
|
+
*
|
|
10
|
+
* `CONSULTATION_ERROR_CODES` mirrors the KB API's single list of reader
|
|
11
|
+
* consultation codes (apps/knowledge-base/api/src/services/consultations/
|
|
12
|
+
* consultation-errors.ts, docs/internal/reader-consultations.md §11). A drift
|
|
13
|
+
* test compares the two lists.
|
|
14
|
+
*/
|
|
15
|
+
/** Every reader-consultation error code of the KB API, in its declaration order. */
|
|
16
|
+
export declare const CONSULTATION_ERROR_CODES: readonly ["UNAUTHENTICATED", "FORBIDDEN", "NOT_FOUND", "FEATURE_DISABLED", "INVALID_INPUT", "BODY_TOO_LONG", "NOTICE_REQUIRED", "NOTICE_VERSION_UNKNOWN", "CONSENT_REQUIRED", "CONSENT_VERSION_UNKNOWN", "CHANNEL_NOT_ALLOWED", "THREAD_REQUIRED", "SENDER_MISMATCH", "QUOTA_EXCEEDED", "INVALID_LINK", "THREAD_CLOSED", "ATTACH_EMAIL_MISMATCH", "STALE_THREAD", "STALE_LEASE", "NOTHING_TO_DO", "IDEMPOTENCY_CONFLICT", "LEGAL_HOLD", "CONTENT_ACCESS_REQUIRED", "READER_URL_MISSING", "READER_PATH_MISSING", "TEXT_MISSING", "OPERATOR_MISSING", "TEXT_VERSION_EXISTS", "CONTENT_ACCESS_ATTESTATION_REQUIRED", "AI_DRAFTS_DISABLED", "AI_LOCAL_UNAVAILABLE", "PROCESSING_RESTRICTED", "DRAFT_FLAGS_UNACKNOWLEDGED", "REPLY_POLICY_MISSING", "DRAFT_ID_REQUIRED", "CARD_GUARD_FAILED", "CARD_CONFIRMATION_REQUIRED", "STALE_CARD", "RETRY_LATER", "INTERNAL_ERROR"];
|
|
17
|
+
/** A reader-consultation error code (the `code` of a result or of a thrown error). */
|
|
18
|
+
export type ConsultationErrorCode = (typeof CONSULTATION_ERROR_CODES)[number];
|
|
19
|
+
/**
|
|
20
|
+
* Any error code the SDK can surface: a consultation code, a code a GraphQL
|
|
21
|
+
* server attaches on its own (validation, parse, ...), or any other string a
|
|
22
|
+
* newer server may send. The `string & {}` arm keeps editor autocompletion for
|
|
23
|
+
* the known codes while accepting unknown ones.
|
|
24
|
+
*/
|
|
25
|
+
export type KbErrorCode = ConsultationErrorCode | 'GRAPHQL_VALIDATION_FAILED' | 'GRAPHQL_PARSE_FAILED' | 'BAD_USER_INPUT' | 'INTERNAL_SERVER_ERROR' | (string & {});
|
|
26
|
+
/** True for a code from the consultation list (narrows unknown codes away). */
|
|
27
|
+
export declare function isConsultationErrorCode(code: unknown): code is ConsultationErrorCode;
|
|
28
|
+
/** One GraphQL error as the server sent it (the shape of `response.errors[n]`). */
|
|
29
|
+
export interface RawGraphQLError {
|
|
30
|
+
message: string;
|
|
31
|
+
path?: ReadonlyArray<string | number>;
|
|
32
|
+
extensions?: Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
/** One GraphQL error, normalised. */
|
|
35
|
+
export interface KbGraphQLErrorEntry {
|
|
36
|
+
message: string;
|
|
37
|
+
/** `extensions.code`, or null when the server attached none. */
|
|
38
|
+
code: KbErrorCode | null;
|
|
39
|
+
path: ReadonlyArray<string | number> | null;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A GraphQL error returned by the KB API. `message` and `code` come from the
|
|
43
|
+
* FIRST error; `errors` holds all of them.
|
|
44
|
+
*/
|
|
45
|
+
export declare class KbGraphQLError extends Error {
|
|
46
|
+
/** `errors[0].extensions.code`, or null when absent. */
|
|
47
|
+
readonly code: KbErrorCode | null;
|
|
48
|
+
readonly errors: readonly KbGraphQLErrorEntry[];
|
|
49
|
+
constructor(errors: ReadonlyArray<RawGraphQLError | unknown>);
|
|
50
|
+
}
|
|
51
|
+
/** True for a KbGraphQLError, also one thrown by another copy of the SDK. */
|
|
52
|
+
export declare function isKbGraphQLError(err: unknown): err is KbGraphQLError;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const R = [
|
|
2
|
+
"UNAUTHENTICATED",
|
|
3
|
+
"FORBIDDEN",
|
|
4
|
+
"NOT_FOUND",
|
|
5
|
+
"FEATURE_DISABLED",
|
|
6
|
+
"INVALID_INPUT",
|
|
7
|
+
"BODY_TOO_LONG",
|
|
8
|
+
"NOTICE_REQUIRED",
|
|
9
|
+
"NOTICE_VERSION_UNKNOWN",
|
|
10
|
+
"CONSENT_REQUIRED",
|
|
11
|
+
"CONSENT_VERSION_UNKNOWN",
|
|
12
|
+
"CHANNEL_NOT_ALLOWED",
|
|
13
|
+
"THREAD_REQUIRED",
|
|
14
|
+
"SENDER_MISMATCH",
|
|
15
|
+
"QUOTA_EXCEEDED",
|
|
16
|
+
"INVALID_LINK",
|
|
17
|
+
"THREAD_CLOSED",
|
|
18
|
+
"ATTACH_EMAIL_MISMATCH",
|
|
19
|
+
"STALE_THREAD",
|
|
20
|
+
"STALE_LEASE",
|
|
21
|
+
"NOTHING_TO_DO",
|
|
22
|
+
"IDEMPOTENCY_CONFLICT",
|
|
23
|
+
"LEGAL_HOLD",
|
|
24
|
+
"CONTENT_ACCESS_REQUIRED",
|
|
25
|
+
"READER_URL_MISSING",
|
|
26
|
+
"READER_PATH_MISSING",
|
|
27
|
+
"TEXT_MISSING",
|
|
28
|
+
"OPERATOR_MISSING",
|
|
29
|
+
"TEXT_VERSION_EXISTS",
|
|
30
|
+
"CONTENT_ACCESS_ATTESTATION_REQUIRED",
|
|
31
|
+
"AI_DRAFTS_DISABLED",
|
|
32
|
+
"AI_LOCAL_UNAVAILABLE",
|
|
33
|
+
"PROCESSING_RESTRICTED",
|
|
34
|
+
"DRAFT_FLAGS_UNACKNOWLEDGED",
|
|
35
|
+
"REPLY_POLICY_MISSING",
|
|
36
|
+
"DRAFT_ID_REQUIRED",
|
|
37
|
+
"CARD_GUARD_FAILED",
|
|
38
|
+
"CARD_CONFIRMATION_REQUIRED",
|
|
39
|
+
"STALE_CARD",
|
|
40
|
+
"RETRY_LATER",
|
|
41
|
+
"INTERNAL_ERROR"
|
|
42
|
+
], T = new Set(R);
|
|
43
|
+
function e(E) {
|
|
44
|
+
return typeof E == "string" && T.has(E);
|
|
45
|
+
}
|
|
46
|
+
const r = 128;
|
|
47
|
+
function I(E) {
|
|
48
|
+
const _ = E ?? {}, A = _.extensions?.code;
|
|
49
|
+
return {
|
|
50
|
+
message: typeof _.message == "string" && _.message !== "" ? _.message : "GraphQL error",
|
|
51
|
+
code: typeof A == "string" && A !== "" && A.length <= r ? A : null,
|
|
52
|
+
path: Array.isArray(_.path) ? [..._.path] : null
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const N = /* @__PURE__ */ Symbol.for("@blogmcp/sdk/KbGraphQLError");
|
|
56
|
+
class O extends Error {
|
|
57
|
+
/** `errors[0].extensions.code`, or null when absent. */
|
|
58
|
+
code;
|
|
59
|
+
errors;
|
|
60
|
+
constructor(_) {
|
|
61
|
+
const A = (_.length > 0 ? _ : [void 0]).map(I);
|
|
62
|
+
super(A[0].message), this.name = "KbGraphQLError", this.code = A[0].code, this.errors = A, Object.defineProperty(this, N, { value: !0 });
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function D(E) {
|
|
66
|
+
return E instanceof O ? !0 : E instanceof Error && E[N] === !0;
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
R as CONSULTATION_ERROR_CODES,
|
|
70
|
+
O as KbGraphQLError,
|
|
71
|
+
e as isConsultationErrorCode,
|
|
72
|
+
D as isKbGraphQLError
|
|
73
|
+
};
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export type { Article, ArticleWithTranslation, ArticleVersionContent, 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';
|
|
1
|
+
export type { Article, ArticleWithTranslation, ArticleVersionContent, MediaGeo, ContentImageGeo, Tag, LocalizedTag, SearchResult, KBContextChunk, Translation, Language, AccessLevel, Comment, CommentSubscriptionEvent, CommentsConnection, CommentResult, AuthUser, AuthResult, RegisterResult, UpdateProfileResult, ReportSettings, ReportPolicyValue, EmailNotificationFrequency, FeedbackNotificationFrequency, UpdateReportSettingsInput, PaginatedResponse, ReaderConsultationStatus, ReaderConsultationAuthor, ReaderConsultationMessage, ReaderConsultation, ReaderConsultationSummary, ReaderConsultationResult, ConsultationSessionResult, ConsultationLegalMode, ConsultationLegalText, ConsultationChannelConfig, ConsultationPublicConfig, ConsultationLegalInput, CreateMyConsultationInput, ConsultationMessageInput, ReaderConsultationConsent, ConsultationConsentWithdrawalResult, ConsultationOwnerRef, ConsultationConsentInput, ConsultationNewThreadInput, ConsultationIngestInput, ConsultationIngestResult, ConsultationDeliveryKind, ConsultationLeaseInput, ConsultationLeasedDelivery, ConsultationLeaseResult, ConsultationAckInput, ConsultationFailInput, ConsultationOkResult, ConsultationOutboxStats, ConsultationEraseInput, ConsultationEraseResult, ConsultationOwnerRefsInput, ConsultationOwnerRefsResult, ConsultationThreadOwner, ConsultationThreadByNotice, } from './types';
|
|
2
2
|
export { ACCESS_LEVEL_ORDER } from './types';
|
|
3
|
+
export { KbGraphQLError, isKbGraphQLError, CONSULTATION_ERROR_CODES, isConsultationErrorCode, } from './errors';
|
|
4
|
+
export type { KbErrorCode, ConsultationErrorCode, KbGraphQLErrorEntry, RawGraphQLError, } from './errors';
|
|
3
5
|
export type { KbClientConfig, Fetcher, TokenStorage, ImageHtmlRenderer, SanitizeFn, } from './client-types';
|
|
4
6
|
export type { KbClient } from './client';
|
|
5
7
|
export { createKbClient } from './client';
|
|
@@ -9,6 +11,9 @@ export type { AuthManager } from './auth';
|
|
|
9
11
|
export { createAuthManager, createMemoryTokenStorage, createLocalStorageTokenStorage, decodeJwtUser, hasAccessLevel, } from './auth';
|
|
10
12
|
export { createDelegatedTokenMinter, DelegatedTokenError, } from './delegated-identity';
|
|
11
13
|
export type { DelegatedTokenMinter, DelegatedTokenMinterConfig, DelegatedMintInput, DelegatedIdentity, } from './delegated-identity';
|
|
14
|
+
export type { KbConsultationsApi, KbConsultationSessionApi } from './consultations';
|
|
15
|
+
export { createConsultationAdapterClient, ConsultationAdapterError, isConsultationAdapterError, } from './consultation-adapter';
|
|
16
|
+
export type { ConsultationAdapterClient, ConsultationAdapterClientConfig, ConsultationAdapterOperation, } from './consultation-adapter';
|
|
12
17
|
export { stripLeadingH1, generateDescription } from './article-seo';
|
|
13
18
|
export { createMarkedInstance, defaultImageHtml, parseMarkdownSafe } from './markdown';
|
|
14
19
|
export type { CreateMarkedOptions } from './markdown';
|
|
@@ -26,3 +31,4 @@ export * as queries from './queries';
|
|
|
26
31
|
export { prepareProps } from '@blogmcp/mdx-schema/prepareProps';
|
|
27
32
|
export { getComponentMetadata, getComponentNames, componentMetadata, } from '@blogmcp/mdx-schema/metadata';
|
|
28
33
|
export type { ComponentMetadata, PropMetadata } from '@blogmcp/mdx-schema/metadata';
|
|
34
|
+
export * from './review';
|
package/dist/core/index.js
CHANGED
|
@@ -1,70 +1,86 @@
|
|
|
1
1
|
import { ACCESS_LEVEL_ORDER as t } from "./types.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
2
|
+
import { CONSULTATION_ERROR_CODES as n, KbGraphQLError as i, isConsultationErrorCode as s, isKbGraphQLError as l } from "./errors.js";
|
|
3
|
+
import { createKbClient as m } from "./client.js";
|
|
4
|
+
import { findNavNode as d, flattenNav as c, isNavigable as x, navBreadcrumbs as g, navNextPrev as E, navSiblings as T, navSubtree as u, navWalk as b } from "./navigation.js";
|
|
5
|
+
import { createAuthManager as C, createLocalStorageTokenStorage as v, createMemoryTokenStorage as R, decodeJwtUser as S, hasAccessLevel as L } from "./auth.js";
|
|
6
|
+
import { DelegatedTokenError as k, createDelegatedTokenMinter as N } from "./delegated-identity.js";
|
|
7
|
+
import { ConsultationAdapterError as M, createConsultationAdapterClient as _, isConsultationAdapterError as D } from "./consultation-adapter.js";
|
|
8
|
+
import { generateDescription as H, stripLeadingH1 as O } from "./article-seo.js";
|
|
9
|
+
import { createMarkedInstance as K, defaultImageHtml as U, parseMarkdownSafe as V } from "./markdown.js";
|
|
10
|
+
import { deepMerge as G } from "./blog-config.js";
|
|
11
|
+
import { retryWithBackoff as B } from "./retry.js";
|
|
12
|
+
import { buildThemeCssVars as Q, darkenColor as q, hexToHsl as z, hexToRgb as J, hslToRgb as j, lightenColor as X, rgbTriplet as Y } from "./theme.js";
|
|
13
|
+
import { buildArticleSeo as $, buildHomeSeo as ee, buildListPageSeo as re, localizedHref as oe, pageUrl as te, stripLocalePrefix as ae } from "./seo.js";
|
|
14
|
+
import { buildArticleListItem as ie, formatArticleDate as se, resolveArticleAccessLevel as le, toIsoDate as pe } from "./view-model.js";
|
|
15
|
+
import { createKbI18n as fe, mergeTranslations as de } from "./i18n.js";
|
|
14
16
|
import * as e from "./queries.js";
|
|
15
|
-
import { prepareProps as
|
|
16
|
-
import { componentMetadata as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
17
|
+
import { prepareProps as xe } from "../packages/mdx-schema/dist/prepareProps.js";
|
|
18
|
+
import { componentMetadata as Ee, getComponentMetadata as Te, getComponentNames as ue } from "../packages/mdx-schema/dist/metadata/index.js";
|
|
19
|
+
import { REVIEW_PAGE_PATH as Ae, REVIEW_ROUTE_PATTERN as Ce, isReviewTokenFormat as ve } from "./review/types.js";
|
|
20
|
+
import { formatReviewForAgent as Se, formatReviewRound as Le } from "./review/format.js";
|
|
21
|
+
import { default as ke } from "./translations/cs.json.js";
|
|
22
|
+
import { default as Ie } from "./translations/en.json.js";
|
|
19
23
|
export {
|
|
20
24
|
t as ACCESS_LEVEL_ORDER,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
25
|
+
n as CONSULTATION_ERROR_CODES,
|
|
26
|
+
M as ConsultationAdapterError,
|
|
27
|
+
k as DelegatedTokenError,
|
|
28
|
+
i as KbGraphQLError,
|
|
29
|
+
Ae as REVIEW_PAGE_PATH,
|
|
30
|
+
Ce as REVIEW_ROUTE_PATTERN,
|
|
31
|
+
ie as buildArticleListItem,
|
|
32
|
+
$ as buildArticleSeo,
|
|
33
|
+
ee as buildHomeSeo,
|
|
34
|
+
re as buildListPageSeo,
|
|
35
|
+
Q as buildThemeCssVars,
|
|
36
|
+
Ee as componentMetadata,
|
|
37
|
+
C as createAuthManager,
|
|
38
|
+
_ as createConsultationAdapterClient,
|
|
39
|
+
N as createDelegatedTokenMinter,
|
|
40
|
+
m as createKbClient,
|
|
41
|
+
fe as createKbI18n,
|
|
42
|
+
v as createLocalStorageTokenStorage,
|
|
43
|
+
K as createMarkedInstance,
|
|
44
|
+
R as createMemoryTokenStorage,
|
|
45
|
+
ke as csTranslations,
|
|
46
|
+
q as darkenColor,
|
|
47
|
+
S as decodeJwtUser,
|
|
48
|
+
G as deepMerge,
|
|
49
|
+
U as defaultImageHtml,
|
|
50
|
+
Ie as enTranslations,
|
|
51
|
+
d as findNavNode,
|
|
52
|
+
c as flattenNav,
|
|
53
|
+
se as formatArticleDate,
|
|
54
|
+
Se as formatReviewForAgent,
|
|
55
|
+
Le as formatReviewRound,
|
|
56
|
+
H as generateDescription,
|
|
57
|
+
Te as getComponentMetadata,
|
|
58
|
+
ue as getComponentNames,
|
|
59
|
+
L as hasAccessLevel,
|
|
60
|
+
z as hexToHsl,
|
|
61
|
+
J as hexToRgb,
|
|
62
|
+
j as hslToRgb,
|
|
63
|
+
D as isConsultationAdapterError,
|
|
64
|
+
s as isConsultationErrorCode,
|
|
65
|
+
l as isKbGraphQLError,
|
|
66
|
+
x as isNavigable,
|
|
67
|
+
ve as isReviewTokenFormat,
|
|
68
|
+
X as lightenColor,
|
|
69
|
+
oe as localizedHref,
|
|
70
|
+
de as mergeTranslations,
|
|
71
|
+
g as navBreadcrumbs,
|
|
72
|
+
E as navNextPrev,
|
|
73
|
+
T as navSiblings,
|
|
74
|
+
u as navSubtree,
|
|
75
|
+
b as navWalk,
|
|
76
|
+
te as pageUrl,
|
|
77
|
+
V as parseMarkdownSafe,
|
|
78
|
+
xe as prepareProps,
|
|
63
79
|
e as queries,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
80
|
+
le as resolveArticleAccessLevel,
|
|
81
|
+
B as retryWithBackoff,
|
|
82
|
+
Y as rgbTriplet,
|
|
83
|
+
O as stripLeadingH1,
|
|
84
|
+
ae as stripLocalePrefix,
|
|
85
|
+
pe as toIsoDate
|
|
70
86
|
};
|
package/dist/core/queries.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare const KB_NAVIGATION = "\n query KbNavigation($scope: String, $lo
|
|
|
16
16
|
export declare const ACCESSIBLE_TAGS = "\n query AccessibleTags {\n accessibleKbTags {\n tags {\n id\n slug\n name\n description\n color\n }\n totalCount\n }\n }\n";
|
|
17
17
|
export declare const LOCALIZED_TAGS = "\n query LocalizedTags($languageCode: String!) {\n localizedTags(languageCode: $languageCode) {\n id\n name\n slug\n description\n color\n accessLevel\n languageCode\n isFallback\n }\n }\n";
|
|
18
18
|
export declare const KB_LANGUAGES = "\n query KBLanguages {\n kbLanguages {\n id\n code\n name\n nativeName\n isSource\n isEnabled\n sortOrder\n }\n }\n";
|
|
19
|
-
export declare const ARTICLE_TRANSLATIONS = "\n query ArticleTranslations($
|
|
19
|
+
export declare const ARTICLE_TRANSLATIONS = "\n query ArticleTranslations($articleId: ID!) {\n listArticleTranslations(articleId: $articleId) {\n id\n languageCode\n title\n syncStatus\n reviewed\n updatedAt\n }\n }\n";
|
|
20
20
|
export declare const GET_TRANSLATION = "\n query GetTranslation($sourceFilename: String!, $languageCode: String!) {\n getTranslation(sourceFilename: $sourceFilename, languageCode: $languageCode) {\n id\n articleId\n languageCode\n title\n content\n syncStatus\n reviewed\n translatedBy\n updatedAt\n }\n }\n";
|
|
21
21
|
export declare const ARTICLE_COMMENTS = "\n query ArticleComments($articleId: ID!, $languageCode: String!) {\n articleComments(articleId: $articleId, languageCode: $languageCode) {\n comments {\n \n id\n articleId\n userId\n userName\n parentCommentId\n displayContent\n displayLanguageCode\n sourceLanguageCode\n sourceContent\n isPendingTranslation\n isTranslated\n isEdited\n createdAt\n\n replies {\n \n id\n articleId\n userId\n userName\n parentCommentId\n displayContent\n displayLanguageCode\n sourceLanguageCode\n sourceContent\n isPendingTranslation\n isTranslated\n isEdited\n createdAt\n\n replies {\n \n id\n articleId\n userId\n userName\n parentCommentId\n displayContent\n displayLanguageCode\n sourceLanguageCode\n sourceContent\n isPendingTranslation\n isTranslated\n isEdited\n createdAt\n\n replies {\n \n id\n articleId\n userId\n userName\n parentCommentId\n displayContent\n displayLanguageCode\n sourceLanguageCode\n sourceContent\n isPendingTranslation\n isTranslated\n isEdited\n createdAt\n\n }\n }\n }\n }\n totalCount\n }\n }\n";
|
|
22
22
|
export declare const GET_COMMENT = "\n query GetComment($commentId: ID!, $languageCode: String!) {\n comment(commentId: $commentId, languageCode: $languageCode) {\n \n id\n articleId\n userId\n userName\n parentCommentId\n displayContent\n displayLanguageCode\n sourceLanguageCode\n sourceContent\n isPendingTranslation\n isTranslated\n isEdited\n createdAt\n\n replies {\n \n id\n articleId\n userId\n userName\n parentCommentId\n displayContent\n displayLanguageCode\n sourceLanguageCode\n sourceContent\n isPendingTranslation\n isTranslated\n isEdited\n createdAt\n\n }\n }\n }\n";
|
|
@@ -34,3 +34,18 @@ export declare const CHANGE_PASSWORD = "\n mutation ChangePassword($currentPass
|
|
|
34
34
|
export declare const UPDATE_MY_PROFILE = "\n mutation UpdateMyProfile($name: String, $email: String) {\n updateMyProfile(name: $name, email: $email) {\n success\n emailChanged\n user {\n id\n email\n name\n accessLevel\n }\n error\n }\n }\n";
|
|
35
35
|
export declare const MY_REPORT_SETTINGS = "\n query MyReportSettings {\n myReportSettings {\n autoReportErrors\n autoReportContent\n autoReportPerformance\n includeContextData\n rateLimitPerHour\n emailNotifications\n feedbackNotifications\n }\n }\n";
|
|
36
36
|
export declare const UPDATE_MY_REPORT_SETTINGS = "\n mutation UpdateMyReportSettings(\n $autoReportErrors: String\n $autoReportContent: String\n $autoReportPerformance: String\n $includeContextData: Boolean\n $rateLimitPerHour: Int\n $emailNotifications: String\n $feedbackNotifications: String\n ) {\n updateMyReportSettings(\n autoReportErrors: $autoReportErrors\n autoReportContent: $autoReportContent\n autoReportPerformance: $autoReportPerformance\n includeContextData: $includeContextData\n rateLimitPerHour: $rateLimitPerHour\n emailNotifications: $emailNotifications\n feedbackNotifications: $feedbackNotifications\n ) {\n autoReportErrors\n autoReportContent\n autoReportPerformance\n includeContextData\n rateLimitPerHour\n emailNotifications\n feedbackNotifications\n }\n }\n";
|
|
37
|
+
export declare const CONSULTATION_PUBLIC_CONFIG = "\n query ConsultationPublicConfig($locale: String!) {\n consultationPublicConfig(locale: $locale) {\n enabled\n channels {\n channel\n mode\n text {\n purpose\n version\n locale\n body\n }\n }\n }\n }\n";
|
|
38
|
+
export declare const MY_CONSULTATIONS = "\n query MyConsultations($limit: Int, $offset: Int) {\n myConsultations(limit: $limit, offset: $offset) {\n id\n status\n createdAt\n lastActivityAt\n messageCount\n }\n }\n";
|
|
39
|
+
export declare const MY_CONSULTATION = "\n query MyConsultation($id: ID!) {\n myConsultation(id: $id) {\n id\n status\n canReply\n canAttachToAccount\n createdAt\n lastActivityAt\n messages {\n id\n author\n authorName\n body\n createdAt\n }\n}\n }\n";
|
|
40
|
+
export declare const CREATE_MY_CONSULTATION = "\n mutation CreateMyConsultation($input: CreateMyConsultationInput!) {\n createMyConsultation(input: $input) {\n success\n code\n error\n duplicate\n consultation {\n id\n status\n canReply\n canAttachToAccount\n createdAt\n lastActivityAt\n messages {\n id\n author\n authorName\n body\n createdAt\n }\n}\n}\n }\n";
|
|
41
|
+
export declare const POST_MY_CONSULTATION_MESSAGE = "\n mutation PostMyConsultationMessage($consultationId: ID!, $body: String!, $clientRequestId: String!) {\n postMyConsultationMessage(consultationId: $consultationId, body: $body, clientRequestId: $clientRequestId) {\n success\n code\n error\n duplicate\n consultation {\n id\n status\n canReply\n canAttachToAccount\n createdAt\n lastActivityAt\n messages {\n id\n author\n authorName\n body\n createdAt\n }\n}\n}\n }\n";
|
|
42
|
+
export declare const REQUEST_MY_CONSULTATION_ERASURE = "\n mutation RequestMyConsultationErasure($consultationId: ID!) {\n requestMyConsultationErasure(consultationId: $consultationId) {\n success\n code\n error\n duplicate\n consultation {\n id\n status\n canReply\n canAttachToAccount\n createdAt\n lastActivityAt\n messages {\n id\n author\n authorName\n body\n createdAt\n }\n}\n}\n }\n";
|
|
43
|
+
export declare const MY_CONSULTATION_CONSENT = "\n query MyConsultationConsent($locale: String!) {\n myConsultationConsent(locale: $locale) {\n mode\n active\n givenAt\n version\n needsConsent\n text {\n purpose\n version\n locale\n body\n }\n }\n }\n";
|
|
44
|
+
export declare const WITHDRAW_MY_CONSULTATION_CONSENT = "\n mutation WithdrawMyConsultationConsent {\n withdrawMyConsultationConsent {\n success\n code\n error\n threadsClosed\n }\n }\n";
|
|
45
|
+
export declare const EXCHANGE_CONSULTATION_LINK = "\n mutation ExchangeConsultationLink($token: String!) {\n exchangeConsultationLink(token: $token) {\n success\n code\n error\n session\n expiresAt\n consultation {\n id\n status\n canReply\n canAttachToAccount\n createdAt\n lastActivityAt\n messages {\n id\n author\n authorName\n body\n createdAt\n }\n}\n }\n }\n";
|
|
46
|
+
export declare const CONSULTATION_BY_SESSION = "\n query ConsultationBySession($session: String!) {\n consultationBySession(session: $session) {\n id\n status\n canReply\n canAttachToAccount\n createdAt\n lastActivityAt\n messages {\n id\n author\n authorName\n body\n createdAt\n }\n}\n }\n";
|
|
47
|
+
export declare const POST_CONSULTATION_MESSAGE_BY_SESSION = "\n mutation PostConsultationMessageBySession($session: String!, $body: String!, $clientRequestId: String!) {\n postConsultationMessageBySession(session: $session, body: $body, clientRequestId: $clientRequestId) {\n success\n code\n error\n duplicate\n consultation {\n id\n status\n canReply\n canAttachToAccount\n createdAt\n lastActivityAt\n messages {\n id\n author\n authorName\n body\n createdAt\n }\n}\n}\n }\n";
|
|
48
|
+
export declare const REQUEST_CONSULTATION_ERASURE_BY_SESSION = "\n mutation RequestConsultationErasureBySession($session: String!) {\n requestConsultationErasureBySession(session: $session) {\n success\n code\n error\n duplicate\n consultation {\n id\n status\n canReply\n canAttachToAccount\n createdAt\n lastActivityAt\n messages {\n id\n author\n authorName\n body\n createdAt\n }\n}\n}\n }\n";
|
|
49
|
+
export declare const CLOSE_CONSULTATION_SESSION = "\n mutation CloseConsultationSession($session: String!) {\n closeConsultationSession(session: $session) {\n success\n code\n error\n duplicate\n consultation {\n id\n status\n canReply\n canAttachToAccount\n createdAt\n lastActivityAt\n messages {\n id\n author\n authorName\n body\n createdAt\n }\n}\n}\n }\n";
|
|
50
|
+
export declare const ATTACH_CONSULTATION_TO_MY_ACCOUNT = "\n mutation AttachConsultationToMyAccount($session: String!) {\n attachConsultationToMyAccount(session: $session) {\n success\n code\n error\n duplicate\n consultation {\n id\n status\n canReply\n canAttachToAccount\n createdAt\n lastActivityAt\n messages {\n id\n author\n authorName\n body\n createdAt\n }\n}\n}\n }\n";
|
|
51
|
+
export declare const REQUEST_CONSULTATION_LINK = "\n mutation RequestConsultationLink($email: String!) {\n requestConsultationLink(email: $email)\n }\n";
|