@sparkvault/sdk-js 16.2.1 → 16.4.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/README.md +5 -1
- package/dist/index.cjs +23 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.mjs +23 -13
- package/dist/index.mjs.map +1 -1
- package/dist/products/help-desk/support-view.d.ts +3 -0
- package/dist/products/help-desk/types.d.ts +6 -2
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3644,6 +3644,8 @@ interface HelpDeskDesk {
|
|
|
3644
3644
|
customer_can_mark_resolved: boolean;
|
|
3645
3645
|
/** Optional plain-text note shown only after a request is confirmed sent. */
|
|
3646
3646
|
ticket_confirmation_message?: string | null;
|
|
3647
|
+
/** Optional one-line plain-text note shown beside the support view's ticket button. */
|
|
3648
|
+
ticket_contact_note?: string | null;
|
|
3647
3649
|
/** Independent ticket-portal gate, additional to customer authentication. */
|
|
3648
3650
|
ticket_access_control?: {
|
|
3649
3651
|
mode: 'public' | 'password' | 'ip_allowlist' | 'identity';
|
|
@@ -3658,10 +3660,12 @@ interface HelpDeskCustomer {
|
|
|
3658
3660
|
requester_id: string;
|
|
3659
3661
|
email: string;
|
|
3660
3662
|
display_name: string | null;
|
|
3661
|
-
assurance: 'identity' | 'email_pin' | 'external_sso';
|
|
3662
|
-
/**
|
|
3663
|
+
assurance: 'identity' | 'email_pin' | 'external_sso' | 'federated';
|
|
3664
|
+
/** Whether anyone verified the address. False forbids update emails: a company-session contact their company did not verify, or a person the organization's own identity provider signed in without verifying it. */
|
|
3663
3665
|
email_verified?: boolean;
|
|
3664
3666
|
email_updates?: boolean;
|
|
3667
|
+
/** True for a session the organization's own identity provider signed in, whose `assurance` is then `federated`: it changes none of the address's update-email choices. */
|
|
3668
|
+
federated?: boolean;
|
|
3665
3669
|
needs_display_name: boolean;
|
|
3666
3670
|
}
|
|
3667
3671
|
interface HelpDeskSession {
|
package/dist/index.mjs
CHANGED
|
@@ -18051,7 +18051,12 @@ class HelpDeskClient {
|
|
|
18051
18051
|
}, undefined, false);
|
|
18052
18052
|
if (revision !== this.revision)
|
|
18053
18053
|
throw sessionChanged();
|
|
18054
|
-
|
|
18054
|
+
// A native sign-in opens a session at the desk's issuer: an email sign-in's customer is linked to
|
|
18055
|
+
// its Secure Identity (`identity`); a sign-in by the organization's own identity provider carries
|
|
18056
|
+
// the `federated` mark and the `federated` assurance together, never one without the other.
|
|
18057
|
+
const customer = result?.customer;
|
|
18058
|
+
const nativeIdentity = customer?.federated === true ? customer.assurance === 'federated' : customer?.assurance === 'identity';
|
|
18059
|
+
if (!validToken(result?.token) || !nativeIdentity || !/^hdwip_[A-Za-z0-9_-]{43}$/.test(result.identity_grant?.token)) {
|
|
18055
18060
|
throw new SparkVaultError('The help desk returned an invalid support identity.', 'HELP_DESK_INVALID_RESPONSE');
|
|
18056
18061
|
}
|
|
18057
18062
|
this.issuedSessions.set(result, result.token);
|
|
@@ -22671,9 +22676,9 @@ function injectHelpDeskSupportStyles() {
|
|
|
22671
22676
|
.svhs-result:hover .svhs-result-title{color:var(--hd-accent-ink,${DS.action});text-decoration:underline}
|
|
22672
22677
|
.svhs-result-excerpt{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin:0;color:${DS.slate600};font-size:14px;line-height:1.5;overflow-wrap:anywhere}
|
|
22673
22678
|
.svhs-result-category{display:block;margin-top:6px;color:${DS.slate500};font-size:12px;line-height:1.4}
|
|
22674
|
-
.svhs-results-bottom{background:${DS.slate50};border-top-color:${DS.slate200}}
|
|
22675
|
-
|
|
22676
|
-
.svhs-
|
|
22679
|
+
.svhs-results-bottom{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;background:${DS.slate50};border-top-color:${DS.slate200}}
|
|
22680
|
+
/* Wraps below the ticket button when less than 200px remain beside it, as under the panel's full-width button. */
|
|
22681
|
+
.svhs-contact-note{flex:1 1 200px;min-width:0;margin:0;color:${DS.slate500};font-size:13px;line-height:1.5;overflow-wrap:anywhere}
|
|
22677
22682
|
.svhs-error{margin:12px 0 0;color:${DS.error};font-size:14px;line-height:1.5;overflow-wrap:anywhere}
|
|
22678
22683
|
.svhs-status{margin:16px 0;color:${DS.slate600};font-size:14px;line-height:1.5}
|
|
22679
22684
|
.svhs-empty{padding:12px 0 4px}
|
|
@@ -22816,10 +22821,6 @@ function injectHelpDeskSupportStyles() {
|
|
|
22816
22821
|
.svhs-page .svhs-start-bottom{padding-top:0;align-items:flex-start}
|
|
22817
22822
|
.svhs-page .svhs-start-bottom .svhs-primary{width:auto;min-width:160px}
|
|
22818
22823
|
.svhs-page[data-stage=issue] .svhs-heading{font-size:28px}
|
|
22819
|
-
.svhs-page .svhs-results-bottom{display:flex;align-items:center;gap:24px}
|
|
22820
|
-
.svhs-page .svhs-results-bottom[hidden]{display:none}
|
|
22821
|
-
.svhs-page .svhs-escalation{flex:1;min-width:0}
|
|
22822
|
-
.svhs-page .svhs-footer-copy{margin:0}
|
|
22823
22824
|
.svhs-page .svhs-results-bottom .svhs-secondary{width:auto;flex:none}
|
|
22824
22825
|
.svhs-page .svhs-contact-target,.svhs-page .svhs-contact-target>.svhd-container{min-height:0}
|
|
22825
22826
|
.svhs-page .svhs-contact-scroll{padding:0}
|
|
@@ -22832,8 +22833,7 @@ function injectHelpDeskSupportStyles() {
|
|
|
22832
22833
|
.svhs-page .svhs-start-bottom{padding-top:0}
|
|
22833
22834
|
.svhs-page .svhs-start-bottom .svhs-primary{width:100%}
|
|
22834
22835
|
.svhs-page[data-stage=issue] .svhs-heading{font-size:26px}
|
|
22835
|
-
.svhs-page .svhs-results-bottom{
|
|
22836
|
-
.svhs-page .svhs-results-bottom .svhs-secondary{width:100%;margin-top:14px}
|
|
22836
|
+
.svhs-page .svhs-results-bottom .svhs-secondary{width:100%}
|
|
22837
22837
|
.svhs-page .svhs-contact-scroll{padding:0}
|
|
22838
22838
|
}
|
|
22839
22839
|
`;
|
|
@@ -23223,6 +23223,7 @@ class SupportView {
|
|
|
23223
23223
|
this.resultCopy = element('p', 'svhs-copy');
|
|
23224
23224
|
this.resultStatus = element('div', 'svhs-empty');
|
|
23225
23225
|
this.resultError = element('p', 'svhs-error');
|
|
23226
|
+
this.contactNote = element('p', 'svhs-contact-note');
|
|
23226
23227
|
this.articleTitle = element('h2', 'svhs-article-title');
|
|
23227
23228
|
this.articleCategory = element('p', 'svhs-category');
|
|
23228
23229
|
this.articleContent = element('div', 'svhs-article-content');
|
|
@@ -23335,9 +23336,11 @@ class SupportView {
|
|
|
23335
23336
|
return;
|
|
23336
23337
|
this.actions.onContact(['locked', 'unavailable'].includes(this.state?.kbState || '') ? 'direct' : this.state?.results?.length ? 'none_match' : 'no_results');
|
|
23337
23338
|
});
|
|
23339
|
+
this.contactNote.id = `${this.prefix}-contact-note`;
|
|
23340
|
+
this.contactNote.hidden = true;
|
|
23338
23341
|
this.resultsFooter = this.footer('results');
|
|
23339
23342
|
this.resultsFooter.classList.add('svhs-results-bottom');
|
|
23340
|
-
this.resultsFooter.append(this.contactResults);
|
|
23343
|
+
this.resultsFooter.append(this.contactResults, this.contactNote);
|
|
23341
23344
|
const article = this.screen('article');
|
|
23342
23345
|
article.classList.add('svhs-article-scroll');
|
|
23343
23346
|
this.articleTitle.tabIndex = -1;
|
|
@@ -23705,6 +23708,13 @@ class SupportView {
|
|
|
23705
23708
|
}
|
|
23706
23709
|
this.resultsFooter.hidden = Boolean(state.busy);
|
|
23707
23710
|
this.contactResults.disabled = Boolean(state.busy);
|
|
23711
|
+
// Desk configuration, set as text: never parsed as markup.
|
|
23712
|
+
this.contactNote.textContent = state.contactNote || '';
|
|
23713
|
+
this.contactNote.hidden = !state.contactNote;
|
|
23714
|
+
if (state.contactNote)
|
|
23715
|
+
this.contactResults.setAttribute('aria-describedby', this.contactNote.id);
|
|
23716
|
+
else
|
|
23717
|
+
this.contactResults.removeAttribute('aria-describedby');
|
|
23708
23718
|
}
|
|
23709
23719
|
renderResultStatus(state, results) {
|
|
23710
23720
|
const signature = state.kbState === 'locked' ? `locked:${state.kbAccessMode}` : state.busy ? 'busy' : state.kbState === 'unavailable' ? 'unavailable' : results.length ? 'matches' : 'empty';
|
|
@@ -24202,7 +24212,7 @@ function createHelpDeskSupport(config, options) {
|
|
|
24202
24212
|
return (await http.request(path, { method: 'POST', body, credentials: 'omit', headers: { 'X-SV-Client': 'help-desk-portal', ...headers } })).data;
|
|
24203
24213
|
},
|
|
24204
24214
|
});
|
|
24205
|
-
update({ deskName: answer.desk.organization_name || 'Support', brandColor: answer.desk.branding?.color });
|
|
24215
|
+
update({ deskName: answer.desk.organization_name || 'Support', brandColor: answer.desk.branding?.color, contactNote: answer.desk.ticket_contact_note ?? undefined });
|
|
24206
24216
|
return answer;
|
|
24207
24217
|
}).catch((error) => { connected = null; throw error; });
|
|
24208
24218
|
return connected;
|
|
@@ -29543,7 +29553,7 @@ class SparkVault {
|
|
|
29543
29553
|
}
|
|
29544
29554
|
/** Get the SDK version */
|
|
29545
29555
|
static get version() {
|
|
29546
|
-
return '16.
|
|
29556
|
+
return '16.4.0';
|
|
29547
29557
|
}
|
|
29548
29558
|
}
|
|
29549
29559
|
if (typeof window !== 'undefined') {
|