@awell-health/awell-extensions 2.0.194 → 2.0.195

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.
Files changed (68) hide show
  1. package/dist/extensions/braze/actions/actionHelpers.d.ts +1 -0
  2. package/dist/extensions/braze/actions/actionHelpers.js +9 -0
  3. package/dist/extensions/braze/actions/actionHelpers.js.map +1 -0
  4. package/dist/extensions/braze/actions/index.d.ts +933 -0
  5. package/dist/extensions/braze/actions/index.js +16 -0
  6. package/dist/extensions/braze/actions/index.js.map +1 -0
  7. package/dist/extensions/braze/actions/scheduleEmail/config.d.ts +145 -0
  8. package/dist/extensions/braze/actions/scheduleEmail/config.js +120 -0
  9. package/dist/extensions/braze/actions/scheduleEmail/config.js.map +1 -0
  10. package/dist/extensions/braze/actions/scheduleEmail/index.d.ts +1 -0
  11. package/dist/extensions/braze/actions/scheduleEmail/index.js +18 -0
  12. package/dist/extensions/braze/actions/scheduleEmail/index.js.map +1 -0
  13. package/dist/extensions/braze/actions/scheduleEmail/scheduleEmail.d.ts +220 -0
  14. package/dist/extensions/braze/actions/scheduleEmail/scheduleEmail.js +73 -0
  15. package/dist/extensions/braze/actions/scheduleEmail/scheduleEmail.js.map +1 -0
  16. package/dist/extensions/braze/actions/scheduleSMS/config.d.ts +129 -0
  17. package/dist/extensions/braze/actions/scheduleSMS/config.js +108 -0
  18. package/dist/extensions/braze/actions/scheduleSMS/config.js.map +1 -0
  19. package/dist/extensions/braze/actions/scheduleSMS/index.d.ts +1 -0
  20. package/dist/extensions/braze/actions/scheduleSMS/index.js +18 -0
  21. package/dist/extensions/braze/actions/scheduleSMS/index.js.map +1 -0
  22. package/dist/extensions/braze/actions/scheduleSMS/scheduleSMS.d.ts +196 -0
  23. package/dist/extensions/braze/actions/scheduleSMS/scheduleSMS.js +68 -0
  24. package/dist/extensions/braze/actions/scheduleSMS/scheduleSMS.js.map +1 -0
  25. package/dist/extensions/braze/actions/sendEmail/config.d.ts +115 -0
  26. package/dist/extensions/braze/actions/sendEmail/config.js +96 -0
  27. package/dist/extensions/braze/actions/sendEmail/config.js.map +1 -0
  28. package/dist/extensions/braze/actions/sendEmail/index.d.ts +1 -0
  29. package/dist/extensions/braze/actions/sendEmail/index.js +18 -0
  30. package/dist/extensions/braze/actions/sendEmail/index.js.map +1 -0
  31. package/dist/extensions/braze/actions/sendEmail/sendEmail.d.ts +178 -0
  32. package/dist/extensions/braze/actions/sendEmail/sendEmail.js +71 -0
  33. package/dist/extensions/braze/actions/sendEmail/sendEmail.js.map +1 -0
  34. package/dist/extensions/braze/actions/sendEmailUsingTemplate/config.d.ts +125 -0
  35. package/dist/extensions/braze/actions/sendEmailUsingTemplate/config.js +104 -0
  36. package/dist/extensions/braze/actions/sendEmailUsingTemplate/config.js.map +1 -0
  37. package/dist/extensions/braze/actions/sendEmailUsingTemplate/index.d.ts +1 -0
  38. package/dist/extensions/braze/actions/sendEmailUsingTemplate/index.js +18 -0
  39. package/dist/extensions/braze/actions/sendEmailUsingTemplate/index.js.map +1 -0
  40. package/dist/extensions/braze/actions/sendEmailUsingTemplate/sendEmailUsingTemplate.d.ts +192 -0
  41. package/dist/extensions/braze/actions/sendEmailUsingTemplate/sendEmailUsingTemplate.js +78 -0
  42. package/dist/extensions/braze/actions/sendEmailUsingTemplate/sendEmailUsingTemplate.js.map +1 -0
  43. package/dist/extensions/braze/actions/sendSMS/config.d.ts +95 -0
  44. package/dist/extensions/braze/actions/sendSMS/config.js +80 -0
  45. package/dist/extensions/braze/actions/sendSMS/config.js.map +1 -0
  46. package/dist/extensions/braze/actions/sendSMS/index.d.ts +1 -0
  47. package/dist/extensions/braze/actions/sendSMS/index.js +18 -0
  48. package/dist/extensions/braze/actions/sendSMS/index.js.map +1 -0
  49. package/dist/extensions/braze/actions/sendSMS/sendSMS.d.ts +150 -0
  50. package/dist/extensions/braze/actions/sendSMS/sendSMS.js +67 -0
  51. package/dist/extensions/braze/actions/sendSMS/sendSMS.js.map +1 -0
  52. package/dist/extensions/braze/client.d.ts +18 -0
  53. package/dist/extensions/braze/client.js +29 -0
  54. package/dist/extensions/braze/client.js.map +1 -0
  55. package/dist/extensions/braze/index.d.ts +2 -0
  56. package/dist/extensions/braze/index.js +20 -0
  57. package/dist/extensions/braze/index.js.map +1 -0
  58. package/dist/extensions/braze/settings.d.ts +27 -0
  59. package/dist/extensions/braze/settings.js +25 -0
  60. package/dist/extensions/braze/settings.js.map +1 -0
  61. package/dist/extensions/canvasMedical/v1/validation/questionnaireResponses.zod.d.ts +12 -12
  62. package/dist/extensions/docuSign/actions/createEmbeddedSignatureRequestWithTemplate/config/fields.d.ts +2 -2
  63. package/dist/extensions/dropboxSign/v1/actions/createEmbeddedSignatureRequestWithTemplate/config/fields.d.ts +2 -2
  64. package/dist/extensions/dropboxSign/v1/actions/sendSignatureRequestWithTemplate/config/fields.d.ts +2 -2
  65. package/dist/extensions/index.js +2 -0
  66. package/dist/extensions/index.js.map +1 -1
  67. package/dist/extensions/markdown.json +4 -0
  68. package/package.json +1 -1
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.actions = void 0;
4
+ const sendSMS_1 = require("./sendSMS");
5
+ const scheduleSMS_1 = require("./scheduleSMS");
6
+ const sendEmail_1 = require("./sendEmail");
7
+ const scheduleEmail_1 = require("./scheduleEmail");
8
+ const sendEmailUsingTemplate_1 = require("./sendEmailUsingTemplate");
9
+ exports.actions = {
10
+ sendSMS: sendSMS_1.sendSMS,
11
+ scheduleSMS: scheduleSMS_1.scheduleSMS,
12
+ sendEmail: sendEmail_1.sendEmail,
13
+ scheduleEmail: scheduleEmail_1.scheduleEmail,
14
+ sendEmailUsingTemplate: sendEmailUsingTemplate_1.sendEmailUsingTemplate,
15
+ };
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/braze/actions/index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AACnC,+CAA2C;AAC3C,2CAAuC;AACvC,mDAA+C;AAC/C,qEAAiE;AAEpD,QAAA,OAAO,GAAG;IACrB,OAAO,EAAP,iBAAO;IACP,WAAW,EAAX,yBAAW;IACX,SAAS,EAAT,qBAAS;IACT,aAAa,EAAb,6BAAa;IACb,sBAAsB,EAAtB,+CAAsB;CACvB,CAAA"}
@@ -0,0 +1,145 @@
1
+ import { FieldType } from '@awell-health/extensions-core';
2
+ import { z } from 'zod';
3
+ export declare const fields: {
4
+ externalUserId: {
5
+ id: string;
6
+ label: string;
7
+ type: FieldType.STRING;
8
+ required: true;
9
+ description: string;
10
+ };
11
+ appId: {
12
+ id: string;
13
+ label: string;
14
+ type: FieldType.STRING;
15
+ required: true;
16
+ description: string;
17
+ };
18
+ from: {
19
+ id: string;
20
+ label: string;
21
+ type: FieldType.STRING;
22
+ required: true;
23
+ description: string;
24
+ };
25
+ replyTo: {
26
+ id: string;
27
+ label: string;
28
+ type: FieldType.STRING;
29
+ required: false;
30
+ description: string;
31
+ };
32
+ subject: {
33
+ id: string;
34
+ label: string;
35
+ type: FieldType.STRING;
36
+ required: false;
37
+ description: string;
38
+ };
39
+ body: {
40
+ id: string;
41
+ label: string;
42
+ type: FieldType.HTML;
43
+ required: true;
44
+ description: string;
45
+ };
46
+ preheader: {
47
+ id: string;
48
+ label: string;
49
+ type: FieldType.STRING;
50
+ required: false;
51
+ description: string;
52
+ };
53
+ shouldInlineCss: {
54
+ id: string;
55
+ label: string;
56
+ type: FieldType.BOOLEAN;
57
+ required: false;
58
+ description: string;
59
+ };
60
+ scheduleTime: {
61
+ id: string;
62
+ label: string;
63
+ type: FieldType.DATE;
64
+ required: true;
65
+ description: string;
66
+ };
67
+ inPatientLocalTime: {
68
+ id: string;
69
+ label: string;
70
+ type: FieldType.BOOLEAN;
71
+ required: false;
72
+ description: string;
73
+ };
74
+ atOptimalTime: {
75
+ id: string;
76
+ label: string;
77
+ type: FieldType.BOOLEAN;
78
+ required: false;
79
+ description: string;
80
+ };
81
+ campaignId: {
82
+ id: string;
83
+ label: string;
84
+ type: FieldType.STRING;
85
+ required: false;
86
+ description: string;
87
+ };
88
+ messageVariantionId: {
89
+ id: string;
90
+ label: string;
91
+ type: FieldType.STRING;
92
+ required: false;
93
+ description: string;
94
+ };
95
+ };
96
+ export declare const dataPoints: {
97
+ EmailDispatchId: {
98
+ key: string;
99
+ valueType: "string";
100
+ };
101
+ };
102
+ export declare const FieldsSchema: z.ZodObject<{
103
+ externalUserId: z.ZodString;
104
+ appId: z.ZodString;
105
+ from: z.ZodString;
106
+ replyTo: z.ZodOptional<z.ZodString>;
107
+ subject: z.ZodOptional<z.ZodString>;
108
+ body: z.ZodString;
109
+ preheader: z.ZodOptional<z.ZodString>;
110
+ shouldInlineCss: z.ZodOptional<z.ZodBoolean>;
111
+ scheduleTime: z.ZodEffects<z.ZodDate, string, Date>;
112
+ inPatientLocalTime: z.ZodOptional<z.ZodBoolean>;
113
+ atOptimalTime: z.ZodOptional<z.ZodBoolean>;
114
+ campaignId: z.ZodOptional<z.ZodString>;
115
+ messageVariantionId: z.ZodOptional<z.ZodString>;
116
+ }, "strip", z.ZodTypeAny, {
117
+ body: string;
118
+ from: string;
119
+ externalUserId: string;
120
+ appId: string;
121
+ scheduleTime: string;
122
+ campaignId?: string | undefined;
123
+ messageVariantionId?: string | undefined;
124
+ inPatientLocalTime?: boolean | undefined;
125
+ atOptimalTime?: boolean | undefined;
126
+ replyTo?: string | undefined;
127
+ subject?: string | undefined;
128
+ preheader?: string | undefined;
129
+ shouldInlineCss?: boolean | undefined;
130
+ }, {
131
+ body: string;
132
+ from: string;
133
+ externalUserId: string;
134
+ appId: string;
135
+ scheduleTime: Date;
136
+ campaignId?: string | undefined;
137
+ messageVariantionId?: string | undefined;
138
+ inPatientLocalTime?: boolean | undefined;
139
+ atOptimalTime?: boolean | undefined;
140
+ replyTo?: string | undefined;
141
+ subject?: string | undefined;
142
+ preheader?: string | undefined;
143
+ shouldInlineCss?: boolean | undefined;
144
+ }>;
145
+ export type ActionFields = z.infer<typeof FieldsSchema>;
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldsSchema = exports.dataPoints = exports.fields = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const zod_1 = require("zod");
6
+ exports.fields = {
7
+ externalUserId: {
8
+ id: 'externalUserId',
9
+ label: 'External User ID',
10
+ type: extensions_core_1.FieldType.STRING,
11
+ required: true,
12
+ description: 'The ID of the user in your system that this message is being sent to.',
13
+ },
14
+ appId: {
15
+ id: 'appId',
16
+ label: 'App ID',
17
+ type: extensions_core_1.FieldType.STRING,
18
+ required: true,
19
+ description: 'App id is the reference of the specific app.',
20
+ },
21
+ from: {
22
+ id: 'from',
23
+ label: 'From',
24
+ type: extensions_core_1.FieldType.STRING,
25
+ required: true,
26
+ description: 'valid email address in the format "Display Name <email@address.com>"',
27
+ },
28
+ replyTo: {
29
+ id: 'replyTo',
30
+ label: 'Reply To',
31
+ type: extensions_core_1.FieldType.STRING,
32
+ required: false,
33
+ description: 'Valid email address in the format "email@address.com" - defaults to your workspace`s default reply to if not set',
34
+ },
35
+ subject: {
36
+ id: 'subject',
37
+ label: 'Subject',
38
+ type: extensions_core_1.FieldType.STRING,
39
+ required: false,
40
+ description: 'The subject of the email.',
41
+ },
42
+ body: {
43
+ id: 'body',
44
+ label: 'Body',
45
+ type: extensions_core_1.FieldType.HTML,
46
+ required: true,
47
+ description: 'The body of the email.',
48
+ },
49
+ preheader: {
50
+ id: 'preheader',
51
+ label: 'Preheader',
52
+ type: extensions_core_1.FieldType.STRING,
53
+ required: false,
54
+ description: 'The preheader of the email. Recommended length 50-100 characters',
55
+ },
56
+ shouldInlineCss: {
57
+ id: 'shouldInlineCss',
58
+ label: 'Should inline CSS',
59
+ type: extensions_core_1.FieldType.BOOLEAN,
60
+ required: false,
61
+ description: 'Whether to inline the CSS of the body of the email. If not provided, falls back to the default CSS inlining value for the workspace ',
62
+ },
63
+ scheduleTime: {
64
+ id: 'scheduleTime',
65
+ label: 'Schedule Time',
66
+ type: extensions_core_1.FieldType.DATE,
67
+ required: true,
68
+ description: 'The time to schedule the SMS to be sent. Must be a datetime as ISO 8601 string and time to send the message in UTC',
69
+ },
70
+ inPatientLocalTime: {
71
+ id: 'inPatientLocalTime',
72
+ label: 'In Patient Local Time',
73
+ type: extensions_core_1.FieldType.BOOLEAN,
74
+ required: false,
75
+ description: "If true, the schedule time will be in the patient's local time.",
76
+ },
77
+ atOptimalTime: {
78
+ id: 'atOptimalTime',
79
+ label: 'At Optimal Time',
80
+ type: extensions_core_1.FieldType.BOOLEAN,
81
+ required: false,
82
+ description: 'If true, the schedule time will be at the optimal time.',
83
+ },
84
+ campaignId: {
85
+ id: 'campaignId',
86
+ label: 'Campaign ID',
87
+ type: extensions_core_1.FieldType.STRING,
88
+ required: false,
89
+ description: 'Optional but required if you wish to track campaign stats',
90
+ },
91
+ messageVariantionId: {
92
+ id: 'messageVariantionId',
93
+ label: 'Message Variantion ID',
94
+ type: extensions_core_1.FieldType.STRING,
95
+ required: false,
96
+ description: 'Used when providing a campaign_id to specify which message variation this message should be tracked under',
97
+ },
98
+ };
99
+ exports.dataPoints = {
100
+ EmailDispatchId: {
101
+ key: 'EmailDispatchId',
102
+ valueType: 'string',
103
+ },
104
+ };
105
+ exports.FieldsSchema = zod_1.z.object({
106
+ externalUserId: zod_1.z.string().min(1),
107
+ appId: zod_1.z.string().min(1),
108
+ from: zod_1.z.string(),
109
+ replyTo: zod_1.z.string().optional(),
110
+ subject: zod_1.z.string().optional(),
111
+ body: zod_1.z.string(),
112
+ preheader: zod_1.z.string().optional(),
113
+ shouldInlineCss: zod_1.z.boolean().optional(),
114
+ scheduleTime: extensions_core_1.DateTimeSchema,
115
+ inPatientLocalTime: zod_1.z.boolean().optional(),
116
+ atOptimalTime: zod_1.z.boolean().optional(),
117
+ campaignId: zod_1.z.string().optional(),
118
+ messageVariantionId: zod_1.z.string().optional(),
119
+ });
120
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../extensions/braze/actions/scheduleEmail/config.ts"],"names":[],"mappings":";;;AAAA,mEAKsC;AACtC,6BAAuB;AAEV,QAAA,MAAM,GAAG;IACpB,cAAc,EAAE;QACd,EAAE,EAAE,gBAAgB;QACpB,KAAK,EAAE,kBAAkB;QACzB,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,uEAAuE;KAC1E;IACD,KAAK,EAAE;QACL,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,8CAA8C;KAC5D;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,sEAAsE;KACzE;IACD,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;QACf,WAAW,EACT,kHAAkH;KACrH;IACD,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,2BAA2B;KACzC;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,wBAAwB;KACtC;IACD,SAAS,EAAE;QACT,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,WAAW;QAClB,IAAI,E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,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,eAAe,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACvC,YAAY,EAAE,gCAAc;IAC5B,kBAAkB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC1C,aAAa,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACrC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,mBAAmB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export * from './scheduleEmail';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./scheduleEmail"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/braze/actions/scheduleEmail/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B"}
@@ -0,0 +1,220 @@
1
+ import { Category } from '@awell-health/extensions-core';
2
+ export declare const scheduleEmail: {
3
+ key: string;
4
+ title: string;
5
+ description: string;
6
+ category: Category.COMMUNICATION;
7
+ fields: {
8
+ externalUserId: {
9
+ id: string;
10
+ label: string;
11
+ type: import("@awell-health/extensions-core").FieldType.STRING;
12
+ required: true;
13
+ description: string;
14
+ };
15
+ appId: {
16
+ id: string;
17
+ label: string;
18
+ type: import("@awell-health/extensions-core").FieldType.STRING;
19
+ required: true;
20
+ description: string;
21
+ };
22
+ from: {
23
+ id: string;
24
+ label: string;
25
+ type: import("@awell-health/extensions-core").FieldType.STRING;
26
+ required: true;
27
+ description: string;
28
+ };
29
+ replyTo: {
30
+ id: string;
31
+ label: string;
32
+ type: import("@awell-health/extensions-core").FieldType.STRING;
33
+ required: false;
34
+ description: string;
35
+ };
36
+ subject: {
37
+ id: string;
38
+ label: string;
39
+ type: import("@awell-health/extensions-core").FieldType.STRING;
40
+ required: false;
41
+ description: string;
42
+ };
43
+ body: {
44
+ id: string;
45
+ label: string;
46
+ type: import("@awell-health/extensions-core").FieldType.HTML;
47
+ required: true;
48
+ description: string;
49
+ };
50
+ preheader: {
51
+ id: string;
52
+ label: string;
53
+ type: import("@awell-health/extensions-core").FieldType.STRING;
54
+ required: false;
55
+ description: string;
56
+ };
57
+ shouldInlineCss: {
58
+ id: string;
59
+ label: string;
60
+ type: import("@awell-health/extensions-core").FieldType.BOOLEAN;
61
+ required: false;
62
+ description: string;
63
+ };
64
+ scheduleTime: {
65
+ id: string;
66
+ label: string;
67
+ type: import("@awell-health/extensions-core").FieldType.DATE;
68
+ required: true;
69
+ description: string;
70
+ };
71
+ inPatientLocalTime: {
72
+ id: string;
73
+ label: string;
74
+ type: import("@awell-health/extensions-core").FieldType.BOOLEAN;
75
+ required: false;
76
+ description: string;
77
+ };
78
+ atOptimalTime: {
79
+ id: string;
80
+ label: string;
81
+ type: import("@awell-health/extensions-core").FieldType.BOOLEAN;
82
+ required: false;
83
+ description: string;
84
+ };
85
+ campaignId: {
86
+ id: string;
87
+ label: string;
88
+ type: import("@awell-health/extensions-core").FieldType.STRING;
89
+ required: false;
90
+ description: string;
91
+ };
92
+ messageVariantionId: {
93
+ id: string;
94
+ label: string;
95
+ type: import("@awell-health/extensions-core").FieldType.STRING;
96
+ required: false;
97
+ description: string;
98
+ };
99
+ };
100
+ dataPoints: {
101
+ EmailDispatchId: {
102
+ key: string;
103
+ valueType: "string";
104
+ };
105
+ };
106
+ previewable: false;
107
+ onEvent: ({ payload, onComplete, onError, helpers }: {
108
+ payload: import("@awell-health/extensions-core").NewActivityPayload<{
109
+ externalUserId: {
110
+ id: string;
111
+ label: string;
112
+ type: import("@awell-health/extensions-core").FieldType.STRING;
113
+ required: true;
114
+ description: string;
115
+ };
116
+ appId: {
117
+ id: string;
118
+ label: string;
119
+ type: import("@awell-health/extensions-core").FieldType.STRING;
120
+ required: true;
121
+ description: string;
122
+ };
123
+ from: {
124
+ id: string;
125
+ label: string;
126
+ type: import("@awell-health/extensions-core").FieldType.STRING;
127
+ required: true;
128
+ description: string;
129
+ };
130
+ replyTo: {
131
+ id: string;
132
+ label: string;
133
+ type: import("@awell-health/extensions-core").FieldType.STRING;
134
+ required: false;
135
+ description: string;
136
+ };
137
+ subject: {
138
+ id: string;
139
+ label: string;
140
+ type: import("@awell-health/extensions-core").FieldType.STRING;
141
+ required: false;
142
+ description: string;
143
+ };
144
+ body: {
145
+ id: string;
146
+ label: string;
147
+ type: import("@awell-health/extensions-core").FieldType.HTML;
148
+ required: true;
149
+ description: string;
150
+ };
151
+ preheader: {
152
+ id: string;
153
+ label: string;
154
+ type: import("@awell-health/extensions-core").FieldType.STRING;
155
+ required: false;
156
+ description: string;
157
+ };
158
+ shouldInlineCss: {
159
+ id: string;
160
+ label: string;
161
+ type: import("@awell-health/extensions-core").FieldType.BOOLEAN;
162
+ required: false;
163
+ description: string;
164
+ };
165
+ scheduleTime: {
166
+ id: string;
167
+ label: string;
168
+ type: import("@awell-health/extensions-core").FieldType.DATE;
169
+ required: true;
170
+ description: string;
171
+ };
172
+ inPatientLocalTime: {
173
+ id: string;
174
+ label: string;
175
+ type: import("@awell-health/extensions-core").FieldType.BOOLEAN;
176
+ required: false;
177
+ description: string;
178
+ };
179
+ atOptimalTime: {
180
+ id: string;
181
+ label: string;
182
+ type: import("@awell-health/extensions-core").FieldType.BOOLEAN;
183
+ required: false;
184
+ description: string;
185
+ };
186
+ campaignId: {
187
+ id: string;
188
+ label: string;
189
+ type: import("@awell-health/extensions-core").FieldType.STRING;
190
+ required: false;
191
+ description: string;
192
+ };
193
+ messageVariantionId: {
194
+ id: string;
195
+ label: string;
196
+ type: import("@awell-health/extensions-core").FieldType.STRING;
197
+ required: false;
198
+ description: string;
199
+ };
200
+ }, {
201
+ apiKey: {
202
+ key: string;
203
+ label: string;
204
+ obfuscated: true;
205
+ required: true;
206
+ description: string;
207
+ };
208
+ baseUrl: {
209
+ key: string;
210
+ label: string;
211
+ obfuscated: false;
212
+ required: true;
213
+ description: string;
214
+ };
215
+ }>;
216
+ onComplete: import("@awell-health/extensions-core").OnCompleteCallback<string>;
217
+ onError: import("@awell-health/extensions-core").OnErrorCallback;
218
+ helpers: import("@awell-health/extensions-core").Helpers;
219
+ }) => Promise<void>;
220
+ };
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.scheduleEmail = void 0;
4
+ const zod_1 = require("zod");
5
+ const lodash_1 = require("lodash");
6
+ const extensions_core_1 = require("@awell-health/extensions-core");
7
+ const settings_1 = require("../../settings");
8
+ const client_1 = require("../../client");
9
+ const config_1 = require("./config");
10
+ const actionHelpers_1 = require("../actionHelpers");
11
+ exports.scheduleEmail = {
12
+ key: 'scheduleEmail',
13
+ title: 'Schedule Email',
14
+ description: 'Schedule an email to be sent to a patient.',
15
+ category: extensions_core_1.Category.COMMUNICATION,
16
+ fields: config_1.fields,
17
+ dataPoints: config_1.dataPoints,
18
+ previewable: false,
19
+ onEvent: async ({ payload, onComplete, onError, helpers }) => {
20
+ const { fields: { externalUserId, appId: app_id, from, replyTo: reply_to, subject, body, preheader, shouldInlineCss: should_inline_css, scheduleTime: time, inPatientLocalTime: in_local_time, atOptimalTime: at_optimal_time, campaignId: campaign_id, messageVariantionId: message_variation_id, }, settings: { apiKey, baseUrl }, } = (0, extensions_core_1.validate)({
21
+ schema: zod_1.z.object({
22
+ fields: config_1.FieldsSchema,
23
+ settings: settings_1.SettingsValidationSchema,
24
+ }),
25
+ payload,
26
+ });
27
+ const client = new client_1.BrazeClient({ apiKey, baseUrl });
28
+ const requestBody = {
29
+ external_user_ids: [externalUserId],
30
+ ...(!(0, lodash_1.isNil)(campaign_id) && {
31
+ campaign_id,
32
+ }),
33
+ schedule: {
34
+ time,
35
+ ...(0, actionHelpers_1.addBooleanFieldIfDefined)({ in_local_time }),
36
+ ...(0, actionHelpers_1.addBooleanFieldIfDefined)({ at_optimal_time }),
37
+ },
38
+ messages: {
39
+ email: {
40
+ from,
41
+ body,
42
+ app_id,
43
+ ...(!(0, lodash_1.isNil)(subject) && {
44
+ subject,
45
+ }),
46
+ ...(!(0, lodash_1.isNil)(preheader) && {
47
+ preheader,
48
+ }),
49
+ ...(!(0, lodash_1.isNil)(message_variation_id) && {
50
+ message_variation_id,
51
+ }),
52
+ ...(!(0, lodash_1.isNil)(reply_to) && {
53
+ reply_to,
54
+ }),
55
+ ...(0, actionHelpers_1.addBooleanFieldIfDefined)({ should_inline_css }),
56
+ },
57
+ },
58
+ };
59
+ const resp = await client.scheduleMessage(requestBody);
60
+ await onComplete({
61
+ events: [
62
+ {
63
+ date: new Date().toISOString(),
64
+ text: { en: `Email sent. Response: ${JSON.stringify(resp)}` },
65
+ },
66
+ ],
67
+ data_points: {
68
+ EmailDispatchId: resp.dispatch_id,
69
+ },
70
+ });
71
+ },
72
+ };
73
+ //# sourceMappingURL=scheduleEmail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scheduleEmail.js","sourceRoot":"","sources":["../../../../../extensions/braze/actions/scheduleEmail/scheduleEmail.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,mCAA8B;AAC9B,mEAA+E;AAE/E,6CAAwE;AACxE,yCAA0C;AAC1C,qCAA2D;AAC3D,oDAA2D;AAE9C,QAAA,aAAa,GAAG;IAC3B,GAAG,EAAE,eAAe;IACpB,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,4CAA4C;IACzD,QAAQ,EAAE,0BAAQ,CAAC,aAAa;IAChC,MAAM,EAAN,eAAM;IACN,UAAU,EAAV,mBAAU;IACV,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;QAC3D,MAAM,EACJ,MAAM,EAAE,EACN,cAAc,EACd,KAAK,EAAE,MAAM,EACb,IAAI,EACJ,OAAO,EAAE,QAAQ,EACjB,OAAO,EACP,IAAI,EACJ,SAAS,EACT,eAAe,EAAE,iBAAiB,EAClC,YAAY,EAAE,IAAI,EAClB,kBAAkB,EAAE,aAAa,EACjC,aAAa,EAAE,eAAe,EAC9B,UAAU,EAAE,WAAW,EACvB,mBAAmB,EAAE,oBAAoB,GAC1C,EACD,QAAQ,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAC9B,GAAG,IAAA,0BAAQ,EAAC;YACX,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;gBACf,MAAM,EAAE,qBAAY;gBACpB,QAAQ,EAAE,mCAAwB;aAC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