@sparkvault/sdk-js 15.14.1 → 15.14.3

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.
@@ -8,6 +8,7 @@ export interface HelpDeskFormDraft {
8
8
  subject: string;
9
9
  body: string;
10
10
  attachments: string[];
11
+ source_article_id?: string;
11
12
  } | null;
12
13
  hadFiles: boolean;
13
14
  }
@@ -36,6 +36,8 @@ export interface HelpDeskFormOptions {
36
36
  assistance_attempt_id: string;
37
37
  assistance_visitor_id: string;
38
38
  } | undefined;
39
+ /** @internal Optional article reference, captured once with the submitted composition. */
40
+ sourceArticleId?: () => string | undefined;
39
41
  /**
40
42
  * Ask host code for a server-issued help desk session. This callback must
41
43
  * not construct a session from a browser-supplied user ID or email address.
@@ -1,6 +1,6 @@
1
1
  import type { ResolvedConfig } from '../../config';
2
- import type { KbMediaHydration, KbReaderDocument, KbSearchResponse, KbSearchResult, KbUnlockOptions, KbWidgetConfig } from './kb-types';
3
- export type { KbMediaHydration, KbReaderDocument, KbSearchResponse, KbSearchResult, KbUnlockOptions, KbWidgetConfig } from './kb-types';
2
+ import type { KbArticleVote, KbMediaHydration, KbReaderDocument, KbSearchResponse, KbSearchResult, KbUnlockOptions, KbWidgetConfig } from './kb-types';
3
+ export type { KbArticleVote, KbMediaHydration, KbReaderDocument, KbSearchResponse, KbSearchResult, KbUnlockOptions, KbWidgetConfig } from './kb-types';
4
4
  export declare class HelpDeskKnowledgeBaseClient {
5
5
  private readonly sdkConfig;
6
6
  private readonly deskId;
@@ -9,6 +9,9 @@ export declare class HelpDeskKnowledgeBaseClient {
9
9
  private config;
10
10
  private index;
11
11
  private indexPending;
12
+ private visitorSession;
13
+ private visitorPending;
14
+ private readonly voteQueues;
12
15
  private readonly objectUrls;
13
16
  private generation;
14
17
  private readerRevision;
@@ -27,6 +30,12 @@ export declare class HelpDeskKnowledgeBaseClient {
27
30
  private result;
28
31
  search(issue: string): Promise<KbSearchResponse>;
29
32
  resolveLink(value: string): Promise<KbSearchResult | null>;
33
+ /** Resolve a ticket's article reference only against the current authorized publication. */
34
+ resolveArticle(id: string): Promise<KbSearchResult | null>;
35
+ private visitor;
36
+ /** Use the help center's browser visitor and vote receipt; ticket identity is never sent. */
37
+ vote(article: KbReaderDocument, vote: 'yes' | 'no'): Promise<KbArticleVote>;
38
+ private saveVote;
30
39
  read(result: KbSearchResult): Promise<KbReaderDocument>;
31
40
  /** Paint article text first; hydrate only approved media without replacing the reader DOM. */
32
41
  hydrateAssets(document: KbReaderDocument, callbacks: KbMediaHydration): () => void;
@@ -37,6 +37,12 @@ export interface KbReaderDocument {
37
37
  /** Release-local image paths, hydrated separately after the readable text is shown. */
38
38
  assets: string[];
39
39
  }
40
+ /** Acknowledged article feedback, counted once per anonymous browser visitor. */
41
+ export interface KbArticleVote {
42
+ vote: 'yes' | 'no';
43
+ version: number;
44
+ review_url?: string | null;
45
+ }
40
46
  export interface KbMediaHydration {
41
47
  onAsset: (path: string, blobUrl: string) => void;
42
48
  onError?: (path: string, error: unknown) => void;
@@ -0,0 +1,2 @@
1
+ /** Scoped brand properties work in both a hosted page and an unrelated widget host. */
2
+ export declare function applySupportBrand(target: HTMLElement, value: unknown): void;
@@ -1,5 +1,5 @@
1
1
  import type { HelpDeskConnectOptions, HelpDeskSession, HelpDeskTicketCreated } from './types';
2
- export type HelpDeskSupportStage = 'issue' | 'results' | 'article' | 'feedback' | 'contact' | 'receipt';
2
+ export type HelpDeskSupportStage = 'issue' | 'results' | 'article' | 'feedback' | 'resolved' | 'contact' | 'receipt';
3
3
  export interface HelpDeskSupportLauncherOptions {
4
4
  /** HTTPS image URL. Omit to use the accessible question-mark icon. */
5
5
  imageUrl?: string;
@@ -31,6 +31,8 @@ export interface HelpDeskSupportOptions extends HelpDeskConnectOptions {
31
31
  export interface HelpDeskSupportOpenOptions {
32
32
  /** Prefill the initial question only when starting a new support conversation. */
33
33
  issue?: string;
34
+ /** Continue directly from a published article that did not resolve the question. */
35
+ articleId?: string;
34
36
  }
35
37
  export interface HelpDeskSupportState {
36
38
  visible: boolean;
@@ -1,10 +1,11 @@
1
1
  import type { KbReaderDocument, KbSearchResult } from './kb-types';
2
- export type SupportViewStage = 'issue' | 'results' | 'article' | 'feedback' | 'contact' | 'receipt';
2
+ export type SupportViewStage = 'issue' | 'results' | 'article' | 'feedback' | 'resolved' | 'contact' | 'receipt';
3
3
  export type SupportContactReason = 'direct' | 'no_results' | 'none_match' | 'article_not_answered';
4
4
  /** Presentation data only; the support controller owns authentication and writes. */
5
5
  export interface SupportViewState {
6
6
  visible: boolean;
7
7
  deskName: string;
8
+ brandColor?: string | null;
8
9
  stage: SupportViewStage;
9
10
  issue: string;
10
11
  busy?: boolean;
@@ -12,6 +13,13 @@ export interface SupportViewState {
12
13
  results?: KbSearchResult[];
13
14
  article?: KbReaderDocument;
14
15
  articleUrl?: string;
16
+ feedbackBusy?: boolean;
17
+ feedbackError?: string;
18
+ reviewUrl?: string;
19
+ sourceArticle?: {
20
+ title: string;
21
+ url: string;
22
+ };
15
23
  identityPending?: boolean;
16
24
  navigationLocked?: boolean;
17
25
  kbState?: 'ready' | 'empty' | 'unavailable' | 'locked';
@@ -39,6 +47,7 @@ export interface SupportViewActions {
39
47
  onBack: () => void;
40
48
  onClose: () => void;
41
49
  onAnswered: () => void;
50
+ onRetryFeedback?: () => void;
42
51
  onRetry?: () => void;
43
52
  onUnlock?: (password?: string) => void;
44
53
  onUnlockTicketAccess?: (password?: string) => void;
@@ -78,6 +87,7 @@ export declare class SupportView {
78
87
  private readonly resultStatus;
79
88
  private readonly resultError;
80
89
  private readonly contactResults;
90
+ private readonly resultsFooter;
81
91
  private readonly articleTitle;
82
92
  private readonly articleCategory;
83
93
  private readonly articleContent;
@@ -85,6 +95,12 @@ export declare class SupportView {
85
95
  private readonly articleError;
86
96
  private readonly articleRetry;
87
97
  private readonly articleFooter;
98
+ private readonly feedbackStatus;
99
+ private readonly feedbackError;
100
+ private readonly retryFeedback;
101
+ private readonly reviewPrompt;
102
+ private readonly reviewLink;
103
+ private readonly sourceArticle;
88
104
  private readonly contactTitle;
89
105
  private readonly contactStatus;
90
106
  private readonly contactError;
@@ -130,6 +130,8 @@ export interface HelpDeskCreateTicketOptions {
130
130
  /** Optional server-minted support-assistance correlation; never includes the customer's question. */
131
131
  assistance_attempt_id?: string;
132
132
  assistance_visitor_id?: string;
133
+ /** Optional published article ID; Core resolves its metadata for the support operator. */
134
+ source_article_id?: string;
133
135
  }
134
136
  export interface HelpDeskTicket {
135
137
  number: number;