@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.
- package/README.md +13 -6
- package/dist/index.cjs +1679 -1109
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +21 -5
- package/dist/index.mjs +1679 -1109
- package/dist/index.mjs.map +1 -1
- package/dist/products/help-desk/client.d.ts +18 -4
- package/dist/products/help-desk/form-attachments.d.ts +1 -0
- package/dist/products/help-desk/form.d.ts +20 -1
- package/dist/products/help-desk/types.d.ts +3 -1
- package/dist/sparkvault.js +1 -1
- package/dist/sparkvault.js.map +1 -1
- package/dist/ui/modal-shell.d.ts +41 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -148,8 +148,10 @@ const removeSupport = sv.products.helpDesk.attach('.support-button', {
|
|
|
148
148
|
Call `removeSupport()` on unmount/account change to detach its listeners and close its form.
|
|
149
149
|
|
|
150
150
|
`openForm(options)` opens the same modal programmatically. It handles close,
|
|
151
|
-
Escape, backdrop,
|
|
152
|
-
|
|
151
|
+
Escape, the backdrop, keeping Tab inside the dialog, focus restoration and
|
|
152
|
+
teardown. Closing while the customer has unsent work asks "Discard this
|
|
153
|
+
request?" first. These browser UI methods complement the inline form and
|
|
154
|
+
headless client below.
|
|
153
155
|
Closing a form suppresses later UI callbacks; it cannot undo a submission the
|
|
154
156
|
server has already accepted. Check the customer's ticket history before
|
|
155
157
|
starting another request after closing an in-flight send.
|
|
@@ -171,9 +173,11 @@ const form = await sv.products.helpDesk.mountForm({
|
|
|
171
173
|
|
|
172
174
|
Call `form.destroy()` when your component unmounts or your website customer changes.
|
|
173
175
|
|
|
174
|
-
The form handles subject/description, screenshots and files, the desk's email-code flow
|
|
175
|
-
|
|
176
|
-
|
|
176
|
+
The form handles subject/description, screenshots and files, the desk's email-code flow (pasted
|
|
177
|
+
codes, sending a new code, using a different email), a missing display name,
|
|
178
|
+
submitting once, and retrying the same draft after an uncertain response.
|
|
179
|
+
`onSuccess` runs only after the service confirms a ticket number; the form then
|
|
180
|
+
shows the request number and a link to the request's page in the hosted portal.
|
|
177
181
|
`onStateChange` observes `authenticating`, `editing`, `verifying`, `submitting`, `uncertain`, `success` and
|
|
178
182
|
`destroyed`; `reset()` clears an idle/completed form. Observer callback errors
|
|
179
183
|
do not turn an accepted ticket into a retry. The file picker appears when the
|
|
@@ -215,7 +219,10 @@ Pass
|
|
|
215
219
|
`expectedSessionToken` in a write's context argument to refuse a send if a
|
|
216
220
|
dynamic session provider has switched customers. A session stays in memory by
|
|
217
221
|
default. `setSession(answer)` accepts a server-issued session answer; it does
|
|
218
|
-
not authenticate a browser's claimed identity.
|
|
222
|
+
not authenticate a browser's claimed identity. A session the client receives
|
|
223
|
+
itself is timed on the device's clock from the answer's `ttl_seconds`, never
|
|
224
|
+
from `expires_at`; one installed with `setSession` lasts until the server
|
|
225
|
+
answers 401. `clearSession()` overrides any
|
|
219
226
|
token provider with a signed-out state; `refreshSession()` explicitly resumes
|
|
220
227
|
that provider. `logout()` revokes the current desk session. On account change,
|
|
221
228
|
clear/destroy the customer UI before showing a new customer's data.
|