@awell-health/awell-extensions 1.1.21 → 1.1.23
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/extensions/elation/actions/updateNonVisitNote.d.ts +7 -0
- package/dist/extensions/elation/actions/updateNonVisitNote.js +27 -70
- package/dist/extensions/elation/actions/updateNonVisitNote.js.map +1 -1
- package/dist/extensions/elation/validation/nonVisitNote.zod.d.ts +6 -0
- package/dist/extensions/elation/validation/nonVisitNote.zod.js +2 -0
- package/dist/extensions/elation/validation/nonVisitNote.zod.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
@@ -74,6 +74,13 @@ declare const fields: {
|
|
74
74
|
type: FieldType.STRING;
|
75
75
|
required: false;
|
76
76
|
};
|
77
|
+
signed_by: {
|
78
|
+
id: string;
|
79
|
+
label: string;
|
80
|
+
description: string;
|
81
|
+
type: FieldType.NUMERIC;
|
82
|
+
required: false;
|
83
|
+
};
|
77
84
|
};
|
78
85
|
export declare const updateNonVisitNote: Action<typeof fields, typeof settings>;
|
79
86
|
export {};
|
@@ -2,11 +2,8 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.updateNonVisitNote = void 0;
|
4
4
|
/* eslint-disable @typescript-eslint/naming-convention */
|
5
|
-
const zod_1 = require("zod");
|
6
5
|
const extensions_core_1 = require("@awell-health/extensions-core");
|
7
6
|
const client_1 = require("../client");
|
8
|
-
const zod_validation_error_1 = require("zod-validation-error");
|
9
|
-
const axios_1 = require("axios");
|
10
7
|
const nonVisitNote_zod_1 = require("../validation/nonVisitNote.zod");
|
11
8
|
const lodash_1 = require("lodash");
|
12
9
|
/**
|
@@ -83,6 +80,13 @@ const fields = {
|
|
83
80
|
type: extensions_core_1.FieldType.STRING,
|
84
81
|
required: false,
|
85
82
|
},
|
83
|
+
signed_by: {
|
84
|
+
id: 'signed_by',
|
85
|
+
label: 'Signed by (user ID)',
|
86
|
+
description: 'ID of a user who signed the note.',
|
87
|
+
type: extensions_core_1.FieldType.NUMERIC,
|
88
|
+
required: false,
|
89
|
+
},
|
86
90
|
};
|
87
91
|
exports.updateNonVisitNote = {
|
88
92
|
key: 'updateNonVisitNote',
|
@@ -92,73 +96,26 @@ exports.updateNonVisitNote = {
|
|
92
96
|
fields,
|
93
97
|
previewable: true,
|
94
98
|
onActivityCreated: async (payload, onComplete, onError) => {
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
if (err instanceof zod_1.ZodError) {
|
116
|
-
const error = (0, zod_validation_error_1.fromZodError)(err);
|
117
|
-
await onError({
|
118
|
-
events: [
|
119
|
-
{
|
120
|
-
date: new Date().toISOString(),
|
121
|
-
text: { en: error.message },
|
122
|
-
error: {
|
123
|
-
category: 'WRONG_INPUT',
|
124
|
-
message: error.message,
|
125
|
-
},
|
126
|
-
},
|
127
|
-
],
|
128
|
-
});
|
129
|
-
}
|
130
|
-
else if (err instanceof axios_1.AxiosError) {
|
131
|
-
await onError({
|
132
|
-
events: [
|
133
|
-
{
|
134
|
-
date: new Date().toISOString(),
|
135
|
-
text: {
|
136
|
-
en: `${(_a = err.status) !== null && _a !== void 0 ? _a : '(no status code)'} Error: ${err.message}`,
|
137
|
-
},
|
138
|
-
error: {
|
139
|
-
category: 'SERVER_ERROR',
|
140
|
-
message: `${(_b = err.status) !== null && _b !== void 0 ? _b : '(no status code)'} Error: ${err.message}`,
|
141
|
-
},
|
142
|
-
},
|
143
|
-
],
|
144
|
-
});
|
145
|
-
}
|
146
|
-
else {
|
147
|
-
const message = err.message;
|
148
|
-
await onError({
|
149
|
-
events: [
|
150
|
-
{
|
151
|
-
date: new Date().toISOString(),
|
152
|
-
text: { en: message },
|
153
|
-
error: {
|
154
|
-
category: 'SERVER_ERROR',
|
155
|
-
message,
|
156
|
-
},
|
157
|
-
},
|
158
|
-
],
|
159
|
-
});
|
160
|
-
}
|
161
|
-
}
|
99
|
+
const { nonVisitNoteId, nonVisitNoteBulletId, authorId, chartDate, documentDate, text, category, patientId, practiceId, signed_by, ...fields } = payload.fields;
|
100
|
+
const noteId = extensions_core_1.NumericIdSchema.parse(nonVisitNoteId);
|
101
|
+
// partial - all fields are optional
|
102
|
+
const note = nonVisitNote_zod_1.nonVisitNoteSchema.partial().parse({
|
103
|
+
...fields,
|
104
|
+
patient: patientId,
|
105
|
+
practice: practiceId,
|
106
|
+
bullets: (0, lodash_1.isNil)(nonVisitNoteBulletId)
|
107
|
+
? undefined
|
108
|
+
: [{ id: nonVisitNoteBulletId, text, author: authorId, category }],
|
109
|
+
document_date: documentDate,
|
110
|
+
chart_date: chartDate,
|
111
|
+
...(!(0, lodash_1.isNil)(signed_by) && {
|
112
|
+
signed_by,
|
113
|
+
sign_date: new Date().toISOString(),
|
114
|
+
}),
|
115
|
+
});
|
116
|
+
const api = (0, client_1.makeAPIClient)(payload.settings);
|
117
|
+
await api.updateNonVisitNote(noteId, note);
|
118
|
+
await onComplete();
|
162
119
|
},
|
163
120
|
};
|
164
121
|
//# sourceMappingURL=updateNonVisitNote.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"updateNonVisitNote.js","sourceRoot":"","sources":["../../../../extensions/elation/actions/updateNonVisitNote.ts"],"names":[],"mappings":";;;AAAA,yDAAyD;AACzD,
|
1
|
+
{"version":3,"file":"updateNonVisitNote.js","sourceRoot":"","sources":["../../../../extensions/elation/actions/updateNonVisitNote.ts"],"names":[],"mappings":"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"}
|
@@ -38,6 +38,8 @@ export declare const nonVisitNoteSchema: z.ZodObject<{
|
|
38
38
|
document_date: z.ZodEffects<z.ZodDate, string, Date>;
|
39
39
|
chart_date: z.ZodEffects<z.ZodDate, string, Date>;
|
40
40
|
tags: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string[], string>>;
|
41
|
+
signed_by: z.ZodOptional<z.ZodNumber>;
|
42
|
+
sign_date: z.ZodOptional<z.ZodEffects<z.ZodDate, string, Date>>;
|
41
43
|
}, "strip", z.ZodTypeAny, {
|
42
44
|
type: "email" | "phone" | "nonvisit";
|
43
45
|
patient: number;
|
@@ -51,6 +53,8 @@ export declare const nonVisitNoteSchema: z.ZodObject<{
|
|
51
53
|
chart_date: string;
|
52
54
|
tags?: string[] | undefined;
|
53
55
|
practice?: number | undefined;
|
56
|
+
signed_by?: number | undefined;
|
57
|
+
sign_date?: string | undefined;
|
54
58
|
}, {
|
55
59
|
patient: number;
|
56
60
|
bullets: {
|
@@ -64,4 +68,6 @@ export declare const nonVisitNoteSchema: z.ZodObject<{
|
|
64
68
|
type?: "email" | "phone" | "nonvisit" | undefined;
|
65
69
|
tags?: string | undefined;
|
66
70
|
practice?: number | undefined;
|
71
|
+
signed_by?: number | undefined;
|
72
|
+
sign_date?: Date | undefined;
|
67
73
|
}>;
|
@@ -72,5 +72,7 @@ exports.nonVisitNoteSchema = z.object({
|
|
72
72
|
document_date: extensions_core_1.DateTimeSchema,
|
73
73
|
chart_date: extensions_core_1.DateTimeSchema,
|
74
74
|
tags: (0, extensions_core_1.validateCommaSeparatedList)((value) => extensions_core_1.NumericIdSchema.safeParse(value).success, true).optional(),
|
75
|
+
signed_by: extensions_core_1.NumericIdSchema.optional(),
|
76
|
+
sign_date: extensions_core_1.DateTimeSchema.optional(),
|
75
77
|
});
|
76
78
|
//# sourceMappingURL=nonVisitNote.zod.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nonVisitNote.zod.js","sourceRoot":"","sources":["../../../../extensions/elation/validation/nonVisitNote.zod.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwB;AACxB,mEAIsC;AAEtC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAA;AAEnE,sCAAsC;AACtC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC;IAChC,SAAS;IACT,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,IAAI;IACJ,KAAK;IACL,KAAK;IACL,MAAM;IACN,YAAY;IACZ,MAAM;IACN,IAAI;IACJ,WAAW;IACX,UAAU;IACV,QAAQ;IACR,MAAM;IACN,WAAW;IACX,KAAK;IACL,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,eAAe;IACf,UAAU;IACV,QAAQ;IACR,YAAY;IACZ,WAAW;CACZ,CAAC,CAAA;AAEW,QAAA,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,EAAE,EAAE,iCAAe,CAAC,QAAQ,EAAE;IAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,MAAM,EAAE,iCAAe;IACvB,QAAQ,EAAE,kBAAkB,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC;CACtE,CAAC,CAAA;AAEW,QAAA,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC;IACtE,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAY,CAAC;IAC9B,OAAO,EAAE,iCAAe;IACxB,QAAQ,EAAE,iCAAe,CAAC,QAAQ,EAAE;IACpC,aAAa,EAAE,gCAAc;IAC7B,UAAU,EAAE,gCAAc;IAC1B,IAAI,EAAE,IAAA,4CAA0B,EAC9B,CAAC,KAAK,EAAE,EAAE,CAAC,iCAAe,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,EACnD,IAAI,CACL,CAAC,QAAQ,EAAE;
|
1
|
+
{"version":3,"file":"nonVisitNote.zod.js","sourceRoot":"","sources":["../../../../extensions/elation/validation/nonVisitNote.zod.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwB;AACxB,mEAIsC;AAEtC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAA;AAEnE,sCAAsC;AACtC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC;IAChC,SAAS;IACT,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,IAAI;IACJ,KAAK;IACL,KAAK;IACL,MAAM;IACN,YAAY;IACZ,MAAM;IACN,IAAI;IACJ,WAAW;IACX,UAAU;IACV,QAAQ;IACR,MAAM;IACN,WAAW;IACX,KAAK;IACL,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,eAAe;IACf,UAAU;IACV,QAAQ;IACR,YAAY;IACZ,WAAW;CACZ,CAAC,CAAA;AAEW,QAAA,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,EAAE,EAAE,iCAAe,CAAC,QAAQ,EAAE;IAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,MAAM,EAAE,iCAAe;IACvB,QAAQ,EAAE,kBAAkB,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC;CACtE,CAAC,CAAA;AAEW,QAAA,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC;IACtE,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAY,CAAC;IAC9B,OAAO,EAAE,iCAAe;IACxB,QAAQ,EAAE,iCAAe,CAAC,QAAQ,EAAE;IACpC,aAAa,EAAE,gCAAc;IAC7B,UAAU,EAAE,gCAAc;IAC1B,IAAI,EAAE,IAAA,4CAA0B,EAC9B,CAAC,KAAK,EAAE,EAAE,CAAC,iCAAe,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,OAAO,EACnD,IAAI,CACL,CAAC,QAAQ,EAAE;IACZ,SAAS,EAAE,iCAAe,CAAC,QAAQ,EAAE;IACrC,SAAS,EAAE,gCAAc,CAAC,QAAQ,EAAE;CACrC,CAAC,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"}
|