glitchgrab 1.62.2 → 1.62.4
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 +29 -1
- package/dist/server.d.mts +50 -5
- package/dist/server.d.ts +50 -5
- package/dist/server.js +14 -1
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +14 -1
- package/dist/server.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -319,7 +319,7 @@ const leads = await listLeads({ source: "demo", since: "2026-09-01" }); // GLITC
|
|
|
319
319
|
|
|
320
320
|
## How do I show customer follow-ups in my own admin?
|
|
321
321
|
|
|
322
|
-
Glitchgrab keeps, per customer, the recorded calls, a running note history and the booked next call — and WhatsApps whoever booked it
|
|
322
|
+
Glitchgrab keeps, per customer, the recorded calls, a running note history and the booked next call — and WhatsApps whoever booked it 5 minutes before it is due. After each call a note of what was asked and promised appears by itself, and the next call is booked from what was said, with a reason. Read and write it from your server with the `ggc_` key:
|
|
323
323
|
|
|
324
324
|
```ts
|
|
325
325
|
import { listFollowUps, setFollowUpBooking, dialFollowUp, addFollowUpNote } from "glitchgrab/server";
|
|
@@ -337,6 +337,21 @@ await dialFollowUp(owner.id, { operator: { email: "admin@you.in" } });
|
|
|
337
337
|
|
|
338
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
339
|
|
|
340
|
+
### The next call, booked from the call — with why
|
|
341
|
+
|
|
342
|
+
When a call's summary is ready, Glitchgrab books the next call the customer and caller agreed on, unless a booking someone set by hand already stands (that one is never overwritten). Show `booking.reason` under "Next call":
|
|
343
|
+
|
|
344
|
+
```ts
|
|
345
|
+
// Send the customer's business with the call — it is named in the reason
|
|
346
|
+
await dialFollowUp(owner.id, { operator: { email: "admin@you.in" }, name: "Sunita Patil", businessName: "Shanti Study Room" });
|
|
347
|
+
|
|
348
|
+
const [row] = await listFollowUps([owner.id]);
|
|
349
|
+
row.booking; // { at, reason: "Ravi → Sunita Patil (Shanti Study Room): set up auto-pay again", auto: true, confirmedAt: null, bookedBy: "Ravi" }
|
|
350
|
+
// auto → label it "Booked from the call summary"
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
Whoever made the call gets a WhatsApp asking to keep it (Yes) or remove it (No); no answer keeps it. Moving or clearing it with `setFollowUpBooking` makes it a person's booking; send `reason` there to set your own, or leave it out to keep the current one.
|
|
354
|
+
|
|
340
355
|
### "Ring me on" — pick which phone rings
|
|
341
356
|
|
|
342
357
|
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.
|
|
@@ -382,6 +397,19 @@ A caller your key added is rung only on phones they confirmed with press 1 — n
|
|
|
382
397
|
|
|
383
398
|
`ringPhone` omitted = their Default. While a call is still `DIALING`, `lastCall.ringingPhone` is the phone ringing now; `ringingIndex` above 0 means a backup.
|
|
384
399
|
|
|
400
|
+
### Call another number, and see who missed it
|
|
401
|
+
|
|
402
|
+
`toPhone` rings a different number for one call — the follow-up's saved `phone` stays as it is, and it isn't checked against other follow-ups. (`phone` still rewrites the saved number.)
|
|
403
|
+
|
|
404
|
+
```ts
|
|
405
|
+
await dialFollowUp(owner.id, { operator: { email: "admin@you.in" }, toPhone: "98200 00000" });
|
|
406
|
+
|
|
407
|
+
const detail = await getFollowUp(owner.id);
|
|
408
|
+
// detail.calls[i].to → "+919820000000", the number rung
|
|
409
|
+
// detail.calls[i].missedBy → "operator" (none of your phones picked up) | "customer" | null
|
|
410
|
+
// detail.calls[i].operatorName → who placed it
|
|
411
|
+
```
|
|
412
|
+
|
|
385
413
|
## What keyboard shortcuts are available?
|
|
386
414
|
|
|
387
415
|
Once `GlitchgrabProvider` is mounted, these shortcuts work globally:
|
package/dist/server.d.mts
CHANGED
|
@@ -643,11 +643,19 @@ interface FollowUp {
|
|
|
643
643
|
/** Digits, `91` + 10. */
|
|
644
644
|
phone: string | null;
|
|
645
645
|
name: string | null;
|
|
646
|
+
/** The customer's business (Abhyasika: the library name), as you sent it. */
|
|
647
|
+
businessName: string | null;
|
|
646
648
|
/** ISO. The booked next call. */
|
|
647
649
|
nextCallAt: string | null;
|
|
648
650
|
nextCallBookedBy: string | null;
|
|
649
651
|
due: FollowUpDue;
|
|
650
|
-
/**
|
|
652
|
+
/** The next call with why it is happening (#670). Null when nothing is booked. */
|
|
653
|
+
booking: FollowUpBooking | null;
|
|
654
|
+
/**
|
|
655
|
+
* ISO. Read from the last call's transcript. Since #670 a call's suggestion
|
|
656
|
+
* is booked by itself (see `booking.auto`); it stays only a suggestion when
|
|
657
|
+
* a person's own booking already stands.
|
|
658
|
+
*/
|
|
651
659
|
suggestedNextCallAt: string | null;
|
|
652
660
|
suggestedNextCallReason: string | null;
|
|
653
661
|
lastNote: string | null;
|
|
@@ -665,6 +673,19 @@ interface FollowUp {
|
|
|
665
673
|
ringingPhone: string | null;
|
|
666
674
|
} | null;
|
|
667
675
|
}
|
|
676
|
+
interface FollowUpBooking {
|
|
677
|
+
/** ISO. */
|
|
678
|
+
at: string;
|
|
679
|
+
/** "Ravi → Sunita Patil (Shanti Study Room): set up auto-pay again" — show it under "Next call". */
|
|
680
|
+
reason: string | null;
|
|
681
|
+
/** Booked by Glitchgrab from the call summary — label it "Booked from the call summary". */
|
|
682
|
+
auto: boolean;
|
|
683
|
+
/** ISO. The caller tapped "Yes, keep it" on WhatsApp. */
|
|
684
|
+
confirmedAt: string | null;
|
|
685
|
+
/** The "keep this call?" WhatsApp reached whoever made the call. */
|
|
686
|
+
askedOnWhatsApp: boolean;
|
|
687
|
+
bookedBy: string | null;
|
|
688
|
+
}
|
|
668
689
|
interface FollowUpNote {
|
|
669
690
|
id: string;
|
|
670
691
|
body: string;
|
|
@@ -685,6 +706,16 @@ interface FollowUpCall {
|
|
|
685
706
|
ringingIndex: number | null;
|
|
686
707
|
/** That phone. While `status` is "DIALING" it is the one ringing right now. */
|
|
687
708
|
ringingPhone: string | null;
|
|
709
|
+
/** E.164 number the call rang — `toPhone` when the dial sent one, else the follow-up's phone (#666). */
|
|
710
|
+
to: string | null;
|
|
711
|
+
/**
|
|
712
|
+
* Who didn't pick up a NO_ANSWER outbound call (#666): "operator" = none of
|
|
713
|
+
* the operator's phones (backups included), "customer" = the operator
|
|
714
|
+
* answered and the customer didn't. Null otherwise, and on older calls.
|
|
715
|
+
*/
|
|
716
|
+
missedBy: "operator" | "customer" | null;
|
|
717
|
+
/** Who placed it. Null on inbound calls. */
|
|
718
|
+
operatorName: string | null;
|
|
688
719
|
/** Shared with you — calls dialled from a follow-up are; an inbound call is once the owner shares it. */
|
|
689
720
|
shared: boolean;
|
|
690
721
|
overview: string | null;
|
|
@@ -743,36 +774,50 @@ declare function addFollowUpNote(externalId: string, note: {
|
|
|
743
774
|
author?: string;
|
|
744
775
|
phone?: string;
|
|
745
776
|
name?: string;
|
|
777
|
+
businessName?: string;
|
|
746
778
|
}, options?: CallsOptions): Promise<FollowUpWriteResult<{
|
|
747
779
|
id: string;
|
|
748
780
|
}>>;
|
|
749
781
|
/**
|
|
750
782
|
* Book, move (`Date`/ISO) or clear (`null`) the next call. The reminder
|
|
751
|
-
* WhatsApp goes to `operator`, else the project owner.
|
|
783
|
+
* WhatsApp goes to `operator`, else the project owner. `reason` is read back
|
|
784
|
+
* as `booking.reason`; left out, a moved booking keeps its reason. A booking
|
|
785
|
+
* made here is never replaced by the next call's automatic one. Never throws.
|
|
752
786
|
*/
|
|
753
787
|
declare function setFollowUpBooking(externalId: string, booking: {
|
|
754
788
|
nextCallAt: Date | string | null;
|
|
789
|
+
reason?: string | null;
|
|
755
790
|
operator?: FollowUpOperator;
|
|
756
791
|
author?: string;
|
|
757
792
|
phone?: string;
|
|
758
793
|
name?: string;
|
|
794
|
+
businessName?: string;
|
|
759
795
|
}, options?: CallsOptions): Promise<FollowUpWriteResult<{
|
|
760
796
|
nextCallAt: string | null;
|
|
797
|
+
reason: string | null;
|
|
761
798
|
}>>;
|
|
762
799
|
/**
|
|
763
800
|
* Start a recorded call: Glitchgrab rings `operator`'s phone, then the
|
|
764
|
-
* customer, from the project's line. The operator must be on that line.
|
|
765
|
-
*
|
|
801
|
+
* customer, from the project's line. The operator must be on that line. Once
|
|
802
|
+
* the call is transcribed a note is written and the next call is booked from
|
|
803
|
+
* it with a reason (#670) — unless a person's booking already stands — and the
|
|
804
|
+
* operator is asked on WhatsApp to keep or remove it. `businessName` (the
|
|
805
|
+
* customer's business) is named in that reason. Never throws.
|
|
766
806
|
*
|
|
767
807
|
* `ringPhone` picks which of the operator's verified phones rings first (list
|
|
768
808
|
* them with {@link getOperatorRingNumbers}); omitted = their Default. If that
|
|
769
809
|
* phone isn't picked up, their backups ring in order (`ringNumbers`). A
|
|
770
810
|
* refusal carries `code` — see {@link RingErrorCode}.
|
|
811
|
+
*
|
|
812
|
+
* `toPhone` dials another number for this one call and leaves the follow-up's
|
|
813
|
+
* saved `phone` alone (#666); `phone` rewrites the saved number.
|
|
771
814
|
*/
|
|
772
815
|
declare function dialFollowUp(externalId: string, call: {
|
|
773
816
|
operator: FollowUpOperator;
|
|
774
817
|
phone?: string;
|
|
818
|
+
toPhone?: string;
|
|
775
819
|
name?: string;
|
|
820
|
+
businessName?: string;
|
|
776
821
|
lineId?: string;
|
|
777
822
|
ringPhone?: string;
|
|
778
823
|
}, options?: CallsOptions): Promise<FollowUpWriteResult<{
|
|
@@ -915,4 +960,4 @@ declare function testRingNumber(id: string, options?: CallsOptions): Promise<Rin
|
|
|
915
960
|
verified: boolean;
|
|
916
961
|
}>>;
|
|
917
962
|
|
|
918
|
-
export { type Booking, type BookingAnswer, type BookingClientNotice, type BookingMutationResult, type BookingNotifyRecipient, type BookingQuestion, type BookingQuestionInput, type BookingSettings, type BookingSettingsChanges, type BookingSettingsResult, type BookingSettingsState, type BookingWorkingHours, type Call, type CallAudio, type CallListItem, type CallMoment, type CallParticipant, type CallsOptions, type CaptureServerErrorsOptions, type DeleteCallResult, type FollowUp, type FollowUpCall, type FollowUpDetail, type FollowUpDue, type FollowUpNote, type FollowUpOperator, type FollowUpWriteResult, type GetCallOptions, type Guide, type GuideReadOptions, type GuideSummary, type Lead, type LineCallerResult, type ListBookingsOptions, type ListCallsOptions, type ListLeadsOptions, type OperatorRingNumber, type OperatorRingNumbersResult, ReportResult, ReportSeverity, ReportType, type RingErrorCode, type RingNumber, type RingNumberList, type RingNumberWriteResult, type ServerReportOptions, type ServerReporterConfig, type ServerReporterIdentity, type SignSessionOptions, addFollowUpNote, addLineCaller, addRingNumber, cancelBooking, captureServerErrors, configureServerReporter, deleteCall, dialFollowUp, discardBookingQuestionsDraft, escapeJsonForScript, getBookingSettings, getCall, getFollowUp, getGuide, getOperatorRingNumbers, listBookings, listCalls, listFollowUps, listGuides, listLeads, listRingNumbers, publishBookingQuestions, removeLineCaller, removeRingNumber, reportServerError, rescheduleBooking, resetServerReporter, setFollowUpBooking, signSession, testRingNumber, updateBookingSettings, updateRingNumber };
|
|
963
|
+
export { type Booking, type BookingAnswer, type BookingClientNotice, type BookingMutationResult, type BookingNotifyRecipient, type BookingQuestion, type BookingQuestionInput, type BookingSettings, type BookingSettingsChanges, type BookingSettingsResult, type BookingSettingsState, type BookingWorkingHours, type Call, type CallAudio, type CallListItem, type CallMoment, type CallParticipant, type CallsOptions, type CaptureServerErrorsOptions, type DeleteCallResult, type FollowUp, type FollowUpBooking, type FollowUpCall, type FollowUpDetail, type FollowUpDue, type FollowUpNote, type FollowUpOperator, type FollowUpWriteResult, type GetCallOptions, type Guide, type GuideReadOptions, type GuideSummary, type Lead, type LineCallerResult, type ListBookingsOptions, type ListCallsOptions, type ListLeadsOptions, type OperatorRingNumber, type OperatorRingNumbersResult, ReportResult, ReportSeverity, ReportType, type RingErrorCode, type RingNumber, type RingNumberList, type RingNumberWriteResult, type ServerReportOptions, type ServerReporterConfig, type ServerReporterIdentity, type SignSessionOptions, addFollowUpNote, addLineCaller, addRingNumber, cancelBooking, captureServerErrors, configureServerReporter, deleteCall, dialFollowUp, discardBookingQuestionsDraft, escapeJsonForScript, getBookingSettings, getCall, getFollowUp, getGuide, getOperatorRingNumbers, listBookings, listCalls, listFollowUps, listGuides, listLeads, listRingNumbers, publishBookingQuestions, removeLineCaller, removeRingNumber, reportServerError, rescheduleBooking, resetServerReporter, setFollowUpBooking, signSession, testRingNumber, updateBookingSettings, updateRingNumber };
|
package/dist/server.d.ts
CHANGED
|
@@ -643,11 +643,19 @@ interface FollowUp {
|
|
|
643
643
|
/** Digits, `91` + 10. */
|
|
644
644
|
phone: string | null;
|
|
645
645
|
name: string | null;
|
|
646
|
+
/** The customer's business (Abhyasika: the library name), as you sent it. */
|
|
647
|
+
businessName: string | null;
|
|
646
648
|
/** ISO. The booked next call. */
|
|
647
649
|
nextCallAt: string | null;
|
|
648
650
|
nextCallBookedBy: string | null;
|
|
649
651
|
due: FollowUpDue;
|
|
650
|
-
/**
|
|
652
|
+
/** The next call with why it is happening (#670). Null when nothing is booked. */
|
|
653
|
+
booking: FollowUpBooking | null;
|
|
654
|
+
/**
|
|
655
|
+
* ISO. Read from the last call's transcript. Since #670 a call's suggestion
|
|
656
|
+
* is booked by itself (see `booking.auto`); it stays only a suggestion when
|
|
657
|
+
* a person's own booking already stands.
|
|
658
|
+
*/
|
|
651
659
|
suggestedNextCallAt: string | null;
|
|
652
660
|
suggestedNextCallReason: string | null;
|
|
653
661
|
lastNote: string | null;
|
|
@@ -665,6 +673,19 @@ interface FollowUp {
|
|
|
665
673
|
ringingPhone: string | null;
|
|
666
674
|
} | null;
|
|
667
675
|
}
|
|
676
|
+
interface FollowUpBooking {
|
|
677
|
+
/** ISO. */
|
|
678
|
+
at: string;
|
|
679
|
+
/** "Ravi → Sunita Patil (Shanti Study Room): set up auto-pay again" — show it under "Next call". */
|
|
680
|
+
reason: string | null;
|
|
681
|
+
/** Booked by Glitchgrab from the call summary — label it "Booked from the call summary". */
|
|
682
|
+
auto: boolean;
|
|
683
|
+
/** ISO. The caller tapped "Yes, keep it" on WhatsApp. */
|
|
684
|
+
confirmedAt: string | null;
|
|
685
|
+
/** The "keep this call?" WhatsApp reached whoever made the call. */
|
|
686
|
+
askedOnWhatsApp: boolean;
|
|
687
|
+
bookedBy: string | null;
|
|
688
|
+
}
|
|
668
689
|
interface FollowUpNote {
|
|
669
690
|
id: string;
|
|
670
691
|
body: string;
|
|
@@ -685,6 +706,16 @@ interface FollowUpCall {
|
|
|
685
706
|
ringingIndex: number | null;
|
|
686
707
|
/** That phone. While `status` is "DIALING" it is the one ringing right now. */
|
|
687
708
|
ringingPhone: string | null;
|
|
709
|
+
/** E.164 number the call rang — `toPhone` when the dial sent one, else the follow-up's phone (#666). */
|
|
710
|
+
to: string | null;
|
|
711
|
+
/**
|
|
712
|
+
* Who didn't pick up a NO_ANSWER outbound call (#666): "operator" = none of
|
|
713
|
+
* the operator's phones (backups included), "customer" = the operator
|
|
714
|
+
* answered and the customer didn't. Null otherwise, and on older calls.
|
|
715
|
+
*/
|
|
716
|
+
missedBy: "operator" | "customer" | null;
|
|
717
|
+
/** Who placed it. Null on inbound calls. */
|
|
718
|
+
operatorName: string | null;
|
|
688
719
|
/** Shared with you — calls dialled from a follow-up are; an inbound call is once the owner shares it. */
|
|
689
720
|
shared: boolean;
|
|
690
721
|
overview: string | null;
|
|
@@ -743,36 +774,50 @@ declare function addFollowUpNote(externalId: string, note: {
|
|
|
743
774
|
author?: string;
|
|
744
775
|
phone?: string;
|
|
745
776
|
name?: string;
|
|
777
|
+
businessName?: string;
|
|
746
778
|
}, options?: CallsOptions): Promise<FollowUpWriteResult<{
|
|
747
779
|
id: string;
|
|
748
780
|
}>>;
|
|
749
781
|
/**
|
|
750
782
|
* Book, move (`Date`/ISO) or clear (`null`) the next call. The reminder
|
|
751
|
-
* WhatsApp goes to `operator`, else the project owner.
|
|
783
|
+
* WhatsApp goes to `operator`, else the project owner. `reason` is read back
|
|
784
|
+
* as `booking.reason`; left out, a moved booking keeps its reason. A booking
|
|
785
|
+
* made here is never replaced by the next call's automatic one. Never throws.
|
|
752
786
|
*/
|
|
753
787
|
declare function setFollowUpBooking(externalId: string, booking: {
|
|
754
788
|
nextCallAt: Date | string | null;
|
|
789
|
+
reason?: string | null;
|
|
755
790
|
operator?: FollowUpOperator;
|
|
756
791
|
author?: string;
|
|
757
792
|
phone?: string;
|
|
758
793
|
name?: string;
|
|
794
|
+
businessName?: string;
|
|
759
795
|
}, options?: CallsOptions): Promise<FollowUpWriteResult<{
|
|
760
796
|
nextCallAt: string | null;
|
|
797
|
+
reason: string | null;
|
|
761
798
|
}>>;
|
|
762
799
|
/**
|
|
763
800
|
* Start a recorded call: Glitchgrab rings `operator`'s phone, then the
|
|
764
|
-
* customer, from the project's line. The operator must be on that line.
|
|
765
|
-
*
|
|
801
|
+
* customer, from the project's line. The operator must be on that line. Once
|
|
802
|
+
* the call is transcribed a note is written and the next call is booked from
|
|
803
|
+
* it with a reason (#670) — unless a person's booking already stands — and the
|
|
804
|
+
* operator is asked on WhatsApp to keep or remove it. `businessName` (the
|
|
805
|
+
* customer's business) is named in that reason. Never throws.
|
|
766
806
|
*
|
|
767
807
|
* `ringPhone` picks which of the operator's verified phones rings first (list
|
|
768
808
|
* them with {@link getOperatorRingNumbers}); omitted = their Default. If that
|
|
769
809
|
* phone isn't picked up, their backups ring in order (`ringNumbers`). A
|
|
770
810
|
* refusal carries `code` — see {@link RingErrorCode}.
|
|
811
|
+
*
|
|
812
|
+
* `toPhone` dials another number for this one call and leaves the follow-up's
|
|
813
|
+
* saved `phone` alone (#666); `phone` rewrites the saved number.
|
|
771
814
|
*/
|
|
772
815
|
declare function dialFollowUp(externalId: string, call: {
|
|
773
816
|
operator: FollowUpOperator;
|
|
774
817
|
phone?: string;
|
|
818
|
+
toPhone?: string;
|
|
775
819
|
name?: string;
|
|
820
|
+
businessName?: string;
|
|
776
821
|
lineId?: string;
|
|
777
822
|
ringPhone?: string;
|
|
778
823
|
}, options?: CallsOptions): Promise<FollowUpWriteResult<{
|
|
@@ -915,4 +960,4 @@ declare function testRingNumber(id: string, options?: CallsOptions): Promise<Rin
|
|
|
915
960
|
verified: boolean;
|
|
916
961
|
}>>;
|
|
917
962
|
|
|
918
|
-
export { type Booking, type BookingAnswer, type BookingClientNotice, type BookingMutationResult, type BookingNotifyRecipient, type BookingQuestion, type BookingQuestionInput, type BookingSettings, type BookingSettingsChanges, type BookingSettingsResult, type BookingSettingsState, type BookingWorkingHours, type Call, type CallAudio, type CallListItem, type CallMoment, type CallParticipant, type CallsOptions, type CaptureServerErrorsOptions, type DeleteCallResult, type FollowUp, type FollowUpCall, type FollowUpDetail, type FollowUpDue, type FollowUpNote, type FollowUpOperator, type FollowUpWriteResult, type GetCallOptions, type Guide, type GuideReadOptions, type GuideSummary, type Lead, type LineCallerResult, type ListBookingsOptions, type ListCallsOptions, type ListLeadsOptions, type OperatorRingNumber, type OperatorRingNumbersResult, ReportResult, ReportSeverity, ReportType, type RingErrorCode, type RingNumber, type RingNumberList, type RingNumberWriteResult, type ServerReportOptions, type ServerReporterConfig, type ServerReporterIdentity, type SignSessionOptions, addFollowUpNote, addLineCaller, addRingNumber, cancelBooking, captureServerErrors, configureServerReporter, deleteCall, dialFollowUp, discardBookingQuestionsDraft, escapeJsonForScript, getBookingSettings, getCall, getFollowUp, getGuide, getOperatorRingNumbers, listBookings, listCalls, listFollowUps, listGuides, listLeads, listRingNumbers, publishBookingQuestions, removeLineCaller, removeRingNumber, reportServerError, rescheduleBooking, resetServerReporter, setFollowUpBooking, signSession, testRingNumber, updateBookingSettings, updateRingNumber };
|
|
963
|
+
export { type Booking, type BookingAnswer, type BookingClientNotice, type BookingMutationResult, type BookingNotifyRecipient, type BookingQuestion, type BookingQuestionInput, type BookingSettings, type BookingSettingsChanges, type BookingSettingsResult, type BookingSettingsState, type BookingWorkingHours, type Call, type CallAudio, type CallListItem, type CallMoment, type CallParticipant, type CallsOptions, type CaptureServerErrorsOptions, type DeleteCallResult, type FollowUp, type FollowUpBooking, type FollowUpCall, type FollowUpDetail, type FollowUpDue, type FollowUpNote, type FollowUpOperator, type FollowUpWriteResult, type GetCallOptions, type Guide, type GuideReadOptions, type GuideSummary, type Lead, type LineCallerResult, type ListBookingsOptions, type ListCallsOptions, type ListLeadsOptions, type OperatorRingNumber, type OperatorRingNumbersResult, ReportResult, ReportSeverity, ReportType, type RingErrorCode, type RingNumber, type RingNumberList, type RingNumberWriteResult, type ServerReportOptions, type ServerReporterConfig, type ServerReporterIdentity, type SignSessionOptions, addFollowUpNote, addLineCaller, addRingNumber, cancelBooking, captureServerErrors, configureServerReporter, deleteCall, dialFollowUp, discardBookingQuestionsDraft, escapeJsonForScript, getBookingSettings, getCall, getFollowUp, getGuide, getOperatorRingNumbers, listBookings, listCalls, listFollowUps, listGuides, listLeads, listRingNumbers, publishBookingQuestions, removeLineCaller, removeRingNumber, reportServerError, rescheduleBooking, resetServerReporter, setFollowUpBooking, signSession, testRingNumber, updateBookingSettings, updateRingNumber };
|
package/dist/server.js
CHANGED
|
@@ -744,9 +744,18 @@ function readFollowUp(value) {
|
|
|
744
744
|
externalId: stringOrNull(value.externalId),
|
|
745
745
|
phone: stringOrNull(value.phone),
|
|
746
746
|
name: stringOrNull(value.name),
|
|
747
|
+
businessName: stringOrNull(value.businessName),
|
|
747
748
|
nextCallAt: stringOrNull(value.nextCallAt),
|
|
748
749
|
nextCallBookedBy: stringOrNull(value.nextCallBookedBy),
|
|
749
750
|
due: typeof value.due === "string" && DUES.has(value.due) ? value.due : "none",
|
|
751
|
+
booking: isRecord(value.booking) && typeof value.booking.at === "string" ? {
|
|
752
|
+
at: value.booking.at,
|
|
753
|
+
reason: stringOrNull(value.booking.reason),
|
|
754
|
+
auto: value.booking.auto === true,
|
|
755
|
+
confirmedAt: stringOrNull(value.booking.confirmedAt),
|
|
756
|
+
askedOnWhatsApp: value.booking.askedOnWhatsApp === true,
|
|
757
|
+
bookedBy: stringOrNull(value.booking.bookedBy)
|
|
758
|
+
} : null,
|
|
750
759
|
suggestedNextCallAt: stringOrNull(value.suggestedNextCallAt),
|
|
751
760
|
suggestedNextCallReason: stringOrNull(value.suggestedNextCallReason),
|
|
752
761
|
lastNote: stringOrNull(value.lastNote),
|
|
@@ -792,6 +801,9 @@ function readFollowUpDetail(value) {
|
|
|
792
801
|
durationSec: numberOrNull(c.durationSec),
|
|
793
802
|
ringingIndex: numberOrNull(c.ringingIndex),
|
|
794
803
|
ringingPhone: stringOrNull(c.ringingPhone),
|
|
804
|
+
to: stringOrNull(c.to),
|
|
805
|
+
missedBy: c.missedBy === "operator" || c.missedBy === "customer" ? c.missedBy : null,
|
|
806
|
+
operatorName: stringOrNull(c.operatorName),
|
|
795
807
|
shared: c.shared === true,
|
|
796
808
|
overview: stringOrNull(c.overview),
|
|
797
809
|
recordingUrl: stringOrNull(c.recordingUrl)
|
|
@@ -851,7 +863,8 @@ function addFollowUpNote(externalId, note, options = {}) {
|
|
|
851
863
|
function setFollowUpBooking(externalId, booking, options = {}) {
|
|
852
864
|
const at = booking.nextCallAt instanceof Date ? booking.nextCallAt.toISOString() : booking.nextCallAt;
|
|
853
865
|
return writeFollowUp(followUpPath(externalId, "/booking"), "PUT", { ...booking, nextCallAt: at }, options, (d) => ({
|
|
854
|
-
nextCallAt: stringOrNull(d.nextCallAt)
|
|
866
|
+
nextCallAt: stringOrNull(d.nextCallAt),
|
|
867
|
+
reason: stringOrNull(d.reason)
|
|
855
868
|
}));
|
|
856
869
|
}
|
|
857
870
|
function dialFollowUp(externalId, call, options = {}) {
|