glitchgrab 1.61.2 → 1.62.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/README.md CHANGED
@@ -317,6 +317,56 @@ import { listLeads } from "glitchgrab/server";
317
317
  const leads = await listLeads({ source: "demo", since: "2026-09-01" }); // GLITCHGRAB_CALLS_KEY=ggc_…
318
318
  ```
319
319
 
320
+ ## How do I show customer follow-ups in my own admin?
321
+
322
+ Glitchgrab keeps, per customer, the recorded calls, a running note history and the booked next call — and WhatsApps whoever booked it when it is due. After each call a note of what was asked and promised appears by itself, with a suggested next call. Read and write it from your server with the `ggc_` key:
323
+
324
+ ```ts
325
+ import { listFollowUps, setFollowUpBooking, dialFollowUp, addFollowUpNote } from "glitchgrab/server";
326
+
327
+ // One request for a whole list page (≤500 ids): nextCallAt, due, lastNote, noteCount, lastCall
328
+ const rows = await listFollowUps(owners.map((o) => o.id));
329
+
330
+ // The first write for a new id needs its phone
331
+ await addFollowUpNote(owner.id, { body: "Wants WhatsApp receipts", author: "Super Admin", phone: owner.phone });
332
+ await setFollowUpBooking(owner.id, { nextCallAt: new Date("2026-10-27T05:30:00Z"), operator: { email: "admin@you.in" } });
333
+
334
+ // Rings the operator first, then the customer, from your project's Glitchgrab number — recorded
335
+ await dialFollowUp(owner.id, { operator: { email: "admin@you.in" } });
336
+ ```
337
+
338
+ The `operator` must be someone on the project's phone line in Glitchgrab. Webhooks `followup.note_added` and `followup.booking_changed` keep your list fresh without polling.
339
+
340
+ ### "Ring me on" — pick which phone rings
341
+
342
+ Each person on the line keeps a list of verified phones for your project (shown read-only in Glitchgrab under Calls → Phone lines → People): one Default, the rest backups. Lists are per project — your key never sees or changes another product's. If a phone isn't picked up, busy or rejected, the next backup rings by itself.
343
+
344
+ ```ts
345
+ import { getOperatorRingNumbers, dialFollowUp } from "glitchgrab/server";
346
+
347
+ const r = await getOperatorRingNumbers({ email: "admin@you.in" });
348
+ // r.numbers → [{ phone: "+9198…", label: "Work SIM", isDefault: true, order: 0 }, …]
349
+
350
+ const call = await dialFollowUp(owner.id, { operator: { email: "admin@you.in" }, ringPhone: picked.phone });
351
+ if (!call.ok) showError(call.code); // NOT_ON_LINE | NO_VERIFIED_NUMBER | RING_PHONE_NOT_YOURS
352
+ ```
353
+
354
+ Ring numbers are managed from your product, not in Glitchgrab (it shows them read-only):
355
+
356
+ ```ts
357
+ import { listRingNumbers, addRingNumber, updateRingNumber, removeRingNumber, testRingNumber } from "glitchgrab/server";
358
+
359
+ await addRingNumber({ email: "admin@you.in" }, { phone: "98765 43210", label: "Work SIM" }); // test ring goes out now
360
+ const list = await listRingNumbers({ email: "admin@you.in" }); // poll until numbers[i].verified; !ok → list.code
361
+ if (list.ok) await updateRingNumber(list.numbers[1].id, { makeDefault: true }); // or { move: "up" | "down" }, { label }
362
+ await removeRingNumber(id);
363
+ await testRingNumber(id); // ring again if they missed it
364
+ ```
365
+
366
+ A number is never rung for a call until whoever holds it presses 1 on the test ring, and the project owner is emailed every time one is verified — so a leaked server key adding its own phone does not go unnoticed.
367
+
368
+ `ringPhone` omitted = their Default. While a call is still `DIALING`, `lastCall.ringingPhone` is the phone ringing now; `ringingIndex` above 0 means a backup.
369
+
320
370
  ## What keyboard shortcuts are available?
321
371
 
322
372
  Once `GlitchgrabProvider` is mounted, these shortcuts work globally:
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { h as GlitchgrabProviderProps, U as UseGlitchgrabReturn, R as ReportButtonProps, B as BookedDemo, F as FeedbackButtonProps, i as GlitchgrabSession, C as CaptureErrorOptions, g as GlitchgrabFeedback, c as BreadcrumbType, b as Breadcrumb, d as CapturedContext, D as DeviceInfo, e as FeedbackPayload, f as FeedbackResult, L as LeadInput, j as LeadResult, k as ReportPayload, l as ReportResult } from './types-BlMF6wzX.mjs';
3
- export { a as BookingDialogOptions, G as GlitchgrabConfig, m as ReportSeverity, n as ReportType, o as RuntimeInfo } from './types-BlMF6wzX.mjs';
2
+ import { h as GlitchgrabProviderProps, U as UseGlitchgrabReturn, R as ReportButtonProps, B as BookedDemo, F as FeedbackButtonProps, i as GlitchgrabSession, C as CaptureErrorOptions, g as GlitchgrabFeedback, c as BreadcrumbType, b as Breadcrumb, d as CapturedContext, D as DeviceInfo, e as FeedbackPayload, f as FeedbackResult, L as LeadInput, j as LeadResult, k as ReportPayload, l as ReportResult } from './types-Dp5Sh_hd.mjs';
3
+ export { a as BookingDialogOptions, G as GlitchgrabConfig, m as ReportSeverity, n as ReportType, o as RuntimeInfo } from './types-Dp5Sh_hd.mjs';
4
4
  import * as React from 'react';
5
5
  import { ReactNode } from 'react';
6
6
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { h as GlitchgrabProviderProps, U as UseGlitchgrabReturn, R as ReportButtonProps, B as BookedDemo, F as FeedbackButtonProps, i as GlitchgrabSession, C as CaptureErrorOptions, g as GlitchgrabFeedback, c as BreadcrumbType, b as Breadcrumb, d as CapturedContext, D as DeviceInfo, e as FeedbackPayload, f as FeedbackResult, L as LeadInput, j as LeadResult, k as ReportPayload, l as ReportResult } from './types-BlMF6wzX.js';
3
- export { a as BookingDialogOptions, G as GlitchgrabConfig, m as ReportSeverity, n as ReportType, o as RuntimeInfo } from './types-BlMF6wzX.js';
2
+ import { h as GlitchgrabProviderProps, U as UseGlitchgrabReturn, R as ReportButtonProps, B as BookedDemo, F as FeedbackButtonProps, i as GlitchgrabSession, C as CaptureErrorOptions, g as GlitchgrabFeedback, c as BreadcrumbType, b as Breadcrumb, d as CapturedContext, D as DeviceInfo, e as FeedbackPayload, f as FeedbackResult, L as LeadInput, j as LeadResult, k as ReportPayload, l as ReportResult } from './types-Dp5Sh_hd.js';
3
+ export { a as BookingDialogOptions, G as GlitchgrabConfig, m as ReportSeverity, n as ReportType, o as RuntimeInfo } from './types-Dp5Sh_hd.js';
4
4
  import * as React from 'react';
5
5
  import { ReactNode } from 'react';
6
6