@awell-health/awell-extensions 2.1.136 → 2.1.138
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/actions/createSmsConversation/config/dataPoints.d.ts +10 -0
- package/dist/extensions/bland/actions/createSmsConversation/config/dataPoints.js +14 -0
- package/dist/extensions/bland/actions/createSmsConversation/config/dataPoints.js.map +1 -0
- package/dist/extensions/bland/actions/createSmsConversation/config/fields.d.ts +112 -0
- package/dist/extensions/bland/actions/createSmsConversation/config/fields.js +97 -0
- package/dist/extensions/bland/actions/createSmsConversation/config/fields.js.map +1 -0
- package/dist/extensions/bland/actions/createSmsConversation/config/index.d.ts +2 -0
- package/dist/extensions/bland/actions/createSmsConversation/config/index.js +9 -0
- package/dist/extensions/bland/actions/createSmsConversation/config/index.js.map +1 -0
- package/dist/extensions/bland/actions/createSmsConversation/createSmsConversation.d.ts +4 -0
- package/dist/extensions/bland/actions/createSmsConversation/createSmsConversation.js +68 -0
- package/dist/extensions/bland/actions/createSmsConversation/createSmsConversation.js.map +1 -0
- package/dist/extensions/bland/actions/createSmsConversation/index.d.ts +1 -0
- package/dist/extensions/bland/actions/createSmsConversation/index.js +6 -0
- package/dist/extensions/bland/actions/createSmsConversation/index.js.map +1 -0
- package/dist/extensions/bland/actions/index.d.ts +154 -0
- package/dist/extensions/bland/actions/index.js +4 -0
- package/dist/extensions/bland/actions/index.js.map +1 -1
- package/dist/extensions/bland/actions/sendSms/config/dataPoints.d.ts +10 -0
- package/dist/extensions/bland/actions/sendSms/config/dataPoints.js +14 -0
- package/dist/extensions/bland/actions/sendSms/config/dataPoints.js.map +1 -0
- package/dist/extensions/bland/actions/sendSms/config/fields.d.ts +86 -0
- package/dist/extensions/bland/actions/sendSms/config/fields.js +75 -0
- package/dist/extensions/bland/actions/sendSms/config/fields.js.map +1 -0
- package/dist/extensions/bland/actions/sendSms/config/index.d.ts +2 -0
- package/dist/extensions/bland/actions/sendSms/config/index.js +9 -0
- package/dist/extensions/bland/actions/sendSms/config/index.js.map +1 -0
- package/dist/extensions/bland/actions/sendSms/index.d.ts +1 -0
- package/dist/extensions/bland/actions/sendSms/index.js +6 -0
- package/dist/extensions/bland/actions/sendSms/index.js.map +1 -0
- package/dist/extensions/bland/actions/sendSms/sendSms.d.ts +4 -0
- package/dist/extensions/bland/actions/sendSms/sendSms.js +64 -0
- package/dist/extensions/bland/actions/sendSms/sendSms.js.map +1 -0
- package/dist/extensions/bland/api/client.d.ts +3 -1
- package/dist/extensions/bland/api/client.js +8 -0
- package/dist/extensions/bland/api/client.js.map +1 -1
- package/dist/extensions/bland/api/schema/CreateSmsConversation.schema.d.ts +89 -0
- package/dist/extensions/bland/api/schema/CreateSmsConversation.schema.js +36 -0
- package/dist/extensions/bland/api/schema/CreateSmsConversation.schema.js.map +1 -0
- package/dist/extensions/bland/api/schema/SendSms.schema.d.ts +77 -0
- package/dist/extensions/bland/api/schema/SendSms.schema.js +30 -0
- package/dist/extensions/bland/api/schema/SendSms.schema.js.map +1 -0
- package/dist/extensions/bland/api/schema/index.d.ts +2 -0
- package/dist/extensions/bland/api/schema/index.js +2 -0
- package/dist/extensions/bland/api/schema/index.js.map +1 -1
- package/dist/extensions/elation/validation/messageThread.zod.d.ts +2 -2
- package/dist/extensions/markdown.json +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dataPoints = void 0;
|
|
4
|
+
exports.dataPoints = {
|
|
5
|
+
conversationId: {
|
|
6
|
+
key: 'conversationId',
|
|
7
|
+
valueType: 'string',
|
|
8
|
+
},
|
|
9
|
+
createResponse: {
|
|
10
|
+
key: 'createResponse',
|
|
11
|
+
valueType: 'json',
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=dataPoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../../extensions/bland/actions/createSmsConversation/config/dataPoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,cAAc,EAAE;QACd,GAAG,EAAE,gBAAgB;QACrB,SAAS,EAAE,QAAQ;KACpB;IACD,cAAc,EAAE;QACd,GAAG,EAAE,gBAAgB;QACrB,SAAS,EAAE,MAAM;KAClB;CAC4C,CAAA"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { FieldType, StringType } from '@awell-health/extensions-core';
|
|
2
|
+
import z from 'zod';
|
|
3
|
+
export declare const fields: {
|
|
4
|
+
userNumber: {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
type: FieldType.STRING;
|
|
9
|
+
stringType: StringType.PHONE;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
agentNumber: {
|
|
13
|
+
id: string;
|
|
14
|
+
label: string;
|
|
15
|
+
description: string;
|
|
16
|
+
type: FieldType.STRING;
|
|
17
|
+
stringType: StringType.PHONE;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
message: {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
description: string;
|
|
24
|
+
type: FieldType.TEXT;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
sender: {
|
|
28
|
+
id: string;
|
|
29
|
+
label: string;
|
|
30
|
+
description: string;
|
|
31
|
+
type: FieldType.STRING;
|
|
32
|
+
required: false;
|
|
33
|
+
options: {
|
|
34
|
+
dropdownOptions: {
|
|
35
|
+
value: string;
|
|
36
|
+
label: string;
|
|
37
|
+
}[];
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
currPathwayId: {
|
|
41
|
+
id: string;
|
|
42
|
+
label: string;
|
|
43
|
+
description: string;
|
|
44
|
+
type: FieldType.STRING;
|
|
45
|
+
required: false;
|
|
46
|
+
};
|
|
47
|
+
currPathwayVersion: {
|
|
48
|
+
id: string;
|
|
49
|
+
label: string;
|
|
50
|
+
description: string;
|
|
51
|
+
type: FieldType.STRING;
|
|
52
|
+
required: false;
|
|
53
|
+
};
|
|
54
|
+
currentNodeId: {
|
|
55
|
+
id: string;
|
|
56
|
+
label: string;
|
|
57
|
+
description: string;
|
|
58
|
+
type: FieldType.STRING;
|
|
59
|
+
required: false;
|
|
60
|
+
};
|
|
61
|
+
newConversation: {
|
|
62
|
+
id: string;
|
|
63
|
+
label: string;
|
|
64
|
+
description: string;
|
|
65
|
+
type: FieldType.STRING;
|
|
66
|
+
required: false;
|
|
67
|
+
options: {
|
|
68
|
+
dropdownOptions: {
|
|
69
|
+
value: string;
|
|
70
|
+
label: string;
|
|
71
|
+
}[];
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
requestData: {
|
|
75
|
+
id: string;
|
|
76
|
+
label: string;
|
|
77
|
+
description: string;
|
|
78
|
+
type: FieldType.JSON;
|
|
79
|
+
required: false;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export declare const FieldsValidationSchema: z.ZodObject<{
|
|
83
|
+
userNumber: z.ZodString;
|
|
84
|
+
agentNumber: z.ZodString;
|
|
85
|
+
message: z.ZodString;
|
|
86
|
+
sender: z.ZodOptional<z.ZodEnum<["USER", "AGENT"]>>;
|
|
87
|
+
currPathwayId: z.ZodOptional<z.ZodString>;
|
|
88
|
+
currPathwayVersion: z.ZodOptional<z.ZodString>;
|
|
89
|
+
currentNodeId: z.ZodOptional<z.ZodString>;
|
|
90
|
+
newConversation: z.ZodOptional<z.ZodEffects<z.ZodEnum<["true", "false"]>, boolean, "true" | "false">>;
|
|
91
|
+
requestData: z.ZodOptional<z.ZodEffects<z.ZodOptional<z.ZodString>, Record<string, unknown>, string | undefined>>;
|
|
92
|
+
}, "strip", z.ZodTypeAny, {
|
|
93
|
+
message: string;
|
|
94
|
+
userNumber: string;
|
|
95
|
+
agentNumber: string;
|
|
96
|
+
sender?: "USER" | "AGENT" | undefined;
|
|
97
|
+
requestData?: Record<string, unknown> | undefined;
|
|
98
|
+
newConversation?: boolean | undefined;
|
|
99
|
+
currPathwayId?: string | undefined;
|
|
100
|
+
currPathwayVersion?: string | undefined;
|
|
101
|
+
currentNodeId?: string | undefined;
|
|
102
|
+
}, {
|
|
103
|
+
message: string;
|
|
104
|
+
userNumber: string;
|
|
105
|
+
agentNumber: string;
|
|
106
|
+
sender?: "USER" | "AGENT" | undefined;
|
|
107
|
+
requestData?: string | undefined;
|
|
108
|
+
newConversation?: "true" | "false" | undefined;
|
|
109
|
+
currPathwayId?: string | undefined;
|
|
110
|
+
currPathwayVersion?: string | undefined;
|
|
111
|
+
currentNodeId?: string | undefined;
|
|
112
|
+
}>;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FieldsValidationSchema = exports.fields = void 0;
|
|
7
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
|
8
|
+
const zod_1 = __importDefault(require("zod"));
|
|
9
|
+
const sharedActionFields_1 = require("../../../lib/sharedActionFields");
|
|
10
|
+
exports.fields = {
|
|
11
|
+
userNumber: {
|
|
12
|
+
id: 'userNumber',
|
|
13
|
+
label: 'User phone number',
|
|
14
|
+
description: 'The phone number of the user in the conversation (E.164 format).',
|
|
15
|
+
type: extensions_core_1.FieldType.STRING,
|
|
16
|
+
stringType: extensions_core_1.StringType.PHONE,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
agentNumber: {
|
|
20
|
+
id: 'agentNumber',
|
|
21
|
+
label: 'Agent phone number',
|
|
22
|
+
description: 'The Bland-owned, SMS-enabled phone number for the conversation (E.164 format).',
|
|
23
|
+
type: extensions_core_1.FieldType.STRING,
|
|
24
|
+
stringType: extensions_core_1.StringType.PHONE,
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
message: {
|
|
28
|
+
id: 'message',
|
|
29
|
+
label: 'Message',
|
|
30
|
+
description: 'The message to seed the conversation with. It is recorded in the conversation but NOT sent to the user.',
|
|
31
|
+
type: extensions_core_1.FieldType.TEXT,
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
sender: {
|
|
35
|
+
id: 'sender',
|
|
36
|
+
label: 'Sender',
|
|
37
|
+
description: 'Who the seeded message is attributed to. Defaults to USER when omitted.',
|
|
38
|
+
type: extensions_core_1.FieldType.STRING,
|
|
39
|
+
required: false,
|
|
40
|
+
options: {
|
|
41
|
+
dropdownOptions: [
|
|
42
|
+
{ value: 'USER', label: 'User' },
|
|
43
|
+
{ value: 'AGENT', label: 'Agent' },
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
currPathwayId: {
|
|
48
|
+
id: 'currPathwayId',
|
|
49
|
+
label: 'Current pathway ID',
|
|
50
|
+
description: 'The pathway to position the conversation on.',
|
|
51
|
+
type: extensions_core_1.FieldType.STRING,
|
|
52
|
+
required: false,
|
|
53
|
+
},
|
|
54
|
+
currPathwayVersion: {
|
|
55
|
+
id: 'currPathwayVersion',
|
|
56
|
+
label: 'Current pathway version',
|
|
57
|
+
description: 'The version of the pathway.',
|
|
58
|
+
type: extensions_core_1.FieldType.STRING,
|
|
59
|
+
required: false,
|
|
60
|
+
},
|
|
61
|
+
currentNodeId: {
|
|
62
|
+
id: 'currentNodeId',
|
|
63
|
+
label: 'Current node ID',
|
|
64
|
+
description: 'The pathway node the conversation should be positioned at.',
|
|
65
|
+
type: extensions_core_1.FieldType.STRING,
|
|
66
|
+
required: false,
|
|
67
|
+
},
|
|
68
|
+
newConversation: {
|
|
69
|
+
id: 'newConversation',
|
|
70
|
+
label: 'Start new conversation',
|
|
71
|
+
description: 'When enabled, starts a fresh conversation instead of continuing an existing one.',
|
|
72
|
+
type: extensions_core_1.FieldType.STRING,
|
|
73
|
+
required: false,
|
|
74
|
+
options: {
|
|
75
|
+
dropdownOptions: sharedActionFields_1.dropdownOptionsBoolean,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
requestData: {
|
|
79
|
+
id: 'requestData',
|
|
80
|
+
label: 'Request data',
|
|
81
|
+
description: 'JSON object of variables made available to the pathway/agent during the conversation. Can be referenced with Prompt Variables.',
|
|
82
|
+
type: extensions_core_1.FieldType.JSON,
|
|
83
|
+
required: false,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
exports.FieldsValidationSchema = zod_1.default.object({
|
|
87
|
+
userNumber: zod_1.default.string().trim().min(1),
|
|
88
|
+
agentNumber: zod_1.default.string().trim().min(1),
|
|
89
|
+
message: zod_1.default.string().trim().min(1),
|
|
90
|
+
sender: zod_1.default.enum(['USER', 'AGENT']).optional(),
|
|
91
|
+
currPathwayId: zod_1.default.string().optional(),
|
|
92
|
+
currPathwayVersion: zod_1.default.string().optional(),
|
|
93
|
+
currentNodeId: zod_1.default.string().optional(),
|
|
94
|
+
newConversation: sharedActionFields_1.dropdownOptionsBooleanSchema.optional(),
|
|
95
|
+
requestData: sharedActionFields_1.JsonObjectSchema.optional(),
|
|
96
|
+
});
|
|
97
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/bland/actions/createSmsConversation/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAIsC;AACtC,8CAAwC;AACxC,wEAIwC;AAE3B,QAAA,MAAM,GAAG;IACpB,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,kEAAkE;QAC/E,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,UAAU,EAAE,4BAAU,CAAC,KAAK;QAC5B,QAAQ,EAAE,IAAI;KACf;IAC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BAAwB;QAC/B,WAAW,EACT,kFAAkF;QACpF,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE;YACP,eAAe,EAAE,2CAAsB;SACxC;KACF;IACD,WAAW,EAAE;QACX,EAAE,EAAE,aAAa;QACjB,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,gIAAgI;QAClI,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,KAAK;KAChB;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,aAAC,CAAC,MAAM,CAAC;IAC7C,UAAU,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,WAAW,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,OAAO,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,MAAM,EAAE,aAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC5C,aAAa,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,kBAAkB,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzC,aAAa,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,eAAe,EAAE,iDAA4B,CAAC,QAAQ,EAAE;IACxD,WAAW,EAAE,qCAAgB,CAAC,QAAQ,EAAE;CACS,CAAC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dataPoints = exports.FieldsValidationSchema = exports.fields = void 0;
|
|
4
|
+
var fields_1 = require("./fields");
|
|
5
|
+
Object.defineProperty(exports, "fields", { enumerable: true, get: function () { return fields_1.fields; } });
|
|
6
|
+
Object.defineProperty(exports, "FieldsValidationSchema", { enumerable: true, get: function () { return fields_1.FieldsValidationSchema; } });
|
|
7
|
+
var dataPoints_1 = require("./dataPoints");
|
|
8
|
+
Object.defineProperty(exports, "dataPoints", { enumerable: true, get: function () { return dataPoints_1.dataPoints; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/bland/actions/createSmsConversation/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSmsConversation = void 0;
|
|
4
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
|
5
|
+
const crypto_1 = require("crypto");
|
|
6
|
+
const lodash_1 = require("lodash");
|
|
7
|
+
const validatePayloadAndCreateSdk_1 = require("../../lib/validatePayloadAndCreateSdk");
|
|
8
|
+
const config_1 = require("./config");
|
|
9
|
+
const schema_1 = require("../../api/schema");
|
|
10
|
+
const addEventLog_1 = require("../../../../src/lib/awell/addEventLog");
|
|
11
|
+
exports.createSmsConversation = {
|
|
12
|
+
key: 'createSmsConversation',
|
|
13
|
+
category: extensions_core_1.Category.COMMUNICATION,
|
|
14
|
+
title: 'Create SMS conversation',
|
|
15
|
+
description: 'Create an SMS conversation seeded with pathway state, without sending a message immediately. The pathway then drives outbound texts.',
|
|
16
|
+
fields: config_1.fields,
|
|
17
|
+
previewable: true,
|
|
18
|
+
dataPoints: config_1.dataPoints,
|
|
19
|
+
supports_automated_retries: true,
|
|
20
|
+
onEvent: async ({ payload, onComplete, helpers: { log } }) => {
|
|
21
|
+
var _a;
|
|
22
|
+
const { fields, blandSdk } = await (0, validatePayloadAndCreateSdk_1.validatePayloadAndCreateSdk)({
|
|
23
|
+
fieldsSchema: config_1.FieldsValidationSchema,
|
|
24
|
+
payload,
|
|
25
|
+
});
|
|
26
|
+
const createSmsConversationInput = schema_1.CreateSmsConversationInputSchema.parse({
|
|
27
|
+
user_number: fields.userNumber,
|
|
28
|
+
agent_number: fields.agentNumber,
|
|
29
|
+
message: fields.message,
|
|
30
|
+
// Required by the live Bland API despite being documented as optional;
|
|
31
|
+
// it is only a correlation id so a generated UUID is sufficient.
|
|
32
|
+
message_sid: (0, crypto_1.randomUUID)(),
|
|
33
|
+
sender: fields.sender,
|
|
34
|
+
curr_pathway_id: (0, lodash_1.isEmpty)(fields.currPathwayId)
|
|
35
|
+
? undefined
|
|
36
|
+
: fields.currPathwayId,
|
|
37
|
+
curr_pathway_version: (0, lodash_1.isEmpty)(fields.currPathwayVersion)
|
|
38
|
+
? undefined
|
|
39
|
+
: fields.currPathwayVersion,
|
|
40
|
+
current_node_id: (0, lodash_1.isEmpty)(fields.currentNodeId)
|
|
41
|
+
? undefined
|
|
42
|
+
: fields.currentNodeId,
|
|
43
|
+
new_conversation: fields.newConversation,
|
|
44
|
+
request_data: (0, lodash_1.isEmpty)(fields.requestData) ? undefined : fields.requestData,
|
|
45
|
+
});
|
|
46
|
+
try {
|
|
47
|
+
log({ createSmsConversationInput }, 'Creating SMS conversation via Bland');
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
console.error('unable to use new helpers.log');
|
|
51
|
+
console.error(JSON.stringify(err));
|
|
52
|
+
}
|
|
53
|
+
const { data } = await blandSdk.createSmsConversation(createSmsConversationInput);
|
|
54
|
+
const conversationId = (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.conversation_id;
|
|
55
|
+
await onComplete({
|
|
56
|
+
data_points: {
|
|
57
|
+
conversationId: (0, lodash_1.isNil)(conversationId) ? undefined : conversationId,
|
|
58
|
+
createResponse: (0, lodash_1.isNil)(data) ? undefined : JSON.stringify(data),
|
|
59
|
+
},
|
|
60
|
+
events: [
|
|
61
|
+
(0, addEventLog_1.addActivityEventLog)({
|
|
62
|
+
message: `SMS conversation created in Bland.\nConversation ID: ${conversationId !== null && conversationId !== void 0 ? conversationId : 'n/a'}`,
|
|
63
|
+
}),
|
|
64
|
+
],
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=createSmsConversation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSmsConversation.js","sourceRoot":"","sources":["../../../../../extensions/bland/actions/createSmsConversation/createSmsConversation.ts"],"names":[],"mappings":";;;AACA,mEAAwD;AACxD,mCAAmC;AACnC,mCAAuC;AACvC,uFAAmF;AAEnF,qCAAqE;AACrE,6CAAmE;AACnE,uEAA2E;AAE9D,QAAA,qBAAqB,GAI9B;IACF,GAAG,EAAE,uBAAuB;IAC5B,QAAQ,EAAE,0BAAQ,CAAC,aAAa;IAChC,KAAK,EAAE,yBAAyB;IAChC,WAAW,EACT,sIAAsI;IACxI,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,IAAI;IACjB,UAAU,EAAV,mBAAU;IACV,0BAA0B,EAAE,IAAI;IAChC,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE,EAAiB,EAAE;;QAC1E,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAA,yDAA2B,EAAC;YAC7D,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,0BAA0B,GAAG,yCAAgC,CAAC,KAAK,CAAC;YACxE,WAAW,EAAE,MAAM,CAAC,UAAU;YAC9B,YAAY,EAAE,MAAM,CAAC,WAAW;YAChC,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,uEAAuE;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BAClE,cAAc,EAAE,IAAA,cAAK,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;aAC/D;YACD,MAAM,EAAE;gBACN,IAAA,iCAAmB,EAAC;oBAClB,OAAO,EAAE,wDACP,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,KACpB,EAAE;iBACH,CAAC;aACH;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createSmsConversation } from './createSmsConversation';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSmsConversation = void 0;
|
|
4
|
+
var createSmsConversation_1 = require("./createSmsConversation");
|
|
5
|
+
Object.defineProperty(exports, "createSmsConversation", { enumerable: true, get: function () { return createSmsConversation_1.createSmsConversation; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/bland/actions/createSmsConversation/index.ts"],"names":[],"mappings":";;;AAAA,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA"}
|
|
@@ -694,4 +694,158 @@ export declare const actions: {
|
|
|
694
694
|
required: true;
|
|
695
695
|
};
|
|
696
696
|
}, "message" | "status">;
|
|
697
|
+
sendSms: import("@awell-health/extensions-core").Action<{
|
|
698
|
+
userNumber: {
|
|
699
|
+
id: string;
|
|
700
|
+
label: string;
|
|
701
|
+
description: string;
|
|
702
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
|
703
|
+
stringType: import("@awell-health/extensions-core").StringType.PHONE;
|
|
704
|
+
required: true;
|
|
705
|
+
};
|
|
706
|
+
agentNumber: {
|
|
707
|
+
id: string;
|
|
708
|
+
label: string;
|
|
709
|
+
description: string;
|
|
710
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
|
711
|
+
stringType: import("@awell-health/extensions-core").StringType.PHONE;
|
|
712
|
+
required: true;
|
|
713
|
+
};
|
|
714
|
+
agentMessage: {
|
|
715
|
+
id: string;
|
|
716
|
+
label: string;
|
|
717
|
+
description: string;
|
|
718
|
+
type: import("@awell-health/extensions-core").FieldType.TEXT;
|
|
719
|
+
required: false;
|
|
720
|
+
};
|
|
721
|
+
pathwayId: {
|
|
722
|
+
id: string;
|
|
723
|
+
label: string;
|
|
724
|
+
description: string;
|
|
725
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
|
726
|
+
required: false;
|
|
727
|
+
};
|
|
728
|
+
newConversation: {
|
|
729
|
+
id: string;
|
|
730
|
+
label: string;
|
|
731
|
+
description: string;
|
|
732
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
|
733
|
+
required: false;
|
|
734
|
+
options: {
|
|
735
|
+
dropdownOptions: {
|
|
736
|
+
value: string;
|
|
737
|
+
label: string;
|
|
738
|
+
}[];
|
|
739
|
+
};
|
|
740
|
+
};
|
|
741
|
+
requestData: {
|
|
742
|
+
id: string;
|
|
743
|
+
label: string;
|
|
744
|
+
description: string;
|
|
745
|
+
type: import("@awell-health/extensions-core").FieldType.JSON;
|
|
746
|
+
required: false;
|
|
747
|
+
};
|
|
748
|
+
metadata: {
|
|
749
|
+
id: string;
|
|
750
|
+
label: string;
|
|
751
|
+
description: string;
|
|
752
|
+
type: import("@awell-health/extensions-core").FieldType.JSON;
|
|
753
|
+
required: false;
|
|
754
|
+
};
|
|
755
|
+
}, {
|
|
756
|
+
apiKey: {
|
|
757
|
+
key: string;
|
|
758
|
+
label: string;
|
|
759
|
+
obfuscated: true;
|
|
760
|
+
description: string;
|
|
761
|
+
required: true;
|
|
762
|
+
};
|
|
763
|
+
}, "conversationId" | "smsResponse">;
|
|
764
|
+
createSmsConversation: import("@awell-health/extensions-core").Action<{
|
|
765
|
+
userNumber: {
|
|
766
|
+
id: string;
|
|
767
|
+
label: string;
|
|
768
|
+
description: string;
|
|
769
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
|
770
|
+
stringType: import("@awell-health/extensions-core").StringType.PHONE;
|
|
771
|
+
required: true;
|
|
772
|
+
};
|
|
773
|
+
agentNumber: {
|
|
774
|
+
id: string;
|
|
775
|
+
label: string;
|
|
776
|
+
description: string;
|
|
777
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
|
778
|
+
stringType: import("@awell-health/extensions-core").StringType.PHONE;
|
|
779
|
+
required: true;
|
|
780
|
+
};
|
|
781
|
+
message: {
|
|
782
|
+
id: string;
|
|
783
|
+
label: string;
|
|
784
|
+
description: string;
|
|
785
|
+
type: import("@awell-health/extensions-core").FieldType.TEXT;
|
|
786
|
+
required: true;
|
|
787
|
+
};
|
|
788
|
+
sender: {
|
|
789
|
+
id: string;
|
|
790
|
+
label: string;
|
|
791
|
+
description: string;
|
|
792
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
|
793
|
+
required: false;
|
|
794
|
+
options: {
|
|
795
|
+
dropdownOptions: {
|
|
796
|
+
value: string;
|
|
797
|
+
label: string;
|
|
798
|
+
}[];
|
|
799
|
+
};
|
|
800
|
+
};
|
|
801
|
+
currPathwayId: {
|
|
802
|
+
id: string;
|
|
803
|
+
label: string;
|
|
804
|
+
description: string;
|
|
805
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
|
806
|
+
required: false;
|
|
807
|
+
};
|
|
808
|
+
currPathwayVersion: {
|
|
809
|
+
id: string;
|
|
810
|
+
label: string;
|
|
811
|
+
description: string;
|
|
812
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
|
813
|
+
required: false;
|
|
814
|
+
};
|
|
815
|
+
currentNodeId: {
|
|
816
|
+
id: string;
|
|
817
|
+
label: string;
|
|
818
|
+
description: string;
|
|
819
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
|
820
|
+
required: false;
|
|
821
|
+
};
|
|
822
|
+
newConversation: {
|
|
823
|
+
id: string;
|
|
824
|
+
label: string;
|
|
825
|
+
description: string;
|
|
826
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
|
827
|
+
required: false;
|
|
828
|
+
options: {
|
|
829
|
+
dropdownOptions: {
|
|
830
|
+
value: string;
|
|
831
|
+
label: string;
|
|
832
|
+
}[];
|
|
833
|
+
};
|
|
834
|
+
};
|
|
835
|
+
requestData: {
|
|
836
|
+
id: string;
|
|
837
|
+
label: string;
|
|
838
|
+
description: string;
|
|
839
|
+
type: import("@awell-health/extensions-core").FieldType.JSON;
|
|
840
|
+
required: false;
|
|
841
|
+
};
|
|
842
|
+
}, {
|
|
843
|
+
apiKey: {
|
|
844
|
+
key: string;
|
|
845
|
+
label: string;
|
|
846
|
+
obfuscated: true;
|
|
847
|
+
description: string;
|
|
848
|
+
required: true;
|
|
849
|
+
};
|
|
850
|
+
}, "conversationId" | "createResponse">;
|
|
697
851
|
};
|
|
@@ -5,10 +5,14 @@ const sendCall_1 = require("./sendCall");
|
|
|
5
5
|
const sendCallWithPathway_1 = require("./sendCallWithPathway");
|
|
6
6
|
const getCallDetails_1 = require("./getCallDetails");
|
|
7
7
|
const stopActiveCall_1 = require("./stopActiveCall");
|
|
8
|
+
const sendSms_1 = require("./sendSms");
|
|
9
|
+
const createSmsConversation_1 = require("./createSmsConversation");
|
|
8
10
|
exports.actions = {
|
|
9
11
|
sendCallWithPathway: sendCallWithPathway_1.sendCallWithPathway,
|
|
10
12
|
sendCall: sendCall_1.sendCall,
|
|
11
13
|
getCallDetails: getCallDetails_1.getCallDetails,
|
|
12
14
|
stopActiveCall: stopActiveCall_1.stopActiveCall,
|
|
15
|
+
sendSms: sendSms_1.sendSms,
|
|
16
|
+
createSmsConversation: createSmsConversation_1.createSmsConversation,
|
|
13
17
|
};
|
|
14
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/bland/actions/index.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,+DAA2D;AAC3D,qDAAiD;AACjD,qDAAiD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/bland/actions/index.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,+DAA2D;AAC3D,qDAAiD;AACjD,qDAAiD;AACjD,uCAAmC;AACnC,mEAA+D;AAElD,QAAA,OAAO,GAAG;IACrB,mBAAmB,EAAnB,yCAAmB;IACnB,QAAQ,EAAR,mBAAQ;IACR,cAAc,EAAd,+BAAc;IACd,cAAc,EAAd,+BAAc;IACd,OAAO,EAAP,iBAAO;IACP,qBAAqB,EAArB,6CAAqB;CACtB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dataPoints = void 0;
|
|
4
|
+
exports.dataPoints = {
|
|
5
|
+
conversationId: {
|
|
6
|
+
key: 'conversationId',
|
|
7
|
+
valueType: 'string',
|
|
8
|
+
},
|
|
9
|
+
smsResponse: {
|
|
10
|
+
key: 'smsResponse',
|
|
11
|
+
valueType: 'json',
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=dataPoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../../extensions/bland/actions/sendSms/config/dataPoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,cAAc,EAAE;QACd,GAAG,EAAE,gBAAgB;QACrB,SAAS,EAAE,QAAQ;KACpB;IACD,WAAW,EAAE;QACX,GAAG,EAAE,aAAa;QAClB,SAAS,EAAE,MAAM;KAClB;CAC4C,CAAA"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { FieldType, StringType } from '@awell-health/extensions-core';
|
|
2
|
+
import z from 'zod';
|
|
3
|
+
export declare const fields: {
|
|
4
|
+
userNumber: {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
type: FieldType.STRING;
|
|
9
|
+
stringType: StringType.PHONE;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
agentNumber: {
|
|
13
|
+
id: string;
|
|
14
|
+
label: string;
|
|
15
|
+
description: string;
|
|
16
|
+
type: FieldType.STRING;
|
|
17
|
+
stringType: StringType.PHONE;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
agentMessage: {
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
description: string;
|
|
24
|
+
type: FieldType.TEXT;
|
|
25
|
+
required: false;
|
|
26
|
+
};
|
|
27
|
+
pathwayId: {
|
|
28
|
+
id: string;
|
|
29
|
+
label: string;
|
|
30
|
+
description: string;
|
|
31
|
+
type: FieldType.STRING;
|
|
32
|
+
required: false;
|
|
33
|
+
};
|
|
34
|
+
newConversation: {
|
|
35
|
+
id: string;
|
|
36
|
+
label: string;
|
|
37
|
+
description: string;
|
|
38
|
+
type: FieldType.STRING;
|
|
39
|
+
required: false;
|
|
40
|
+
options: {
|
|
41
|
+
dropdownOptions: {
|
|
42
|
+
value: string;
|
|
43
|
+
label: string;
|
|
44
|
+
}[];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
requestData: {
|
|
48
|
+
id: string;
|
|
49
|
+
label: string;
|
|
50
|
+
description: string;
|
|
51
|
+
type: FieldType.JSON;
|
|
52
|
+
required: false;
|
|
53
|
+
};
|
|
54
|
+
metadata: {
|
|
55
|
+
id: string;
|
|
56
|
+
label: string;
|
|
57
|
+
description: string;
|
|
58
|
+
type: FieldType.JSON;
|
|
59
|
+
required: false;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export declare const FieldsValidationSchema: z.ZodObject<{
|
|
63
|
+
userNumber: z.ZodString;
|
|
64
|
+
agentNumber: z.ZodString;
|
|
65
|
+
agentMessage: z.ZodOptional<z.ZodString>;
|
|
66
|
+
pathwayId: z.ZodOptional<z.ZodString>;
|
|
67
|
+
newConversation: z.ZodOptional<z.ZodEffects<z.ZodEnum<["true", "false"]>, boolean, "true" | "false">>;
|
|
68
|
+
requestData: z.ZodOptional<z.ZodEffects<z.ZodOptional<z.ZodString>, Record<string, unknown>, string | undefined>>;
|
|
69
|
+
metadata: z.ZodOptional<z.ZodEffects<z.ZodOptional<z.ZodString>, Record<string, unknown>, string | undefined>>;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
userNumber: string;
|
|
72
|
+
agentNumber: string;
|
|
73
|
+
pathwayId?: string | undefined;
|
|
74
|
+
metadata?: Record<string, unknown> | undefined;
|
|
75
|
+
requestData?: Record<string, unknown> | undefined;
|
|
76
|
+
agentMessage?: string | undefined;
|
|
77
|
+
newConversation?: boolean | undefined;
|
|
78
|
+
}, {
|
|
79
|
+
userNumber: string;
|
|
80
|
+
agentNumber: string;
|
|
81
|
+
pathwayId?: string | undefined;
|
|
82
|
+
metadata?: string | undefined;
|
|
83
|
+
requestData?: string | undefined;
|
|
84
|
+
agentMessage?: string | undefined;
|
|
85
|
+
newConversation?: "true" | "false" | undefined;
|
|
86
|
+
}>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FieldsValidationSchema = exports.fields = void 0;
|
|
7
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
|
8
|
+
const zod_1 = __importDefault(require("zod"));
|
|
9
|
+
const sharedActionFields_1 = require("../../../lib/sharedActionFields");
|
|
10
|
+
exports.fields = {
|
|
11
|
+
userNumber: {
|
|
12
|
+
id: 'userNumber',
|
|
13
|
+
label: 'User phone number',
|
|
14
|
+
description: 'The phone number of the recipient (E.164 format).',
|
|
15
|
+
type: extensions_core_1.FieldType.STRING,
|
|
16
|
+
stringType: extensions_core_1.StringType.PHONE,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
agentNumber: {
|
|
20
|
+
id: 'agentNumber',
|
|
21
|
+
label: 'Agent phone number',
|
|
22
|
+
description: 'The Bland-owned, SMS-enabled phone number to send the message from (E.164 format).',
|
|
23
|
+
type: extensions_core_1.FieldType.STRING,
|
|
24
|
+
stringType: extensions_core_1.StringType.PHONE,
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
agentMessage: {
|
|
28
|
+
id: 'agentMessage',
|
|
29
|
+
label: 'Agent message',
|
|
30
|
+
description: 'The message to send. When omitted and a pathway is configured on the agent number, the pathway generates the message.',
|
|
31
|
+
type: extensions_core_1.FieldType.TEXT,
|
|
32
|
+
required: false,
|
|
33
|
+
},
|
|
34
|
+
pathwayId: {
|
|
35
|
+
id: 'pathwayId',
|
|
36
|
+
label: 'Pathway ID',
|
|
37
|
+
description: 'The conversational pathway to drive the SMS conversation with.',
|
|
38
|
+
type: extensions_core_1.FieldType.STRING,
|
|
39
|
+
required: false,
|
|
40
|
+
},
|
|
41
|
+
newConversation: {
|
|
42
|
+
id: 'newConversation',
|
|
43
|
+
label: 'Start new conversation',
|
|
44
|
+
description: 'When enabled, starts a fresh conversation instead of continuing an existing one.',
|
|
45
|
+
type: extensions_core_1.FieldType.STRING,
|
|
46
|
+
required: false,
|
|
47
|
+
options: {
|
|
48
|
+
dropdownOptions: sharedActionFields_1.dropdownOptionsBoolean,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
requestData: {
|
|
52
|
+
id: 'requestData',
|
|
53
|
+
label: 'Request data',
|
|
54
|
+
description: 'JSON object of variables made available to the pathway/agent during the conversation. Can be referenced with Prompt Variables.',
|
|
55
|
+
type: extensions_core_1.FieldType.JSON,
|
|
56
|
+
required: false,
|
|
57
|
+
},
|
|
58
|
+
metadata: {
|
|
59
|
+
id: 'metadata',
|
|
60
|
+
label: 'Metadata',
|
|
61
|
+
description: 'Add any additional information you want to associate with the conversation.',
|
|
62
|
+
type: extensions_core_1.FieldType.JSON,
|
|
63
|
+
required: false,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
exports.FieldsValidationSchema = zod_1.default.object({
|
|
67
|
+
userNumber: zod_1.default.string().trim().min(1),
|
|
68
|
+
agentNumber: zod_1.default.string().trim().min(1),
|
|
69
|
+
agentMessage: zod_1.default.string().optional(),
|
|
70
|
+
pathwayId: zod_1.default.string().optional(),
|
|
71
|
+
newConversation: sharedActionFields_1.dropdownOptionsBooleanSchema.optional(),
|
|
72
|
+
requestData: sharedActionFields_1.JsonObjectSchema.optional(),
|
|
73
|
+
metadata: sharedActionFields_1.JsonObjectSchema.optional(),
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/bland/actions/sendSms/config/fields.ts"],"names":[],"mappings":";;;;;;AAAA,mEAIsC;AACtC,8CAAwC;AACxC,wEAIwC;AAE3B,QAAA,MAAM,GAAG;IACpB,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,mDAAmD;QAChE,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,UAAU,EAAE,4BAAU,CAAC,KAAK;QAC5B,QAAQ,EAAE,IAAI;KACf;IACD,WAAW,EAAE;QACX,EAAE,EAAE,aAAa;QACjB,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EACT,oFAAoF;QACtF,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,UAAU,EAAE,4BAAU,CAAC,KAAK;QAC5B,QAAQ,EAAE,IAAI;KACf;IACD,YAAY,EAAE;QACZ,EAAE,EAAE,cAAc;QAClB,KAAK,EAAE,eAAe;QAC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AE;IACxC,QAAQ,EAAE,qCAAgB,CAAC,QAAQ,EAAE;CACY,CAAC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dataPoints = exports.FieldsValidationSchema = exports.fields = void 0;
|
|
4
|
+
var fields_1 = require("./fields");
|
|
5
|
+
Object.defineProperty(exports, "fields", { enumerable: true, get: function () { return fields_1.fields; } });
|
|
6
|
+
Object.defineProperty(exports, "FieldsValidationSchema", { enumerable: true, get: function () { return fields_1.FieldsValidationSchema; } });
|
|
7
|
+
var dataPoints_1 = require("./dataPoints");
|
|
8
|
+
Object.defineProperty(exports, "dataPoints", { enumerable: true, get: function () { return dataPoints_1.dataPoints; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/bland/actions/sendSms/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { sendSms } from './sendSms';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendSms = void 0;
|
|
4
|
+
var sendSms_1 = require("./sendSms");
|
|
5
|
+
Object.defineProperty(exports, "sendSms", { enumerable: true, get: function () { return sendSms_1.sendSms; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/bland/actions/sendSms/index.ts"],"names":[],"mappings":";;;AAAA,qCAAmC;AAA1B,kGAAA,OAAO,OAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendSms = void 0;
|
|
4
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
|
5
|
+
const lodash_1 = require("lodash");
|
|
6
|
+
const validatePayloadAndCreateSdk_1 = require("../../lib/validatePayloadAndCreateSdk");
|
|
7
|
+
const config_1 = require("./config");
|
|
8
|
+
const schema_1 = require("../../api/schema");
|
|
9
|
+
const addEventLog_1 = require("../../../../src/lib/awell/addEventLog");
|
|
10
|
+
exports.sendSms = {
|
|
11
|
+
key: 'sendSms',
|
|
12
|
+
category: extensions_core_1.Category.COMMUNICATION,
|
|
13
|
+
title: 'Send SMS',
|
|
14
|
+
description: 'Send an SMS message immediately. The agent message is optional when a pathway drives the conversation.',
|
|
15
|
+
fields: config_1.fields,
|
|
16
|
+
previewable: true,
|
|
17
|
+
dataPoints: config_1.dataPoints,
|
|
18
|
+
supports_automated_retries: true,
|
|
19
|
+
onEvent: async ({ payload, onComplete, helpers: { log } }) => {
|
|
20
|
+
var _a;
|
|
21
|
+
const { fields, blandSdk } = await (0, validatePayloadAndCreateSdk_1.validatePayloadAndCreateSdk)({
|
|
22
|
+
fieldsSchema: config_1.FieldsValidationSchema,
|
|
23
|
+
payload,
|
|
24
|
+
});
|
|
25
|
+
const sendSmsInput = schema_1.SendSmsInputSchema.parse({
|
|
26
|
+
user_number: fields.userNumber,
|
|
27
|
+
agent_number: fields.agentNumber,
|
|
28
|
+
agent_message: (0, lodash_1.isEmpty)(fields.agentMessage)
|
|
29
|
+
? undefined
|
|
30
|
+
: fields.agentMessage,
|
|
31
|
+
pathway_id: (0, lodash_1.isEmpty)(fields.pathwayId) ? undefined : fields.pathwayId,
|
|
32
|
+
new_conversation: fields.newConversation,
|
|
33
|
+
request_data: (0, lodash_1.isEmpty)(fields.requestData) ? undefined : fields.requestData,
|
|
34
|
+
metadata: {
|
|
35
|
+
...fields.metadata,
|
|
36
|
+
awell_patient_id: payload.patient.id,
|
|
37
|
+
awell_care_flow_definition_id: payload.pathway.definition_id,
|
|
38
|
+
awell_care_flow_id: payload.pathway.id,
|
|
39
|
+
awell_activity_id: payload.activity.id,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
try {
|
|
43
|
+
log({ sendSmsInput }, 'Sending SMS via Bland');
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
console.error('unable to use new helpers.log');
|
|
47
|
+
console.error(JSON.stringify(err));
|
|
48
|
+
}
|
|
49
|
+
const { data } = await blandSdk.sendSms(sendSmsInput);
|
|
50
|
+
const conversationId = (_a = data === null || data === void 0 ? void 0 : data.data) === null || _a === void 0 ? void 0 : _a.conversation_id;
|
|
51
|
+
await onComplete({
|
|
52
|
+
data_points: {
|
|
53
|
+
conversationId: (0, lodash_1.isNil)(conversationId) ? undefined : conversationId,
|
|
54
|
+
smsResponse: (0, lodash_1.isNil)(data) ? undefined : JSON.stringify(data),
|
|
55
|
+
},
|
|
56
|
+
events: [
|
|
57
|
+
(0, addEventLog_1.addActivityEventLog)({
|
|
58
|
+
message: `SMS request sent to Bland.\nConversation ID: ${conversationId !== null && conversationId !== void 0 ? conversationId : 'n/a'}`,
|
|
59
|
+
}),
|
|
60
|
+
],
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=sendSms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sendSms.js","sourceRoot":"","sources":["../../../../../extensions/bland/actions/sendSms/sendSms.ts"],"names":[],"mappings":";;;AACA,mEAAwD;AACxD,mCAAuC;AACvC,uFAAmF;AAEnF,qCAAqE;AACrE,6CAAqD;AACrD,uEAA2E;AAE9D,QAAA,OAAO,GAIhB;IACF,GAAG,EAAE,SAAS;IACd,QAAQ,EAAE,0BAAQ,CAAC,aAAa;IAChC,KAAK,EAAE,UAAU;IACjB,WAAW,EACT,wGAAwG;IAC1G,MAAM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AC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAA;YAC9C,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAA;QACpC,CAAC;QAED,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;QAErD,MAAM,cAAc,GAAG,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,0CAAE,eAAe,CAAA;QAElD,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,cAAc,EAAE,IAAA,cAAK,EAAC,cAAc,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc;gBAClE,WAAW,EAAE,IAAA,cAAK,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;aAC5D;YACD,MAAM,EAAE;gBACN,IAAA,iCAAmB,EAAC;oBAClB,OAAO,EAAE,gDACP,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI,KACpB,EAAE;iBACH,CAAC;aACH;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AxiosResponse } from 'axios';
|
|
2
|
-
import { type SendCallResponseType, type SendCallInputType, type GetCallDetailsInputType, type GetCallDetailsResponseType, type StopActiveCallInputType, type StopActiveCallResponseType } from './schema';
|
|
2
|
+
import { type SendCallResponseType, type SendCallInputType, type GetCallDetailsInputType, type GetCallDetailsResponseType, type StopActiveCallInputType, type StopActiveCallResponseType, type SendSmsInputType, type SendSmsResponseType, type CreateSmsConversationInputType, type CreateSmsConversationResponseType } from './schema';
|
|
3
3
|
export declare class BlandApiClient {
|
|
4
4
|
private readonly client;
|
|
5
5
|
constructor({ baseUrl, apiKey }: {
|
|
@@ -8,5 +8,7 @@ export declare class BlandApiClient {
|
|
|
8
8
|
});
|
|
9
9
|
sendCall(input: SendCallInputType): Promise<AxiosResponse<SendCallResponseType>>;
|
|
10
10
|
getCallDetails(input: GetCallDetailsInputType): Promise<AxiosResponse<GetCallDetailsResponseType>>;
|
|
11
|
+
sendSms(input: SendSmsInputType): Promise<AxiosResponse<SendSmsResponseType>>;
|
|
12
|
+
createSmsConversation(input: CreateSmsConversationInputType): Promise<AxiosResponse<CreateSmsConversationResponseType>>;
|
|
11
13
|
stopActiveCall(input: StopActiveCallInputType): Promise<AxiosResponse<StopActiveCallResponseType>>;
|
|
12
14
|
}
|
|
@@ -23,6 +23,14 @@ class BlandApiClient {
|
|
|
23
23
|
const response = await this.client.get(`/calls/${input.call_id}`);
|
|
24
24
|
return response;
|
|
25
25
|
}
|
|
26
|
+
async sendSms(input) {
|
|
27
|
+
const response = await this.client.post(`/sms/send`, input);
|
|
28
|
+
return response;
|
|
29
|
+
}
|
|
30
|
+
async createSmsConversation(input) {
|
|
31
|
+
const response = await this.client.post(`/sms/create`, input);
|
|
32
|
+
return response;
|
|
33
|
+
}
|
|
26
34
|
async stopActiveCall(input) {
|
|
27
35
|
const response = await this.client.post(`/calls/${input.call_id}/stop`);
|
|
28
36
|
return response;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../extensions/bland/api/client.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAqE;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../extensions/bland/api/client.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAqE;AAcrE,MAAa,cAAc;IAGzB,YAAY,EAAE,OAAO,EAAE,MAAM,EAAuC;QAClE,IAAI,CAAC,MAAM,GAAG,eAAK,CAAC,MAAM,CAAC;YACzB,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE;gBACP,aAAa,EAAE,MAAM;gBACrB,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ,CACZ,KAAwB;QAExB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACrC,QAAQ,EACR,KAAK,CACN,CAAA;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,KAA8B;QAE9B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACpC,UAAU,KAAK,CAAC,OAAO,EAAE,CAC1B,CAAA;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,KAAK,CAAC,OAAO,CACX,KAAuB;QAEvB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACrC,WAAW,EACX,KAAK,CACN,CAAA;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,KAAK,CAAC,qBAAqB,CACzB,KAAqC;QAErC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACrC,aAAa,EACb,KAAK,CACN,CAAA;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,KAA8B;QAE9B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACrC,UAAU,KAAK,CAAC,OAAO,OAAO,CAC/B,CAAA;QAED,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF;AAjED,wCAiEC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const CreateSmsConversationInputSchema: z.ZodObject<{
|
|
3
|
+
user_number: z.ZodString;
|
|
4
|
+
agent_number: z.ZodString;
|
|
5
|
+
message: z.ZodString;
|
|
6
|
+
/**
|
|
7
|
+
* Required by the live API even though Bland docs mark it optional
|
|
8
|
+
* (omitting it returns 400 MISSING_REQUIRED_FIELDS). It is a Twilio
|
|
9
|
+
* correlation id; a generated UUID is acceptable.
|
|
10
|
+
*/
|
|
11
|
+
message_sid: z.ZodString;
|
|
12
|
+
curr_pathway_id: z.ZodOptional<z.ZodString>;
|
|
13
|
+
curr_pathway_version: z.ZodOptional<z.ZodString>;
|
|
14
|
+
current_node_id: z.ZodOptional<z.ZodString>;
|
|
15
|
+
sender: z.ZodOptional<z.ZodEnum<["USER", "AGENT"]>>;
|
|
16
|
+
new_conversation: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
request_data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
18
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
19
|
+
user_number: z.ZodString;
|
|
20
|
+
agent_number: z.ZodString;
|
|
21
|
+
message: z.ZodString;
|
|
22
|
+
/**
|
|
23
|
+
* Required by the live API even though Bland docs mark it optional
|
|
24
|
+
* (omitting it returns 400 MISSING_REQUIRED_FIELDS). It is a Twilio
|
|
25
|
+
* correlation id; a generated UUID is acceptable.
|
|
26
|
+
*/
|
|
27
|
+
message_sid: z.ZodString;
|
|
28
|
+
curr_pathway_id: z.ZodOptional<z.ZodString>;
|
|
29
|
+
curr_pathway_version: z.ZodOptional<z.ZodString>;
|
|
30
|
+
current_node_id: z.ZodOptional<z.ZodString>;
|
|
31
|
+
sender: z.ZodOptional<z.ZodEnum<["USER", "AGENT"]>>;
|
|
32
|
+
new_conversation: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
request_data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
34
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
35
|
+
user_number: z.ZodString;
|
|
36
|
+
agent_number: z.ZodString;
|
|
37
|
+
message: z.ZodString;
|
|
38
|
+
/**
|
|
39
|
+
* Required by the live API even though Bland docs mark it optional
|
|
40
|
+
* (omitting it returns 400 MISSING_REQUIRED_FIELDS). It is a Twilio
|
|
41
|
+
* correlation id; a generated UUID is acceptable.
|
|
42
|
+
*/
|
|
43
|
+
message_sid: z.ZodString;
|
|
44
|
+
curr_pathway_id: z.ZodOptional<z.ZodString>;
|
|
45
|
+
curr_pathway_version: z.ZodOptional<z.ZodString>;
|
|
46
|
+
current_node_id: z.ZodOptional<z.ZodString>;
|
|
47
|
+
sender: z.ZodOptional<z.ZodEnum<["USER", "AGENT"]>>;
|
|
48
|
+
new_conversation: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
request_data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
50
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
51
|
+
export type CreateSmsConversationInputType = z.infer<typeof CreateSmsConversationInputSchema>;
|
|
52
|
+
export declare const CreateSmsConversationResponseSchema: z.ZodObject<{
|
|
53
|
+
data: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
54
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
55
|
+
status: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
57
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
58
|
+
status: z.ZodOptional<z.ZodString>;
|
|
59
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
60
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
61
|
+
status: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
63
|
+
errors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodAny, "many">>>;
|
|
64
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
65
|
+
data: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
66
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
67
|
+
status: z.ZodOptional<z.ZodString>;
|
|
68
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
69
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
70
|
+
status: z.ZodOptional<z.ZodString>;
|
|
71
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
72
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
73
|
+
status: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
75
|
+
errors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodAny, "many">>>;
|
|
76
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
77
|
+
data: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
78
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
79
|
+
status: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
81
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
82
|
+
status: z.ZodOptional<z.ZodString>;
|
|
83
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
84
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
85
|
+
status: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
87
|
+
errors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodAny, "many">>>;
|
|
88
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
89
|
+
export type CreateSmsConversationResponseType = z.infer<typeof CreateSmsConversationResponseSchema>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateSmsConversationResponseSchema = exports.CreateSmsConversationInputSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.CreateSmsConversationInputSchema = zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
user_number: zod_1.z.string().min(1), // For best results, use the E.164 format.
|
|
8
|
+
agent_number: zod_1.z.string().min(1), // Must be a Bland-owned SMS-enabled number.
|
|
9
|
+
message: zod_1.z.string().min(1), // The message seeded into the conversation (recorded, not sent).
|
|
10
|
+
/**
|
|
11
|
+
* Required by the live API even though Bland docs mark it optional
|
|
12
|
+
* (omitting it returns 400 MISSING_REQUIRED_FIELDS). It is a Twilio
|
|
13
|
+
* correlation id; a generated UUID is acceptable.
|
|
14
|
+
*/
|
|
15
|
+
message_sid: zod_1.z.string().min(1),
|
|
16
|
+
curr_pathway_id: zod_1.z.string().optional(),
|
|
17
|
+
curr_pathway_version: zod_1.z.string().optional(),
|
|
18
|
+
current_node_id: zod_1.z.string().optional(),
|
|
19
|
+
sender: zod_1.z.enum(['USER', 'AGENT']).optional(),
|
|
20
|
+
new_conversation: zod_1.z.boolean().optional(),
|
|
21
|
+
request_data: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
22
|
+
})
|
|
23
|
+
.passthrough();
|
|
24
|
+
exports.CreateSmsConversationResponseSchema = zod_1.z
|
|
25
|
+
.object({
|
|
26
|
+
data: zod_1.z
|
|
27
|
+
.object({
|
|
28
|
+
conversation_id: zod_1.z.string().optional(),
|
|
29
|
+
status: zod_1.z.string().optional(),
|
|
30
|
+
})
|
|
31
|
+
.passthrough()
|
|
32
|
+
.nullish(),
|
|
33
|
+
errors: zod_1.z.array(zod_1.z.any()).nullish(),
|
|
34
|
+
})
|
|
35
|
+
.passthrough();
|
|
36
|
+
//# sourceMappingURL=CreateSmsConversation.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateSmsConversation.schema.js","sourceRoot":"","sources":["../../../../../extensions/bland/api/schema/CreateSmsConversation.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,gCAAgC,GAAG,OAAC;KAC9C,MAAM,CAAC;IACN,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,0CAA0C;IAC1E,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC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.ZodString;
|
|
5
|
+
agent_message: z.ZodOptional<z.ZodString>;
|
|
6
|
+
pathway_id: z.ZodOptional<z.ZodString>;
|
|
7
|
+
new_conversation: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
request_data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
9
|
+
webhook: z.ZodOptional<z.ZodString>;
|
|
10
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
11
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
12
|
+
user_number: z.ZodString;
|
|
13
|
+
agent_number: z.ZodString;
|
|
14
|
+
agent_message: z.ZodOptional<z.ZodString>;
|
|
15
|
+
pathway_id: z.ZodOptional<z.ZodString>;
|
|
16
|
+
new_conversation: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
+
request_data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
18
|
+
webhook: z.ZodOptional<z.ZodString>;
|
|
19
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
20
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
21
|
+
user_number: z.ZodString;
|
|
22
|
+
agent_number: z.ZodString;
|
|
23
|
+
agent_message: z.ZodOptional<z.ZodString>;
|
|
24
|
+
pathway_id: z.ZodOptional<z.ZodString>;
|
|
25
|
+
new_conversation: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
request_data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
27
|
+
webhook: z.ZodOptional<z.ZodString>;
|
|
28
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
29
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
30
|
+
export type SendSmsInputType = z.infer<typeof SendSmsInputSchema>;
|
|
31
|
+
export declare const SendSmsResponseSchema: z.ZodObject<{
|
|
32
|
+
data: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
33
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
34
|
+
message_id: z.ZodOptional<z.ZodString>;
|
|
35
|
+
status: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
37
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
38
|
+
message_id: z.ZodOptional<z.ZodString>;
|
|
39
|
+
status: z.ZodOptional<z.ZodString>;
|
|
40
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
41
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
42
|
+
message_id: z.ZodOptional<z.ZodString>;
|
|
43
|
+
status: z.ZodOptional<z.ZodString>;
|
|
44
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
45
|
+
errors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodAny, "many">>>;
|
|
46
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
47
|
+
data: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
48
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
49
|
+
message_id: z.ZodOptional<z.ZodString>;
|
|
50
|
+
status: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
52
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
53
|
+
message_id: z.ZodOptional<z.ZodString>;
|
|
54
|
+
status: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
56
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
57
|
+
message_id: z.ZodOptional<z.ZodString>;
|
|
58
|
+
status: z.ZodOptional<z.ZodString>;
|
|
59
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
60
|
+
errors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodAny, "many">>>;
|
|
61
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
62
|
+
data: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
63
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
64
|
+
message_id: z.ZodOptional<z.ZodString>;
|
|
65
|
+
status: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
67
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
68
|
+
message_id: z.ZodOptional<z.ZodString>;
|
|
69
|
+
status: z.ZodOptional<z.ZodString>;
|
|
70
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
71
|
+
conversation_id: z.ZodOptional<z.ZodString>;
|
|
72
|
+
message_id: z.ZodOptional<z.ZodString>;
|
|
73
|
+
status: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
75
|
+
errors: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodAny, "many">>>;
|
|
76
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
77
|
+
export type SendSmsResponseType = z.infer<typeof SendSmsResponseSchema>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SendSmsResponseSchema = exports.SendSmsInputSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.SendSmsInputSchema = zod_1.z
|
|
6
|
+
.object({
|
|
7
|
+
user_number: zod_1.z.string().min(1), // For best results, use the E.164 format.
|
|
8
|
+
agent_number: zod_1.z.string().min(1), // Must be a Bland-owned SMS-enabled number.
|
|
9
|
+
agent_message: zod_1.z.string().optional(), // When omitted, the pathway generates the message.
|
|
10
|
+
pathway_id: zod_1.z.string().optional(),
|
|
11
|
+
new_conversation: zod_1.z.boolean().optional(),
|
|
12
|
+
request_data: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
13
|
+
webhook: zod_1.z.string().optional(),
|
|
14
|
+
metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).optional(),
|
|
15
|
+
})
|
|
16
|
+
.passthrough();
|
|
17
|
+
exports.SendSmsResponseSchema = zod_1.z
|
|
18
|
+
.object({
|
|
19
|
+
data: zod_1.z
|
|
20
|
+
.object({
|
|
21
|
+
conversation_id: zod_1.z.string().optional(),
|
|
22
|
+
message_id: zod_1.z.string().optional(),
|
|
23
|
+
status: zod_1.z.string().optional(),
|
|
24
|
+
})
|
|
25
|
+
.passthrough()
|
|
26
|
+
.nullish(),
|
|
27
|
+
errors: zod_1.z.array(zod_1.z.any()).nullish(),
|
|
28
|
+
})
|
|
29
|
+
.passthrough();
|
|
30
|
+
//# sourceMappingURL=SendSms.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SendSms.schema.js","sourceRoot":"","sources":["../../../../../extensions/bland/api/schema/SendSms.schema.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,kBAAkB,GAAG,OAAC;KAChC,MAAM,CAAC;IACN,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,0CAA0C;IAC1E,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,4CAA4C;IAC7E,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,mDAAmD;IACzF,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,gBAAgB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACxC,YAAY,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtD,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC;KACD,WAAW,EAAE,CAAA;AAIH,QAAA,qBAAqB,GAAG,OAAC;KACnC,MAAM,CAAC;IACN,IAAI,EAAE,OAAC;SACJ,MAAM,CAAC;QACN,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACtC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACjC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC9B,CAAC;SACD,WAAW,EAAE;SACb,OAAO,EAAE;IACZ,MAAM,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,EAAE;CACnC,CAAC;KACD,WAAW,EAAE,CAAA"}
|
|
@@ -17,4 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./SendCall.schema"), exports);
|
|
18
18
|
__exportStar(require("./GetCallDetails.schema"), exports);
|
|
19
19
|
__exportStar(require("./StopActiveCall.schema"), exports);
|
|
20
|
+
__exportStar(require("./SendSms.schema"), exports);
|
|
21
|
+
__exportStar(require("./CreateSmsConversation.schema"), exports);
|
|
20
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/bland/api/schema/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAiC;AACjC,0DAAuC;AACvC,0DAAuC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/bland/api/schema/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAiC;AACjC,0DAAuC;AACvC,0DAAuC;AACvC,mDAAgC;AAChC,iEAA8C"}
|
|
@@ -70,10 +70,10 @@ export declare const messageThreadSchema: z.ZodObject<{
|
|
|
70
70
|
}>, "many">;
|
|
71
71
|
}, "strip", z.ZodTypeAny, {
|
|
72
72
|
patient: number;
|
|
73
|
+
sender: number;
|
|
73
74
|
practice: number;
|
|
74
75
|
document_date: string;
|
|
75
76
|
chart_date: string;
|
|
76
|
-
sender: number;
|
|
77
77
|
is_urgent: boolean;
|
|
78
78
|
members: {
|
|
79
79
|
status: "Addressed" | "Requiring Action";
|
|
@@ -87,10 +87,10 @@ export declare const messageThreadSchema: z.ZodObject<{
|
|
|
87
87
|
}[];
|
|
88
88
|
}, {
|
|
89
89
|
patient: number;
|
|
90
|
+
sender: number;
|
|
90
91
|
practice: number;
|
|
91
92
|
document_date: string;
|
|
92
93
|
chart_date: string;
|
|
93
|
-
sender: number;
|
|
94
94
|
is_urgent: boolean;
|
|
95
95
|
members: {
|
|
96
96
|
status: "Addressed" | "Requiring Action";
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"bland": {
|
|
23
23
|
"readme": "---\ntitle: Bland.ai\ndescription: To do\n---\n\n# Bland.ai\n\nWith Bland.ai you can build, test, and deploy AI phone calling agents. \n\n## Extension settings\n\nTo set up this extension, you will need to provide an API key for Bland.\n\n## Actions\n\n### Send call (with Pathway)\n\nInitiates an AI phone call using a simple prompt or a conversational pathway agent built on the Bland platform. This action is asynchronous—it triggers a call request in Bland, which queues the call. Note that the action only confirms that Bland has received the request; it does not wait for the call to complete or handle any callbacks from Bland.\n\nAwell lets you specify both the data you want to send to Bland and the structured data you’d like to receive in return. This is achieved by defining the request data for outgoing information and an analysis schema for the structured data you’ll get back.\n\n#### Request data\n\nAny JSON you put in here will be visible to the AI agent during the call - and can also be referenced with Prompt Variables.\n\nFor example, let’s say in the action you want to programmatically set the name of the person you’re calling. You could set request data to:\n\n```json\n{\n \"name\": \"John Doe\",\n}\n```\n\n[Also see Bland documentation.](https://docs.bland.ai/api-v1/post/calls)\n\n#### Analysis schema\n\nDefine a JSON schema for how you want to get information about the call - information like email addresses, names, appointment times or any other type of custom data.\n\nFor example, if you wanted to retrieve this information from the call:\n\n```json\n{\n \"email_address\": \"email\",\n \"first_name\": \"string\",\n \"last_name\": \"string\",\n \"wants_to_book_appointment\": \"boolean\",\n \"appointment_time\": \"YYYY-MM-DD HH:MM:SS\"\n}\n```\n\nWhen retrieving the call details, Bland will return data about the call in the following format:\n\n```json\n{\n \"analysis\": {\n \"email_address\": \"johndoe@gmail.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"wants_to_book_appointment\": true,\n \"appointment_time\": \"2024-01-01 12:00:00\"\n }\n}\n```\n\n[Also see Bland documentation.](https://docs.bland.ai/api-v1/post/calls)\n\n### Get call details\n\nRetrieve the details of a call based on the provider call ID.",
|
|
24
|
-
"changelog": "# CHANGELOG"
|
|
24
|
+
"changelog": "# CHANGELOG\n\n## Unreleased\n\n- Added `sendSms` action: send an SMS immediately via Bland `POST /v1/sms/send`. The agent message is optional; when omitted, the pathway configured on the agent number generates the message.\n- Added `createSmsConversation` action: seed an SMS conversation positioned at pathway state via Bland `POST /v1/sms/create` without sending a message.\n"
|
|
25
25
|
},
|
|
26
26
|
"braze": {
|
|
27
27
|
"readme": "---\ntitle: Braze\ndescription: Braze is a customer engagement platform that helps you communicate with your patients.\n---\n\n# Braze\n\nBraze is a comprehensive customer engagement platform that specializes in helping businesses connect with their users through personalized messaging channels.\n\n## Extension settings\n\nAn api key and the REST Endpoint URL are needed to be provided in order for the extension to authenticate with Braze's API. \n\nAn app ID can also be specified via the extension settings or the action field. Actions requiring an app ID to be provided will throw an error if no app ID is provided via the extension settings or the action field. If both are provided, the app ID from the action field will be used.\n\nList of URLs can be found [here](https://www.braze.com/docs/api/basics/#endpoints) - make sure it's the REST Endpoint URL. Documentation on API keys can be found [here](https://www.braze.com/docs/api/basics/#about-rest-api-keys).\n\n## Supported Actins\n\n### Send SMS\n\nSend an immediate SMS message to a specified user\n\nRequired permissions: `messages.send`\n\n### Schedule SMS\n\nSchedule an SMS message to be sent at a specific time\n\nRequired permissions: `messages.schedule.create`\n\n### Send Email\n\nSend an immediate email to a specified user\n\nRequired permissions: `messages.send`\n\n### Schedule Email\n\nSchedule an email to be sent at a specific time\n\nRequired permissions: `messages.schedule.create`\n\n### Send Email Using Template\n\nSend an email using a pre-defined Braze template\n\nRequired permissions: `messages.send`\n\n### Send campaign\n\nSend a campaign message.\n\nRequired permissions: `campaigns.trigger.send`\n",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awell-health/awell-extensions",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.138",
|
|
4
4
|
"packageManager": "yarn@4.5.3",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -19,11 +19,13 @@
|
|
|
19
19
|
"start": "node dist/src/index.js",
|
|
20
20
|
"lint": "eslint \"**/*.{ts,tsx}\"",
|
|
21
21
|
"test": "jest --verbose --testPathIgnorePatterns '.*\\.local\\.test\\.ts$'",
|
|
22
|
+
"test-file": "jest --verbose --testPathIgnorePatterns='.*\\.local\\.test\\.ts$' --testPathPattern",
|
|
22
23
|
"test-local": "jest --verbose",
|
|
23
24
|
"prepack": "yarn build",
|
|
24
25
|
"test-server": "ts-node-dev --respawn --transpile-only ./src/test-server.ts",
|
|
25
26
|
"prepare": "husky",
|
|
26
|
-
"generate-extension": "ts-node ./scripts/generate-extension.ts"
|
|
27
|
+
"generate-extension": "ts-node ./scripts/generate-extension.ts",
|
|
28
|
+
"cli": "ts-node --transpile-only ./cli/src/index.ts"
|
|
27
29
|
},
|
|
28
30
|
"types": "dist/src/index.d.ts",
|
|
29
31
|
"exports": {
|