@sparkvault/sdk-js 19.0.0 → 19.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.
Files changed (132) hide show
  1. package/README.md +26 -4
  2. package/dist/npm/chunks/index-BnP-2w0t.cjs +13025 -0
  3. package/dist/npm/chunks/index-BnP-2w0t.cjs.map +1 -0
  4. package/dist/npm/chunks/index-CgR08uMG.mjs +12960 -0
  5. package/dist/npm/chunks/index-CgR08uMG.mjs.map +1 -0
  6. package/dist/npm/identity.cjs +23 -0
  7. package/dist/npm/identity.cjs.map +1 -0
  8. package/dist/npm/identity.mjs +12 -0
  9. package/dist/npm/identity.mjs.map +1 -0
  10. package/dist/{index.cjs → npm/index.cjs} +799 -13755
  11. package/dist/npm/index.cjs.map +1 -0
  12. package/dist/{index.mjs → npm/index.mjs} +200 -13155
  13. package/dist/npm/index.mjs.map +1 -0
  14. package/dist/sparkvault-identity.js +2 -0
  15. package/dist/sparkvault-identity.js.map +1 -0
  16. package/dist/sparkvault.js +1 -1
  17. package/dist/types/identity.d.ts +8 -0
  18. package/dist/{index.d.ts → types/index.d.ts} +4 -790
  19. package/dist/types/shared/errors-C-gjmGBs.d.ts +800 -0
  20. package/package.json +20 -9
  21. package/dist/api-base.d.ts +0 -116
  22. package/dist/auto-init.d.ts +0 -32
  23. package/dist/config.d.ts +0 -79
  24. package/dist/entropy/index.d.ts +0 -35
  25. package/dist/entropy/types.d.ts +0 -32
  26. package/dist/errors.d.ts +0 -146
  27. package/dist/folders/index.d.ts +0 -102
  28. package/dist/folders/types.d.ts +0 -91
  29. package/dist/health.d.ts +0 -18
  30. package/dist/http.d.ts +0 -46
  31. package/dist/index.cjs.map +0 -1
  32. package/dist/index.mjs.map +0 -1
  33. package/dist/ingots/fetch-download.d.ts +0 -78
  34. package/dist/ingots/history.d.ts +0 -4
  35. package/dist/ingots/index.d.ts +0 -388
  36. package/dist/ingots/revision.d.ts +0 -4
  37. package/dist/ingots/types.d.ts +0 -556
  38. package/dist/logger.d.ts +0 -32
  39. package/dist/notify/index.d.ts +0 -154
  40. package/dist/notify/types.d.ts +0 -232
  41. package/dist/products/help-desk/client.d.ts +0 -198
  42. package/dist/products/help-desk/desk-id.d.ts +0 -2
  43. package/dist/products/help-desk/form-draft.d.ts +0 -37
  44. package/dist/products/help-desk/form-types.d.ts +0 -123
  45. package/dist/products/help-desk/form.d.ts +0 -83
  46. package/dist/products/help-desk/index.d.ts +0 -47
  47. package/dist/products/help-desk/kb-client.d.ts +0 -48
  48. package/dist/products/help-desk/kb-types.d.ts +0 -59
  49. package/dist/products/help-desk/modal.d.ts +0 -8
  50. package/dist/products/help-desk/styles.d.ts +0 -9
  51. package/dist/products/help-desk/support-analytics-types.d.ts +0 -32
  52. package/dist/products/help-desk/support-analytics.d.ts +0 -3
  53. package/dist/products/help-desk/support-brand.d.ts +0 -49
  54. package/dist/products/help-desk/support-controller.d.ts +0 -4
  55. package/dist/products/help-desk/support-history.d.ts +0 -38
  56. package/dist/products/help-desk/support-launcher.d.ts +0 -12
  57. package/dist/products/help-desk/support-styles.d.ts +0 -14
  58. package/dist/products/help-desk/support-types.d.ts +0 -66
  59. package/dist/products/help-desk/support-view.d.ts +0 -173
  60. package/dist/products/help-desk/types.d.ts +0 -285
  61. package/dist/products/help-desk/widget-identity.d.ts +0 -32
  62. package/dist/products/identity/api.d.ts +0 -237
  63. package/dist/products/identity/container.d.ts +0 -44
  64. package/dist/products/identity/dialog-launcher.d.ts +0 -133
  65. package/dist/products/identity/federation-flow.d.ts +0 -31
  66. package/dist/products/identity/handlers/otp-handler.d.ts +0 -69
  67. package/dist/products/identity/handlers/passkey-handler.d.ts +0 -105
  68. package/dist/products/identity/handlers/sparklink-handler.d.ts +0 -34
  69. package/dist/products/identity/index.d.ts +0 -296
  70. package/dist/products/identity/inline-container.d.ts +0 -53
  71. package/dist/products/identity/methods.d.ts +0 -19
  72. package/dist/products/identity/modal.d.ts +0 -51
  73. package/dist/products/identity/pending-signin.d.ts +0 -102
  74. package/dist/products/identity/popup-launcher.d.ts +0 -73
  75. package/dist/products/identity/renderer.d.ts +0 -525
  76. package/dist/products/identity/state.d.ts +0 -84
  77. package/dist/products/identity/styles.d.ts +0 -31
  78. package/dist/products/identity/types.d.ts +0 -561
  79. package/dist/products/identity/utils/cooldown-timer.d.ts +0 -73
  80. package/dist/products/identity/utils.d.ts +0 -85
  81. package/dist/products/identity/views/backup-verify.d.ts +0 -42
  82. package/dist/products/identity/views/base.d.ts +0 -51
  83. package/dist/products/identity/views/error.d.ts +0 -65
  84. package/dist/products/identity/views/icons.d.ts +0 -41
  85. package/dist/products/identity/views/identity-input.d.ts +0 -80
  86. package/dist/products/identity/views/index.d.ts +0 -20
  87. package/dist/products/identity/views/loading.d.ts +0 -23
  88. package/dist/products/identity/views/method-button.d.ts +0 -14
  89. package/dist/products/identity/views/method-select.d.ts +0 -42
  90. package/dist/products/identity/views/origin-not-allowed.d.ts +0 -25
  91. package/dist/products/identity/views/otp-verify.d.ts +0 -58
  92. package/dist/products/identity/views/passkey-auto.d.ts +0 -22
  93. package/dist/products/identity/views/passkey-prompt.d.ts +0 -25
  94. package/dist/products/identity/views/passkey.d.ts +0 -38
  95. package/dist/products/identity/views/product-not-configured.d.ts +0 -21
  96. package/dist/products/identity/views/service-unavailable.d.ts +0 -21
  97. package/dist/products/identity/views/sms-consent.d.ts +0 -16
  98. package/dist/products/identity/views/sparklink-waiting.d.ts +0 -40
  99. package/dist/products/identity/views/two-factor.d.ts +0 -37
  100. package/dist/products/index.d.ts +0 -51
  101. package/dist/products/messaging/index.d.ts +0 -38
  102. package/dist/products/messaging/types.d.ts +0 -162
  103. package/dist/products/notify/index.d.ts +0 -436
  104. package/dist/products/notify/project-types.d.ts +0 -44
  105. package/dist/products/notify/projects.d.ts +0 -15
  106. package/dist/products/notify/types.d.ts +0 -1327
  107. package/dist/products/structured-ingots/index.d.ts +0 -31
  108. package/dist/products/structured-ingots/types-client.d.ts +0 -19
  109. package/dist/products/structured-ingots/types.d.ts +0 -293
  110. package/dist/products/structured-ingots/validation.d.ts +0 -25
  111. package/dist/request-path.d.ts +0 -44
  112. package/dist/sparks/index.d.ts +0 -91
  113. package/dist/sparks/types.d.ts +0 -304
  114. package/dist/ui/chrome.d.ts +0 -16
  115. package/dist/ui/ds-tokens.d.ts +0 -59
  116. package/dist/ui/inline-shell.d.ts +0 -19
  117. package/dist/ui/live-region.d.ts +0 -15
  118. package/dist/ui/modal-shell.d.ts +0 -67
  119. package/dist/ui/target.d.ts +0 -6
  120. package/dist/utils/dom.d.ts +0 -26
  121. package/dist/vault-session.d.ts +0 -2
  122. package/dist/vaults/index.d.ts +0 -254
  123. package/dist/vaults/types.d.ts +0 -368
  124. package/dist/vaults/upload/api.d.ts +0 -310
  125. package/dist/vaults/upload/chrome.d.ts +0 -21
  126. package/dist/vaults/upload/container.d.ts +0 -37
  127. package/dist/vaults/upload/index.d.ts +0 -76
  128. package/dist/vaults/upload/inline-container.d.ts +0 -41
  129. package/dist/vaults/upload/modal.d.ts +0 -55
  130. package/dist/vaults/upload/renderer.d.ts +0 -150
  131. package/dist/vaults/upload/styles.d.ts +0 -14
  132. package/dist/vaults/upload/types.d.ts +0 -220
@@ -1,123 +0,0 @@
1
- import type { SupportBrand } from './support-brand';
2
- import type { HelpDeskCustomer, HelpDeskSession, HelpDeskTicketCreated } from './types';
3
- /**
4
- * @internal The unsent text a widget form hands on with an account change, and
5
- * `hadFiles` when its composer held files then: files never go on to another form.
6
- */
7
- export interface HelpDeskCarriedComposition {
8
- subject: string;
9
- body: string;
10
- hadFiles: boolean;
11
- }
12
- /**
13
- * @internal The account change a widget form arrives from, carrying the request
14
- * on: a Sign out, to a signed-out form, or a Switch account or Use website
15
- * account, to the account arrived at. `droppedFiles` when files the request
16
- * held stayed behind.
17
- */
18
- export interface HelpDeskFormArrival {
19
- from: 'signOut' | 'switch';
20
- droppedFiles: boolean;
21
- }
22
- /** Internal adapter used by the KB-first support widget; a standalone form verifies the customer itself. */
23
- export interface HelpDeskWidgetFormIdentity {
24
- customer: HelpDeskCustomer | null;
25
- /**
26
- * Open the native sign-in window in the caller's gesture, with no hint of
27
- * who signs in: the window offers the accounts this browser is signed in
28
- * to, or a sign-in, and asks a missing name itself. A session it answers
29
- * that the form does not install, the form discards
30
- * (`HelpDeskClient.discardSession`).
31
- */
32
- signIn(): Promise<HelpDeskSession>;
33
- /**
34
- * Open the sign-in window's account chooser in the caller's gesture. This
35
- * customer stays signed in until another account is chosen; the promise
36
- * then resolves as a form for that account, carrying `composition`,
37
- * replaces this one. It rejects, nothing changed, when no account is
38
- * chosen: a UserCancelledError when the window closes.
39
- *
40
- * No `composition` is handed on while a send is under way, unanswered or done.
41
- */
42
- switchAccount(composition: HelpDeskCarriedComposition | null): Promise<void>;
43
- /** Sign this customer out of support, without a window: a signed-out form carrying `composition` replaces this one. */
44
- signOut(composition: HelpDeskCarriedComposition | null): void;
45
- /**
46
- * Present when the host bridges its website account: sign in with it again,
47
- * carrying the request, or, `recovering`, a website-account customer's
48
- * hidden saved request, which the next form keeps hidden while the website
49
- * gives no account back.
50
- */
51
- useWebsiteAccount?: (composition: HelpDeskCarriedComposition | null, recovering?: boolean) => void;
52
- /** Keep a website-account customer's saved request hidden from the start, as the form this one replaces did; `websiteSignedOut` when the website just gave no account back. */
53
- recovering?: {
54
- websiteSignedOut: boolean;
55
- };
56
- /**
57
- * The account change this form arrives from, which it says. A saved request
58
- * this tab holds for the account arrived at takes the carried text's place,
59
- * and its own status stands.
60
- */
61
- arrived?: HelpDeskFormArrival;
62
- /** Offer Use website account beside the request: the customer switched away from the website's account. */
63
- offerWebsiteAccount: boolean;
64
- /** A previous customer's request left the form: forget their question, in view and in storage. */
65
- forgetIssue(): void;
66
- /** The form left a hidden saved request for a new one: fill it from the question as the customer last wrote it. */
67
- followIssue(): void;
68
- }
69
- /** The injected form's state; uncertain sends keep an exact snapshot until recovered. */
70
- export type HelpDeskFormState = 'authenticating' | 'editing' | 'verifying' | 'submitting' | 'uncertain' | 'success' | 'destroyed';
71
- export interface HelpDeskFormOptions {
72
- /** The element (or selector) to replace with a ticket form. */
73
- target: string | HTMLElement;
74
- /** Optional subject to begin a new request with. */
75
- subject?: string;
76
- /** Optional safe-markup description to begin a new request with. */
77
- body?: string;
78
- /** Show the default file picker when the desk permits customer uploads. Defaults to true. */
79
- attachments?: boolean;
80
- /** Keep this tab's verified requester's draft for 30 minutes, including uncertain-send recovery. Defaults to false. */
81
- persist?: boolean;
82
- /** @internal The issue the support wizard fills the form from, in place of `subject` and `body`; a field holding it stays free for a rewritten issue. */
83
- issue?: string;
84
- /** @internal The support controller owns account transitions and native Identity. */
85
- widgetIdentity?: HelpDeskWidgetFormIdentity;
86
- /** @internal The support wizard is inline on the host's page (any `target`): that page asks before it unloads while the request holds unsent work. */
87
- pageLayout?: boolean;
88
- /** @internal The form's controls changed in place: it moved between its steps, its actions changed as it left a hidden saved request, or an account switch held or released them. */
89
- onScreenChange?: () => void;
90
- /** @internal The host page already shows "Secured by SparkVault", so the form leaves its own out. */
91
- hostShowsAttribution?: boolean;
92
- /** @internal The desk's brand its opener already paired (supportBrand), so the form pairs it no second time. */
93
- brand?: SupportBrand;
94
- /** @internal Server-minted, content-free assistance correlation. */
95
- assistanceContext?: () => {
96
- assistance_attempt_id: string;
97
- assistance_visitor_id: string;
98
- } | undefined;
99
- /** @internal Optional article reference, captured once with the submitted composition. */
100
- sourceArticleId?: () => string | undefined;
101
- /**
102
- * Ask host code for a server-issued help desk session. This callback must
103
- * not construct a session from a browser-supplied user ID or email address.
104
- * Return null to use the desk's existing verification or hosted sign-in.
105
- */
106
- onAuthRequired?: () => HelpDeskSession | null | Promise<HelpDeskSession | null>;
107
- /** Called after this form installs a verified customer session. Callback failures never affect a send. */
108
- onSession?: (session: HelpDeskSession) => void;
109
- /** Called only after the service confirms the ticket. Callback errors never retry it. */
110
- onSuccess?: (ticket: HelpDeskTicketCreated) => void;
111
- /** Called after a failed request; uncertain sends retain a read-only exact snapshot for recovery. */
112
- onError?: (error: Error) => void;
113
- onStateChange?: (state: HelpDeskFormState) => void;
114
- /** Called when the customer chooses Cancel, after the form is destroyed. */
115
- onCancel?: () => void;
116
- }
117
- export interface HelpDeskFormHandle {
118
- /** Remove the form and suppress pending UI updates and callbacks; does not log out. */
119
- destroy(): void;
120
- /** Clear the completed/idle form. Ignored while a request is pending or its send outcome is uncertain. */
121
- reset(): void;
122
- getState(): HelpDeskFormState;
123
- }
@@ -1,83 +0,0 @@
1
- import type { HelpDeskClient } from './client';
2
- import type { HelpDeskFormHandle, HelpDeskFormOptions } from './form-types';
3
- /**
4
- * The form's handle and the one dismissal every close control and the SDK's
5
- * modal route through. Internal: the package's public API hands out only
6
- * HelpDeskFormHandle.
7
- */
8
- export interface HelpDeskFormController extends HelpDeskFormHandle {
9
- /**
10
- * Close at once when nothing is unsent. Otherwise ask whether to discard
11
- * the request, and a second request while that question shows keeps
12
- * editing.
13
- */
14
- requestDismiss(): void;
15
- /**
16
- * Close the form for an account change that carries its unsent text on:
17
- * the saved request of the customer the form shows now is removed instead
18
- * of saved. A form with a send under way or unanswered, or a hidden saved
19
- * request (recovery), closes as destroy() does, every row kept.
20
- */
21
- leave(): void;
22
- /**
23
- * Put a composition in the subject and description without changing what
24
- * the form was filled with: text that differs from that fill, such as edits
25
- * carried from an earlier form for this request, stays the customer's own,
26
- * so closing asks first.
27
- */
28
- restoreComposition(composition: {
29
- subject: string;
30
- body: string;
31
- }): void;
32
- /**
33
- * Follow a rewritten issue. A field is free while it is blank or holds what
34
- * the form was filled with, and the customer's once they write in it; a
35
- * refill never changes the customer's. With both fields free the issue lands
36
- * as contact starts (`composeIssue`). With one free, that field takes the
37
- * whole issue, except that the summary holds only one line of at most
38
- * MAX_SUBJECT_LEN characters and is emptied for any other: a free field never
39
- * keeps an earlier issue. The issue is then what the form was filled with;
40
- * files, name and email stay. Refused (false, nothing changed) while a send
41
- * is under way, unanswered or done.
42
- */
43
- refill(issue: string): boolean;
44
- /** Clear a resolved access-gate error without changing a draft or uncertain send. */
45
- resumeAfterAccess(): void;
46
- /**
47
- * Go back from the sign-in step to the request, as the support wizard's
48
- * Back does there. False on the request step, where Back is the wizard's.
49
- */
50
- returnToRequest(): boolean;
51
- /**
52
- * Focus where the customer goes on: on the sign-in step its sign-in
53
- * button, which is all it asks; on the request step the field it asks for
54
- * (`stepField`), the end of the details once the summary holds text; or the
55
- * step's heading while that control cannot be used. False only once the
56
- * form is destroyed or hidden.
57
- */
58
- focusEntry(focusOptions?: FocusOptions): boolean;
59
- }
60
- export declare const HELP_DESK_FORM_TITLE = "Open a Support Ticket";
61
- /**
62
- * A ticket's body: the details the customer wrote, or, when they wrote none,
63
- * the summary, since every ticket carries a message. The one place the two
64
- * fields become the body that is checked against the limit and sent.
65
- */
66
- export declare function ticketBody(summary: string, details: string): string;
67
- /**
68
- * Inject a ticket form using only the requester's customer API. Authentication
69
- * is the desk's email-code flow or an explicit host-provided customer session.
70
- * Files use the same direct resumable Forge ceremony as the hosted portal.
71
- *
72
- * A check the form makes itself (an empty subject, a short code) and the
73
- * server's refusal of a code read under the field they concern; the status
74
- * line carries the flow (a code sent, a send in progress or uncertain, a
75
- * changed sign-in, a server error). Closing with unsent work asks first.
76
- * A confirmed send replaces the form with its confirmation.
77
- *
78
- * The request is a summary and optional details, in a composer that also
79
- * takes files. A signed-out widget customer writes it before continuing to
80
- * sign-in, where one button opens the native sign-in window and sends it. A
81
- * signed-in customer can switch account or sign out beside the request.
82
- */
83
- export declare function mountHelpDeskForm(client: HelpDeskClient, options: HelpDeskFormOptions): HelpDeskFormController;
@@ -1,47 +0,0 @@
1
- /** Customer ticket APIs and optional UI, isolated from Core/operator credentials. */
2
- import type { ResolvedConfig } from '../../config';
3
- import { HelpDeskClient } from './client';
4
- import type { HelpDeskConnectOptions } from './types';
5
- import type { HelpDeskFormHandle, HelpDeskFormOptions } from './form-types';
6
- import type { HelpDeskSupportHandle, HelpDeskSupportOptions } from './support-types';
7
- /**
8
- * One-call website setup. No browser secrets or identity assertions are
9
- * configured here. The form reports a lost revocation through `onError`, as it
10
- * reports its own, so these take no `onDiscardError`.
11
- */
12
- export type HelpDeskMountFormOptions = Omit<HelpDeskConnectOptions, 'onDiscardError'> & HelpDeskFormOptions;
13
- export type HelpDeskOpenFormOptions = Omit<HelpDeskConnectOptions, 'onDiscardError'> & Omit<HelpDeskFormOptions, 'target'>;
14
- export declare class HelpDeskModule {
15
- private readonly config;
16
- constructor(config: ResolvedConfig);
17
- /** Resolve a configured desk host and obtain its customer-only, headless API. */
18
- connect(options: HelpDeskConnectOptions): Promise<HelpDeskClient>;
19
- /** Create one KB-first support front door, with an optional floating launcher. */
20
- createSupport(options: HelpDeskSupportOptions): HelpDeskSupportHandle;
21
- /**
22
- * Inject a ticket form, including email-code verification where the desk
23
- * enables it. A custom onAuthRequired callback may supply a server-issued
24
- * help desk session. OAuth desks open their hosted portal for sign-in unless
25
- * a desk session is already installed. Destroy on unmount/account change.
26
- */
27
- mountForm(options: HelpDeskMountFormOptions): Promise<HelpDeskFormHandle>;
28
- /** Inject a form over an already-connected client that the host also drives headlessly. */
29
- mountClientForm(client: HelpDeskClient, options: HelpDeskFormOptions): HelpDeskFormHandle;
30
- /** Open a ticket form in the SDK's accessible modal. */
31
- openForm(options: HelpDeskOpenFormOptions): Promise<HelpDeskFormHandle>;
32
- /** Open a modal over a client whose company session the host also drives headlessly. */
33
- openClientForm(client: HelpDeskClient, options?: Omit<HelpDeskFormOptions, 'target'>): HelpDeskFormHandle;
34
- /**
35
- * Connect the client one of this module's own forms opens over: a lost
36
- * revocation of a session the client let go of unused reaches the form's
37
- * `onError` while the form stands, as the form reports its own.
38
- */
39
- private connectForm;
40
- /** Bind existing support buttons, including ones added later. Cleanup closes this binding's form. */
41
- attach(selector: string, options: HelpDeskOpenFormOptions): () => void;
42
- }
43
- export { HelpDeskClient } from './client';
44
- export type * from './types';
45
- export type * from './form-types';
46
- export type * from './support-types';
47
- export type { HelpDeskWidgetIdentityOptions, HelpDeskWidgetIdentityChallenge, HelpDeskWidgetIdentitySession } from './widget-identity';
@@ -1,48 +0,0 @@
1
- import type { ResolvedConfig } from '../../config';
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
- export declare class HelpDeskKnowledgeBaseClient {
5
- private readonly sdkConfig;
6
- private readonly deskId;
7
- private grant;
8
- private grantDeadline;
9
- private config;
10
- private index;
11
- private indexPending;
12
- private visitorSession;
13
- private visitorPending;
14
- private readonly voteQueues;
15
- private readonly objectUrls;
16
- private generation;
17
- private readerRevision;
18
- private readerDocument;
19
- private activeMedia;
20
- private destroyed;
21
- private readonly close;
22
- constructor(sdkConfig: ResolvedConfig, deskId: string);
23
- getAccessHeaders(): Record<string, string>;
24
- private request;
25
- /** Fresh config validates publication and access before a cached index is reused. */
26
- load(): Promise<KbWidgetConfig>;
27
- private canonicalOrigin;
28
- unlock(options: KbUnlockOptions): Promise<KbWidgetConfig>;
29
- private currentIndex;
30
- private result;
31
- search(issue: string): Promise<KbSearchResponse>;
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;
39
- read(result: KbSearchResult): Promise<KbReaderDocument>;
40
- /** Record only a displayed reader document; access is checked again by the event endpoint. */
41
- view(document: KbReaderDocument): Promise<void>;
42
- /** Paint article text first; hydrate only approved media without replacing the reader DOM. */
43
- hydrateAssets(document: KbReaderDocument, callbacks: KbMediaHydration): () => void;
44
- private readAsset;
45
- private clearContent;
46
- clearAccess(): void;
47
- destroy(): void;
48
- }
@@ -1,59 +0,0 @@
1
- /** Published knowledge-base data, independent of customer ticket authorization. */
2
- export interface KbWidgetConfig {
3
- visitor_identifier?: {
4
- enabled: boolean;
5
- domain_scope: 'host' | 'parent';
6
- cookie_name: string;
7
- };
8
- available: boolean;
9
- release_id: string | null;
10
- canonical_origin: string | null;
11
- search_enabled: boolean;
12
- access: {
13
- mode: 'public' | 'password' | 'ip_allowlist' | 'identity';
14
- company_id?: string;
15
- };
16
- authorized: boolean;
17
- }
18
- export interface KbSearchResult {
19
- id: string;
20
- kind: 'article' | 'faq';
21
- title: string;
22
- summary: string;
23
- category: string;
24
- path: string;
25
- canonical_url: string;
26
- release_id: string;
27
- }
28
- export interface KbSearchResponse {
29
- release_id: string;
30
- results: KbSearchResult[];
31
- total: number;
32
- }
33
- export interface KbReaderDocument {
34
- version: 1;
35
- kind: 'article' | 'faq';
36
- id: string;
37
- title: string;
38
- canonical_url: string;
39
- release_id: string;
40
- /** Platform-rendered, sanitized article body; contains no theme shell or scripts. */
41
- body_html: string;
42
- /** Release-local image paths, hydrated separately after the readable text is shown. */
43
- assets: string[];
44
- }
45
- /** Acknowledged article feedback, counted once per anonymous browser visitor. */
46
- export interface KbArticleVote {
47
- vote: 'yes' | 'no';
48
- version: number;
49
- review_url?: string | null;
50
- }
51
- export interface KbMediaHydration {
52
- onAsset: (path: string, blobUrl: string) => void;
53
- onError?: (path: string, error: unknown) => void;
54
- }
55
- export interface KbUnlockOptions {
56
- password?: string;
57
- /** The Help Desk sign-in's opaque employee-gate proof (`identity_grant.token` of signInWidgetIdentity's answer). */
58
- identity_grant?: string;
59
- }
@@ -1,8 +0,0 @@
1
- import type { HelpDeskClient } from './client';
2
- import type { HelpDeskFormHandle, HelpDeskFormOptions } from './form-types';
3
- export type HelpDeskOpenFormOptions = Omit<HelpDeskFormOptions, 'target'> & {
4
- /** Blur the page behind the modal; defaults to true. */
5
- backdropBlur?: boolean;
6
- };
7
- /** Open the same customer form in the SDK's shared dismissible modal shell. */
8
- export declare function openHelpDeskForm(client: HelpDeskClient, options?: HelpDeskOpenFormOptions): HelpDeskFormHandle;
@@ -1,9 +0,0 @@
1
- /**
2
- * Scoped styles for the optional inline help desk form and its modal, in the
3
- * help desk's color roles (@sparkvault/app-sdk/help-desk-colors): their
4
- * neutrals the page's roles where it sets them (HOST), their accent the
5
- * page's accent roles, else the desk's light pairing, which the form's
6
- * container and the modal each carry (ACCENT, DEFAULT_PAIRING_DECLARATIONS),
7
- * as the support panel does.
8
- */
9
- export declare function injectHelpDeskFormStyles(): void;
@@ -1,32 +0,0 @@
1
- /** Privacy-preserving, optional assistance telemetry. No issue text or identity belongs in this contract. */
2
- import type { ApiPath } from '../../request-path';
3
- export type SupportContactReason = 'no_results' | 'none_match' | 'article_not_answered';
4
- export type SupportAttemptStart = {
5
- availability: 'available';
6
- releaseId: string;
7
- resultCount: number;
8
- } | {
9
- availability: 'unavailable';
10
- };
11
- export interface SupportTicketContext {
12
- assistance_attempt_id: string;
13
- assistance_visitor_id: string;
14
- }
15
- export interface SupportAttempt {
16
- /** Use the release actually read when a publication changed during this issue. */
17
- articleOpened(articleId: string, releaseId?: string): void;
18
- solved(): void;
19
- /** Omit the reason only when help-center search was unavailable. */
20
- contactRequested(reason?: SupportContactReason): void;
21
- /** Passed only to authenticated ticket creation; browsers never report a successful submission. */
22
- ticketContext(): SupportTicketContext | undefined;
23
- }
24
- export interface SupportAnalyticsOptions {
25
- deskId: string;
26
- /** The caller supplies the same approved-origin/access-grant transport used by KB reads. */
27
- post<T>(path: ApiPath, body: Record<string, unknown>): Promise<T>;
28
- }
29
- export interface SupportAnalytics {
30
- start(options: SupportAttemptStart): Promise<SupportAttempt | null>;
31
- dispose(): void;
32
- }
@@ -1,3 +0,0 @@
1
- import type { SupportAnalytics, SupportAnalyticsOptions, SupportAttempt, SupportAttemptStart, SupportContactReason, SupportTicketContext } from './support-analytics-types';
2
- export declare function createSupportAnalytics({ deskId, post }: SupportAnalyticsOptions): SupportAnalytics;
3
- export type { SupportAnalytics, SupportAnalyticsOptions, SupportAttempt, SupportAttemptStart, SupportContactReason, SupportTicketContext };
@@ -1,49 +0,0 @@
1
- /**
2
- * The default pairings (@sparkvault/app-sdk/brand-color DEFAULT_PAIRINGS, the
3
- * ones the customer portal, the console's sample and the desk's email paint
4
- * for a desk without a brand color) as stylesheet declarations, which a
5
- * desk's brand color replaces (applySupportBrand). The launcher, the support
6
- * panel, the request form's container and its modal each carry them, so the
7
- * accent roles (@sparkvault/app-sdk/help-desk-colors HELP_DESK_ACCENT) read
8
- * the light pairing the element carries, and a website may point those roles
9
- * at the dark one.
10
- */
11
- export declare const DEFAULT_PAIRING_DECLARATIONS: string;
12
- /**
13
- * A desk's brand color as its carriers paint it: the color (`#rrggbb`, null
14
- * for none) and both of its pairings as the custom properties each carrier
15
- * sets on itself, null for none, which leaves the stylesheet's default
16
- * pairings (DEFAULT_PAIRING_DECLARATIONS).
17
- */
18
- export interface SupportBrand {
19
- readonly color: string | null;
20
- readonly properties: Readonly<Record<string, string>> | null;
21
- }
22
- /**
23
- * Pairs a desk's brand color for every carrier, once: both of its pairings
24
- * (@sparkvault/app-sdk/brand-color schemePairings, the ones the customer
25
- * portal and the desk's email paint too), under each scheme's names: the
26
- * fill, white or the ink on it, the accent as text, and the fill under the
27
- * pointer. Whoever learns the desk's color derives it and hands the one brand
28
- * to each element it paints (applySupportBrand), so a desk's color is paired
29
- * once however often its elements render. A value that is no brand color is
30
- * none.
31
- */
32
- export declare function supportBrand(value: unknown): SupportBrand;
33
- /**
34
- * The brand for a desk's color: `held` where it pairs that same color, so a
35
- * color learned again (a held desk's, then connect's answer for it) is paired
36
- * once and stays the one object every element compares.
37
- */
38
- export declare function brandFor(value: unknown, held: SupportBrand): SupportBrand;
39
- /**
40
- * Sets a desk's brand (supportBrand) on the launcher, the support panel, the
41
- * request form's container or the form's modal. The stylesheet paints the
42
- * light pairing wherever the accent roles (`--hd-accent*`) are not set, so on
43
- * a website the widget's accent is the pairing the portal paints on light
44
- * pages until the page points the roles at the dark pairing, and inside the
45
- * customer portal each takes the portal's roles. Scoped to the element, so it
46
- * works on a hosted page and on any website the widget stands on; a brand
47
- * with no color clears them, and the stylesheet's default pairings return.
48
- */
49
- export declare function applySupportBrand(target: HTMLElement, brand: SupportBrand): void;
@@ -1,4 +0,0 @@
1
- import type { ResolvedConfig } from '../../config';
2
- import type { HelpDeskSupportHandle, HelpDeskSupportOptions } from './support-types';
3
- /** One state machine owns launcher, host links, KB suggestions and the ticket front door. */
4
- export declare function createHelpDeskSupport(config: ResolvedConfig, options: HelpDeskSupportOptions): HelpDeskSupportHandle;
@@ -1,38 +0,0 @@
1
- export interface SupportPhoneHistoryActions {
2
- /** A traversal away minimizes neutrally, never answers the article prompt. */
3
- onBack: () => void;
4
- /** Forward into the same active support entry resumes the preserved journey. */
5
- onForward: () => void;
6
- }
7
- /**
8
- * One same-URL entry while phone support is open. No popstate is cancelled or
9
- * swallowed, and no cleanup ever calls history.back()/go(). Explicit close,
10
- * resize and disposal replace only a proven owned current entry with its
11
- * original host state. The inactive entry can be reused while still owned.
12
- * A harmless same-URL entry is preferable to consuming a host's later route.
13
- */
14
- export declare class SupportPhoneHistory {
15
- private readonly actions;
16
- private readonly marker;
17
- private readonly token;
18
- private baseState;
19
- private url;
20
- private activeReference;
21
- private inactiveReference;
22
- private hasInactiveEntry;
23
- private wantsPhone;
24
- private mobile;
25
- private active;
26
- private forwardAllowed;
27
- private destroyed;
28
- private unobserve;
29
- private readonly onHostMutation;
30
- private readonly onPopState;
31
- constructor(actions: SupportPhoneHistoryActions);
32
- sync(visible: boolean, mobile: boolean): void;
33
- /** Explicit close also invalidates a forward entry after a neutral Back. */
34
- deactivate(): void;
35
- destroy(): void;
36
- private arm;
37
- private isMarkedEntry;
38
- }
@@ -1,12 +0,0 @@
1
- import type { HelpDeskSupportLauncherOptions } from './support-types';
2
- import { type SupportBrand } from './support-brand';
3
- /**
4
- * A convenience path only: it never owns a second support flow. It carries
5
- * the desk's brand (`brand`, then setBrand), so its focus ring is the desk's,
6
- * as the panel's are.
7
- */
8
- export declare function createSupportLauncher(options: HelpDeskSupportLauncherOptions, brand: SupportBrand, open: () => void): {
9
- setExpanded(expanded: boolean): void;
10
- setBrand(next: SupportBrand): void;
11
- destroy(): void;
12
- };
@@ -1,14 +0,0 @@
1
- /**
2
- * The support journey's only skin. Customer content stays in the product register.
3
- * The panel's focus ring is 2px, 3px out, in the desk's focus color: its width and
4
- * offset are the panel's custom properties, which the help desk composer inside
5
- * its request form reads, so the composer rings as the fields beside it do. It
6
- * paints in the help desk's color roles (@sparkvault/app-sdk/help-desk-colors):
7
- * its neutrals read the page's roles (HOST), so in the customer portal they
8
- * follow the portal's scheme, and stay light anywhere else; its accent reads
9
- * the page's accent roles, else the desk's light pairing (ACCENT), which the
10
- * panel and the launcher each carry (DEFAULT_PAIRING_DECLARATIONS), so the
11
- * launcher rings in the desk's color, as every control in the panel does,
12
- * outside a ring of its own that reads on any page (LAUNCHER_RING).
13
- */
14
- export declare function injectHelpDeskSupportStyles(): void;
@@ -1,66 +0,0 @@
1
- import type { HelpDeskConnectOptions, HelpDeskSession, HelpDeskTicketCreated } from './types';
2
- export type HelpDeskSupportStage = 'issue' | 'results' | 'article' | 'feedback' | 'resolved' | 'contact' | 'receipt';
3
- export interface HelpDeskSupportLauncherOptions {
4
- /** HTTPS image URL. Omit to use the accessible question-mark icon. */
5
- imageUrl?: string;
6
- label?: string;
7
- /** Distance in CSS pixels, in addition to the device safe area. */
8
- right?: number;
9
- bottom?: number;
10
- }
11
- /**
12
- * One support journey for a website or a hosted help desk page. Support
13
- * reports a lost revocation through `onError`, as it reports its own, so it
14
- * takes no `onDiscardError`.
15
- */
16
- export interface HelpDeskSupportOptions extends Omit<HelpDeskConnectOptions, 'onDiscardError'> {
17
- /** Render the same support journey in this page element. Omit for the floating widget. */
18
- target?: string | HTMLElement;
19
- /** @internal The host page already shows "Secured by SparkVault", so the contact form leaves its own out. */
20
- hostShowsAttribution?: boolean;
21
- /**
22
- * @internal The host keeps the session this journey proves (`onSession`) and
23
- * lends it back (`getSessionToken`): no website account stands behind it to go
24
- * back to, and `onSignOut` runs when the customer signs out here.
25
- */
26
- hostKeepsSession?: {
27
- onSignOut(): void;
28
- };
29
- /** Keep recoverable composition in this browser tab through navigation and reload. Defaults to false. */
30
- persist?: boolean;
31
- /** Observe the customer session the journey proves or clears. */
32
- onSession?: (session: HelpDeskSession | null) => void;
33
- /** Share an access grant with the enclosing customer portal after the common gate succeeds. */
34
- onTicketAccess?: (grant: {
35
- token: string;
36
- ttl_seconds: number;
37
- }) => void;
38
- /** Show a floating button immediately. Defaults to false. */
39
- launcher?: boolean | HelpDeskSupportLauncherOptions;
40
- attachments?: boolean;
41
- onSuccess?: (ticket: HelpDeskTicketCreated) => void;
42
- onError?: (error: Error) => void;
43
- onStateChange?: (state: HelpDeskSupportState) => void;
44
- }
45
- export interface HelpDeskSupportOpenOptions {
46
- /** Prefill the initial question only when starting a new support conversation. */
47
- issue?: string;
48
- /** Continue directly from a published article that did not resolve the question. */
49
- articleId?: string;
50
- }
51
- export interface HelpDeskSupportState {
52
- visible: boolean;
53
- stage: HelpDeskSupportStage;
54
- busy: boolean;
55
- }
56
- export interface HelpDeskSupportHandle {
57
- /** The one entry point used by the launcher and custom support links. */
58
- open(options?: HelpDeskSupportOpenOptions): Promise<void>;
59
- /** Minimize while retaining this browser page's unsent composition. */
60
- close(): void;
61
- /** Bind existing or subsequently inserted links to this same widget. */
62
- attach(selector: string): () => void;
63
- /** Remove the launcher, dialog, authorization, files and all in-memory support state. */
64
- destroy(): void;
65
- getState(): HelpDeskSupportState;
66
- }