@sparkvault/sdk-js 15.2.0 → 15.3.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/dist/index.d.ts CHANGED
@@ -3259,6 +3259,14 @@ interface HelpDeskDesk {
3259
3259
  } | null;
3260
3260
  external_identity?: HelpDeskExternalIdentity | null;
3261
3261
  customer_can_mark_resolved: boolean;
3262
+ /** Optional plain-text note shown only after a request is confirmed sent. */
3263
+ ticket_confirmation_message?: string | null;
3264
+ /** Independent ticket-portal gate, additional to customer authentication. */
3265
+ ticket_access_control?: {
3266
+ mode: 'public' | 'password' | 'ip_allowlist' | 'identity';
3267
+ company_id?: string;
3268
+ ip_allowed?: boolean;
3269
+ };
3262
3270
  customer_can_attach_files: boolean;
3263
3271
  knowledge_base_enabled: boolean;
3264
3272
  portal_client: string;
@@ -3322,6 +3330,9 @@ interface HelpDeskCreateTicketOptions {
3322
3330
  /** Help desk safe markup, not HTML. */
3323
3331
  body: string;
3324
3332
  attachments?: string[];
3333
+ /** Optional server-minted support-assistance correlation; never includes the customer's question. */
3334
+ assistance_attempt_id?: string;
3335
+ assistance_visitor_id?: string;
3325
3336
  }
3326
3337
  interface HelpDeskTicket {
3327
3338
  number: number;
@@ -3405,6 +3416,31 @@ interface HelpDeskAttachmentDownload {
3405
3416
  disposition: string;
3406
3417
  }
3407
3418
 
3419
+ interface HelpDeskWidgetIdentityOptions {
3420
+ email?: string;
3421
+ givenName?: string;
3422
+ familyName?: string;
3423
+ selectAccount?: boolean;
3424
+ /** The current employee gate's company. Its own Identity methods and MFA must also complete. */
3425
+ employeeCompanyId?: string;
3426
+ signal?: AbortSignal;
3427
+ }
3428
+ interface HelpDeskWidgetIdentityChallenge {
3429
+ challenge_id: string;
3430
+ verifier: string;
3431
+ state: string;
3432
+ sign_in_url: string;
3433
+ expires_at: number;
3434
+ }
3435
+ interface HelpDeskWidgetIdentitySession extends HelpDeskSession {
3436
+ /** An origin-bound, five-minute proof for explicit employee gate exchanges; never a content bearer. */
3437
+ identity_grant: {
3438
+ token: string;
3439
+ expires_at: number;
3440
+ ttl_seconds: number;
3441
+ };
3442
+ }
3443
+
3408
3444
  /**
3409
3445
  * One desk's customer client. Sessions stay in memory unless a host supplies a
3410
3446
  * provider. A provider must supply an hdt_ token, not a website identity JWT.
@@ -3430,6 +3466,12 @@ declare class HelpDeskClient {
3430
3466
  private deadline;
3431
3467
  private token;
3432
3468
  private revision;
3469
+ private websiteAccountSuppressed;
3470
+ private ticketAccess;
3471
+ private currentTicketPolicy;
3472
+ /** Only this client's own sign-in ceremonies create credentials it may revoke on account switch. */
3473
+ private readonly issuedSessions;
3474
+ private ownsSession;
3433
3475
  private constructor();
3434
3476
  /** Discover a desk by its configured host, before any customer credentials are sent. */
3435
3477
  static connect(config: ResolvedConfig, options: HelpDeskConnectOptions): Promise<HelpDeskClient>;
@@ -3451,8 +3493,20 @@ declare class HelpDeskClient {
3451
3493
  subscribeSession(listener: (change: HelpDeskSessionChange) => void): () => void;
3452
3494
  /** Explicitly refresh the host-managed session, for example after a backend handoff. */
3453
3495
  refreshSession(): Promise<string | null>;
3496
+ /** Resume provider authority without starting its proof before an independent access gate. */
3497
+ private resetProviderSession;
3454
3498
  /** Whether company identity can be established without customer interaction. */
3455
3499
  get hasIdentityProvider(): boolean;
3500
+ /** The independent ticket gate must be met before rendering authenticated ticket UI. */
3501
+ get hasTicketAccess(): boolean;
3502
+ clearTicketAccess(): void;
3503
+ get ticketAccessPolicy(): HelpDeskDesk['ticket_access_control'];
3504
+ /** Refresh network/policy hints without replacing requester state or composition. */
3505
+ refreshTicketAccessPolicy(): Promise<void>;
3506
+ unlockTicketAccess(options: {
3507
+ password?: string;
3508
+ identityGrant?: string;
3509
+ }): Promise<void>;
3456
3510
  /** @internal Read an installed server-proven company bearer without invoking any identity provider. */
3457
3511
  verifiedSessionTokenFor(requesterId: string): string | null;
3458
3512
  getSessionToken(): Promise<string | null>;
@@ -3496,6 +3550,12 @@ declare class HelpDeskClient {
3496
3550
  completeIdentity(options: {
3497
3551
  token: string;
3498
3552
  }): Promise<HelpDeskSession>;
3553
+ /** Uninstalled result: the owning form/controller decides when the new requester becomes current. */
3554
+ signInWidgetIdentity(options?: HelpDeskWidgetIdentityOptions): Promise<HelpDeskWidgetIdentitySession>;
3555
+ /** Choose a different support identity without logging out or changing the host website. */
3556
+ switchSupportAccount(): Promise<void>;
3557
+ /** The only operation that resumes the website's configured identity provider after an explicit switch. */
3558
+ useWebsiteAccount(): Promise<HelpDeskSession | null>;
3499
3559
  getMe(): Promise<HelpDeskCustomer>;
3500
3560
  updateMe(patch: HelpDeskCustomerPatch, context?: HelpDeskRequestContext): Promise<HelpDeskCustomer>;
3501
3561
  createDraft(context?: HelpDeskRequestContext): Promise<HelpDeskDraft>;
@@ -3521,8 +3581,26 @@ declare class HelpDeskClient {
3521
3581
  attachmentDownload(attachmentId: string, number: number): Promise<HelpDeskAttachmentDownload>;
3522
3582
  /** Revoke this bearer, clearing only the session whose logout completed. */
3523
3583
  logout(): Promise<void>;
3584
+ private releaseSession;
3524
3585
  }
3525
3586
 
3587
+ /** Internal adapter used by the KB-first widget; legacy forms retain their existing verification flow. */
3588
+ interface HelpDeskWidgetFormIdentity {
3589
+ customer: HelpDeskCustomer | null;
3590
+ signIn(input: {
3591
+ email: string;
3592
+ givenName: string;
3593
+ familyName: string;
3594
+ }): Promise<HelpDeskSession>;
3595
+ switchAccount(composition: {
3596
+ subject: string;
3597
+ body: string;
3598
+ } | null): void;
3599
+ useWebsiteAccount?: (composition: {
3600
+ subject: string;
3601
+ body: string;
3602
+ } | null) => void;
3603
+ }
3526
3604
  /** The injected form's state; uncertain sends keep an exact snapshot until recovered. */
3527
3605
  type HelpDeskFormState = 'authenticating' | 'editing' | 'verifying' | 'submitting' | 'uncertain' | 'success' | 'destroyed';
3528
3606
  interface HelpDeskFormOptions {
@@ -3534,6 +3612,13 @@ interface HelpDeskFormOptions {
3534
3612
  body?: string;
3535
3613
  /** Show the default file picker when the desk permits customer uploads. Defaults to true. */
3536
3614
  attachments?: boolean;
3615
+ /** @internal The support controller owns account transitions and native Identity. */
3616
+ widgetIdentity?: HelpDeskWidgetFormIdentity;
3617
+ /** @internal Server-minted, content-free assistance correlation. */
3618
+ assistanceContext?: () => {
3619
+ assistance_attempt_id: string;
3620
+ assistance_visitor_id: string;
3621
+ } | undefined;
3537
3622
  /**
3538
3623
  * Ask host code for a server-issued help desk session. This callback must
3539
3624
  * not construct a session from a browser-supplied user ID or email address.
@@ -3556,6 +3641,45 @@ interface HelpDeskFormHandle {
3556
3641
  getState(): HelpDeskFormState;
3557
3642
  }
3558
3643
 
3644
+ type HelpDeskSupportStage = 'issue' | 'results' | 'article' | 'feedback' | 'contact' | 'receipt';
3645
+ interface HelpDeskSupportLauncherOptions {
3646
+ /** HTTPS image URL. Omit to use the accessible question-mark icon. */
3647
+ imageUrl?: string;
3648
+ label?: string;
3649
+ /** Distance in CSS pixels, in addition to the device safe area. */
3650
+ right?: number;
3651
+ bottom?: number;
3652
+ }
3653
+ /** One persistent, memory-only support session for a website. */
3654
+ interface HelpDeskSupportOptions extends HelpDeskConnectOptions {
3655
+ /** Show a floating button immediately. Defaults to false. */
3656
+ launcher?: boolean | HelpDeskSupportLauncherOptions;
3657
+ attachments?: boolean;
3658
+ onSuccess?: (ticket: HelpDeskTicketCreated) => void;
3659
+ onError?: (error: Error) => void;
3660
+ onStateChange?: (state: HelpDeskSupportState) => void;
3661
+ }
3662
+ interface HelpDeskSupportOpenOptions {
3663
+ /** Prefill the initial question only when starting a new support conversation. */
3664
+ issue?: string;
3665
+ }
3666
+ interface HelpDeskSupportState {
3667
+ visible: boolean;
3668
+ stage: HelpDeskSupportStage;
3669
+ busy: boolean;
3670
+ }
3671
+ interface HelpDeskSupportHandle {
3672
+ /** The one entry point used by the launcher and custom support links. */
3673
+ open(options?: HelpDeskSupportOpenOptions): Promise<void>;
3674
+ /** Minimize while retaining this browser page's unsent composition. */
3675
+ close(): void;
3676
+ /** Bind existing or subsequently inserted links to this same widget. */
3677
+ attach(selector: string): () => void;
3678
+ /** Remove the launcher, dialog, authorization, files and all in-memory support state. */
3679
+ destroy(): void;
3680
+ getState(): HelpDeskSupportState;
3681
+ }
3682
+
3559
3683
  /** Customer ticket APIs and optional UI, isolated from Core/operator credentials. */
3560
3684
 
3561
3685
  /** One-call website setup. No browser secrets or identity assertions are configured here. */
@@ -3566,6 +3690,8 @@ declare class HelpDeskModule {
3566
3690
  constructor(config: ResolvedConfig);
3567
3691
  /** Resolve a configured desk host and obtain its customer-only, headless API. */
3568
3692
  connect(options: HelpDeskConnectOptions): Promise<HelpDeskClient>;
3693
+ /** Create one KB-first support front door, with an optional floating launcher. */
3694
+ createSupport(options: HelpDeskSupportOptions): HelpDeskSupportHandle;
3569
3695
  /**
3570
3696
  * Inject a ticket form, including email-code verification where the desk
3571
3697
  * enables it. A custom onAuthRequired callback may supply a server-issued
@@ -5309,4 +5435,4 @@ declare global {
5309
5435
  }
5310
5436
 
5311
5437
  export { AuthenticationError, AuthorizationError, EntropyModule, FoldersModule, HelpDeskClient, HelpDeskModule, IdentityModule, IdentityProviderError, IngotsModule, NAME_CONFLICT_POLICIES, NOTIFY_PRESETS, NetworkError, NotifyModule, NotifyProductModule, NotifySubscriptionRequiredError, PlanRequiredError, PopupBlockedError, ProductsModule, QuotaExceededError, SparkVault, SparkVaultError, SparksModule, TimeoutError, UnauthorizedError, UserCancelledError, ValidationError, VaultsModule, buildNotifyPresetSend, SparkVault as default, fetchDownload, isReceivedUploadFailure, logger, setDebugMode };
5312
- export type { AccessLogRetention, AccessLogsOptions, CreateFolderOptions, CreateNotifySendOptions, CreateSparkOptions, CreateUploadOptions, CreateVaultOptions, CreatedIngot, CreatedSpark, DownloadIngotOptions, EntropyFormat, EntropyResult, FetchDownloadOptions, FetchedDownload, Folder, FolderBreadcrumbItem, FolderContents, FolderPage, GenerateEntropyOptions, HealthCheckOptions, HealthCheckResult, HelpDeskAttachmentDownload, HelpDeskAttachmentInput, HelpDeskAttachmentUpload, HelpDeskConnectOptions, HelpDeskCreateTicketOptions, HelpDeskCustomer, HelpDeskCustomerPatch, HelpDeskDesk, HelpDeskDraft, HelpDeskEvent, HelpDeskExternalChallenge, HelpDeskExternalIdentity, HelpDeskFormHandle, HelpDeskFormOptions, HelpDeskFormState, HelpDeskIdentityRequest, HelpDeskListTicketsOptions, HelpDeskMountFormOptions, HelpDeskOpenFormOptions, HelpDeskPinChallenge, HelpDeskReplyCreated, HelpDeskReplyOptions, HelpDeskRequestContext, HelpDeskSession, HelpDeskSessionChange, HelpDeskTicket, HelpDeskTicketCreated, HelpDeskTicketDetail, HelpDeskTicketList, HelpDeskTimeline, HelpDeskVerifyPinOptions, AttachOptions as IdentityAttachOptions, Ingot, IngotAccessLog, IngotAccessLogPage, IngotDownloadLink, IngotInvitation, IngotInvite, IngotPage, IngotSharingConfig, IngotUpload, ListContentsOptions, ListFoldersOptions, ListIngotsOptions, ListNotificationsOptions, ListNotificationsResponse, ListNotifyInboxOptions, ListNotifyInboxResponse, ListNotifyReceiptsOptions, ListNotifyReceiptsResponse, ListNotifySendsOptions, ListNotifySendsResponse, ListSparksOptions, MarkAllNotificationsStateOptions, MarkAllNotificationsStateResponse, MarkAllReadResult, MarkNotificationStateOptions, MarkNotificationStateResponse, MarkNotifyInboxAllOptions, MarkNotifyInboxAllResponse, MarkNotifyInboxStateOptions, MarkNotifyInboxStateResponse, NameConflictPolicy, NotificationBulkMarkState, NotificationInboxState, NotificationMarkState, NotificationRow, NotificationSender, NotifyCategory, NotifyChannel, NotifyConfig, NotifyConfigCategory, NotifyConfigDelivery, NotifyConfigDeliveryPatch, NotifyConfigDestinations, NotifyConfigDestinationsPatch, NotifyConfigEvents, NotifyConfigEventsRead, NotifyConfigHistory, NotifyConfigOverrides, NotifyConfigPatch, NotifyConfigRealtimeFallbackDelay, NotifyConfigReliability, NotifyConfigResponse, NotifyConfigSecurity, NotifyDeliveryMode, NotifyDestinationFailureReason, NotifyDestinationKind, NotifyDestinationReason, NotifyDestinationSkipReason, NotifyDestinationState, NotifyDestinationTestReason, NotifyDestinationTestResult, NotifyDestinationTransportReason, NotifyEscalation, NotifyInboxBulkMarkState, NotifyInboxMarkState, NotifyInboxRow, NotifyInboxView, NotifyIngotRef, NotifyInteraction, NotifyPreset, NotifyPresetCategory, NotifyPresetName, NotifyPresetSendOptions, NotifyRecallMode, NotifyReceipt, NotifyReceiptEventType, NotifyRecipient, NotifyRecipientRef, NotifyRecipientState, NotifyReportableVerificationLevel, NotifySendContent, NotifySendPolicy, NotifySendReceipt, NotifySendReceiptsResponse, NotifySendResult, NotifySendState, NotifySendStatus, NotifySendStatusCounts, NotifySendStatusDestination, NotifySendStatusRecipient, NotifySendSummary, NotifySendSummaryDestination, NotifySlackDestination, NotifySuppressionReason, NotifyTeamsDestination, NotifyTeamsDestinationRead, NotifyVerificationLevel, NotifyWebhookDestination, NotifyWebhookDestinationRead, QuotaResource, RecallNotifySendOptions, RecallNotifySendResponse, RegisterWebPushResponse, ReplaceIngotOptions, ResumeUploadOptions, ScheduledVaultDeletion, SearchIngotsOptions, SendUploadOptions, ShareSparkOptions, SignInOptions, SignInResult, Spark, SparkInviteResend, SparkLinkActionOptions, SparkPage, SparkShare, SparkSummary, SparkVaultConfig, SparkVisibility, StartedVaultDeletion, SubscribeWebPushOptions, SubscribeWebPushResult, SubscribeWebPushStatus, TokenClaims, UnreachedAdmin, UnreadCountResponse, UnsealVaultOptions, UnsealedVault, UnsubscribeWebPushResponse, UpdateFolderOptions, UpdateIngotSharingOptions, UpdateVaultUploadOptions, UpdatedVault, UploadAttachOptions, UploadBranding, UploadEnd, UploadIngotOptions, UploadOptions, UploadProgress, UploadResult, UploadSession, Vault, VaultDetail, VaultLifecycle, VaultResealDefaults, VaultResealSettings, VaultResealSettingsResult, VaultSessionExtension, VaultSessionTiming, VaultSharingConfig, VaultSharingOptions, VaultSummary, VaultUploadConfig, VaultUploadSettings, VerifyOptions, VerifyResult, WebPushKeyResponse, WebPushStatus, WebPushStatusOptions, WebPushStatusResult, WebPushSubscriptionInput };
5438
+ export type { AccessLogRetention, AccessLogsOptions, CreateFolderOptions, CreateNotifySendOptions, CreateSparkOptions, CreateUploadOptions, CreateVaultOptions, CreatedIngot, CreatedSpark, DownloadIngotOptions, EntropyFormat, EntropyResult, FetchDownloadOptions, FetchedDownload, Folder, FolderBreadcrumbItem, FolderContents, FolderPage, GenerateEntropyOptions, HealthCheckOptions, HealthCheckResult, HelpDeskAttachmentDownload, HelpDeskAttachmentInput, HelpDeskAttachmentUpload, HelpDeskConnectOptions, HelpDeskCreateTicketOptions, HelpDeskCustomer, HelpDeskCustomerPatch, HelpDeskDesk, HelpDeskDraft, HelpDeskEvent, HelpDeskExternalChallenge, HelpDeskExternalIdentity, HelpDeskFormHandle, HelpDeskFormOptions, HelpDeskFormState, HelpDeskIdentityRequest, HelpDeskListTicketsOptions, HelpDeskMountFormOptions, HelpDeskOpenFormOptions, HelpDeskPinChallenge, HelpDeskReplyCreated, HelpDeskReplyOptions, HelpDeskRequestContext, HelpDeskSession, HelpDeskSessionChange, HelpDeskSupportHandle, HelpDeskSupportLauncherOptions, HelpDeskSupportOpenOptions, HelpDeskSupportOptions, HelpDeskSupportStage, HelpDeskSupportState, HelpDeskTicket, HelpDeskTicketCreated, HelpDeskTicketDetail, HelpDeskTicketList, HelpDeskTimeline, HelpDeskVerifyPinOptions, HelpDeskWidgetFormIdentity, HelpDeskWidgetIdentityChallenge, HelpDeskWidgetIdentityOptions, HelpDeskWidgetIdentitySession, AttachOptions as IdentityAttachOptions, Ingot, IngotAccessLog, IngotAccessLogPage, IngotDownloadLink, IngotInvitation, IngotInvite, IngotPage, IngotSharingConfig, IngotUpload, ListContentsOptions, ListFoldersOptions, ListIngotsOptions, ListNotificationsOptions, ListNotificationsResponse, ListNotifyInboxOptions, ListNotifyInboxResponse, ListNotifyReceiptsOptions, ListNotifyReceiptsResponse, ListNotifySendsOptions, ListNotifySendsResponse, ListSparksOptions, MarkAllNotificationsStateOptions, MarkAllNotificationsStateResponse, MarkAllReadResult, MarkNotificationStateOptions, MarkNotificationStateResponse, MarkNotifyInboxAllOptions, MarkNotifyInboxAllResponse, MarkNotifyInboxStateOptions, MarkNotifyInboxStateResponse, NameConflictPolicy, NotificationBulkMarkState, NotificationInboxState, NotificationMarkState, NotificationRow, NotificationSender, NotifyCategory, NotifyChannel, NotifyConfig, NotifyConfigCategory, NotifyConfigDelivery, NotifyConfigDeliveryPatch, NotifyConfigDestinations, NotifyConfigDestinationsPatch, NotifyConfigEvents, NotifyConfigEventsRead, NotifyConfigHistory, NotifyConfigOverrides, NotifyConfigPatch, NotifyConfigRealtimeFallbackDelay, NotifyConfigReliability, NotifyConfigResponse, NotifyConfigSecurity, NotifyDeliveryMode, NotifyDestinationFailureReason, NotifyDestinationKind, NotifyDestinationReason, NotifyDestinationSkipReason, NotifyDestinationState, NotifyDestinationTestReason, NotifyDestinationTestResult, NotifyDestinationTransportReason, NotifyEscalation, NotifyInboxBulkMarkState, NotifyInboxMarkState, NotifyInboxRow, NotifyInboxView, NotifyIngotRef, NotifyInteraction, NotifyPreset, NotifyPresetCategory, NotifyPresetName, NotifyPresetSendOptions, NotifyRecallMode, NotifyReceipt, NotifyReceiptEventType, NotifyRecipient, NotifyRecipientRef, NotifyRecipientState, NotifyReportableVerificationLevel, NotifySendContent, NotifySendPolicy, NotifySendReceipt, NotifySendReceiptsResponse, NotifySendResult, NotifySendState, NotifySendStatus, NotifySendStatusCounts, NotifySendStatusDestination, NotifySendStatusRecipient, NotifySendSummary, NotifySendSummaryDestination, NotifySlackDestination, NotifySuppressionReason, NotifyTeamsDestination, NotifyTeamsDestinationRead, NotifyVerificationLevel, NotifyWebhookDestination, NotifyWebhookDestinationRead, QuotaResource, RecallNotifySendOptions, RecallNotifySendResponse, RegisterWebPushResponse, ReplaceIngotOptions, ResumeUploadOptions, ScheduledVaultDeletion, SearchIngotsOptions, SendUploadOptions, ShareSparkOptions, SignInOptions, SignInResult, Spark, SparkInviteResend, SparkLinkActionOptions, SparkPage, SparkShare, SparkSummary, SparkVaultConfig, SparkVisibility, StartedVaultDeletion, SubscribeWebPushOptions, SubscribeWebPushResult, SubscribeWebPushStatus, TokenClaims, UnreachedAdmin, UnreadCountResponse, UnsealVaultOptions, UnsealedVault, UnsubscribeWebPushResponse, UpdateFolderOptions, UpdateIngotSharingOptions, UpdateVaultUploadOptions, UpdatedVault, UploadAttachOptions, UploadBranding, UploadEnd, UploadIngotOptions, UploadOptions, UploadProgress, UploadResult, UploadSession, Vault, VaultDetail, VaultLifecycle, VaultResealDefaults, VaultResealSettings, VaultResealSettingsResult, VaultSessionExtension, VaultSessionTiming, VaultSharingConfig, VaultSharingOptions, VaultSummary, VaultUploadConfig, VaultUploadSettings, VerifyOptions, VerifyResult, WebPushKeyResponse, WebPushStatus, WebPushStatusOptions, WebPushStatusResult, WebPushSubscriptionInput };