@awell-health/awell-extensions 1.1.22 → 1.1.24
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/extensions/elation/actions/index.d.ts +122 -0
- package/dist/extensions/elation/actions/index.js +2 -2
- package/dist/extensions/elation/actions/index.js.map +1 -1
- package/dist/extensions/twilio/common/validation.d.ts +7 -0
- package/dist/extensions/twilio/common/validation.js +7 -1
- package/dist/extensions/twilio/common/validation.js.map +1 -1
- package/dist/extensions/twilio/index.js +1 -0
- package/dist/extensions/twilio/index.js.map +1 -1
- package/dist/extensions/twilio/v2/actions/createFlowExecution/config/actionSchema.d.ts +195 -0
- package/dist/extensions/twilio/v2/actions/createFlowExecution/config/actionSchema.js +37 -0
- package/dist/extensions/twilio/v2/actions/createFlowExecution/config/actionSchema.js.map +1 -0
- package/dist/extensions/twilio/v2/actions/createFlowExecution/config/dataPoints.d.ts +6 -0
- package/dist/extensions/twilio/v2/actions/createFlowExecution/config/dataPoints.js +10 -0
- package/dist/extensions/twilio/v2/actions/createFlowExecution/config/dataPoints.js.map +1 -0
- package/dist/extensions/twilio/v2/actions/createFlowExecution/config/fields.d.ts +66 -0
- package/dist/extensions/twilio/v2/actions/createFlowExecution/config/fields.js +46 -0
- package/dist/extensions/twilio/v2/actions/createFlowExecution/config/fields.js.map +1 -0
- package/dist/extensions/twilio/v2/actions/createFlowExecution/config/index.d.ts +3 -0
- package/dist/extensions/twilio/v2/actions/createFlowExecution/config/index.js +11 -0
- package/dist/extensions/twilio/v2/actions/createFlowExecution/config/index.js.map +1 -0
- package/dist/extensions/twilio/v2/actions/createFlowExecution/createFlowExecution.d.ts +4 -0
- package/dist/extensions/twilio/v2/actions/createFlowExecution/createFlowExecution.js +44 -0
- package/dist/extensions/twilio/v2/actions/createFlowExecution/createFlowExecution.js.map +1 -0
- package/dist/extensions/twilio/v2/actions/createFlowExecution/index.d.ts +1 -0
- package/dist/extensions/twilio/v2/actions/createFlowExecution/index.js +6 -0
- package/dist/extensions/twilio/v2/actions/createFlowExecution/index.js.map +1 -0
- package/dist/extensions/twilio/v2/actions/index.d.ts +1 -0
- package/dist/extensions/twilio/v2/actions/index.js +3 -1
- package/dist/extensions/twilio/v2/actions/index.js.map +1 -1
- package/package.json +1 -1
@@ -848,6 +848,128 @@ export declare const actions: {
|
|
848
848
|
required: true;
|
849
849
|
};
|
850
850
|
}, "nonVisitNoteId" | "nonVisitNoteBulletId">;
|
851
|
+
updateNonVisitNote: import("@awell-health/extensions-core").Action<{
|
852
|
+
nonVisitNoteId: {
|
853
|
+
id: string;
|
854
|
+
label: string;
|
855
|
+
description: string;
|
856
|
+
type: import("@awell-health/extensions-core").FieldType.NUMERIC;
|
857
|
+
required: true;
|
858
|
+
};
|
859
|
+
nonVisitNoteBulletId: {
|
860
|
+
id: string;
|
861
|
+
label: string;
|
862
|
+
description: string;
|
863
|
+
type: import("@awell-health/extensions-core").FieldType.NUMERIC;
|
864
|
+
required: false;
|
865
|
+
};
|
866
|
+
text: {
|
867
|
+
id: string;
|
868
|
+
label: string;
|
869
|
+
description: string;
|
870
|
+
type: import("@awell-health/extensions-core").FieldType.TEXT;
|
871
|
+
required: false;
|
872
|
+
};
|
873
|
+
authorId: {
|
874
|
+
id: string;
|
875
|
+
label: string;
|
876
|
+
description: string;
|
877
|
+
type: import("@awell-health/extensions-core").FieldType.NUMERIC;
|
878
|
+
required: false;
|
879
|
+
};
|
880
|
+
patientId: {
|
881
|
+
id: string;
|
882
|
+
label: string;
|
883
|
+
description: string;
|
884
|
+
type: import("@awell-health/extensions-core").FieldType.NUMERIC;
|
885
|
+
required: false;
|
886
|
+
};
|
887
|
+
category: {
|
888
|
+
id: string;
|
889
|
+
label: string;
|
890
|
+
description: string;
|
891
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
892
|
+
required: false;
|
893
|
+
};
|
894
|
+
practiceId: {
|
895
|
+
id: string;
|
896
|
+
label: string;
|
897
|
+
description: string;
|
898
|
+
type: import("@awell-health/extensions-core").FieldType.NUMERIC;
|
899
|
+
required: false;
|
900
|
+
};
|
901
|
+
documentDate: {
|
902
|
+
id: string;
|
903
|
+
label: string;
|
904
|
+
description: string;
|
905
|
+
type: import("@awell-health/extensions-core").FieldType.DATE;
|
906
|
+
required: false;
|
907
|
+
};
|
908
|
+
chartDate: {
|
909
|
+
id: string;
|
910
|
+
label: string;
|
911
|
+
description: string;
|
912
|
+
type: import("@awell-health/extensions-core").FieldType.DATE;
|
913
|
+
required: false;
|
914
|
+
};
|
915
|
+
tags: {
|
916
|
+
id: string;
|
917
|
+
label: string;
|
918
|
+
description: string;
|
919
|
+
type: import("@awell-health/extensions-core").FieldType.STRING;
|
920
|
+
required: false;
|
921
|
+
};
|
922
|
+
signed_by: {
|
923
|
+
id: string;
|
924
|
+
label: string;
|
925
|
+
description: string;
|
926
|
+
type: import("@awell-health/extensions-core").FieldType.NUMERIC;
|
927
|
+
required: false;
|
928
|
+
};
|
929
|
+
}, {
|
930
|
+
base_url: {
|
931
|
+
key: string;
|
932
|
+
label: string;
|
933
|
+
obfuscated: false;
|
934
|
+
description: string;
|
935
|
+
required: true;
|
936
|
+
};
|
937
|
+
auth_url: {
|
938
|
+
key: string;
|
939
|
+
label: string;
|
940
|
+
obfuscated: false;
|
941
|
+
description: string;
|
942
|
+
required: true;
|
943
|
+
};
|
944
|
+
client_id: {
|
945
|
+
key: string;
|
946
|
+
label: string;
|
947
|
+
obfuscated: false;
|
948
|
+
description: string;
|
949
|
+
required: true;
|
950
|
+
};
|
951
|
+
client_secret: {
|
952
|
+
key: string;
|
953
|
+
label: string;
|
954
|
+
obfuscated: true;
|
955
|
+
description: string;
|
956
|
+
required: true;
|
957
|
+
};
|
958
|
+
username: {
|
959
|
+
key: string;
|
960
|
+
label: string;
|
961
|
+
obfuscated: false;
|
962
|
+
description: string;
|
963
|
+
required: true;
|
964
|
+
};
|
965
|
+
password: {
|
966
|
+
key: string;
|
967
|
+
label: string;
|
968
|
+
obfuscated: true;
|
969
|
+
description: string;
|
970
|
+
required: true;
|
971
|
+
};
|
972
|
+
}, string>;
|
851
973
|
getNonVisitNote: import("@awell-health/extensions-core").Action<{
|
852
974
|
nonVisitNoteId: {
|
853
975
|
id: string;
|
@@ -9,7 +9,7 @@ const getAppointment_1 = require("./getAppointment");
|
|
9
9
|
const findAppointments_1 = require("./findAppointments");
|
10
10
|
const findPhysician_1 = require("./findPhysician");
|
11
11
|
const createNonVisitNote_1 = require("./createNonVisitNote");
|
12
|
-
|
12
|
+
const updateNonVisitNote_1 = require("./updateNonVisitNote");
|
13
13
|
const getNonVisitNote_1 = require("./getNonVisitNote");
|
14
14
|
const deleteNonVisitNote_1 = require("./deleteNonVisitNote");
|
15
15
|
const getPhysician_1 = require("./getPhysician");
|
@@ -25,7 +25,7 @@ exports.actions = {
|
|
25
25
|
getPhysician: getPhysician_1.getPhysician,
|
26
26
|
findPhysician: findPhysician_1.findPhysician,
|
27
27
|
createNonVisitNote: createNonVisitNote_1.createNonVisitNote,
|
28
|
-
|
28
|
+
updateNonVisitNote: updateNonVisitNote_1.updateNonVisitNote,
|
29
29
|
getNonVisitNote: getNonVisitNote_1.getNonVisitNote,
|
30
30
|
deleteNonVisitNote: deleteNonVisitNote_1.deleteNonVisitNote,
|
31
31
|
postLetter: postLetter_1.postLetter,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/elation/actions/index.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AACzC,mDAA+C;AAC/C,mDAA+C;AAC/C,2DAAuD;AACvD,qDAAiD;AACjD,yDAAqD;AACrD,mDAA+C;AAC/C,6DAAyD;AACzD,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/elation/actions/index.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AACzC,mDAA+C;AAC/C,mDAA+C;AAC/C,2DAAuD;AACvD,qDAAiD;AACjD,yDAAqD;AACrD,mDAA+C;AAC/C,6DAAyD;AACzD,6DAAyD;AACzD,uDAAmD;AACnD,6DAAyD;AACzD,iDAA6C;AAC7C,6CAAyC;AACzC,qDAAiD;AAEpC,QAAA,OAAO,GAAG;IACrB,UAAU,EAAV,uBAAU;IACV,aAAa,EAAb,6BAAa;IACb,aAAa,EAAb,6BAAa;IACb,iBAAiB,EAAjB,qCAAiB;IACjB,cAAc,EAAd,+BAAc;IACd,gBAAgB,EAAhB,mCAAgB;IAChB,YAAY,EAAZ,2BAAY;IACZ,aAAa,EAAb,6BAAa;IACb,kBAAkB,EAAlB,uCAAkB;IAClB,kBAAkB,EAAlB,uCAAkB;IAClB,eAAe,EAAf,iCAAe;IACf,kBAAkB,EAAlB,uCAAkB;IAClB,UAAU,EAAV,uBAAU;IACV,cAAc,EAAd,+BAAc;CACf,CAAA"}
|
@@ -1,2 +1,9 @@
|
|
1
1
|
import { z } from 'zod';
|
2
2
|
export declare const MessageValidationSchema: z.ZodString;
|
3
|
+
export declare const ParametersValidationSchema: z.ZodObject<{
|
4
|
+
patient_id: z.ZodOptional<z.ZodAny>;
|
5
|
+
}, "strip", z.ZodAny, z.objectOutputType<{
|
6
|
+
patient_id: z.ZodOptional<z.ZodAny>;
|
7
|
+
}, z.ZodAny, "strip">, z.objectInputType<{
|
8
|
+
patient_id: z.ZodOptional<z.ZodAny>;
|
9
|
+
}, z.ZodAny, "strip">>;
|
@@ -1,9 +1,15 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.MessageValidationSchema = void 0;
|
3
|
+
exports.ParametersValidationSchema = exports.MessageValidationSchema = void 0;
|
4
4
|
const zod_1 = require("zod");
|
5
5
|
exports.MessageValidationSchema = zod_1.z
|
6
6
|
.string()
|
7
7
|
.min(1, { message: 'Missing or empty message' })
|
8
8
|
.max(1600, { message: 'Message can not be longer than 1600 characters' });
|
9
|
+
// The expectation here is that any object can be passed
|
10
|
+
exports.ParametersValidationSchema = zod_1.z
|
11
|
+
.object({
|
12
|
+
patient_id: zod_1.z.any().optional(),
|
13
|
+
})
|
14
|
+
.catchall(zod_1.z.any());
|
9
15
|
//# sourceMappingURL=validation.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../extensions/twilio/common/validation.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,uBAAuB,GAAG,OAAC;KACrC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE,CAAC;KAC/C,GAAG,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,gDAAgD,EAAE,CAAC,CAAA"}
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../extensions/twilio/common/validation.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,uBAAuB,GAAG,OAAC;KACrC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE,CAAC;KAC/C,GAAG,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,gDAAgD,EAAE,CAAC,CAAA;AAE3E,wDAAwD;AAC3C,QAAA,0BAA0B,GAAG,OAAC;KACxC,MAAM,CAAC;IACN,UAAU,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC;KACD,QAAQ,CAAC,OAAC,CAAC,GAAG,EAAE,CAAC,CAAA"}
|
@@ -18,6 +18,7 @@ exports.Twilio = {
|
|
18
18
|
sendSmsWithMessagingService: actions_1.sendSmsWithMessagingService,
|
19
19
|
getMessages: actions_1.getMessages,
|
20
20
|
sendSmsDuringBusinessHours: actions_1.sendSmsDuringBusinessHours,
|
21
|
+
createFlowExecution: actions_1.createFlowExecution,
|
21
22
|
},
|
22
23
|
settings: settings_1.settings,
|
23
24
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/twilio/index.ts"],"names":[],"mappings":";;;AACA,mEAAoE;AACpE,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/twilio/index.ts"],"names":[],"mappings":";;;AACA,mEAAoE;AACpE,0CAMqB;AACrB,yCAAqC;AAExB,QAAA,MAAM,GAAc;IAC/B,GAAG,EAAE,QAAQ;IACb,KAAK,EAAE,QAAQ;IACf,QAAQ,EAAE,0DAA0D;IACpE,WAAW,EAAE,sDAAsD;IACnE,QAAQ,EAAE,0BAAQ,CAAC,aAAa;IAChC,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,OAAO,EAAE;QACP,OAAO,EAAP,iBAAO;QACP,2BAA2B,EAA3B,qCAA2B;QAC3B,WAAW,EAAX,qBAAW;QACX,0BAA0B,EAA1B,oCAA0B;QAC1B,mBAAmB,EAAnB,6BAAmB;KACpB;IACD,QAAQ,EAAR,mBAAQ;CACT,CAAA"}
|
@@ -0,0 +1,195 @@
|
|
1
|
+
import z from 'zod';
|
2
|
+
export declare const CreateFlowExecutionSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
3
|
+
settings: z.ZodObject<{
|
4
|
+
accountSid: z.ZodString;
|
5
|
+
authToken: z.ZodString;
|
6
|
+
fromNumber: z.ZodUnion<[z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, import("libphonenumber-js").PhoneNumber | import("libphonenumber-js").ParseError, string>, import("libphonenumber-js").PhoneNumber | import("libphonenumber-js").ParseError, string>, import("libphonenumber-js").E164Number, string>>, z.ZodEffects<z.ZodLiteral<"">, undefined, "">]>;
|
7
|
+
messagingServiceSid: z.ZodOptional<z.ZodString>;
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
9
|
+
accountSid: string;
|
10
|
+
authToken: string;
|
11
|
+
fromNumber?: import("libphonenumber-js").E164Number | undefined;
|
12
|
+
messagingServiceSid?: string | undefined;
|
13
|
+
}, {
|
14
|
+
accountSid: string;
|
15
|
+
authToken: string;
|
16
|
+
fromNumber?: string | undefined;
|
17
|
+
messagingServiceSid?: string | undefined;
|
18
|
+
}>;
|
19
|
+
fields: z.ZodObject<{
|
20
|
+
recipient: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, import("libphonenumber-js").PhoneNumber | import("libphonenumber-js").ParseError, string>, import("libphonenumber-js").PhoneNumber | import("libphonenumber-js").ParseError, string>, import("libphonenumber-js").E164Number, string>;
|
21
|
+
from: z.ZodUnion<[z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, import("libphonenumber-js").PhoneNumber | import("libphonenumber-js").ParseError, string>, import("libphonenumber-js").PhoneNumber | import("libphonenumber-js").ParseError, string>, import("libphonenumber-js").E164Number, string>>, z.ZodEffects<z.ZodLiteral<"">, undefined, "">]>;
|
22
|
+
parameters: z.ZodObject<{
|
23
|
+
patient_id: z.ZodOptional<z.ZodAny>;
|
24
|
+
}, "strip", z.ZodAny, z.objectOutputType<{
|
25
|
+
patient_id: z.ZodOptional<z.ZodAny>;
|
26
|
+
}, z.ZodAny, "strip">, z.objectInputType<{
|
27
|
+
patient_id: z.ZodOptional<z.ZodAny>;
|
28
|
+
}, z.ZodAny, "strip">>;
|
29
|
+
flow_id: z.ZodString;
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
31
|
+
recipient: string & {
|
32
|
+
__tag?: "E164Number" | undefined;
|
33
|
+
};
|
34
|
+
flow_id: string;
|
35
|
+
parameters: {
|
36
|
+
patient_id?: any;
|
37
|
+
} & {
|
38
|
+
[k: string]: any;
|
39
|
+
};
|
40
|
+
from?: import("libphonenumber-js").E164Number | undefined;
|
41
|
+
}, {
|
42
|
+
recipient: string;
|
43
|
+
flow_id: string;
|
44
|
+
parameters: {
|
45
|
+
patient_id?: any;
|
46
|
+
} & {
|
47
|
+
[k: string]: any;
|
48
|
+
};
|
49
|
+
from?: string | undefined;
|
50
|
+
}>;
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
52
|
+
settings: {
|
53
|
+
accountSid: string;
|
54
|
+
authToken: string;
|
55
|
+
fromNumber?: import("libphonenumber-js").E164Number | undefined;
|
56
|
+
messagingServiceSid?: string | undefined;
|
57
|
+
};
|
58
|
+
fields: {
|
59
|
+
recipient: string & {
|
60
|
+
__tag?: "E164Number" | undefined;
|
61
|
+
};
|
62
|
+
flow_id: string;
|
63
|
+
parameters: {
|
64
|
+
patient_id?: any;
|
65
|
+
} & {
|
66
|
+
[k: string]: any;
|
67
|
+
};
|
68
|
+
from?: import("libphonenumber-js").E164Number | undefined;
|
69
|
+
};
|
70
|
+
}, {
|
71
|
+
settings: {
|
72
|
+
accountSid: string;
|
73
|
+
authToken: string;
|
74
|
+
fromNumber?: string | undefined;
|
75
|
+
messagingServiceSid?: string | undefined;
|
76
|
+
};
|
77
|
+
fields: {
|
78
|
+
recipient: string;
|
79
|
+
flow_id: string;
|
80
|
+
parameters: {
|
81
|
+
patient_id?: any;
|
82
|
+
} & {
|
83
|
+
[k: string]: any;
|
84
|
+
};
|
85
|
+
from?: string | undefined;
|
86
|
+
};
|
87
|
+
}>, {
|
88
|
+
settings: {
|
89
|
+
accountSid: string;
|
90
|
+
authToken: string;
|
91
|
+
fromNumber?: import("libphonenumber-js").E164Number | undefined;
|
92
|
+
messagingServiceSid?: string | undefined;
|
93
|
+
};
|
94
|
+
fields: {
|
95
|
+
recipient: string & {
|
96
|
+
__tag?: "E164Number" | undefined;
|
97
|
+
};
|
98
|
+
flow_id: string;
|
99
|
+
parameters: {
|
100
|
+
patient_id?: any;
|
101
|
+
} & {
|
102
|
+
[k: string]: any;
|
103
|
+
};
|
104
|
+
from?: import("libphonenumber-js").E164Number | undefined;
|
105
|
+
};
|
106
|
+
}, {
|
107
|
+
settings: {
|
108
|
+
accountSid: string;
|
109
|
+
authToken: string;
|
110
|
+
fromNumber?: string | undefined;
|
111
|
+
messagingServiceSid?: string | undefined;
|
112
|
+
};
|
113
|
+
fields: {
|
114
|
+
recipient: string;
|
115
|
+
flow_id: string;
|
116
|
+
parameters: {
|
117
|
+
patient_id?: any;
|
118
|
+
} & {
|
119
|
+
[k: string]: any;
|
120
|
+
};
|
121
|
+
from?: string | undefined;
|
122
|
+
};
|
123
|
+
}>, {
|
124
|
+
settings: {
|
125
|
+
accountSid: string;
|
126
|
+
authToken: string;
|
127
|
+
fromNumber?: import("libphonenumber-js").E164Number | undefined;
|
128
|
+
messagingServiceSid?: string | undefined;
|
129
|
+
};
|
130
|
+
fields: {
|
131
|
+
from: import("libphonenumber-js").E164Number | undefined;
|
132
|
+
recipient: string & {
|
133
|
+
__tag?: "E164Number" | undefined;
|
134
|
+
};
|
135
|
+
flow_id: string;
|
136
|
+
parameters: {
|
137
|
+
patient_id?: any;
|
138
|
+
} & {
|
139
|
+
[k: string]: any;
|
140
|
+
};
|
141
|
+
};
|
142
|
+
}, {
|
143
|
+
settings: {
|
144
|
+
accountSid: string;
|
145
|
+
authToken: string;
|
146
|
+
fromNumber?: string | undefined;
|
147
|
+
messagingServiceSid?: string | undefined;
|
148
|
+
};
|
149
|
+
fields: {
|
150
|
+
recipient: string;
|
151
|
+
flow_id: string;
|
152
|
+
parameters: {
|
153
|
+
patient_id?: any;
|
154
|
+
} & {
|
155
|
+
[k: string]: any;
|
156
|
+
};
|
157
|
+
from?: string | undefined;
|
158
|
+
};
|
159
|
+
}>, {
|
160
|
+
settings: {
|
161
|
+
accountSid: string;
|
162
|
+
authToken: string;
|
163
|
+
fromNumber?: import("libphonenumber-js").E164Number | undefined;
|
164
|
+
messagingServiceSid?: string | undefined;
|
165
|
+
};
|
166
|
+
fields: {
|
167
|
+
from: import("libphonenumber-js").E164Number | undefined;
|
168
|
+
recipient: string & {
|
169
|
+
__tag?: "E164Number" | undefined;
|
170
|
+
};
|
171
|
+
flow_id: string;
|
172
|
+
parameters: {
|
173
|
+
patient_id?: any;
|
174
|
+
} & {
|
175
|
+
[k: string]: any;
|
176
|
+
};
|
177
|
+
};
|
178
|
+
}, {
|
179
|
+
settings: {
|
180
|
+
accountSid: string;
|
181
|
+
authToken: string;
|
182
|
+
fromNumber?: string | undefined;
|
183
|
+
messagingServiceSid?: string | undefined;
|
184
|
+
};
|
185
|
+
fields: {
|
186
|
+
recipient: string;
|
187
|
+
flow_id: string;
|
188
|
+
parameters: {
|
189
|
+
patient_id?: any;
|
190
|
+
} & {
|
191
|
+
[k: string]: any;
|
192
|
+
};
|
193
|
+
from?: string | undefined;
|
194
|
+
};
|
195
|
+
}>;
|
@@ -0,0 +1,37 @@
|
|
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.CreateFlowExecutionSchema = void 0;
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
8
|
+
const fields_1 = require("./fields");
|
9
|
+
const lodash_1 = require("lodash");
|
10
|
+
const settings_1 = require("../../../../settings");
|
11
|
+
exports.CreateFlowExecutionSchema = zod_1.default
|
12
|
+
.object({
|
13
|
+
settings: settings_1.SettingsValidationSchema,
|
14
|
+
fields: fields_1.FieldsValidationSchema,
|
15
|
+
})
|
16
|
+
.superRefine((value, ctx) => {
|
17
|
+
// if both `from` values missing - throw error
|
18
|
+
if ((0, lodash_1.isNil)(value.settings.fromNumber) && (0, lodash_1.isNil)(value.fields.from)) {
|
19
|
+
ctx.addIssue({
|
20
|
+
code: zod_1.default.ZodIssueCode.custom,
|
21
|
+
fatal: true,
|
22
|
+
message: '"From" number is missing in both settings and in the action field.',
|
23
|
+
});
|
24
|
+
}
|
25
|
+
})
|
26
|
+
.transform((val) => {
|
27
|
+
var _a;
|
28
|
+
return {
|
29
|
+
settings: val.settings,
|
30
|
+
fields: {
|
31
|
+
...val.fields,
|
32
|
+
from: (_a = val.fields.from) !== null && _a !== void 0 ? _a : val.settings.fromNumber,
|
33
|
+
},
|
34
|
+
};
|
35
|
+
})
|
36
|
+
.refine((v) => !(0, lodash_1.isNil)(v.fields.from) && typeof v.fields.from === 'string');
|
37
|
+
//# sourceMappingURL=actionSchema.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"actionSchema.js","sourceRoot":"","sources":["../../../../../../../extensions/twilio/v2/actions/createFlowExecution/config/actionSchema.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAmB;AACnB,qCAAiD;AACjD,mCAA8B;AAC9B,mDAA+D;AAElD,QAAA,yBAAyB,GAAG,aAAC;KACvC,MAAM,CAAC;IACN,QAAQ,EAAE,mCAAwB;IAClC,MAAM,EAAE,+BAAsB;CAC/B,CAAC;KACD,WAAW,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAC1B,8CAA8C;IAC9C,IAAI,IAAA,cAAK,EAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,IAAA,cAAK,EAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QAChE,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,aAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,KAAK,EAAE,IAAI;YACX,OAAO,EACL,oEAAoE;SACvE,CAAC,CAAA;KACH;AACH,CAAC,CAAC;KACD,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE;;IACjB,OAAO;QACL,QAAQ,EAAE,GAAG,CAAC,QAAQ;QACtB,MAAM,EAAE;YACN,GAAG,GAAG,CAAC,MAAM;YACb,IAAI,EAAE,MAAA,GAAG,CAAC,MAAM,CAAC,IAAI,mCAAI,GAAG,CAAC,QAAQ,CAAC,UAAU;SACjD;KACF,CAAA;AACH,CAAC,CAAC;KACD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAA,cAAK,EAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../../../extensions/twilio/v2/actions/createFlowExecution/config/dataPoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,WAAW,EAAE;QACX,GAAG,EAAE,aAAa;QAClB,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
import { FieldType, StringType } from '@awell-health/extensions-core';
|
3
|
+
export declare const fields: {
|
4
|
+
from: {
|
5
|
+
label: string;
|
6
|
+
id: string;
|
7
|
+
type: FieldType.STRING;
|
8
|
+
stringType: StringType.PHONE;
|
9
|
+
required: false;
|
10
|
+
description: string;
|
11
|
+
};
|
12
|
+
recipient: {
|
13
|
+
id: string;
|
14
|
+
label: string;
|
15
|
+
type: FieldType.STRING;
|
16
|
+
stringType: StringType.PHONE;
|
17
|
+
description: string;
|
18
|
+
required: true;
|
19
|
+
};
|
20
|
+
flow_id: {
|
21
|
+
id: string;
|
22
|
+
label: string;
|
23
|
+
type: FieldType.STRING;
|
24
|
+
description: string;
|
25
|
+
required: true;
|
26
|
+
};
|
27
|
+
parameters: {
|
28
|
+
id: string;
|
29
|
+
label: string;
|
30
|
+
description: string;
|
31
|
+
type: FieldType.JSON;
|
32
|
+
required: true;
|
33
|
+
};
|
34
|
+
};
|
35
|
+
export declare const FieldsValidationSchema: z.ZodObject<{
|
36
|
+
recipient: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, import("libphonenumber-js").PhoneNumber | import("libphonenumber-js").ParseError, string>, import("libphonenumber-js").PhoneNumber | import("libphonenumber-js").ParseError, string>, import("libphonenumber-js").E164Number, string>;
|
37
|
+
from: z.ZodUnion<[z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, import("libphonenumber-js").PhoneNumber | import("libphonenumber-js").ParseError, string>, import("libphonenumber-js").PhoneNumber | import("libphonenumber-js").ParseError, string>, import("libphonenumber-js").E164Number, string>>, z.ZodEffects<z.ZodLiteral<"">, undefined, "">]>;
|
38
|
+
parameters: z.ZodObject<{
|
39
|
+
patient_id: z.ZodOptional<z.ZodAny>;
|
40
|
+
}, "strip", z.ZodAny, z.objectOutputType<{
|
41
|
+
patient_id: z.ZodOptional<z.ZodAny>;
|
42
|
+
}, z.ZodAny, "strip">, z.objectInputType<{
|
43
|
+
patient_id: z.ZodOptional<z.ZodAny>;
|
44
|
+
}, z.ZodAny, "strip">>;
|
45
|
+
flow_id: z.ZodString;
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
47
|
+
recipient: string & {
|
48
|
+
__tag?: "E164Number" | undefined;
|
49
|
+
};
|
50
|
+
flow_id: string;
|
51
|
+
parameters: {
|
52
|
+
patient_id?: any;
|
53
|
+
} & {
|
54
|
+
[k: string]: any;
|
55
|
+
};
|
56
|
+
from?: import("libphonenumber-js").E164Number | undefined;
|
57
|
+
}, {
|
58
|
+
recipient: string;
|
59
|
+
flow_id: string;
|
60
|
+
parameters: {
|
61
|
+
patient_id?: any;
|
62
|
+
} & {
|
63
|
+
[k: string]: any;
|
64
|
+
};
|
65
|
+
from?: string | undefined;
|
66
|
+
}>;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.FieldsValidationSchema = exports.fields = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
6
|
+
const extensions_core_2 = require("@awell-health/extensions-core");
|
7
|
+
const validation_1 = require("../../../../common/validation");
|
8
|
+
exports.fields = {
|
9
|
+
from: {
|
10
|
+
label: '"From" number',
|
11
|
+
id: 'from',
|
12
|
+
type: extensions_core_2.FieldType.STRING,
|
13
|
+
stringType: extensions_core_2.StringType.PHONE,
|
14
|
+
required: false,
|
15
|
+
description: 'The phone number that will send the text messages, it must be a Twilio phone number that you own. When left blank, the "From" number from the extension settings will be used.',
|
16
|
+
},
|
17
|
+
recipient: {
|
18
|
+
id: 'recipient',
|
19
|
+
label: '"To" phone number',
|
20
|
+
type: extensions_core_2.FieldType.STRING,
|
21
|
+
stringType: extensions_core_2.StringType.PHONE,
|
22
|
+
description: 'The phone number you would like to send the text message to.',
|
23
|
+
required: true,
|
24
|
+
},
|
25
|
+
flow_id: {
|
26
|
+
id: 'flow_id',
|
27
|
+
label: 'Flow ID',
|
28
|
+
type: extensions_core_2.FieldType.STRING,
|
29
|
+
description: 'Flow ID (FWXXXXX...)',
|
30
|
+
required: true,
|
31
|
+
},
|
32
|
+
parameters: {
|
33
|
+
id: 'parameters',
|
34
|
+
label: 'Parameters',
|
35
|
+
description: 'Context to be passed into the flow (as an flat object)',
|
36
|
+
type: extensions_core_2.FieldType.JSON,
|
37
|
+
required: true,
|
38
|
+
},
|
39
|
+
};
|
40
|
+
exports.FieldsValidationSchema = zod_1.z.object({
|
41
|
+
recipient: extensions_core_1.E164PhoneValidationSchema,
|
42
|
+
from: extensions_core_1.E164PhoneValidationOptionalSchema,
|
43
|
+
parameters: validation_1.ParametersValidationSchema,
|
44
|
+
flow_id: zod_1.z.string(),
|
45
|
+
});
|
46
|
+
//# sourceMappingURL=fields.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/twilio/v2/actions/createFlowExecution/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAwC;AACxC,mEAGsC;AACtC,mEAIsC;AACtC,8DAA0E;AAE7D,QAAA,MAAM,GAAG;IACpB,IAAI,EAAE;QACJ,KAAK,EAAE,eAAe;QACtB,EAAE,EAAE,MAAM;QACV,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,UAAU,EAAE,4BAAU,CAAC,KAAK;QAC5B,QAAQ,EAAE,KAAK;QACf,WAAW,EACT,gLAAgL;KACnL;IACD,SAAS,EAAE;QACT,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,mBAAmB;QAC1B,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,UAAU,EAAE,4BAAU,CAAC,KAAK;QAC5B,WAAW,EAAE,8DAA8D;QAC3E,QAAQ,EAAE,IAAI;KACf;IACD,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,WAAW,EAAE,sBAAsB;QACnC,QAAQ,EAAE,IAAI;KACf;IACD,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,wDAAwD;QACrE,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,SAAS,EAAE,2CAAyB;IACpC,IAAI,EAAE,mDAAiC;IACvC,UAAU,EAAE,uCAA0B;IACtC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;CAC8B,CAAC,CAAA"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.dataPoints = exports.CreateFlowExecutionSchema = exports.fields = exports.FieldsValidationSchema = void 0;
|
4
|
+
var fields_1 = require("./fields");
|
5
|
+
Object.defineProperty(exports, "FieldsValidationSchema", { enumerable: true, get: function () { return fields_1.FieldsValidationSchema; } });
|
6
|
+
Object.defineProperty(exports, "fields", { enumerable: true, get: function () { return fields_1.fields; } });
|
7
|
+
var actionSchema_1 = require("./actionSchema");
|
8
|
+
Object.defineProperty(exports, "CreateFlowExecutionSchema", { enumerable: true, get: function () { return actionSchema_1.CreateFlowExecutionSchema; } });
|
9
|
+
var dataPoints_1 = require("./dataPoints");
|
10
|
+
Object.defineProperty(exports, "dataPoints", { enumerable: true, get: function () { return dataPoints_1.dataPoints; } });
|
11
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../extensions/twilio/v2/actions/createFlowExecution/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gHAAA,sBAAsB,OAAA;AAAE,gGAAA,MAAM,OAAA;AACvC,+CAA0D;AAAjD,yHAAA,yBAAyB,OAAA;AAClC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
|
@@ -0,0 +1,44 @@
|
|
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.createFlowExecution = void 0;
|
7
|
+
const twilio_1 = __importDefault(require("../../../common/sdk/twilio"));
|
8
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
9
|
+
const config_1 = require("./config");
|
10
|
+
const lodash_1 = require("lodash");
|
11
|
+
exports.createFlowExecution = {
|
12
|
+
key: 'createFlowExecution',
|
13
|
+
title: 'Start a new execution of a pre-existing flow',
|
14
|
+
description: 'Send a text message from a given telephone number to a recipient of your choice.',
|
15
|
+
category: extensions_core_1.Category.COMMUNICATION,
|
16
|
+
fields: config_1.fields,
|
17
|
+
dataPoints: config_1.dataPoints,
|
18
|
+
previewable: false,
|
19
|
+
onActivityCreated: async (payload, onComplete, onError) => {
|
20
|
+
const { settings: { accountSid, authToken }, fields: { recipient, parameters, from, flow_id }, } = (0, extensions_core_1.validate)({
|
21
|
+
schema: config_1.CreateFlowExecutionSchema,
|
22
|
+
payload,
|
23
|
+
});
|
24
|
+
// TODO: get rid of this assertion
|
25
|
+
if ((0, lodash_1.isNil)(from)) {
|
26
|
+
throw new Error('`from` should never be invalid');
|
27
|
+
}
|
28
|
+
const client = (0, twilio_1.default)(accountSid, authToken, {
|
29
|
+
region: 'IE1',
|
30
|
+
accountSid,
|
31
|
+
});
|
32
|
+
const execution = await client.studio.flows(flow_id).executions.create({
|
33
|
+
to: recipient,
|
34
|
+
from,
|
35
|
+
parameters,
|
36
|
+
});
|
37
|
+
await onComplete({
|
38
|
+
data_points: {
|
39
|
+
executionId: execution.sid,
|
40
|
+
},
|
41
|
+
});
|
42
|
+
},
|
43
|
+
};
|
44
|
+
//# sourceMappingURL=createFlowExecution.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"createFlowExecution.js","sourceRoot":"","sources":["../../../../../../extensions/twilio/v2/actions/createFlowExecution/createFlowExecution.ts"],"names":[],"mappings":";;;;;;AAAA,wEAAkD;AAGlD,mEAAkE;AAClE,qCAAwE;AACxE,mCAA8B;AAEjB,QAAA,mBAAmB,GAA2C;IACzE,GAAG,EAAE,qBAAqB;IAC1B,KAAK,EAAE,8CAA8C;IACrD,WAAW,EACT,kFAAkF;IACpF,QAAQ,EAAE,0BAAQ,CAAC,aAAa;IAChC,MAAM,EAAN,eAAM;IACN,UAAU,EAAV,mBAAU;IACV,WAAW,EAAE,KAAK;IAClB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;QACxD,MAAM,EACJ,QAAQ,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,EACnC,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,GACjD,GAAG,IAAA,0BAAQ,EAAC;YACX,MAAM,EAAE,kCAAyB;YACjC,OAAO;SACR,CAAC,CAAA;QAEF,kCAAkC;QAClC,IAAI,IAAA,cAAK,EAAC,IAAI,CAAC,EAAE;YACf,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;SAClD;QAED,MAAM,MAAM,GAAG,IAAA,gBAAS,EAAC,UAAU,EAAE,SAAS,EAAE;YAC9C,MAAM,EAAE,KAAK;YACb,UAAU;SACX,CAAC,CAAA;QAEF,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC;YACrE,EAAE,EAAE,SAAS;YACb,IAAI;YACJ,UAAU;SACX,CAAC,CAAA;QAEF,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,WAAW,EAAE,SAAS,CAAC,GAAG;aAC3B;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { createFlowExecution } from './createFlowExecution';
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.createFlowExecution = void 0;
|
4
|
+
var createFlowExecution_1 = require("./createFlowExecution");
|
5
|
+
Object.defineProperty(exports, "createFlowExecution", { enumerable: true, get: function () { return createFlowExecution_1.createFlowExecution; } });
|
6
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/twilio/v2/actions/createFlowExecution/index.ts"],"names":[],"mappings":";;;AAAA,6DAA2D;AAAlD,0HAAA,mBAAmB,OAAA"}
|
@@ -2,3 +2,4 @@ export { sendSms } from './sendSms';
|
|
2
2
|
export { sendSmsWithMessagingService } from './sendSmsWithMessagingSid';
|
3
3
|
export { getMessages } from './getMessages';
|
4
4
|
export { sendSmsDuringBusinessHours } from './sendSmsDuringBusinessHours';
|
5
|
+
export { createFlowExecution } from './createFlowExecution';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.sendSmsDuringBusinessHours = exports.getMessages = exports.sendSmsWithMessagingService = exports.sendSms = void 0;
|
3
|
+
exports.createFlowExecution = exports.sendSmsDuringBusinessHours = exports.getMessages = exports.sendSmsWithMessagingService = exports.sendSms = void 0;
|
4
4
|
var sendSms_1 = require("./sendSms");
|
5
5
|
Object.defineProperty(exports, "sendSms", { enumerable: true, get: function () { return sendSms_1.sendSms; } });
|
6
6
|
var sendSmsWithMessagingSid_1 = require("./sendSmsWithMessagingSid");
|
@@ -9,4 +9,6 @@ var getMessages_1 = require("./getMessages");
|
|
9
9
|
Object.defineProperty(exports, "getMessages", { enumerable: true, get: function () { return getMessages_1.getMessages; } });
|
10
10
|
var sendSmsDuringBusinessHours_1 = require("./sendSmsDuringBusinessHours");
|
11
11
|
Object.defineProperty(exports, "sendSmsDuringBusinessHours", { enumerable: true, get: function () { return sendSmsDuringBusinessHours_1.sendSmsDuringBusinessHours; } });
|
12
|
+
var createFlowExecution_1 = require("./createFlowExecution");
|
13
|
+
Object.defineProperty(exports, "createFlowExecution", { enumerable: true, get: function () { return createFlowExecution_1.createFlowExecution; } });
|
12
14
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/twilio/v2/actions/index.ts"],"names":[],"mappings":";;;AAAA,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,qEAAuE;AAA9D,sIAAA,2BAA2B,OAAA;AACpC,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AACpB,2EAAyE;AAAhE,wIAAA,0BAA0B,OAAA"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/twilio/v2/actions/index.ts"],"names":[],"mappings":";;;AAAA,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,qEAAuE;AAA9D,sIAAA,2BAA2B,OAAA;AACpC,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AACpB,2EAAyE;AAAhE,wIAAA,0BAA0B,OAAA;AACnC,6DAA2D;AAAlD,0HAAA,mBAAmB,OAAA"}
|