@sparkvault/sdk-js 14.2.2 → 14.2.3

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.
@@ -18,15 +18,24 @@ export declare class HelpDeskClient {
18
18
  private authorityRevision;
19
19
  private readonly listeners;
20
20
  private session;
21
+ /**
22
+ * When the installed session ends on this device's clock, in seconds: set
23
+ * from `ttl_seconds` as an answer lands from Core. Null for a session whose
24
+ * landing this client did not see (setSession), which ends at Core's 401.
25
+ */
26
+ private deadline;
21
27
  private token;
22
28
  private revision;
23
29
  private constructor();
24
30
  /** Discover a desk by its configured host, before any customer credentials are sent. */
25
31
  static connect(config: ResolvedConfig, options: HelpDeskConnectOptions): Promise<HelpDeskClient>;
26
32
  /**
27
- * Install a customer session answer. A company provider verifies restored
28
- * sessions again before use. Null stays signed out until refreshSession()
29
- * or authenticate() explicitly resumes the provider.
33
+ * Install a customer session answer the host holds, such as one restored
34
+ * from its own storage. Its landing time is unknown, so this client sets it
35
+ * no deadline of its own: it lasts until Core answers 401, which clears it.
36
+ * A company provider verifies restored sessions again before use. Null
37
+ * stays signed out until refreshSession() or authenticate() explicitly
38
+ * resumes the provider.
30
39
  */
31
40
  setSession(session: HelpDeskSession | null): void;
32
41
  private installSession;
@@ -46,7 +55,11 @@ export declare class HelpDeskClient {
46
55
  private rememberToken;
47
56
  private send;
48
57
  private establish;
49
- /** A public, short-lived challenge from the help desk's own Entropy service. */
58
+ /**
59
+ * A public, short-lived challenge from the help desk's own Entropy service.
60
+ * Core refuses a nonce past its `expires_at` on its own clock, so this
61
+ * device's clock never judges it.
62
+ */
50
63
  startExternalChallenge(): Promise<HelpDeskExternalChallenge>;
51
64
  /** Exchange only a purpose-specific company assertion, never an ordinary website token. */
52
65
  completeExternal(options: {
@@ -56,6 +69,7 @@ export declare class HelpDeskClient {
56
69
  private exchangeExternal;
57
70
  /** Silently establish/renew a company session. Concurrent calls share one proof. */
58
71
  authenticate(): Promise<HelpDeskSession | null>;
72
+ /** Install a company session answer that just landed from Core, timed from its `ttl_seconds`. */
59
73
  private acceptExternalSession;
60
74
  /** Mint an opaque hosted-portal code from an assertion binding the registered redirect challenge. */
61
75
  createExternalHandoff(options: {
@@ -8,6 +8,7 @@ export declare function createFormAttachments(client: HelpDeskClient, prefix: st
8
8
  element: HTMLDivElement;
9
9
  readonly attachmentIds: string[];
10
10
  readonly unresolved: boolean;
11
+ readonly hasEntries: boolean;
11
12
  readonly busy: boolean;
12
13
  start(): Promise<void>;
13
14
  lock(value: boolean): void;
@@ -1,8 +1,27 @@
1
1
  import type { HelpDeskClient } from './client';
2
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
+ }
3
16
  /**
4
17
  * Inject a ticket form using only the requester's customer API. Authentication
5
18
  * is the desk's email-code flow or an explicit host-provided customer session.
6
19
  * Files use the same direct resumable Forge ceremony as the hosted portal.
20
+ *
21
+ * A check the form makes itself (an empty subject, a short code) and the
22
+ * server's refusal of a code read under the field they concern; the status
23
+ * line carries the flow (a code sent, a send in progress or uncertain, a
24
+ * changed sign-in, a server error). Closing with unsent work asks first.
25
+ * A confirmed send replaces the form with its confirmation.
7
26
  */
8
- export declare function mountHelpDeskForm(client: HelpDeskClient, options: HelpDeskFormOptions): HelpDeskFormHandle;
27
+ export declare function mountHelpDeskForm(client: HelpDeskClient, options: HelpDeskFormOptions): HelpDeskFormController;
@@ -66,8 +66,10 @@ export interface HelpDeskCustomer {
66
66
  }
67
67
  export interface HelpDeskSession {
68
68
  token: string;
69
- /** Absolute expiry in Unix seconds. */
69
+ /** When Core ends the session at the latest, in Unix seconds on Core's clock. Never compared with this device's clock, which may run apart from Core's. */
70
70
  expires_at: number;
71
+ /** The session's lifetime in seconds from when its answer lands; the client times a fresh answer on this device's clock from it. */
72
+ ttl_seconds: number;
71
73
  customer: HelpDeskCustomer;
72
74
  }
73
75
  /** Why customer-specific UI is being told to reconsider its current session. */