glitchgrab 1.62.4 → 1.63.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.
- package/README.md +5 -1
- package/dist/index.js +18 -154
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -154
- package/dist/index.mjs.map +1 -1
- package/dist/server.d.mts +20 -2
- package/dist/server.d.ts +20 -2
- package/dist/server.js +15 -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/dist/server.d.mts
CHANGED
|
@@ -694,6 +694,8 @@ interface FollowUpNote {
|
|
|
694
694
|
author: string | null;
|
|
695
695
|
callId: string | null;
|
|
696
696
|
editedAt: string | null;
|
|
697
|
+
/** Who last edited it, when your app (or an import) said so. */
|
|
698
|
+
editedBy: string | null;
|
|
697
699
|
createdAt: string;
|
|
698
700
|
}
|
|
699
701
|
interface FollowUpCall {
|
|
@@ -767,7 +769,9 @@ declare function listFollowUps(externalIds: string[], options?: CallsOptions): P
|
|
|
767
769
|
declare function getFollowUp(externalId: string, options?: CallsOptions): Promise<FollowUpDetail | null>;
|
|
768
770
|
/**
|
|
769
771
|
* Add a note from your own screen. `phone` is needed the first time Glitchgrab
|
|
770
|
-
* sees this externalId.
|
|
772
|
+
* sees this externalId. `createdAt` / `editedAt` / `editedBy` copy a note from
|
|
773
|
+
* your old store with its real dates (past only; no webhook fires for it).
|
|
774
|
+
* Never throws.
|
|
771
775
|
*/
|
|
772
776
|
declare function addFollowUpNote(externalId: string, note: {
|
|
773
777
|
body: string;
|
|
@@ -775,6 +779,20 @@ declare function addFollowUpNote(externalId: string, note: {
|
|
|
775
779
|
phone?: string;
|
|
776
780
|
name?: string;
|
|
777
781
|
businessName?: string;
|
|
782
|
+
createdAt?: Date | string;
|
|
783
|
+
editedAt?: Date | string | null;
|
|
784
|
+
editedBy?: string | null;
|
|
785
|
+
}, options?: CallsOptions): Promise<FollowUpWriteResult<{
|
|
786
|
+
id: string;
|
|
787
|
+
}>>;
|
|
788
|
+
/**
|
|
789
|
+
* Edit a note from your own screen: your app's notes and the note written from
|
|
790
|
+
* a call. A note someone wrote inside Glitchgrab can't be edited here (404).
|
|
791
|
+
* `editor` is shown as who edited it. Never throws.
|
|
792
|
+
*/
|
|
793
|
+
declare function editFollowUpNote(externalId: string, noteId: string, edit: {
|
|
794
|
+
body: string;
|
|
795
|
+
editor?: string;
|
|
778
796
|
}, options?: CallsOptions): Promise<FollowUpWriteResult<{
|
|
779
797
|
id: string;
|
|
780
798
|
}>>;
|
|
@@ -960,4 +978,4 @@ declare function testRingNumber(id: string, options?: CallsOptions): Promise<Rin
|
|
|
960
978
|
verified: boolean;
|
|
961
979
|
}>>;
|
|
962
980
|
|
|
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 };
|
|
981
|
+
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, editFollowUpNote, 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
|
@@ -694,6 +694,8 @@ interface FollowUpNote {
|
|
|
694
694
|
author: string | null;
|
|
695
695
|
callId: string | null;
|
|
696
696
|
editedAt: string | null;
|
|
697
|
+
/** Who last edited it, when your app (or an import) said so. */
|
|
698
|
+
editedBy: string | null;
|
|
697
699
|
createdAt: string;
|
|
698
700
|
}
|
|
699
701
|
interface FollowUpCall {
|
|
@@ -767,7 +769,9 @@ declare function listFollowUps(externalIds: string[], options?: CallsOptions): P
|
|
|
767
769
|
declare function getFollowUp(externalId: string, options?: CallsOptions): Promise<FollowUpDetail | null>;
|
|
768
770
|
/**
|
|
769
771
|
* Add a note from your own screen. `phone` is needed the first time Glitchgrab
|
|
770
|
-
* sees this externalId.
|
|
772
|
+
* sees this externalId. `createdAt` / `editedAt` / `editedBy` copy a note from
|
|
773
|
+
* your old store with its real dates (past only; no webhook fires for it).
|
|
774
|
+
* Never throws.
|
|
771
775
|
*/
|
|
772
776
|
declare function addFollowUpNote(externalId: string, note: {
|
|
773
777
|
body: string;
|
|
@@ -775,6 +779,20 @@ declare function addFollowUpNote(externalId: string, note: {
|
|
|
775
779
|
phone?: string;
|
|
776
780
|
name?: string;
|
|
777
781
|
businessName?: string;
|
|
782
|
+
createdAt?: Date | string;
|
|
783
|
+
editedAt?: Date | string | null;
|
|
784
|
+
editedBy?: string | null;
|
|
785
|
+
}, options?: CallsOptions): Promise<FollowUpWriteResult<{
|
|
786
|
+
id: string;
|
|
787
|
+
}>>;
|
|
788
|
+
/**
|
|
789
|
+
* Edit a note from your own screen: your app's notes and the note written from
|
|
790
|
+
* a call. A note someone wrote inside Glitchgrab can't be edited here (404).
|
|
791
|
+
* `editor` is shown as who edited it. Never throws.
|
|
792
|
+
*/
|
|
793
|
+
declare function editFollowUpNote(externalId: string, noteId: string, edit: {
|
|
794
|
+
body: string;
|
|
795
|
+
editor?: string;
|
|
778
796
|
}, options?: CallsOptions): Promise<FollowUpWriteResult<{
|
|
779
797
|
id: string;
|
|
780
798
|
}>>;
|
|
@@ -960,4 +978,4 @@ declare function testRingNumber(id: string, options?: CallsOptions): Promise<Rin
|
|
|
960
978
|
verified: boolean;
|
|
961
979
|
}>>;
|
|
962
980
|
|
|
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 };
|
|
981
|
+
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, editFollowUpNote, 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
|
@@ -29,6 +29,7 @@ __export(server_exports, {
|
|
|
29
29
|
deleteCall: () => deleteCall,
|
|
30
30
|
dialFollowUp: () => dialFollowUp,
|
|
31
31
|
discardBookingQuestionsDraft: () => discardBookingQuestionsDraft,
|
|
32
|
+
editFollowUpNote: () => editFollowUpNote,
|
|
32
33
|
escapeJsonForScript: () => escapeJsonForScript,
|
|
33
34
|
getBookingSettings: () => getBookingSettings,
|
|
34
35
|
getCall: () => getCall,
|
|
@@ -788,6 +789,7 @@ function readFollowUpDetail(value) {
|
|
|
788
789
|
author: stringOrNull(n.author),
|
|
789
790
|
callId: stringOrNull(n.callId),
|
|
790
791
|
editedAt: stringOrNull(n.editedAt),
|
|
792
|
+
editedBy: stringOrNull(n.editedBy),
|
|
791
793
|
createdAt: (_b = stringOrNull(n.createdAt)) != null ? _b : ""
|
|
792
794
|
};
|
|
793
795
|
}) : [],
|
|
@@ -856,10 +858,21 @@ async function getFollowUp(externalId, options = {}) {
|
|
|
856
858
|
}
|
|
857
859
|
}
|
|
858
860
|
function addFollowUpNote(externalId, note, options = {}) {
|
|
859
|
-
|
|
861
|
+
const iso = (v) => v instanceof Date ? v.toISOString() : v;
|
|
862
|
+
const body = { ...note, createdAt: iso(note.createdAt), editedAt: iso(note.editedAt) };
|
|
863
|
+
return writeFollowUp(followUpPath(externalId, "/notes"), "POST", body, options, (d) => ({
|
|
860
864
|
id: typeof d.id === "string" ? d.id : ""
|
|
861
865
|
}));
|
|
862
866
|
}
|
|
867
|
+
function editFollowUpNote(externalId, noteId, edit, options = {}) {
|
|
868
|
+
return writeFollowUp(
|
|
869
|
+
followUpPath(externalId, `/notes/${encodeURIComponent(noteId)}`),
|
|
870
|
+
"PATCH",
|
|
871
|
+
edit,
|
|
872
|
+
options,
|
|
873
|
+
(d) => ({ id: typeof d.id === "string" ? d.id : "" })
|
|
874
|
+
);
|
|
875
|
+
}
|
|
863
876
|
function setFollowUpBooking(externalId, booking, options = {}) {
|
|
864
877
|
const at = booking.nextCallAt instanceof Date ? booking.nextCallAt.toISOString() : booking.nextCallAt;
|
|
865
878
|
return writeFollowUp(followUpPath(externalId, "/booking"), "PUT", { ...booking, nextCallAt: at }, options, (d) => ({
|
|
@@ -1002,6 +1015,7 @@ function testRingNumber(id, options = {}) {
|
|
|
1002
1015
|
deleteCall,
|
|
1003
1016
|
dialFollowUp,
|
|
1004
1017
|
discardBookingQuestionsDraft,
|
|
1018
|
+
editFollowUpNote,
|
|
1005
1019
|
escapeJsonForScript,
|
|
1006
1020
|
getBookingSettings,
|
|
1007
1021
|
getCall,
|