@sparkvault/sdk-js 17.0.2 → 18.0.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/README.md +89 -12
- package/dist/index.cjs +881 -349
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +16 -11
- package/dist/index.mjs +881 -349
- package/dist/index.mjs.map +1 -1
- package/dist/products/help-desk/client.d.ts +0 -4
- package/dist/products/help-desk/form-types.d.ts +3 -0
- package/dist/products/help-desk/kb-types.d.ts +1 -2
- package/dist/products/help-desk/styles.d.ts +8 -1
- package/dist/products/help-desk/support-brand.d.ts +49 -2
- package/dist/products/help-desk/support-launcher.d.ts +8 -2
- package/dist/products/help-desk/support-styles.d.ts +8 -1
- package/dist/products/help-desk/support-view.d.ts +3 -1
- package/dist/products/help-desk/types.d.ts +1 -5
- package/dist/products/help-desk/widget-identity.d.ts +2 -2
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/package.json +1 -1
|
@@ -125,10 +125,6 @@ export declare class HelpDeskClient {
|
|
|
125
125
|
}): Promise<HelpDeskSession>;
|
|
126
126
|
startPin(email: string): Promise<HelpDeskPinChallenge>;
|
|
127
127
|
verifyPin(options: HelpDeskVerifyPinOptions): Promise<HelpDeskSession>;
|
|
128
|
-
/** Identity completion still requires a server-approved desk portal origin. */
|
|
129
|
-
completeIdentity(options: {
|
|
130
|
-
token: string;
|
|
131
|
-
}): Promise<HelpDeskSession>;
|
|
132
128
|
/** Uninstalled result: the owning form/controller decides when the new requester becomes current. */
|
|
133
129
|
signInWidgetIdentity(options?: HelpDeskWidgetIdentityOptions): Promise<HelpDeskWidgetIdentitySession>;
|
|
134
130
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SupportBrand } from './support-brand';
|
|
1
2
|
import type { HelpDeskCustomer, HelpDeskSession, HelpDeskTicketCreated } from './types';
|
|
2
3
|
/**
|
|
3
4
|
* @internal The unsent text a widget form hands on with an account change, and
|
|
@@ -88,6 +89,8 @@ export interface HelpDeskFormOptions {
|
|
|
88
89
|
onScreenChange?: () => void;
|
|
89
90
|
/** @internal The host page already shows "Secured by SparkVault", so the form leaves its own out. */
|
|
90
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;
|
|
91
94
|
/** @internal Server-minted, content-free assistance correlation. */
|
|
92
95
|
assistanceContext?: () => {
|
|
93
96
|
assistance_attempt_id: string;
|
|
@@ -54,7 +54,6 @@ export interface KbMediaHydration {
|
|
|
54
54
|
}
|
|
55
55
|
export interface KbUnlockOptions {
|
|
56
56
|
password?: string;
|
|
57
|
-
|
|
58
|
-
/** Opaque auth.sv proof, issued through the built-in SDK Identity handoff. */
|
|
57
|
+
/** The Help Desk sign-in's opaque employee-gate proof (`identity_grant.token` of signInWidgetIdentity's answer). */
|
|
59
58
|
identity_grant?: string;
|
|
60
59
|
}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
/**
|
|
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
|
+
*/
|
|
2
9
|
export declare function injectHelpDeskFormStyles(): void;
|
|
@@ -1,2 +1,49 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
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,6 +1,12 @@
|
|
|
1
1
|
import type { HelpDeskSupportLauncherOptions } from './support-types';
|
|
2
|
-
|
|
3
|
-
|
|
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): {
|
|
4
9
|
setExpanded(expanded: boolean): void;
|
|
10
|
+
setBrand(next: SupportBrand): void;
|
|
5
11
|
destroy(): void;
|
|
6
12
|
};
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
* The support journey's only skin. Customer content stays in the product register.
|
|
3
3
|
* The panel's focus ring is 2px, 3px out, in the desk's focus color: its width and
|
|
4
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.
|
|
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).
|
|
6
13
|
*/
|
|
7
14
|
export declare function injectHelpDeskSupportStyles(): void;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { KbReaderDocument, KbSearchResult } from './kb-types';
|
|
2
|
+
import { type SupportBrand } from './support-brand';
|
|
2
3
|
export type SupportViewStage = 'issue' | 'results' | 'article' | 'feedback' | 'resolved' | 'contact' | 'receipt';
|
|
3
4
|
export type SupportContactReason = 'direct' | 'no_results' | 'none_match' | 'article_not_answered';
|
|
4
5
|
/** Presentation data only; the support controller owns authentication and writes. */
|
|
5
6
|
export interface SupportViewState {
|
|
6
7
|
visible: boolean;
|
|
7
8
|
deskName: string;
|
|
8
|
-
|
|
9
|
+
/** The desk's brand, paired once by whoever learned its color (supportBrand). */
|
|
10
|
+
brand: SupportBrand;
|
|
9
11
|
/** The desk's plain-text note beside the results' ticket button. */
|
|
10
12
|
contactNote?: string;
|
|
11
13
|
stage: SupportViewStage;
|
|
@@ -77,11 +77,7 @@ export interface HelpDeskDesk {
|
|
|
77
77
|
logo_dark_url: string | null;
|
|
78
78
|
icon_url?: string | null;
|
|
79
79
|
};
|
|
80
|
-
auth_mode: 'email_pin' | '
|
|
81
|
-
identity: {
|
|
82
|
-
issuer_account_id: string;
|
|
83
|
-
client_id: string;
|
|
84
|
-
} | null;
|
|
80
|
+
auth_mode: 'email_pin' | 'external_sso' | 'external_unavailable';
|
|
85
81
|
external_identity?: HelpDeskExternalIdentity | null;
|
|
86
82
|
customer_can_mark_resolved: boolean;
|
|
87
83
|
/** Optional plain-text note shown only after a request is confirmed sent. */
|
|
@@ -4,14 +4,14 @@ export interface HelpDeskWidgetIdentityOptions {
|
|
|
4
4
|
givenName?: string;
|
|
5
5
|
familyName?: string;
|
|
6
6
|
selectAccount?: boolean;
|
|
7
|
-
/** The current employee gate's company
|
|
7
|
+
/** The current employee gate's company, whose membership Core checks for the person this sign-in proves. */
|
|
8
8
|
employeeCompanyId?: string;
|
|
9
9
|
signal?: AbortSignal;
|
|
10
10
|
}
|
|
11
11
|
export interface HelpDeskWidgetIdentityChallenge {
|
|
12
12
|
challenge_id: string;
|
|
13
13
|
verifier: string;
|
|
14
|
-
/** Private to this window, like the verifier: handed only to the
|
|
14
|
+
/** Private to this window, like the verifier: handed only to the sign-in window it opened, which Core requires it from. */
|
|
15
15
|
state: string;
|
|
16
16
|
sign_in_url: string;
|
|
17
17
|
expires_at: number;
|