@awell-health/awell-extensions 2.0.326 → 2.0.327
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/dist/extensions/bland/webhooks/CallCompleted/callCompleted.d.ts +16 -0
- package/dist/extensions/bland/webhooks/CallCompleted/callCompleted.js +44 -1
- package/dist/extensions/bland/webhooks/CallCompleted/callCompleted.js.map +1 -1
- package/dist/extensions/bland/webhooks/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -6,6 +6,22 @@ declare const dataPoints: {
|
|
|
6
6
|
key: string;
|
|
7
7
|
valueType: "string";
|
|
8
8
|
};
|
|
9
|
+
completed: {
|
|
10
|
+
key: string;
|
|
11
|
+
valueType: "boolean";
|
|
12
|
+
};
|
|
13
|
+
status: {
|
|
14
|
+
key: string;
|
|
15
|
+
valueType: "string";
|
|
16
|
+
};
|
|
17
|
+
answeredBy: {
|
|
18
|
+
key: string;
|
|
19
|
+
valueType: "string";
|
|
20
|
+
};
|
|
21
|
+
errorMessage: {
|
|
22
|
+
key: string;
|
|
23
|
+
valueType: "string";
|
|
24
|
+
};
|
|
9
25
|
callObject: {
|
|
10
26
|
key: string;
|
|
11
27
|
valueType: "json";
|
|
@@ -7,6 +7,22 @@ const dataPoints = {
|
|
|
7
7
|
key: 'callId',
|
|
8
8
|
valueType: 'string',
|
|
9
9
|
},
|
|
10
|
+
completed: {
|
|
11
|
+
key: 'completed',
|
|
12
|
+
valueType: 'boolean',
|
|
13
|
+
},
|
|
14
|
+
status: {
|
|
15
|
+
key: 'status',
|
|
16
|
+
valueType: 'string',
|
|
17
|
+
},
|
|
18
|
+
answeredBy: {
|
|
19
|
+
key: 'answeredBy',
|
|
20
|
+
valueType: 'string',
|
|
21
|
+
},
|
|
22
|
+
errorMessage: {
|
|
23
|
+
key: 'errorMessage',
|
|
24
|
+
valueType: 'string',
|
|
25
|
+
},
|
|
10
26
|
callObject: {
|
|
11
27
|
key: 'callObject',
|
|
12
28
|
valueType: 'json',
|
|
@@ -16,7 +32,7 @@ exports.callCompleted = {
|
|
|
16
32
|
key: 'callCompleted',
|
|
17
33
|
dataPoints,
|
|
18
34
|
onEvent: async ({ payload: { payload, rawBody, headers, settings }, onSuccess, onError, }) => {
|
|
19
|
-
var _a, _b;
|
|
35
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
20
36
|
const callId = payload === null || payload === void 0 ? void 0 : payload.call_id;
|
|
21
37
|
const awellPatientId = (_b = (_a = payload === null || payload === void 0 ? void 0 : payload.variables) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.awell_patient_id;
|
|
22
38
|
if ((0, lodash_1.isNil)(callId)) {
|
|
@@ -31,6 +47,33 @@ exports.callCompleted = {
|
|
|
31
47
|
data_points: {
|
|
32
48
|
callId,
|
|
33
49
|
callObject: JSON.stringify(payload),
|
|
50
|
+
/**
|
|
51
|
+
* Whether the call has been completed.
|
|
52
|
+
* This doesn't tell anything about the outcome of the call. That's what status is for
|
|
53
|
+
*/
|
|
54
|
+
completed: (_d = (_c = payload === null || payload === void 0 ? void 0 : payload.completed) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : '',
|
|
55
|
+
/**
|
|
56
|
+
* The status of the call
|
|
57
|
+
* completed - Call was successfully completed, this can be both human or voicemail answered (see answered_by for details on who the call was answered by)
|
|
58
|
+
* failed - Call failed to connect or complete (see error_message for details)
|
|
59
|
+
* busy - Called number was busy
|
|
60
|
+
* no-answer - Call was not answered
|
|
61
|
+
* canceled - Call was canceled before completion
|
|
62
|
+
* unknown - Status could not be determined
|
|
63
|
+
*/
|
|
64
|
+
status: (_e = payload === null || payload === void 0 ? void 0 : payload.status) !== null && _e !== void 0 ? _e : '',
|
|
65
|
+
/**
|
|
66
|
+
* human: The call was answered by a human.
|
|
67
|
+
* voicemail: The call was answered by an answering machine or voicemail.
|
|
68
|
+
* unknown: There was not enough audio at the start of the call to make a determination.
|
|
69
|
+
* no-answer: The call was not answered.
|
|
70
|
+
* null: Not enabled, or still processing the result.
|
|
71
|
+
*/
|
|
72
|
+
answeredBy: (_f = payload === null || payload === void 0 ? void 0 : payload.answered_by) !== null && _f !== void 0 ? _f : '',
|
|
73
|
+
/**
|
|
74
|
+
* If an error occurs, this will contain a description of the error. Otherwise, it will be null.
|
|
75
|
+
*/
|
|
76
|
+
errorMessage: (_g = payload === null || payload === void 0 ? void 0 : payload.error_message) !== null && _g !== void 0 ? _g : '',
|
|
34
77
|
},
|
|
35
78
|
...(awellPatientId !== undefined && { patient_id: awellPatientId }),
|
|
36
79
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callCompleted.js","sourceRoot":"","sources":["../../../../../extensions/bland/webhooks/CallCompleted/callCompleted.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAQ9B,MAAM,UAAU,GAAG;IACjB,MAAM,EAAE;QACN,GAAG,EAAE,QAAQ;QACb,SAAS,EAAE,QAAQ;KACpB;IACD,UAAU,EAAE;QACV,GAAG,EAAE,YAAY;QACjB,SAAS,EAAE,MAAM;KAClB;CAC4C,CAAA;AAElC,QAAA,aAAa,GAItB;IACF,GAAG,EAAE,eAAe;IACpB,UAAU;IACV,OAAO,EAAE,KAAK,EAAE,EACd,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAChD,SAAS,EACT,OAAO,GACR,EAAE,EAAE;;QACH,MAAM,MAAM,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAA;QAC/B,MAAM,cAAc,GAClB,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,0CAAE,QAAQ,0CAAE,gBAAgB,CAAA;QAEhD,IAAI,IAAA,cAAK,EAAC,MAAM,CAAC,EAAE,CAAC;YAClB,MAAM,OAAO,CAAC;gBACZ,QAAQ,EAAE;oBACR,UAAU,EAAE,GAAG;oBACf,OAAO,EAAE,4BAA4B;iBACtC;aACF,CAAC,CAAA;QACJ,CAAC;QAED,MAAM,SAAS,CAAC;YACd,WAAW,EAAE;gBACX,MAAM;gBACN,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"callCompleted.js","sourceRoot":"","sources":["../../../../../extensions/bland/webhooks/CallCompleted/callCompleted.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAQ9B,MAAM,UAAU,GAAG;IACjB,MAAM,EAAE;QACN,GAAG,EAAE,QAAQ;QACb,SAAS,EAAE,QAAQ;KACpB;IACD,SAAS,EAAE;QACT,GAAG,EAAE,WAAW;QAChB,SAAS,EAAE,SAAS;KACrB;IACD,MAAM,EAAE;QACN,GAAG,EAAE,QAAQ;QACb,SAAS,EAAE,QAAQ;KACpB;IACD,UAAU,EAAE;QACV,GAAG,EAAE,YAAY;QACjB,SAAS,EAAE,QAAQ;KACpB;IACD,YAAY,EAAE;QACZ,GAAG,EAAE,cAAc;QACnB,SAAS,EAAE,QAAQ;KACpB;IACD,UAAU,EAAE;QACV,GAAG,EAAE,YAAY;QACjB,SAAS,EAAE,MAAM;KAClB;CAC4C,CAAA;AAElC,QAAA,aAAa,GAItB;IACF,GAAG,EAAE,eAAe;IACpB,UAAU;IACV,OAAO,EAAE,KAAK,EAAE,EACd,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAChD,SAAS,EACT,OAAO,GACR,EAAE,EAAE;;QACH,MAAM,MAAM,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAA;QAC/B,MAAM,cAAc,GAClB,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,0CAAE,QAAQ,0CAAE,gBAAgB,CAAA;QAEhD,IAAI,IAAA,cAAK,EAAC,MAAM,CAAC,EAAE,CAAC;YAClB,MAAM,OAAO,CAAC;gBACZ,QAAQ,EAAE;oBACR,UAAU,EAAE,GAAG;oBACf,OAAO,EAAE,4BAA4B;iBACtC;aACF,CAAC,CAAA;QACJ,CAAC;QAED,MAAM,SAAS,CAAC;YACd,WAAW,EAAE;gBACX,MAAM;gBACN,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;gBACnC;;;mBAGG;gBACH,SAAS,EAAE,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,0CAAE,QAAQ,EAAE,mCAAI,EAAE;gBAC/C;;;;;;;;mBAQG;gBACH,MAAM,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,EAAE;gBAC7B;;;;;;mBAMG;gBACH,UAAU,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,mCAAI,EAAE;gBACtC;;mBAEG;gBACH,YAAY,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,mCAAI,EAAE;aAC3C;YACD,GAAG,CAAC,cAAc,KAAK,SAAS,IAAI,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC;SACpE,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const webhooks: import("@awell-health/extensions-core").Webhook<"callId" | "callObject", import("./CallCompleted/types").CallCompletedWebhookPayload, {
|
|
1
|
+
export declare const webhooks: import("@awell-health/extensions-core").Webhook<"status" | "completed" | "callId" | "answeredBy" | "errorMessage" | "callObject", import("./CallCompleted/types").CallCompletedWebhookPayload, {
|
|
2
2
|
apiKey: {
|
|
3
3
|
key: string;
|
|
4
4
|
label: string;
|