@sparkvault/sdk-js 15.2.0 → 15.3.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/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,9 @@ declare class HelpDeskClient {
3430
3466
  private deadline;
3431
3467
  private token;
3432
3468
  private revision;
3469
+ private websiteAccountSuppressed;
3470
+ private ticketAccess;
3471
+ private currentTicketPolicy;
3433
3472
  private constructor();
3434
3473
  /** Discover a desk by its configured host, before any customer credentials are sent. */
3435
3474
  static connect(config: ResolvedConfig, options: HelpDeskConnectOptions): Promise<HelpDeskClient>;
@@ -3453,6 +3492,16 @@ declare class HelpDeskClient {
3453
3492
  refreshSession(): Promise<string | null>;
3454
3493
  /** Whether company identity can be established without customer interaction. */
3455
3494
  get hasIdentityProvider(): boolean;
3495
+ /** The independent ticket gate must be met before rendering authenticated ticket UI. */
3496
+ get hasTicketAccess(): boolean;
3497
+ clearTicketAccess(): void;
3498
+ get ticketAccessPolicy(): HelpDeskDesk['ticket_access_control'];
3499
+ /** Refresh network/policy hints without replacing requester state or composition. */
3500
+ refreshTicketAccessPolicy(): Promise<void>;
3501
+ unlockTicketAccess(options: {
3502
+ password?: string;
3503
+ identityGrant?: string;
3504
+ }): Promise<void>;
3456
3505
  /** @internal Read an installed server-proven company bearer without invoking any identity provider. */
3457
3506
  verifiedSessionTokenFor(requesterId: string): string | null;
3458
3507
  getSessionToken(): Promise<string | null>;
@@ -3496,6 +3545,12 @@ declare class HelpDeskClient {
3496
3545
  completeIdentity(options: {
3497
3546
  token: string;
3498
3547
  }): Promise<HelpDeskSession>;
3548
+ /** Uninstalled result: the owning form/controller decides when the new requester becomes current. */
3549
+ signInWidgetIdentity(options?: HelpDeskWidgetIdentityOptions): Promise<HelpDeskWidgetIdentitySession>;
3550
+ /** Choose a different support identity without logging out or changing the host website. */
3551
+ switchSupportAccount(): Promise<void>;
3552
+ /** The only operation that resumes the website's configured identity provider after an explicit switch. */
3553
+ useWebsiteAccount(): Promise<HelpDeskSession | null>;
3499
3554
  getMe(): Promise<HelpDeskCustomer>;
3500
3555
  updateMe(patch: HelpDeskCustomerPatch, context?: HelpDeskRequestContext): Promise<HelpDeskCustomer>;
3501
3556
  createDraft(context?: HelpDeskRequestContext): Promise<HelpDeskDraft>;
@@ -3523,6 +3578,23 @@ declare class HelpDeskClient {
3523
3578
  logout(): Promise<void>;
3524
3579
  }
3525
3580
 
3581
+ /** Internal adapter used by the KB-first widget; legacy forms retain their existing verification flow. */
3582
+ interface HelpDeskWidgetFormIdentity {
3583
+ customer: HelpDeskCustomer | null;
3584
+ signIn(input: {
3585
+ email: string;
3586
+ givenName: string;
3587
+ familyName: string;
3588
+ }): Promise<HelpDeskSession>;
3589
+ switchAccount(composition: {
3590
+ subject: string;
3591
+ body: string;
3592
+ } | null): void;
3593
+ useWebsiteAccount?: (composition: {
3594
+ subject: string;
3595
+ body: string;
3596
+ } | null) => void;
3597
+ }
3526
3598
  /** The injected form's state; uncertain sends keep an exact snapshot until recovered. */
3527
3599
  type HelpDeskFormState = 'authenticating' | 'editing' | 'verifying' | 'submitting' | 'uncertain' | 'success' | 'destroyed';
3528
3600
  interface HelpDeskFormOptions {
@@ -3534,6 +3606,13 @@ interface HelpDeskFormOptions {
3534
3606
  body?: string;
3535
3607
  /** Show the default file picker when the desk permits customer uploads. Defaults to true. */
3536
3608
  attachments?: boolean;
3609
+ /** @internal The support controller owns account transitions and native Identity. */
3610
+ widgetIdentity?: HelpDeskWidgetFormIdentity;
3611
+ /** @internal Server-minted, content-free assistance correlation. */
3612
+ assistanceContext?: () => {
3613
+ assistance_attempt_id: string;
3614
+ assistance_visitor_id: string;
3615
+ } | undefined;
3537
3616
  /**
3538
3617
  * Ask host code for a server-issued help desk session. This callback must
3539
3618
  * not construct a session from a browser-supplied user ID or email address.
@@ -3556,6 +3635,45 @@ interface HelpDeskFormHandle {
3556
3635
  getState(): HelpDeskFormState;
3557
3636
  }
3558
3637
 
3638
+ type HelpDeskSupportStage = 'issue' | 'results' | 'article' | 'feedback' | 'contact' | 'receipt';
3639
+ interface HelpDeskSupportLauncherOptions {
3640
+ /** HTTPS image URL. Omit to use the accessible question-mark icon. */
3641
+ imageUrl?: string;
3642
+ label?: string;
3643
+ /** Distance in CSS pixels, in addition to the device safe area. */
3644
+ right?: number;
3645
+ bottom?: number;
3646
+ }
3647
+ /** One persistent, memory-only support session for a website. */
3648
+ interface HelpDeskSupportOptions extends HelpDeskConnectOptions {
3649
+ /** Show a floating button immediately. Defaults to false. */
3650
+ launcher?: boolean | HelpDeskSupportLauncherOptions;
3651
+ attachments?: boolean;
3652
+ onSuccess?: (ticket: HelpDeskTicketCreated) => void;
3653
+ onError?: (error: Error) => void;
3654
+ onStateChange?: (state: HelpDeskSupportState) => void;
3655
+ }
3656
+ interface HelpDeskSupportOpenOptions {
3657
+ /** Prefill the initial question only when starting a new support conversation. */
3658
+ issue?: string;
3659
+ }
3660
+ interface HelpDeskSupportState {
3661
+ visible: boolean;
3662
+ stage: HelpDeskSupportStage;
3663
+ busy: boolean;
3664
+ }
3665
+ interface HelpDeskSupportHandle {
3666
+ /** The one entry point used by the launcher and custom support links. */
3667
+ open(options?: HelpDeskSupportOpenOptions): Promise<void>;
3668
+ /** Minimize while retaining this browser page's unsent composition. */
3669
+ close(): void;
3670
+ /** Bind existing or subsequently inserted links to this same widget. */
3671
+ attach(selector: string): () => void;
3672
+ /** Remove the launcher, dialog, authorization, files and all in-memory support state. */
3673
+ destroy(): void;
3674
+ getState(): HelpDeskSupportState;
3675
+ }
3676
+
3559
3677
  /** Customer ticket APIs and optional UI, isolated from Core/operator credentials. */
3560
3678
 
3561
3679
  /** One-call website setup. No browser secrets or identity assertions are configured here. */
@@ -3566,6 +3684,8 @@ declare class HelpDeskModule {
3566
3684
  constructor(config: ResolvedConfig);
3567
3685
  /** Resolve a configured desk host and obtain its customer-only, headless API. */
3568
3686
  connect(options: HelpDeskConnectOptions): Promise<HelpDeskClient>;
3687
+ /** Create one KB-first support front door, with an optional floating launcher. */
3688
+ createSupport(options: HelpDeskSupportOptions): HelpDeskSupportHandle;
3569
3689
  /**
3570
3690
  * Inject a ticket form, including email-code verification where the desk
3571
3691
  * enables it. A custom onAuthRequired callback may supply a server-issued
@@ -5309,4 +5429,4 @@ declare global {
5309
5429
  }
5310
5430
 
5311
5431
  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 };
5432
+ 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 };