@sparkvault/sdk-js 19.0.1 → 19.1.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.
Files changed (132) hide show
  1. package/README.md +26 -4
  2. package/dist/npm/chunks/index-BnP-2w0t.cjs +13025 -0
  3. package/dist/npm/chunks/index-BnP-2w0t.cjs.map +1 -0
  4. package/dist/npm/chunks/index-CgR08uMG.mjs +12960 -0
  5. package/dist/npm/chunks/index-CgR08uMG.mjs.map +1 -0
  6. package/dist/npm/identity.cjs +23 -0
  7. package/dist/npm/identity.cjs.map +1 -0
  8. package/dist/npm/identity.mjs +12 -0
  9. package/dist/npm/identity.mjs.map +1 -0
  10. package/dist/{index.cjs → npm/index.cjs} +799 -13755
  11. package/dist/npm/index.cjs.map +1 -0
  12. package/dist/{index.mjs → npm/index.mjs} +200 -13155
  13. package/dist/npm/index.mjs.map +1 -0
  14. package/dist/sparkvault-identity.js +2 -0
  15. package/dist/sparkvault-identity.js.map +1 -0
  16. package/dist/sparkvault.js +1 -1
  17. package/dist/types/identity.d.ts +8 -0
  18. package/dist/{index.d.ts → types/index.d.ts} +4 -790
  19. package/dist/types/shared/errors-C-gjmGBs.d.ts +800 -0
  20. package/package.json +20 -9
  21. package/dist/api-base.d.ts +0 -116
  22. package/dist/auto-init.d.ts +0 -32
  23. package/dist/config.d.ts +0 -79
  24. package/dist/entropy/index.d.ts +0 -35
  25. package/dist/entropy/types.d.ts +0 -32
  26. package/dist/errors.d.ts +0 -146
  27. package/dist/folders/index.d.ts +0 -102
  28. package/dist/folders/types.d.ts +0 -91
  29. package/dist/health.d.ts +0 -18
  30. package/dist/http.d.ts +0 -46
  31. package/dist/index.cjs.map +0 -1
  32. package/dist/index.mjs.map +0 -1
  33. package/dist/ingots/fetch-download.d.ts +0 -78
  34. package/dist/ingots/history.d.ts +0 -4
  35. package/dist/ingots/index.d.ts +0 -388
  36. package/dist/ingots/revision.d.ts +0 -4
  37. package/dist/ingots/types.d.ts +0 -556
  38. package/dist/logger.d.ts +0 -32
  39. package/dist/notify/index.d.ts +0 -154
  40. package/dist/notify/types.d.ts +0 -232
  41. package/dist/products/help-desk/client.d.ts +0 -198
  42. package/dist/products/help-desk/desk-id.d.ts +0 -2
  43. package/dist/products/help-desk/form-draft.d.ts +0 -37
  44. package/dist/products/help-desk/form-types.d.ts +0 -123
  45. package/dist/products/help-desk/form.d.ts +0 -83
  46. package/dist/products/help-desk/index.d.ts +0 -47
  47. package/dist/products/help-desk/kb-client.d.ts +0 -48
  48. package/dist/products/help-desk/kb-types.d.ts +0 -59
  49. package/dist/products/help-desk/modal.d.ts +0 -8
  50. package/dist/products/help-desk/styles.d.ts +0 -9
  51. package/dist/products/help-desk/support-analytics-types.d.ts +0 -32
  52. package/dist/products/help-desk/support-analytics.d.ts +0 -3
  53. package/dist/products/help-desk/support-brand.d.ts +0 -49
  54. package/dist/products/help-desk/support-controller.d.ts +0 -4
  55. package/dist/products/help-desk/support-history.d.ts +0 -38
  56. package/dist/products/help-desk/support-launcher.d.ts +0 -12
  57. package/dist/products/help-desk/support-styles.d.ts +0 -14
  58. package/dist/products/help-desk/support-types.d.ts +0 -66
  59. package/dist/products/help-desk/support-view.d.ts +0 -173
  60. package/dist/products/help-desk/types.d.ts +0 -285
  61. package/dist/products/help-desk/widget-identity.d.ts +0 -32
  62. package/dist/products/identity/api.d.ts +0 -237
  63. package/dist/products/identity/container.d.ts +0 -44
  64. package/dist/products/identity/dialog-launcher.d.ts +0 -133
  65. package/dist/products/identity/federation-flow.d.ts +0 -31
  66. package/dist/products/identity/handlers/otp-handler.d.ts +0 -69
  67. package/dist/products/identity/handlers/passkey-handler.d.ts +0 -105
  68. package/dist/products/identity/handlers/sparklink-handler.d.ts +0 -34
  69. package/dist/products/identity/index.d.ts +0 -296
  70. package/dist/products/identity/inline-container.d.ts +0 -53
  71. package/dist/products/identity/methods.d.ts +0 -19
  72. package/dist/products/identity/modal.d.ts +0 -51
  73. package/dist/products/identity/pending-signin.d.ts +0 -102
  74. package/dist/products/identity/popup-launcher.d.ts +0 -73
  75. package/dist/products/identity/renderer.d.ts +0 -525
  76. package/dist/products/identity/state.d.ts +0 -84
  77. package/dist/products/identity/styles.d.ts +0 -31
  78. package/dist/products/identity/types.d.ts +0 -561
  79. package/dist/products/identity/utils/cooldown-timer.d.ts +0 -73
  80. package/dist/products/identity/utils.d.ts +0 -85
  81. package/dist/products/identity/views/backup-verify.d.ts +0 -42
  82. package/dist/products/identity/views/base.d.ts +0 -51
  83. package/dist/products/identity/views/error.d.ts +0 -65
  84. package/dist/products/identity/views/icons.d.ts +0 -41
  85. package/dist/products/identity/views/identity-input.d.ts +0 -80
  86. package/dist/products/identity/views/index.d.ts +0 -20
  87. package/dist/products/identity/views/loading.d.ts +0 -23
  88. package/dist/products/identity/views/method-button.d.ts +0 -14
  89. package/dist/products/identity/views/method-select.d.ts +0 -42
  90. package/dist/products/identity/views/origin-not-allowed.d.ts +0 -25
  91. package/dist/products/identity/views/otp-verify.d.ts +0 -58
  92. package/dist/products/identity/views/passkey-auto.d.ts +0 -22
  93. package/dist/products/identity/views/passkey-prompt.d.ts +0 -25
  94. package/dist/products/identity/views/passkey.d.ts +0 -38
  95. package/dist/products/identity/views/product-not-configured.d.ts +0 -21
  96. package/dist/products/identity/views/service-unavailable.d.ts +0 -21
  97. package/dist/products/identity/views/sms-consent.d.ts +0 -16
  98. package/dist/products/identity/views/sparklink-waiting.d.ts +0 -40
  99. package/dist/products/identity/views/two-factor.d.ts +0 -37
  100. package/dist/products/index.d.ts +0 -51
  101. package/dist/products/messaging/index.d.ts +0 -38
  102. package/dist/products/messaging/types.d.ts +0 -162
  103. package/dist/products/notify/index.d.ts +0 -436
  104. package/dist/products/notify/project-types.d.ts +0 -44
  105. package/dist/products/notify/projects.d.ts +0 -15
  106. package/dist/products/notify/types.d.ts +0 -1327
  107. package/dist/products/structured-ingots/index.d.ts +0 -31
  108. package/dist/products/structured-ingots/types-client.d.ts +0 -19
  109. package/dist/products/structured-ingots/types.d.ts +0 -293
  110. package/dist/products/structured-ingots/validation.d.ts +0 -25
  111. package/dist/request-path.d.ts +0 -44
  112. package/dist/sparks/index.d.ts +0 -91
  113. package/dist/sparks/types.d.ts +0 -304
  114. package/dist/ui/chrome.d.ts +0 -16
  115. package/dist/ui/ds-tokens.d.ts +0 -59
  116. package/dist/ui/inline-shell.d.ts +0 -19
  117. package/dist/ui/live-region.d.ts +0 -15
  118. package/dist/ui/modal-shell.d.ts +0 -67
  119. package/dist/ui/target.d.ts +0 -6
  120. package/dist/utils/dom.d.ts +0 -26
  121. package/dist/vault-session.d.ts +0 -2
  122. package/dist/vaults/index.d.ts +0 -254
  123. package/dist/vaults/types.d.ts +0 -368
  124. package/dist/vaults/upload/api.d.ts +0 -310
  125. package/dist/vaults/upload/chrome.d.ts +0 -21
  126. package/dist/vaults/upload/container.d.ts +0 -37
  127. package/dist/vaults/upload/index.d.ts +0 -76
  128. package/dist/vaults/upload/inline-container.d.ts +0 -41
  129. package/dist/vaults/upload/modal.d.ts +0 -55
  130. package/dist/vaults/upload/renderer.d.ts +0 -150
  131. package/dist/vaults/upload/styles.d.ts +0 -14
  132. package/dist/vaults/upload/types.d.ts +0 -220
@@ -1,173 +0,0 @@
1
- import type { KbReaderDocument, KbSearchResult } from './kb-types';
2
- import { type SupportBrand } from './support-brand';
3
- export type SupportViewStage = 'issue' | 'results' | 'article' | 'feedback' | 'resolved' | 'contact' | 'receipt';
4
- export type SupportContactReason = 'direct' | 'no_results' | 'none_match' | 'article_not_answered';
5
- /** Presentation data only; the support controller owns authentication and writes. */
6
- export interface SupportViewState {
7
- visible: boolean;
8
- deskName: string;
9
- /** The desk's brand, paired once by whoever learned its color (supportBrand). */
10
- brand: SupportBrand;
11
- /** The desk's plain-text note beside the results' ticket button. */
12
- contactNote?: string;
13
- stage: SupportViewStage;
14
- issue: string;
15
- /** The verified requester's name or address beside the hosted page's Continue button. */
16
- requesterLabel?: string | null;
17
- busy?: boolean;
18
- error?: string;
19
- results?: KbSearchResult[];
20
- article?: KbReaderDocument;
21
- articleUrl?: string;
22
- feedbackBusy?: boolean;
23
- feedbackError?: string;
24
- reviewUrl?: string;
25
- sourceArticle?: {
26
- title: string;
27
- url: string;
28
- };
29
- identityPending?: boolean;
30
- navigationLocked?: boolean;
31
- kbState?: 'ready' | 'empty' | 'unavailable' | 'locked';
32
- kbAccessMode?: 'password' | 'ip_allowlist' | 'identity';
33
- ticketAccessMode?: 'password' | 'identity' | 'ip_allowlist';
34
- ticketAccessRequired?: boolean;
35
- ticketPortalUrl?: string;
36
- position?: {
37
- right?: number;
38
- bottom?: number;
39
- };
40
- receipt?: {
41
- ticketNumber: string | number;
42
- ticketUrl?: string;
43
- email?: string;
44
- message?: string;
45
- };
46
- }
47
- export interface SupportViewActions {
48
- onIssueChange: (value: string) => void;
49
- onSearch: (value: string) => void;
50
- onContact: (reason: SupportContactReason) => void;
51
- onOpenArticle: (id: string) => void;
52
- onArticleLink?: (url: string) => void;
53
- onBack: () => void;
54
- onClose: () => void;
55
- onAnswered: () => void;
56
- onRetryFeedback?: () => void;
57
- onRetry?: () => void;
58
- onUnlock?: (password?: string) => void;
59
- onUnlockTicketAccess?: (password?: string) => void;
60
- onRestart?: () => void;
61
- onCancelIdentity?: () => void;
62
- /** Focus the mounted contact form where the customer goes on; false when it has nothing to focus. */
63
- onFocusContact?: (focusOptions: FocusOptions) => boolean;
64
- onBrowserBack?: () => void;
65
- onBrowserForward?: () => void;
66
- }
67
- /**
68
- * The durable support surface. Every screen is kept, including the shared
69
- * contact form's mount node; navigating, minimizing and stacking Identity do
70
- * not destroy the caller's unsent composition.
71
- *
72
- * Desktop is deliberately nonmodal. Phone uses the SDK's shared ModalShell,
73
- * so its page lock and keyboard ownership compose with the Identity dialog.
74
- */
75
- export declare class SupportView {
76
- private readonly actions;
77
- private readonly target?;
78
- readonly contactTarget: HTMLDivElement;
79
- readonly panel: HTMLElement;
80
- private readonly prefix;
81
- private readonly screens;
82
- private readonly scrollers;
83
- private readonly scrollPositions;
84
- private readonly headings;
85
- private readonly deskName;
86
- private readonly back;
87
- private readonly close;
88
- private readonly external;
89
- private readonly issue;
90
- private readonly find;
91
- private readonly requesterIdentity;
92
- private readonly requesterName;
93
- private readonly issueError;
94
- private readonly query;
95
- private readonly resultList;
96
- private readonly resultStatus;
97
- private readonly resultError;
98
- private readonly contactResults;
99
- private readonly contactNote;
100
- private readonly resultsFooter;
101
- private readonly articleTitle;
102
- private readonly articleCategory;
103
- private readonly articleContent;
104
- private readonly articleStatus;
105
- private readonly articleError;
106
- private readonly articleRetry;
107
- private readonly articleFooter;
108
- private readonly feedbackStatus;
109
- private readonly feedbackError;
110
- private readonly retryFeedback;
111
- private readonly reviewPrompt;
112
- private readonly reviewLink;
113
- private readonly sourceArticle;
114
- private readonly contactTitle;
115
- private readonly contactStatus;
116
- private readonly contactError;
117
- private readonly contactRetry;
118
- private readonly ticketGate;
119
- private readonly receiptCopy;
120
- private readonly receiptTicket;
121
- private readonly receiptMessage;
122
- private readonly toolbar;
123
- private readonly identityNotice;
124
- private readonly restart;
125
- private readonly media;
126
- private readonly onMediaChange;
127
- private readonly onViewportChange;
128
- private readonly onKeydown;
129
- private readonly phoneHistory;
130
- private shell;
131
- private opener;
132
- private state;
133
- private resultSignature;
134
- private resultStatusSignature;
135
- private articleSignature;
136
- private ticketGateSignature;
137
- private readonly toastCleanups;
138
- private destroyed;
139
- private screenChanges;
140
- private pressedAt;
141
- private readonly onPress;
142
- constructor(actions: SupportViewActions, target?: HTMLElement | undefined);
143
- render(next: SupportViewState): void;
144
- /** A new contact form, or one whose controls changed in place: a change of screen, as a new stage is. */
145
- contactScreenChanged(): void;
146
- /** Programmatic close invalidates Forward restoration even after neutral Back. */
147
- deactivateHistory(): void;
148
- /** Focus the shared form where the customer goes on, else its heading, after its controller has mounted it. */
149
- focusContact(): void;
150
- /** Hydrate only the current reader's matching authorized publication assets. */
151
- setArticleAsset(path: string, blobUrl: string): void;
152
- setArticleAssetError(path: string): void;
153
- /** A nonessential confirmation; timers pause while it cannot be read. */
154
- showToast(message: string): void;
155
- destroy(): void;
156
- private screen;
157
- private footer;
158
- private search;
159
- private resizeIssue;
160
- private renderResults;
161
- private renderResultStatus;
162
- private renderArticle;
163
- private articleLink;
164
- private renderReceipt;
165
- private renderTicketGate;
166
- private syncPresentation;
167
- private syncViewport;
168
- private hide;
169
- private scrollKey;
170
- private saveScroll;
171
- private restoreScroll;
172
- private focusCurrent;
173
- }
@@ -1,285 +0,0 @@
1
- /** Customer-only help desk contracts. Response fields retain the API's names. */
2
- export interface HelpDeskIdentityRequest {
3
- /** Server-generated nonce. The company backend must include it in its signed assertion. */
4
- nonce: string;
5
- audience: string;
6
- deskId: string;
7
- }
8
- export interface HelpDeskExternalChallenge {
9
- nonce: string;
10
- /** Held only by the initiating browser; used for hosted PKCE redemption, never sent to the company. */
11
- verifier: string;
12
- expires_at: number;
13
- }
14
- export interface HelpDeskExternalIdentity {
15
- issuer: string;
16
- key_id: string;
17
- assertion_audience: string;
18
- session_ttl_seconds: number;
19
- handoff_url?: string | null;
20
- sign_in_url?: string | null;
21
- guest_email?: boolean;
22
- }
23
- /** OAuth endpoints and credentials are configured server-side, never by the host page. */
24
- export interface HelpDeskOAuthIdentity {
25
- issuer: string;
26
- session_ttl_seconds: number;
27
- /** Independently verified email customers can also sign in at this desk. */
28
- guest_email?: boolean;
29
- }
30
- export interface HelpDeskConnectOptions {
31
- /** The configured help desk hostname, for example support.example.com. */
32
- host: string;
33
- /** Optionally pin the expected desk within this company (hdd_ for a named desk, acc_ for its original desk). */
34
- deskId?: string;
35
- /**
36
- * The desk lookup's answer for `host` (`GET /v1/hd/desks`) that the page
37
- * already holds, such as the hosted portal's: connect validates it as it
38
- * validates its own lookup's answer and makes no lookup of its own
39
- * (`refreshTicketAccessPolicy`, which the support widget's contact calls,
40
- * still asks the lookup for the current ticket access policy).
41
- * `host` is then checked as a host name but not compared with the desk,
42
- * since a desk serves hosts its answer does not list (its handle host
43
- * besides a custom `canonical_host`): the page vouches that this is the
44
- * answer for `host`.
45
- */
46
- desk?: HelpDeskDesk;
47
- /** A help desk hdt_ bearer provider. Core access tokens and API keys are never used. */
48
- getSessionToken?: () => string | null | Promise<string | null>;
49
- /** Obtain a purpose-specific JWT from the signed-in company's backend. No customer consent is shown. */
50
- getIdentityAssertion?: (request: HelpDeskIdentityRequest) => string | null | Promise<string | null>;
51
- /** Same-origin backend endpoint accepting POST {nonce,audience,desk_id}; returns {assertion} or {data:{assertion}}. */
52
- identityEndpoint?: string;
53
- /**
54
- * Hears a refused or lost revocation of a session Core opened for this
55
- * client that reaches no one: its answer was invalid, the customer changed
56
- * while it was opened, or the sign-in that asked for it had ended. Nobody
57
- * else holds its bearer; unheard, it lasts out its lifetime. The support
58
- * widget and the SDK's forms report these through their own `onError`.
59
- */
60
- onDiscardError?: (error: Error) => void;
61
- }
62
- export interface HelpDeskDesk {
63
- kind: 'desk';
64
- desk_id: string;
65
- /** Owning company. Required in named-desk discovery; legacy desks may omit it. */
66
- account_id?: string;
67
- handle: string;
68
- visitor_identifier?: {
69
- enabled: boolean;
70
- domain_scope: 'host' | 'parent';
71
- cookie_name: string;
72
- };
73
- analytics?: {
74
- enabled: boolean;
75
- };
76
- canonical_host: string;
77
- sending_host: string;
78
- /** Configured contact/PIN sender, independent of the portal's custom domain. */
79
- contact_email?: string;
80
- organization_name: string | null;
81
- branding: {
82
- color: string | null;
83
- logo_url: string | null;
84
- logo_dark_url: string | null;
85
- icon_url?: string | null;
86
- };
87
- auth_mode: 'email_pin' | 'external_sso' | 'external_unavailable' | 'oauth2';
88
- external_identity?: HelpDeskExternalIdentity | null;
89
- oauth_identity?: HelpDeskOAuthIdentity | null;
90
- customer_can_mark_resolved: boolean;
91
- /** Optional plain-text note shown only after a request is confirmed sent. */
92
- ticket_confirmation_message?: string | null;
93
- /** Optional one-line plain-text note shown beside the support view's ticket button. */
94
- ticket_contact_note?: string | null;
95
- /** Independent ticket-portal gate, additional to customer authentication. */
96
- ticket_access_control?: {
97
- mode: 'public' | 'password' | 'ip_allowlist' | 'identity';
98
- company_id?: string;
99
- ip_allowed?: boolean;
100
- };
101
- customer_can_attach_files: boolean;
102
- knowledge_base_enabled: boolean;
103
- portal_client: string;
104
- }
105
- export interface HelpDeskCustomer {
106
- requester_id: string;
107
- email: string;
108
- display_name: string | null;
109
- assurance: 'identity' | 'email_pin' | 'external_sso' | 'federated';
110
- /** 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. */
111
- email_verified?: boolean;
112
- email_updates?: boolean;
113
- /** 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. */
114
- federated?: boolean;
115
- needs_display_name: boolean;
116
- }
117
- export interface HelpDeskSession {
118
- token: string;
119
- /** 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. */
120
- expires_at: number;
121
- /** The session's lifetime in seconds from when its answer lands; the client times a fresh answer on this device's clock from it. */
122
- ttl_seconds: number;
123
- customer: HelpDeskCustomer;
124
- }
125
- /** Use website account's two parts (`HelpDeskClient.returnToWebsiteAccount`). */
126
- export interface HelpDeskWebsiteAccountReturn {
127
- /**
128
- * The released session's revocation. It rejects when the revocation is
129
- * refused or lost, which leaves the return made, so handle it (await it or
130
- * attach a rejection handler) or the rejection goes unhandled.
131
- */
132
- released: Promise<void>;
133
- /**
134
- * The session the website's identity signed support in with. Null for none,
135
- * for a session the host lends (`getSessionToken`), or, without asking the
136
- * website, while a ticket-access gate stands (`hasTicketAccess` false, as
137
- * the release leaves a password or employee gate). Once the gate opens, a
138
- * company host signs back in with `authenticate()` and a host that lends
139
- * its session reads it with `getSessionToken()`, as the support widget does.
140
- */
141
- resumed: Promise<HelpDeskSession | null>;
142
- }
143
- /** Why customer-specific UI is being told to reconsider its current session. */
144
- export interface HelpDeskSessionChange {
145
- source: 'provider' | 'set' | 'clear' | 'refresh' | 'external' | 'renew';
146
- /** Present only for a company proof verified by the server, never a decoded browser JWT. */
147
- requesterId?: string;
148
- previousRequesterId?: string;
149
- /** True only for a proof initiated by this client's company-provider flow. */
150
- automatic?: boolean;
151
- }
152
- export interface HelpDeskPinChallenge {
153
- challenge_id: string;
154
- binding_secret: string;
155
- expires_at: number;
156
- }
157
- export interface HelpDeskVerifyPinOptions {
158
- challengeId: string;
159
- bindingSecret: string;
160
- code: string;
161
- }
162
- export interface HelpDeskCustomerPatch {
163
- display_name?: string;
164
- email_updates?: boolean;
165
- }
166
- /** Refuse a write if its customer changed while the host composed the request. */
167
- export interface HelpDeskRequestContext {
168
- expectedSessionToken?: string;
169
- }
170
- export interface HelpDeskDraft {
171
- ticket_id: string;
172
- }
173
- export interface HelpDeskTicketCreated {
174
- ticket_id: string;
175
- number: number;
176
- }
177
- export interface HelpDeskCreateTicketOptions {
178
- /** Reuse the same draft ID after a failed/uncertain send; never create another draft to retry. */
179
- ticketId: string;
180
- subject: string;
181
- /** Help desk safe markup, not HTML. */
182
- body: string;
183
- attachments?: string[];
184
- /** Optional server-minted support-assistance correlation; never includes the customer's question. */
185
- assistance_attempt_id?: string;
186
- assistance_visitor_id?: string;
187
- /** Optional published article ID; Core resolves its metadata for the support operator. */
188
- source_article_id?: string;
189
- }
190
- export interface HelpDeskTicket {
191
- number: number;
192
- subject: string;
193
- status: 'open' | 'waiting_on_customer' | 'on_hold' | 'closed';
194
- close_reason: 'resolved' | 'duplicate' | null;
195
- awaiting_first_response: boolean;
196
- created_at: number;
197
- last_public_activity_at: number | null;
198
- /** Epoch seconds of the customer's newest message on the request; null when they have sent none. */
199
- last_customer_message_at: number | null;
200
- /** Epoch seconds of the desk's newest reply to the customer on the request; null until the desk replies. */
201
- last_operator_reply_at: number | null;
202
- muted: boolean;
203
- can_resolve?: boolean;
204
- feedback?: Record<string, unknown>;
205
- }
206
- /** Customer-visible events. Internal operator notes are never included. */
207
- export interface HelpDeskEvent {
208
- event_id: string;
209
- type: string;
210
- seq: number;
211
- created_at: number;
212
- actor: {
213
- kind: string;
214
- label: string | null;
215
- avatar_handle: string | null;
216
- };
217
- body: unknown | null;
218
- attachments: Array<Record<string, unknown>>;
219
- status?: {
220
- from: string | null;
221
- to: string | null;
222
- };
223
- merged?: {
224
- number: number | null;
225
- };
226
- left_out?: {
227
- files: Array<{
228
- reason: string;
229
- content_type: string;
230
- size: number;
231
- }>;
232
- count: number;
233
- };
234
- }
235
- export interface HelpDeskListTicketsOptions {
236
- status?: 'open' | 'closed';
237
- number?: number;
238
- cursor?: string;
239
- }
240
- export interface HelpDeskTicketList {
241
- items: HelpDeskTicket[];
242
- next_cursor: string | null;
243
- }
244
- export interface HelpDeskTimeline {
245
- events: HelpDeskEvent[];
246
- next_cursor: string | null;
247
- }
248
- export interface HelpDeskTicketDetail extends HelpDeskTimeline {
249
- ticket: HelpDeskTicket;
250
- }
251
- export interface HelpDeskReplyOptions {
252
- /** Help desk safe markup, not HTML. */
253
- body: string;
254
- attachments?: string[];
255
- /**
256
- * The id the reply is sent under (`HelpDeskClient.newReplyId()`), named once
257
- * per composed reply and sent with every send of it while its words and
258
- * files stand unchanged, whatever an earlier send answered (a lost
259
- * response, a refusal): a reply an earlier send posted is answered with
260
- * that reply instead of being posted again. Name a changed reply anew.
261
- * Without one the help desk names the reply itself, so a reply sent again
262
- * posts again.
263
- */
264
- eventId?: string;
265
- }
266
- export interface HelpDeskReplyCreated {
267
- event_id: string;
268
- }
269
- export interface HelpDeskAttachmentInput {
270
- name: string;
271
- size: number;
272
- }
273
- export interface HelpDeskAttachmentUpload {
274
- attachment_id: string;
275
- ingot_id: string;
276
- forge_url: string;
277
- expires_at: number;
278
- max_bytes: number;
279
- pending_until: number;
280
- }
281
- export interface HelpDeskAttachmentDownload {
282
- url: string;
283
- expires_at: number;
284
- disposition: string;
285
- }
@@ -1,32 +0,0 @@
1
- import type { HelpDeskSession } from './types';
2
- export interface HelpDeskWidgetIdentityOptions {
3
- email?: string;
4
- givenName?: string;
5
- familyName?: string;
6
- selectAccount?: boolean;
7
- /** The current employee gate's company, whose membership Core checks for the person this sign-in proves. */
8
- employeeCompanyId?: string;
9
- signal?: AbortSignal;
10
- }
11
- export interface HelpDeskWidgetIdentityChallenge {
12
- challenge_id: string;
13
- verifier: string;
14
- /** Private to this window, like the verifier: handed only to the sign-in window it opened, which Core requires it from. */
15
- state: string;
16
- sign_in_url: string;
17
- expires_at: number;
18
- }
19
- export interface HelpDeskWidgetIdentitySession extends HelpDeskSession {
20
- /** An origin-bound, five-minute proof for explicit employee gate exchanges; never a content bearer. */
21
- identity_grant: {
22
- token: string;
23
- expires_at: number;
24
- ttl_seconds: number;
25
- };
26
- }
27
- /**
28
- * Open synchronously inside the user's gesture, before preparing the server
29
- * challenge. A session redeemed after the sign-in already ended (cancelled,
30
- * expired, its window gone) reaches no caller, so it goes to `discard`.
31
- */
32
- export declare function openWidgetIdentity(options: HelpDeskWidgetIdentityOptions, prepare: () => Promise<HelpDeskWidgetIdentityChallenge>, ready: (challenge: HelpDeskWidgetIdentityChallenge) => Promise<boolean>, redeem: (challenge: HelpDeskWidgetIdentityChallenge, code?: string) => Promise<HelpDeskWidgetIdentitySession>, discard: (session: HelpDeskWidgetIdentitySession) => void, deskId: string): Promise<HelpDeskWidgetIdentitySession>;