glitchgrab 1.66.2 → 1.68.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 +1 -1
- package/dist/index.js +2 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -5
- package/dist/index.mjs.map +1 -1
- package/dist/server.d.mts +33 -9
- package/dist/server.d.ts +33 -9
- package/dist/server.js +22 -3
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +21 -3
- package/dist/server.mjs.map +1 -1
- package/package.json +1 -1
package/dist/server.d.mts
CHANGED
|
@@ -711,12 +711,17 @@ interface FollowUp {
|
|
|
711
711
|
lastNoteAt: string | null;
|
|
712
712
|
lastNoteBy: string | null;
|
|
713
713
|
noteCount: number;
|
|
714
|
+
/** Every call to this customer, missed and inbound too. Only `listFollowUps` fills it; null elsewhere or on an older Glitchgrab. */
|
|
715
|
+
callCount: number | null;
|
|
716
|
+
/** The calls somebody answered, and their talk time in seconds (same scope as `callCount`). */
|
|
717
|
+
talkedCount: number | null;
|
|
718
|
+
talkSec: number | null;
|
|
714
719
|
lastCall: {
|
|
715
720
|
id: string;
|
|
716
721
|
status: string | null;
|
|
717
722
|
at: string;
|
|
718
723
|
durationSec: number | null;
|
|
719
|
-
/** Which of the operator's phones the call is on: 0 = the one picked, 1+
|
|
724
|
+
/** Which of the operator's phones the call is on: 0 = the one picked. Outbound never rings a backup, so 1+ only on calls before abhyasika#1141. */
|
|
720
725
|
ringingIndex: number | null;
|
|
721
726
|
/** That phone. While `status` is "DIALING" it is the one ringing right now. */
|
|
722
727
|
ringingPhone: string | null;
|
|
@@ -757,15 +762,15 @@ interface FollowUpCall {
|
|
|
757
762
|
direction: string | null;
|
|
758
763
|
at: string;
|
|
759
764
|
durationSec: number | null;
|
|
760
|
-
/** Which of the operator's phones the call is on: 0 = the one picked, 1+
|
|
765
|
+
/** Which of the operator's phones the call is on: 0 = the one picked. Outbound never rings a backup, so 1+ only on calls before abhyasika#1141. */
|
|
761
766
|
ringingIndex: number | null;
|
|
762
767
|
/** That phone. While `status` is "DIALING" it is the one ringing right now. */
|
|
763
768
|
ringingPhone: string | null;
|
|
764
769
|
/** E.164 number the call rang — `toPhone` when the dial sent one, else the follow-up's phone (#666). */
|
|
765
770
|
to: string | null;
|
|
766
771
|
/**
|
|
767
|
-
* Who didn't pick up a NO_ANSWER outbound call (#666): "operator" =
|
|
768
|
-
*
|
|
772
|
+
* Who didn't pick up a NO_ANSWER outbound call (#666): "operator" = the
|
|
773
|
+
* operator's phone that rang (never a backup), "customer" = the operator
|
|
769
774
|
* answered and the customer didn't. Null otherwise, and on older calls.
|
|
770
775
|
*/
|
|
771
776
|
missedBy: "operator" | "customer" | null;
|
|
@@ -776,6 +781,12 @@ interface FollowUpCall {
|
|
|
776
781
|
overview: string | null;
|
|
777
782
|
/** Presigned; expires after `linksExpireInSeconds`. Null when not shared. */
|
|
778
783
|
recordingUrl: string | null;
|
|
784
|
+
/**
|
|
785
|
+
* When the "From the call" note was written, and with it the next call
|
|
786
|
+
* booked or suggested. Null until then: it lands a few minutes after
|
|
787
|
+
* `overview`, so refresh the booking on this, not on the summary.
|
|
788
|
+
*/
|
|
789
|
+
fromCallNoteAt: string | null;
|
|
779
790
|
}
|
|
780
791
|
interface FollowUpDetail extends FollowUp {
|
|
781
792
|
notes: FollowUpNote[];
|
|
@@ -875,9 +886,9 @@ declare function setFollowUpBooking(externalId: string, booking: {
|
|
|
875
886
|
* operator is asked on WhatsApp to keep or remove it. `businessName` (the
|
|
876
887
|
* customer's business) is named in that reason. Never throws.
|
|
877
888
|
*
|
|
878
|
-
* `ringPhone` picks which of the operator's verified phones rings
|
|
879
|
-
*
|
|
880
|
-
* phone
|
|
889
|
+
* `ringPhone` picks which of the operator's verified phones rings (list them
|
|
890
|
+
* with {@link getOperatorRingNumbers}); omitted = their Default. Only that
|
|
891
|
+
* phone rings: not picked up → NO_ANSWER, never a backup (abhyasika#1141). A
|
|
881
892
|
* refusal carries `code` — see {@link RingErrorCode}.
|
|
882
893
|
*
|
|
883
894
|
* `toPhone` dials another number for this one call and leaves the follow-up's
|
|
@@ -902,7 +913,7 @@ interface OperatorRingNumber {
|
|
|
902
913
|
phone: string;
|
|
903
914
|
label: string | null;
|
|
904
915
|
isDefault: boolean;
|
|
905
|
-
/** 0 = Default, then backups
|
|
916
|
+
/** 0 = Default, then backups. A call you place rings only the one picked; incoming calls ring backups after Defaults. */
|
|
906
917
|
order: number;
|
|
907
918
|
}
|
|
908
919
|
type OperatorRingNumbersResult = {
|
|
@@ -1176,6 +1187,19 @@ declare function enableCalling(params: {
|
|
|
1176
1187
|
declare function disableCalling(params: {
|
|
1177
1188
|
ownerId: string;
|
|
1178
1189
|
}, options?: CallsOptions): Promise<LineRequestResult>;
|
|
1190
|
+
/**
|
|
1191
|
+
* The firm wants a different number (practice-stack #3221). Glitchgrab rents a
|
|
1192
|
+
* new one under the same KYC, points the firm's SAME line at it (callers, call
|
|
1193
|
+
* log and consent stay), then releases the old number; the rent is unchanged.
|
|
1194
|
+
* `phone.line_ready` fires with the new number. `areaCode` = STD code to search
|
|
1195
|
+
* under, else the firm's last choice. Refusals carry `code`: `NO_REQUEST`,
|
|
1196
|
+
* `NO_LINE` (no live number yet), `BUSY` (a change is running), `PROVIDER`.
|
|
1197
|
+
* Renting can take ~30 s: pass a longer `timeoutMs`. Never throws.
|
|
1198
|
+
*/
|
|
1199
|
+
declare function changeLineNumber(params: {
|
|
1200
|
+
ownerId: string;
|
|
1201
|
+
areaCode?: string;
|
|
1202
|
+
}, options?: CallsOptions): Promise<LineRequestResult>;
|
|
1179
1203
|
interface RegisteredWebhook {
|
|
1180
1204
|
id: string;
|
|
1181
1205
|
url: string;
|
|
@@ -1290,4 +1314,4 @@ declare function testRingNumber(id: string, options?: LineCallsOptions): Promise
|
|
|
1290
1314
|
verified: boolean;
|
|
1291
1315
|
}>>;
|
|
1292
1316
|
|
|
1293
|
-
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 CallIssueSessionOptions, type CallIssueSessionResult, type CallListItem, type CallMoment, type CallParticipant, type CallWebhook, 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 LineCallsOptions, type LineRequestResult, type ListBookingsOptions, type ListCallsOptions, type ListLeadsOptions, type OperatorRingNumber, type OperatorRingNumbersResult, type PhoneLineInfo, type PhoneLineRequest, type PhoneLineStatus, type PhoneLineWebhook, type PlaceCallResult, type RegisteredWebhook, 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, createCallIssueSession, deleteCall, dialFollowUp, disableCalling, discardBookingQuestionsDraft, editFollowUpNote, enableCalling, escapeJsonForScript, getBookingSettings, getCall, getFollowUp, getGuide, getOperatorRingNumbers, getPhoneLine, listBookings, listCalls, listFollowUps, listGuides, listLeads, listRingNumbers, listWebhooks, placeCall, publishBookingQuestions, registerWebhook, removeLineCaller, removeRingNumber, removeWebhook, reportServerError, rescheduleBooking, resetServerReporter, setFollowUpBooking, signSession, submitPhoneKyc, testRingNumber, updateBookingSettings, updateRingNumber };
|
|
1317
|
+
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 CallIssueSessionOptions, type CallIssueSessionResult, type CallListItem, type CallMoment, type CallParticipant, type CallWebhook, 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 LineCallsOptions, type LineRequestResult, type ListBookingsOptions, type ListCallsOptions, type ListLeadsOptions, type OperatorRingNumber, type OperatorRingNumbersResult, type PhoneLineInfo, type PhoneLineRequest, type PhoneLineStatus, type PhoneLineWebhook, type PlaceCallResult, type RegisteredWebhook, ReportResult, ReportSeverity, ReportType, type RingErrorCode, type RingNumber, type RingNumberList, type RingNumberWriteResult, type ServerReportOptions, type ServerReporterConfig, type ServerReporterIdentity, type SignSessionOptions, addFollowUpNote, addLineCaller, addRingNumber, cancelBooking, captureServerErrors, changeLineNumber, configureServerReporter, createCallIssueSession, deleteCall, dialFollowUp, disableCalling, discardBookingQuestionsDraft, editFollowUpNote, enableCalling, escapeJsonForScript, getBookingSettings, getCall, getFollowUp, getGuide, getOperatorRingNumbers, getPhoneLine, listBookings, listCalls, listFollowUps, listGuides, listLeads, listRingNumbers, listWebhooks, placeCall, publishBookingQuestions, registerWebhook, removeLineCaller, removeRingNumber, removeWebhook, reportServerError, rescheduleBooking, resetServerReporter, setFollowUpBooking, signSession, submitPhoneKyc, testRingNumber, updateBookingSettings, updateRingNumber };
|
package/dist/server.d.ts
CHANGED
|
@@ -711,12 +711,17 @@ interface FollowUp {
|
|
|
711
711
|
lastNoteAt: string | null;
|
|
712
712
|
lastNoteBy: string | null;
|
|
713
713
|
noteCount: number;
|
|
714
|
+
/** Every call to this customer, missed and inbound too. Only `listFollowUps` fills it; null elsewhere or on an older Glitchgrab. */
|
|
715
|
+
callCount: number | null;
|
|
716
|
+
/** The calls somebody answered, and their talk time in seconds (same scope as `callCount`). */
|
|
717
|
+
talkedCount: number | null;
|
|
718
|
+
talkSec: number | null;
|
|
714
719
|
lastCall: {
|
|
715
720
|
id: string;
|
|
716
721
|
status: string | null;
|
|
717
722
|
at: string;
|
|
718
723
|
durationSec: number | null;
|
|
719
|
-
/** Which of the operator's phones the call is on: 0 = the one picked, 1+
|
|
724
|
+
/** Which of the operator's phones the call is on: 0 = the one picked. Outbound never rings a backup, so 1+ only on calls before abhyasika#1141. */
|
|
720
725
|
ringingIndex: number | null;
|
|
721
726
|
/** That phone. While `status` is "DIALING" it is the one ringing right now. */
|
|
722
727
|
ringingPhone: string | null;
|
|
@@ -757,15 +762,15 @@ interface FollowUpCall {
|
|
|
757
762
|
direction: string | null;
|
|
758
763
|
at: string;
|
|
759
764
|
durationSec: number | null;
|
|
760
|
-
/** Which of the operator's phones the call is on: 0 = the one picked, 1+
|
|
765
|
+
/** Which of the operator's phones the call is on: 0 = the one picked. Outbound never rings a backup, so 1+ only on calls before abhyasika#1141. */
|
|
761
766
|
ringingIndex: number | null;
|
|
762
767
|
/** That phone. While `status` is "DIALING" it is the one ringing right now. */
|
|
763
768
|
ringingPhone: string | null;
|
|
764
769
|
/** E.164 number the call rang — `toPhone` when the dial sent one, else the follow-up's phone (#666). */
|
|
765
770
|
to: string | null;
|
|
766
771
|
/**
|
|
767
|
-
* Who didn't pick up a NO_ANSWER outbound call (#666): "operator" =
|
|
768
|
-
*
|
|
772
|
+
* Who didn't pick up a NO_ANSWER outbound call (#666): "operator" = the
|
|
773
|
+
* operator's phone that rang (never a backup), "customer" = the operator
|
|
769
774
|
* answered and the customer didn't. Null otherwise, and on older calls.
|
|
770
775
|
*/
|
|
771
776
|
missedBy: "operator" | "customer" | null;
|
|
@@ -776,6 +781,12 @@ interface FollowUpCall {
|
|
|
776
781
|
overview: string | null;
|
|
777
782
|
/** Presigned; expires after `linksExpireInSeconds`. Null when not shared. */
|
|
778
783
|
recordingUrl: string | null;
|
|
784
|
+
/**
|
|
785
|
+
* When the "From the call" note was written, and with it the next call
|
|
786
|
+
* booked or suggested. Null until then: it lands a few minutes after
|
|
787
|
+
* `overview`, so refresh the booking on this, not on the summary.
|
|
788
|
+
*/
|
|
789
|
+
fromCallNoteAt: string | null;
|
|
779
790
|
}
|
|
780
791
|
interface FollowUpDetail extends FollowUp {
|
|
781
792
|
notes: FollowUpNote[];
|
|
@@ -875,9 +886,9 @@ declare function setFollowUpBooking(externalId: string, booking: {
|
|
|
875
886
|
* operator is asked on WhatsApp to keep or remove it. `businessName` (the
|
|
876
887
|
* customer's business) is named in that reason. Never throws.
|
|
877
888
|
*
|
|
878
|
-
* `ringPhone` picks which of the operator's verified phones rings
|
|
879
|
-
*
|
|
880
|
-
* phone
|
|
889
|
+
* `ringPhone` picks which of the operator's verified phones rings (list them
|
|
890
|
+
* with {@link getOperatorRingNumbers}); omitted = their Default. Only that
|
|
891
|
+
* phone rings: not picked up → NO_ANSWER, never a backup (abhyasika#1141). A
|
|
881
892
|
* refusal carries `code` — see {@link RingErrorCode}.
|
|
882
893
|
*
|
|
883
894
|
* `toPhone` dials another number for this one call and leaves the follow-up's
|
|
@@ -902,7 +913,7 @@ interface OperatorRingNumber {
|
|
|
902
913
|
phone: string;
|
|
903
914
|
label: string | null;
|
|
904
915
|
isDefault: boolean;
|
|
905
|
-
/** 0 = Default, then backups
|
|
916
|
+
/** 0 = Default, then backups. A call you place rings only the one picked; incoming calls ring backups after Defaults. */
|
|
906
917
|
order: number;
|
|
907
918
|
}
|
|
908
919
|
type OperatorRingNumbersResult = {
|
|
@@ -1176,6 +1187,19 @@ declare function enableCalling(params: {
|
|
|
1176
1187
|
declare function disableCalling(params: {
|
|
1177
1188
|
ownerId: string;
|
|
1178
1189
|
}, options?: CallsOptions): Promise<LineRequestResult>;
|
|
1190
|
+
/**
|
|
1191
|
+
* The firm wants a different number (practice-stack #3221). Glitchgrab rents a
|
|
1192
|
+
* new one under the same KYC, points the firm's SAME line at it (callers, call
|
|
1193
|
+
* log and consent stay), then releases the old number; the rent is unchanged.
|
|
1194
|
+
* `phone.line_ready` fires with the new number. `areaCode` = STD code to search
|
|
1195
|
+
* under, else the firm's last choice. Refusals carry `code`: `NO_REQUEST`,
|
|
1196
|
+
* `NO_LINE` (no live number yet), `BUSY` (a change is running), `PROVIDER`.
|
|
1197
|
+
* Renting can take ~30 s: pass a longer `timeoutMs`. Never throws.
|
|
1198
|
+
*/
|
|
1199
|
+
declare function changeLineNumber(params: {
|
|
1200
|
+
ownerId: string;
|
|
1201
|
+
areaCode?: string;
|
|
1202
|
+
}, options?: CallsOptions): Promise<LineRequestResult>;
|
|
1179
1203
|
interface RegisteredWebhook {
|
|
1180
1204
|
id: string;
|
|
1181
1205
|
url: string;
|
|
@@ -1290,4 +1314,4 @@ declare function testRingNumber(id: string, options?: LineCallsOptions): Promise
|
|
|
1290
1314
|
verified: boolean;
|
|
1291
1315
|
}>>;
|
|
1292
1316
|
|
|
1293
|
-
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 CallIssueSessionOptions, type CallIssueSessionResult, type CallListItem, type CallMoment, type CallParticipant, type CallWebhook, 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 LineCallsOptions, type LineRequestResult, type ListBookingsOptions, type ListCallsOptions, type ListLeadsOptions, type OperatorRingNumber, type OperatorRingNumbersResult, type PhoneLineInfo, type PhoneLineRequest, type PhoneLineStatus, type PhoneLineWebhook, type PlaceCallResult, type RegisteredWebhook, 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, createCallIssueSession, deleteCall, dialFollowUp, disableCalling, discardBookingQuestionsDraft, editFollowUpNote, enableCalling, escapeJsonForScript, getBookingSettings, getCall, getFollowUp, getGuide, getOperatorRingNumbers, getPhoneLine, listBookings, listCalls, listFollowUps, listGuides, listLeads, listRingNumbers, listWebhooks, placeCall, publishBookingQuestions, registerWebhook, removeLineCaller, removeRingNumber, removeWebhook, reportServerError, rescheduleBooking, resetServerReporter, setFollowUpBooking, signSession, submitPhoneKyc, testRingNumber, updateBookingSettings, updateRingNumber };
|
|
1317
|
+
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 CallIssueSessionOptions, type CallIssueSessionResult, type CallListItem, type CallMoment, type CallParticipant, type CallWebhook, 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 LineCallsOptions, type LineRequestResult, type ListBookingsOptions, type ListCallsOptions, type ListLeadsOptions, type OperatorRingNumber, type OperatorRingNumbersResult, type PhoneLineInfo, type PhoneLineRequest, type PhoneLineStatus, type PhoneLineWebhook, type PlaceCallResult, type RegisteredWebhook, ReportResult, ReportSeverity, ReportType, type RingErrorCode, type RingNumber, type RingNumberList, type RingNumberWriteResult, type ServerReportOptions, type ServerReporterConfig, type ServerReporterIdentity, type SignSessionOptions, addFollowUpNote, addLineCaller, addRingNumber, cancelBooking, captureServerErrors, changeLineNumber, configureServerReporter, createCallIssueSession, deleteCall, dialFollowUp, disableCalling, discardBookingQuestionsDraft, editFollowUpNote, enableCalling, escapeJsonForScript, getBookingSettings, getCall, getFollowUp, getGuide, getOperatorRingNumbers, getPhoneLine, listBookings, listCalls, listFollowUps, listGuides, listLeads, listRingNumbers, listWebhooks, placeCall, publishBookingQuestions, registerWebhook, removeLineCaller, removeRingNumber, removeWebhook, reportServerError, rescheduleBooking, resetServerReporter, setFollowUpBooking, signSession, submitPhoneKyc, testRingNumber, updateBookingSettings, updateRingNumber };
|
package/dist/server.js
CHANGED
|
@@ -25,6 +25,7 @@ __export(server_exports, {
|
|
|
25
25
|
addRingNumber: () => addRingNumber,
|
|
26
26
|
cancelBooking: () => cancelBooking,
|
|
27
27
|
captureServerErrors: () => captureServerErrors,
|
|
28
|
+
changeLineNumber: () => changeLineNumber,
|
|
28
29
|
configureServerReporter: () => configureServerReporter,
|
|
29
30
|
createCallIssueSession: () => createCallIssueSession,
|
|
30
31
|
deleteCall: () => deleteCall,
|
|
@@ -315,6 +316,7 @@ function signSession(options) {
|
|
|
315
316
|
}
|
|
316
317
|
var GUIDES_REVALIDATE_SECONDS = 300;
|
|
317
318
|
var SDK_API_TIMEOUT_MS = 5e3;
|
|
319
|
+
var SDK_LINE_REQUEST_TIMEOUT_MS = 4e4;
|
|
318
320
|
async function callSdkApi(path, token, options, init) {
|
|
319
321
|
var _a, _b, _c, _d, _e, _f;
|
|
320
322
|
const baseUrl = ((_c = (_b = (_a = options.baseUrl) != null ? _a : defaults.baseUrl) != null ? _b : readEnv("GLITCHGRAB_BASE_URL")) != null ? _c : DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
@@ -342,7 +344,10 @@ async function callSdkApi(path, token, options, init) {
|
|
|
342
344
|
};
|
|
343
345
|
}
|
|
344
346
|
return { data: (_f = body.data) != null ? _f : null, error: null };
|
|
345
|
-
} catch (
|
|
347
|
+
} catch (err) {
|
|
348
|
+
if ((controller == null ? void 0 : controller.signal.aborted) || err instanceof Error && err.name === "AbortError") {
|
|
349
|
+
return { data: null, error: "Glitchgrab took too long", code: "TIMEOUT" };
|
|
350
|
+
}
|
|
346
351
|
return { data: null, error: "Could not reach Glitchgrab" };
|
|
347
352
|
} finally {
|
|
348
353
|
if (timer) clearTimeout(timer);
|
|
@@ -799,6 +804,9 @@ function readFollowUp(value) {
|
|
|
799
804
|
lastNoteAt: stringOrNull(value.lastNoteAt),
|
|
800
805
|
lastNoteBy: stringOrNull(value.lastNoteBy),
|
|
801
806
|
noteCount: (_a = numberOrNull(value.noteCount)) != null ? _a : 0,
|
|
807
|
+
callCount: numberOrNull(value.callCount),
|
|
808
|
+
talkedCount: numberOrNull(value.talkedCount),
|
|
809
|
+
talkSec: numberOrNull(value.talkSec),
|
|
802
810
|
lastCall: call ? {
|
|
803
811
|
id: call.id,
|
|
804
812
|
status: stringOrNull(call.status),
|
|
@@ -846,7 +854,8 @@ function readFollowUpDetail(value) {
|
|
|
846
854
|
operatorName: stringOrNull(c.operatorName),
|
|
847
855
|
shared: c.shared === true,
|
|
848
856
|
overview: stringOrNull(c.overview),
|
|
849
|
-
recordingUrl: stringOrNull(c.recordingUrl)
|
|
857
|
+
recordingUrl: stringOrNull(c.recordingUrl),
|
|
858
|
+
fromCallNoteAt: stringOrNull(c.fromCallNoteAt)
|
|
850
859
|
};
|
|
851
860
|
}) : []
|
|
852
861
|
};
|
|
@@ -1033,10 +1042,16 @@ async function getPhoneLine(params = {}, options = {}) {
|
|
|
1033
1042
|
}
|
|
1034
1043
|
}
|
|
1035
1044
|
async function lineRequestCall(path, body, options) {
|
|
1045
|
+
var _a;
|
|
1036
1046
|
try {
|
|
1037
1047
|
const key = callsKey(options);
|
|
1038
1048
|
if (!key) return { ok: false, error: NO_KEY_ERROR };
|
|
1039
|
-
const { data, error, code } = await callSdkApi(
|
|
1049
|
+
const { data, error, code } = await callSdkApi(
|
|
1050
|
+
path,
|
|
1051
|
+
key,
|
|
1052
|
+
{ ...options, timeoutMs: (_a = options.timeoutMs) != null ? _a : SDK_LINE_REQUEST_TIMEOUT_MS },
|
|
1053
|
+
{ method: "POST", body, cache: "no-store" }
|
|
1054
|
+
);
|
|
1040
1055
|
const request = isRecord(data) ? lineRequestOf(data.request) : null;
|
|
1041
1056
|
if (error !== null || !request) return { ok: false, error: error != null ? error : "Unexpected response", ...code ? { code } : {} };
|
|
1042
1057
|
return { ok: true, request };
|
|
@@ -1059,6 +1074,9 @@ function enableCalling(params, options = {}) {
|
|
|
1059
1074
|
function disableCalling(params, options = {}) {
|
|
1060
1075
|
return lineRequestCall("/api/v1/sdk/phone-lines/disable", params, options);
|
|
1061
1076
|
}
|
|
1077
|
+
function changeLineNumber(params, options = {}) {
|
|
1078
|
+
return lineRequestCall("/api/v1/sdk/phone-lines/change", params, options);
|
|
1079
|
+
}
|
|
1062
1080
|
async function registerWebhook(webhook, options = {}) {
|
|
1063
1081
|
try {
|
|
1064
1082
|
const key = callsKey(options);
|
|
@@ -1196,6 +1214,7 @@ function testRingNumber(id, options = {}) {
|
|
|
1196
1214
|
addRingNumber,
|
|
1197
1215
|
cancelBooking,
|
|
1198
1216
|
captureServerErrors,
|
|
1217
|
+
changeLineNumber,
|
|
1199
1218
|
configureServerReporter,
|
|
1200
1219
|
createCallIssueSession,
|
|
1201
1220
|
deleteCall,
|