@awell-health/awell-extensions 2.1.178 → 2.1.180

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.
@@ -26,10 +26,58 @@ export declare const fields: {
26
26
  type: FieldType.HTML;
27
27
  required: true;
28
28
  };
29
+ attachmentContent: {
30
+ id: string;
31
+ label: string;
32
+ description: string;
33
+ type: FieldType.STRING;
34
+ required: false;
35
+ };
36
+ attachmentFilename: {
37
+ id: string;
38
+ label: string;
39
+ description: string;
40
+ type: FieldType.STRING;
41
+ required: false;
42
+ };
43
+ attachmentContentType: {
44
+ id: string;
45
+ label: string;
46
+ description: string;
47
+ type: FieldType.STRING;
48
+ required: false;
49
+ };
29
50
  };
51
+ /**
52
+ * Mailgun rejects messages above 25 MB in total. Cap the decoded attachment
53
+ * well below that so the failure surfaces as a clear validation error rather
54
+ * than an opaque API error.
55
+ */
56
+ export declare const MAX_ATTACHMENT_BYTES: number;
57
+ export declare const DEFAULT_ATTACHMENT_CONTENT_TYPE = "application/pdf";
58
+ /**
59
+ * Accepts raw base64 as well as a data URI ("data:application/pdf;base64,....")
60
+ * and returns the bare base64 payload with all whitespace removed.
61
+ */
62
+ export declare const normalizeBase64: (value: string) => string;
63
+ export declare const isValidBase64: (value: string) => boolean;
30
64
  export declare const FieldsValidationSchema: z.ZodObject<{
31
65
  to: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string[], string | undefined>>;
32
66
  subject: z.ZodString;
33
67
  body: z.ZodString;
68
+ attachmentContent: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
69
+ attachmentFilename: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
70
+ attachmentContentType: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
34
71
  }, z.core.$strip>;
35
72
  export declare const validateActionFields: (fields: unknown) => z.infer<typeof FieldsValidationSchema>;
73
+ export interface MailgunAttachment {
74
+ filename: string;
75
+ data: Buffer;
76
+ contentType: string;
77
+ }
78
+ /**
79
+ * Builds the attachment object expected by mailgun.js `messages.create`
80
+ * (`{ filename, data, contentType }`), or `undefined` when no attachment
81
+ * content was provided. Assumes the fields have already been validated.
82
+ */
83
+ export declare const buildAttachment: (fields: z.infer<typeof FieldsValidationSchema>) => MailgunAttachment | undefined;
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateActionFields = exports.FieldsValidationSchema = exports.fields = void 0;
3
+ exports.buildAttachment = exports.validateActionFields = exports.FieldsValidationSchema = exports.isValidBase64 = exports.normalizeBase64 = exports.DEFAULT_ATTACHMENT_CONTENT_TYPE = exports.MAX_ATTACHMENT_BYTES = exports.fields = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const extensions_core_1 = require("@awell-health/extensions-core");
6
6
  const awell_1 = require("../../../../../../src/lib/awell");
7
+ const lodash_1 = require("lodash");
7
8
  exports.fields = {
8
9
  to: {
9
10
  id: 'to',
@@ -31,17 +32,112 @@ exports.fields = {
31
32
  type: extensions_core_1.FieldType.HTML,
32
33
  required: true,
33
34
  },
35
+ attachmentContent: {
36
+ id: 'attachmentContent',
37
+ label: 'Attachment content (base64)',
38
+ description: 'Base64-encoded content of a file to attach, for example the "base64Pdf" data point produced by the Transform "HTML to PDF" action. Leave empty to send the email without an attachment.',
39
+ type: extensions_core_1.FieldType.STRING,
40
+ required: false,
41
+ },
42
+ attachmentFilename: {
43
+ id: 'attachmentFilename',
44
+ label: 'Attachment filename',
45
+ description: 'The filename the recipient will see, including the extension (e.g. "Health-Snapshot.pdf"). Required when attachment content is provided.',
46
+ type: extensions_core_1.FieldType.STRING,
47
+ required: false,
48
+ },
49
+ attachmentContentType: {
50
+ id: 'attachmentContentType',
51
+ label: 'Attachment content type',
52
+ description: 'MIME type of the attachment. Defaults to "application/pdf" when left empty.',
53
+ type: extensions_core_1.FieldType.STRING,
54
+ required: false,
55
+ },
34
56
  };
35
- exports.FieldsValidationSchema = zod_1.z.object({
57
+ /**
58
+ * Mailgun rejects messages above 25 MB in total. Cap the decoded attachment
59
+ * well below that so the failure surfaces as a clear validation error rather
60
+ * than an opaque API error.
61
+ */
62
+ exports.MAX_ATTACHMENT_BYTES = 20 * 1024 * 1024;
63
+ exports.DEFAULT_ATTACHMENT_CONTENT_TYPE = 'application/pdf';
64
+ const BASE64_PATTERN = /^[A-Za-z0-9+/]+={0,2}$/;
65
+ /**
66
+ * Accepts raw base64 as well as a data URI ("data:application/pdf;base64,....")
67
+ * and returns the bare base64 payload with all whitespace removed.
68
+ */
69
+ const normalizeBase64 = (value) => {
70
+ const withoutDataUriPrefix = value.replace(/^data:[^;,]*;base64,/i, '');
71
+ return withoutDataUriPrefix.replace(/\s+/g, '');
72
+ };
73
+ exports.normalizeBase64 = normalizeBase64;
74
+ const isValidBase64 = (value) => value.length > 0 && value.length % 4 === 0 && BASE64_PATTERN.test(value);
75
+ exports.isValidBase64 = isValidBase64;
76
+ const optionalTrimmedString = zod_1.z
77
+ .string()
78
+ .trim()
79
+ .optional()
80
+ .transform((value) => ((0, lodash_1.isNil)(value) || (0, lodash_1.isEmpty)(value) ? undefined : value));
81
+ exports.FieldsValidationSchema = zod_1.z
82
+ .object({
36
83
  to: awell_1.CommaSeparatedEmailsValidationSchema.refine((emails) => emails.length > 0, {
37
84
  error: 'At least one email address is required',
38
85
  }),
39
86
  subject: zod_1.z.string(),
40
87
  body: zod_1.z.string(),
88
+ attachmentContent: optionalTrimmedString,
89
+ attachmentFilename: optionalTrimmedString,
90
+ attachmentContentType: optionalTrimmedString,
91
+ })
92
+ .superRefine((value, ctx) => {
93
+ if ((0, lodash_1.isNil)(value.attachmentContent)) {
94
+ return;
95
+ }
96
+ if ((0, lodash_1.isNil)(value.attachmentFilename)) {
97
+ ctx.addIssue({
98
+ code: 'custom',
99
+ path: ['attachmentFilename'],
100
+ message: 'An attachment filename is required when attachment content is provided.',
101
+ });
102
+ }
103
+ const base64 = (0, exports.normalizeBase64)(value.attachmentContent);
104
+ if (!(0, exports.isValidBase64)(base64)) {
105
+ ctx.addIssue({
106
+ code: 'custom',
107
+ path: ['attachmentContent'],
108
+ message: 'Attachment content is not valid base64. Expected the raw base64 string, e.g. the "base64Pdf" data point from the HTML to PDF action.',
109
+ });
110
+ return;
111
+ }
112
+ const decodedBytes = Buffer.from(base64, 'base64').length;
113
+ if (decodedBytes > exports.MAX_ATTACHMENT_BYTES) {
114
+ ctx.addIssue({
115
+ code: 'custom',
116
+ path: ['attachmentContent'],
117
+ message: `Attachment is ${decodedBytes} bytes, which exceeds the maximum of ${exports.MAX_ATTACHMENT_BYTES} bytes.`,
118
+ });
119
+ }
41
120
  });
42
121
  const validateActionFields = (fields) => {
43
122
  const parsedData = exports.FieldsValidationSchema.parse(fields);
44
123
  return parsedData;
45
124
  };
46
125
  exports.validateActionFields = validateActionFields;
126
+ /**
127
+ * Builds the attachment object expected by mailgun.js `messages.create`
128
+ * (`{ filename, data, contentType }`), or `undefined` when no attachment
129
+ * content was provided. Assumes the fields have already been validated.
130
+ */
131
+ const buildAttachment = (fields) => {
132
+ var _a;
133
+ if ((0, lodash_1.isNil)(fields.attachmentContent) || (0, lodash_1.isNil)(fields.attachmentFilename)) {
134
+ return undefined;
135
+ }
136
+ return {
137
+ filename: fields.attachmentFilename,
138
+ data: Buffer.from((0, exports.normalizeBase64)(fields.attachmentContent), 'base64'),
139
+ contentType: (_a = fields.attachmentContentType) !== null && _a !== void 0 ? _a : exports.DEFAULT_ATTACHMENT_CONTENT_TYPE,
140
+ };
141
+ };
142
+ exports.buildAttachment = buildAttachment;
47
143
  //# sourceMappingURL=fields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/mailgun/v1/actions/sendEmail/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAqC;AACrC,mEAAqE;AACrE,2DAAsF;AAEzE,QAAA,MAAM,GAAG;IACpB,EAAE,EAAE;QACF,EAAE,EAAE,IAAI;QACR,KAAK,EAAE,IAAI;QACX,WAAW,EAAE,qCAAqC;QAClD,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB;;;WAGG;QACH,gCAAgC;QAChC,QAAQ,EAAE,IAAI;KACf;IACD,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,4BAA4B;QACzC,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,WAAW,EAAE,8BAA8B;QAC3C,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,EAAE,EAAE,4CAAoC,CAAC,MAAM,CAC7C,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAC7B;QACE,KAAK,EAAE,wCAAwC;KAChD,CACF;IACD,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;CAC8B,CAAC,CAAA;AAE1C,MAAM,oBAAoB,GAAG,CAClC,MAAe,EACyB,EAAE;IAC1C,MAAM,UAAU,GAAG,8BAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAEvD,OAAO,UAAU,CAAA;AACnB,CAAC,CAAA;AANY,QAAA,oBAAoB,wBAMhC"}
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/mailgun/v1/actions/sendEmail/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAqC;AACrC,mEAAqE;AACrE,2DAAsF;AACtF,mCAAuC;AAE1B,QAAA,MAAM,GAAG;IACpB,EAAE,EAAE;QACF,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ACL,QAAQ,EAAE,MAAM,CAAC,kBAAkB;QACnC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAA,uBAAe,EAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,QAAQ,CAAC;QACtE,WAAW,EAAE,MAAA,MAAM,CAAC,qBAAqB,mCAAI,uCAA+B;KAC7E,CAAA;AACH,CAAC,CAAA;AAZY,QAAA,eAAe,mBAY3B"}
@@ -12,19 +12,34 @@ const utils_1 = require("../../../common/utils");
12
12
  const fields_1 = require("./config/fields");
13
13
  const zod_validation_error_1 = require("zod-validation-error");
14
14
  const zod_1 = require("zod");
15
+ const lodash_1 = require("lodash");
15
16
  const addEventLog_1 = require("../../../../../src/lib/awell/addEventLog");
16
17
  exports.sendEmail = {
17
18
  key: 'sendEmail',
18
19
  title: 'Send email',
19
- description: 'Send an email to a recipient of your choice.',
20
+ description: 'Send an email to a recipient of your choice, optionally with a file attachment.',
20
21
  category: extensions_core_1.Category.COMMUNICATION,
21
22
  fields: config_1.fields,
22
23
  previewable: false,
23
24
  onEvent: async ({ payload, onComplete, onError, helpers }) => {
24
- helpers.log({ fields: payload.fields }, 'Processing sendEmail');
25
+ /**
26
+ * The attachment content can be a large base64 string; log its size
27
+ * rather than the content itself.
28
+ */
29
+ const { attachmentContent, ...loggableFields } = payload.fields;
30
+ helpers.log({
31
+ fields: {
32
+ ...loggableFields,
33
+ attachmentContentLength: (0, lodash_1.isNil)(attachmentContent)
34
+ ? 0
35
+ : String(attachmentContent).length,
36
+ },
37
+ }, 'Processing sendEmail');
25
38
  try {
26
- const { to, subject, body } = (0, fields_1.validateActionFields)(payload.fields);
39
+ const validatedFields = (0, fields_1.validateActionFields)(payload.fields);
40
+ const { to, subject, body } = validatedFields;
27
41
  const { apiKey, domain, region, fromName, fromEmail, testMode } = (0, settings_1.validateSettings)(payload.settings);
42
+ const attachment = (0, fields_1.buildAttachment)(validatedFields);
28
43
  const mg = mailgunSdk_1.default.client({
29
44
  username: 'api',
30
45
  key: apiKey,
@@ -36,11 +51,15 @@ exports.sendEmail = {
36
51
  subject,
37
52
  html: body,
38
53
  'o:testmode': testMode,
54
+ ...(attachment !== undefined && { attachment }),
39
55
  });
56
+ const attachmentSummary = attachment === undefined
57
+ ? ''
58
+ : `, with attachment "${attachment.filename}" (${attachment.data.length} bytes, ${attachment.contentType})`;
40
59
  await onComplete({
41
60
  events: [
42
61
  (0, addEventLog_1.addActivityEventLog)({
43
- message: `Mailgun accepted the request, message ID: ${String(res === null || res === void 0 ? void 0 : res.id)}`,
62
+ message: `Mailgun accepted the request, message ID: ${String(res === null || res === void 0 ? void 0 : res.id)}${attachmentSummary}`,
44
63
  }),
45
64
  ],
46
65
  });
@@ -1 +1 @@
1
- {"version":3,"file":"sendEmail.js","sourceRoot":"","sources":["../../../../../../extensions/mailgun/v1/actions/sendEmail/sendEmail.ts"],"names":[],"mappings":";;;;;;AACA,qCAAiC;AACjC,mEAAwD;AACxD,gDAAmE;AACnE,gFAAuD;AACvD,iDAAiD;AACjD,4CAAsD;AACtD,+DAAmD;AACnD,6BAA8B;AAC9B,0EAA8E;AAEjE,QAAA,SAAS,GAA2C;IAC/D,GAAG,EAAE,WAAW;IAChB,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,8CAA8C;IAC3D,QAAQ,EAAE,0BAAQ,CAAC,aAAa;IAChC,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;QAC3D,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,sBAAsB,CAAC,CAAA;QAE/D,IAAI,CAAC;YACH,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,IAAA,6BAAoB,EAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YAClE,MAAM,EAAE,MAAM,EAAE,MAAM,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AK,CAAC,OAAO,EAAE;6BAC5B;yBACF;qBACF;iBACF,CAAC,CAAA;gBACF,OAAM;YACR,CAAC;YAED,MAAM,KAAK,GAAG,GAAY,CAAA;YAC1B,MAAM,OAAO,CAAC;gBACZ,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;wBAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,qDAAqD,EAAE;wBACnE,KAAK,EAAE;4BACL,QAAQ,EAAE,cAAc;4BACxB,OAAO,EAAE,KAAK,CAAC,OAAO;yBACvB;qBACF;iBACF;aACF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"sendEmail.js","sourceRoot":"","sources":["../../../../../../extensions/mailgun/v1/actions/sendEmail/sendEmail.ts"],"names":[],"mappings":";;;;;;AACA,qCAAiC;AACjC,mEAAwD;AACxD,gDAAmE;AACnE,gFAAuD;AACvD,iDAAiD;AACjD,4CAAuE;AACvE,+DAAmD;AACnD,6BAA8B;AAC9B,mCAA8B;AAC9B,0EAA8E;AAEjE,QAAA,SAAS,GAA2C;IAC/D,GAAG,EAAE,WAAW;IAChB,KAAK,EAAE,YAAY;IACnB,WAAW,EACT,iFAAiF;IACnF,QAAQ,EAAE,0BAAQ,CAAC,aAAa;IAChC,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;QAC3D;;;WAGG;QACH,MAAM,EAAE,iBAAiB,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,CAAC,MAAM,CAAA;QAC/D,OAAO,CAAC,GAAG,CACT;YACE,MAAM,EAAE;gBACN,GAAG,cAAc;gBACjB,uBAAuB,EAAE,IAAA,cAAK,EAAC,iBAAiB,CAAC;oBAC/C,CAAC,CAAC,CAAC;oBACH,CAAC,CAAC,MAAM,CA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,6CAA6C,MAAM,CAC1D,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,EAAE,CACR,GAAG,iBAAiB,EAAE;qBACxB,CAAC;iBACH;aACF,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,GAAY,CAAC,CAAA;YAC3C,IAAI,GAAG,YAAY,cAAQ,EAAE,CAAC;gBAC5B,MAAM,KAAK,GAAG,IAAA,mCAAY,EAAC,GAAG,CAAC,CAAA;gBAC/B,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,IAAI,EAAE;4BACxB,KAAK,EAAE;gCACL,QAAQ,EAAE,aAAa;gCACvB,OAAO,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE;6BAC5B;yBACF;qBACF;iBACF,CAAC,CAAA;gBACF,OAAM;YACR,CAAC;YAED,MAAM,KAAK,GAAG,GAAY,CAAA;YAC1B,MAAM,OAAO,CAAC;gBACZ,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;wBAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,qDAAqD,EAAE;wBACnE,KAAK,EAAE;4BACL,QAAQ,EAAE,cAAc;4BACxB,OAAO,EAAE,KAAK,CAAC,OAAO;yBACvB;qBACF;iBACF;aACF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA"}
@@ -144,8 +144,8 @@
144
144
  "changelog": "# Mailchimp changelog"
145
145
  },
146
146
  "mailgun": {
147
- "readme": "---\ntitle: Mailgun\ndescription: Mailgun is a cloud-based email delivery service that allows businesses and developers to send, receive, and track email messages.\n---\n# Mailgun\n\nMailgun is a cloud-based email delivery service that allows businesses and developers to send, receive, and track email messages. It provides a powerful set of APIs that enable users to integrate email into their applications, automate email delivery, and improve deliverability rates. \n\nWith Mailgun, users can send transactional emails as well as marketing emails, newsletters, and other types of bulk email. The platform also offers real-time email analytics and tools to manage unsubscribes and bounces. Overall, Mailgun provides a reliable and scalable solution for businesses and developers to handle their email needs.\n\n## Extension settings\n\nIn order to set up this extension, you will need to provide a:\n\n1. Mailgun API key\n2. Mailgun domain\n3. From name\n4. From email\n\n## Custom Actions\n\n### Send email\n\nAllows for sending a plain email to a recipient.\n\n### Send email with a template\n\nAllows for sending an email based on a template to a recipient. You can also insert variables so they are rendered in your template.\n",
148
- "changelog": "# Mailgun changelog"
147
+ "readme": "---\ntitle: Mailgun\ndescription: Mailgun is a cloud-based email delivery service that allows businesses and developers to send, receive, and track email messages.\n---\n# Mailgun\n\nMailgun is a cloud-based email delivery service that allows businesses and developers to send, receive, and track email messages. It provides a powerful set of APIs that enable users to integrate email into their applications, automate email delivery, and improve deliverability rates. \n\nWith Mailgun, users can send transactional emails as well as marketing emails, newsletters, and other types of bulk email. The platform also offers real-time email analytics and tools to manage unsubscribes and bounces. Overall, Mailgun provides a reliable and scalable solution for businesses and developers to handle their email needs.\n\n## Extension settings\n\nIn order to set up this extension, you will need to provide a:\n\n1. Mailgun API key\n2. Mailgun domain\n3. From name\n4. From email\n\n## Custom Actions\n\n### Send email\n\nAllows for sending a plain email to a recipient, optionally with a single file attachment.\n\n**Inputs:**\n\n- **To** (required): recipient email address(es), comma-separated.\n- **Subject** (required)\n- **Body** (required): HTML content of the email.\n- **Attachment content (base64)** (optional): the base64-encoded file to attach. Typically bound to the `base64Pdf` data point produced by the Transform extension's \"HTML to PDF\" action.\n- **Attachment filename** (optional, required when attachment content is set): the filename the recipient sees, including extension, e.g. `Health-Snapshot.pdf`.\n- **Attachment content type** (optional): MIME type of the attachment. Defaults to `application/pdf`.\n\nLeave the attachment fields empty to send the email without an attachment. Attachments are limited to 20 MB (decoded) to stay under Mailgun's 25 MB message limit.\n\n### Send email with a template\n\nAllows for sending an email based on a template to a recipient. You can also insert variables so they are rendered in your template.\n",
148
+ "changelog": "# Mailgun changelog\n\n## Unreleased\n\n- \"Send email\": added optional file attachment support via three new fields: attachment content (base64), attachment filename, and attachment content type (defaults to `application/pdf`). Designed to attach the `base64Pdf` output of the Transform \"HTML to PDF\" action. Existing care flows are unaffected when the new fields are left empty.\n"
149
149
  },
150
150
  "math": {
151
151
  "readme": "---\ntitle: Math\ndescription: This extension adds custom actions to your care flow for simple mathematical operations.\n---\n# Math\n\nThis extension adds custom actions to your care flow for simple mathematical operations.\n\n## Custom Actions\n\n### Sum\n\nCalculate the sum of two or more addends.\n\n### Subtract\n\nCalculate the difference between two numbers.\n\n### Multiply\n\nMultiply a series of numbers to get a final product.\n\n### Divide\n\nDivide two numbers.\n\n### Generate random number\n\nGenerates a random (whole) number that falls between the ranges of two numbers [min, max].\n\n### Assign to cohort\n\nDeterministically assign any string value (e.g. patient ID, email, UUID) to a cohort number between 1 and a given number of cohorts. The same input will always produce the same cohort, making this action ideal for A/B testing and patient randomization.\n\n**Inputs:**\n- **Input value**: Any string used to determine the cohort assignment.\n- **Number of cohorts**: The total number of cohorts to distribute inputs across (must be >= 1).\n\n**Output:**\n- **Cohort number**: An integer between 1 and the number of cohorts (inclusive).\n\n> **Note:** When the number of cohorts changes, a patient's assigned cohort may change because the underlying hash modulo base changes. This action does not guarantee cohort stability across different values of the number of cohorts.\n\n### Calculate date difference\n\nCalculate the difference between two dates where \"date left\" is the minuend and \"date right\" the subtrahend.\n\n**You can choose the unit in which you would like to see the difference expressed:**\n\n1. Seconds: get the number of seconds between the given dates. Fractional seconds are truncated towards zero.\n2. Minutes: get the signed number of full (rounded towards 0) minutes between the given dates. Fractional minutes are truncated towards zero.\n3. Hours: get the number of hours between the given dates. Fractional hours are truncated towards zero.\n4. Days: get the number of full day periods between two dates. Fractional days are truncated towards zero.\n5. Weeks: get the number of full weeks between two dates. Fractional weeks are truncated towards zero.\n6. Months: get the number of full months between the given dates. Fractional months are truncated towards zero.\n7. Years: get the number of full years between the given dates.\n",
@@ -217,7 +217,7 @@
217
217
  },
218
218
  "transform": {
219
219
  "readme": "---\ntitle: Transform\ndescription: Transform is an extension with utility functions that allows you to transform or parse data to a format of your liking\n---\n\n# Transform\n\nTransform is an extension on Awell's Marketplace with utility functions that allows you to transform data from one type to another. These functions are particularly useful e.g. when system A works with IDs that are numbers but system B works with IDs that are strings.\n\n## Custom Actions\n\n### Parse number to text\n\nTransform or parse a number to text (string).\n\n### Parse text to number\n\nTransform or parse text (string) to a number. Will return NaN if the input data is not an actual number.\n\n### Parse date to unix timestamp\n\nTransform or parse a date to a unix timestamp.\n\n### Parse unix timestamp to unix date\n\nTransform or parse a unix timestamp to a date.\n\n## Parse number to text with dictionary\n\nTransform or parse a number to a string using a dictionary. Useful for when you have numeric data points but want to map them to strings based on a dictionary. When the action is called with a number that does not have a corresponding mapping in the provided dictionary, it simply returns the number itself as a string. \n\nThe dictionary should be structured in JSON format with string keys mapping to string values. Each key represents a number (as a string), and each value is the corresponding text representation.\n\n**Example:**\n```json\n{\n \"0\": \"Male\",\n \"1\": \"Female\",\n \"2\": \"Not known\",\n // ... other number mappings ...\n}\n```\n\n## Generate dynamic URL\n\nGenerate a dynamic URL based on a URL template with placeholder and a data point value.\n\n```\nurlTemplate https://your-url.com/{{placeholder}}\nvalue hello-world\noutcome https://your-url.com/hello-world\n```\n\n## Feet and inches to inches\n\nConverts a measurement in feet and inches to just inches.\n\n## Combine date and time\n\nCombines a reference date with a time string to create a complete datetime in UTC format. This action supports two input formats for the time string:\n\n1. **Simple time format (HH:mm:ss)**: Combines the reference date with the specified time in ISO format (e.g., \"14:30:00\" not \"2PM\")\n2. **Full datetime with timezone**: Accepts ISO8601 datetime strings with timezone offsets and converts them to UTC\n\n**Examples:**\n\n**Example 1 - Simple time combination:**\n```\nReference date: 2025-09-13\nTime string: 17:45:00\nResult: 2025-09-13T17:45:00Z\n```\n\n**Example 2 - Reference date precedence with timezone-aware datetime:**\n```\nReference date: 2025-09-01\nTime string: 2025-09-06T15:34:44+02:00\nResult: 2025-09-01T13:34:44Z (reference date takes precedence, time converted from +02:00 to UTC)\n```\n\n**Example 3 - Different timezone offset:**\n```\nReference date: 2025-09-06\nTime string: 2025-09-06T10:30:00-05:00\nResult: 2025-09-06T15:30:00Z (converted from -05:00 to UTC)\n```\n\nThis action is particularly useful for scheduling systems like Bland API where you need to combine dates and times from different sources, or when working with timezone-aware scheduling data that needs to be normalized to UTC.\n",
220
- "changelog": "# Transform changelog\n\n## June 2024\n\n- Added \"Feet and inches to inches\" action\n## March 2024\n\n- Added \"Generate dynamic URL\" action\n\n## January 2024\n\n- Added \"Parse number to text with dictionary\" action"
220
+ "changelog": "# Transform changelog\n\n## Unreleased\n\n- Fixed \"HTML to PDF\" ignoring the Options field. Awell delivers JSON fields as a string; the action now parses it before forwarding to the PDF server, so page format, margins, and header/footer settings take effect. Invalid JSON in Options now fails the activity with a clear validation message instead of being silently ignored.\n\n## June 2024\n\n- Added \"Feet and inches to inches\" action\n## March 2024\n\n- Added \"Generate dynamic URL\" action\n\n## January 2024\n\n- Added \"Parse number to text with dictionary\" action"
221
221
  },
222
222
  "twilio": {
223
223
  "readme": "---\ntitle: Twilio\ndescription: Twilio is a customer engagement platform used by hundreds of thousands of businesses and more than ten million developers worldwide to build unique, personalized experiences for their customers.\n---\n# Twilio\n\nTwilio is a customer engagement platform used by hundreds of thousands of businesses and more than ten million developers worldwide to build unique, personalized experiences for their customers.\n\nThey are known for democratizing channels like voice, text, chat, video, and email through APIs, making it easy for every organization to build meaningful interactions with customers on the channels they prefer.\n\n## Extension settings\n\nIn order to set up this extension, you will need:\n\n1. A Twilio API key or auth token which can be found in the Twilio console.\n2. Your account SID which can be found in the Twilio console.\n3. A phone number to send the message from. This must be a Twilio phone number that you own.\n\n## User consent\n\nThe extension has some built-in mechanisms to enforce compliance with [Twilio's messaging policy](https://www.twilio.com/en-us/legal/messaging-policy).\n\n### Opt-out\n\nBy default, every text message will be appended with standard opt-out language (\"Reply STOP to unsubscribe.\"). You can specify custom opt-out language within the settings of the extension but make sure the opt-out keywords used are supported. STOP, UNSTOP, UNSUBSCRIBE or CANCEL are the default opt-out keywords supported but Twilio also supports defining custom stop keywords.\n\nIf you don't want to append opt-out language to your text messages, set the \"Add opt-out language\" setting to \"Off\".\n\nFor more information, please visit the Twilio docs.\n\n### Sending text messages to recipients that opted out\n\nIf you attempt to send a text message to a recipient who has opted out, the message will fail to be delivered and the action will be marked as failed. This is the default behavior of Twilio's API, which prevents sending texts to anyone who has chosen to opt out.\n\n## Custom Actions\n\n### Send SMS\n\nSend an SMS with Twilio to a recipient of your liking.\n\n### Get messages\n\nGet a list of text messages matching the given criteria. Only the last 50 messages are returned.\n\n## Send SMS during working hours\n\nThis action allows for the scheduling of SMS messages to be sent within the \"daily operational hours\" of 9 AM to 5 PM. It ensures that text messages are dispatched at appropriate times during the day, avoiding early morning or late-night disturbances to recipients.\n\n**Here's how it works:**\n\n- If the action is activate during business hours (9 AM to 5 PM), the SMS is sent immediately.\n- If activated before 9 AM, the SMS is scheduled to be sent at 9 AM on the same day.\n- If activated after 5 PM, the SMS is scheduled to be sent at 9 AM the following day.\n\nThis setup ensures that all messages reach your respondents during reasonable daytime hours, enhancing the likelihood of a timely and considerate communication. It's important to mention that messages will still be dispatched over the weekend, but they will adhere to the \"business hours\" schedule of 9 AM to 5 PM.\n\nNote that scheduling messages with Twilio is only possible if you send text messages using a MessagingServiceSid.\n\n\n\n\n\n\n",
@@ -18,5 +18,5 @@ export declare const fields: {
18
18
  };
19
19
  export declare const FieldsValidationSchema: z.ZodObject<{
20
20
  htmlString: z.ZodString;
21
- options: z.ZodOptional<z.ZodAny>;
21
+ options: z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>]>>, z.ZodTransform<Record<string, unknown> | undefined, string | Record<string, any> | undefined>>;
22
22
  }, z.core.$strip>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FieldsValidationSchema = exports.fields = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const extensions_core_1 = require("@awell-health/extensions-core");
6
+ const lodash_1 = require("lodash");
6
7
  exports.fields = {
7
8
  htmlString: {
8
9
  id: 'htmlString',
@@ -19,8 +20,45 @@ exports.fields = {
19
20
  required: false,
20
21
  },
21
22
  };
23
+ /**
24
+ * Awell delivers JSON fields to the extension as a string. Parse it so the
25
+ * options object is forwarded to the PDF server as an object. Objects are
26
+ * accepted as-is so existing callers and tests keep working.
27
+ */
28
+ const OptionsSchema = zod_1.z
29
+ .union([zod_1.z.string(), zod_1.z.record(zod_1.z.string(), zod_1.z.any())])
30
+ .optional()
31
+ .transform((value, ctx) => {
32
+ if ((0, lodash_1.isNil)(value))
33
+ return undefined;
34
+ if (typeof value !== 'string')
35
+ return value;
36
+ const trimmed = value.trim();
37
+ if ((0, lodash_1.isEmpty)(trimmed) || (0, lodash_1.isNil)(trimmed))
38
+ return undefined;
39
+ try {
40
+ const parsed = JSON.parse(trimmed);
41
+ if (typeof parsed !== 'object' ||
42
+ parsed === null ||
43
+ Array.isArray(parsed)) {
44
+ ctx.addIssue({
45
+ code: zod_1.z.ZodIssueCode.custom,
46
+ message: 'Options must be a JSON object',
47
+ });
48
+ return zod_1.z.NEVER;
49
+ }
50
+ return parsed;
51
+ }
52
+ catch (err) {
53
+ ctx.addIssue({
54
+ code: zod_1.z.ZodIssueCode.custom,
55
+ message: 'Options is not valid JSON',
56
+ });
57
+ return zod_1.z.NEVER;
58
+ }
59
+ });
22
60
  exports.FieldsValidationSchema = zod_1.z.object({
23
61
  htmlString: zod_1.z.string().min(1),
24
- options: zod_1.z.any().optional(),
62
+ options: OptionsSchema,
25
63
  });
26
64
  //# sourceMappingURL=fields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/transform/v1/actions/htmlToPdf/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAgC;AAChC,mEAAqE;AAExD,QAAA,MAAM,GAAG;IACpB,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,sCAAsC;QACnD,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,SAAS;QAChB,WAAW,EACT,wEAAwE;QAC1E,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,KAAK;KAChB;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,OAAO,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAA"}
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/transform/v1/actions/htmlToPdf/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAqC;AACrC,mEAAqE;AACrE,mCAAuC;AAE1B,QAAA,MAAM,GAAG;IACpB,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,sCAAsC;QACnD,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,SAAS;QAChB,WAAW,EACT,wEAAwE;QAC1E,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,KAAK;KAChB;CAC8B,CAAA;AAEjC;;;;GAIG;AACH,MAAM,aAAa,GAAG,OAAC;KACpB,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,CAAC,OA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,7 +12,7 @@ exports.htmlToPdf = {
12
12
  category: extensions_core_1.Category.DATA,
13
13
  fields: config_1.fields,
14
14
  dataPoints: config_1.dataPoints,
15
- previewable: false,
15
+ previewable: true,
16
16
  onEvent: async ({ payload, onComplete, onError, helpers }) => {
17
17
  helpers.log({ fields: payload.fields }, 'Processing htmlToPdf');
18
18
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"htmlToPdf.js","sourceRoot":"","sources":["../../../../../../extensions/transform/v1/actions/htmlToPdf/htmlToPdf.ts"],"names":[],"mappings":";;;AACA,mEAAkE;AAElE,qCAAqE;AACrE,6BAAuB;AACvB,kEAAoE;AAEvD,QAAA,SAAS,GAIlB;IACF,GAAG,EAAE,WAAW;IAChB,KAAK,EAAE,aAAa;IACpB,WAAW,EACT,0FAA0F;IAC5F,QAAQ,EAAE,0BAAQ,CAAC,IAAI;IACvB,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,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,sBAAsB,CAAC,CAAA;QAE/D,IAAI,CAAC;YACH,MAAM,EACJ,MAAM,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,GAChC,GAAG,IAAA,0BAAQ,EAAC;gBACX,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;oBACf,MAAM,EAAE,+BAAsB;iBAC/B,CAAC;gBACF,OAAO;aACR,CAAC,CAAA;YAEF,MAAM,SAAS,GAAG,MAAM,IAAA,2BAAe,EAAC,UAAU,EAAE,OAAO,CAAC,CAAA;YAE5D,OAAO,CAAC,GAAG,CACT;gBACE,gBAAgB,EAAE,UAAU,CAAC,MAAM;gBACnC,OAAO;gBACP,eAAe,EAAE,SAAS,CAAC,MAAM;aAClC,EACD,uBAAuB,CACxB,CAAA;YAED,MAAM,UAAU,CAAC;gBACf,WAAW,EAAE;oBACX,SAAS;iBACV;aACF,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,GAAY,CAAC,CAAA;YAC3C,MAAM,KAAK,GAAG,GAAY,CAAA;YAC1B,MAAM,OAAO,CAAC;gBACZ,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;wBAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE;wBAC3B,KAAK,EAAE;4BACL,QAAQ,EAAE,cAAc;4BACxB,OAAO,EAAE,KAAK,CAAC,OAAO;yBACvB;qBACF;iBACF;aACF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"htmlToPdf.js","sourceRoot":"","sources":["../../../../../../extensions/transform/v1/actions/htmlToPdf/htmlToPdf.ts"],"names":[],"mappings":";;;AACA,mEAAkE;AAElE,qCAAqE;AACrE,6BAAuB;AACvB,kEAAoE;AAEvD,QAAA,SAAS,GAIlB;IACF,GAAG,EAAE,WAAW;IAChB,KAAK,EAAE,aAAa;IACpB,WAAW,EACT,0FAA0F;IAC5F,QAAQ,EAAE,0BAAQ,CAAC,IAAI;IACvB,MAAM,EAAN,eAAM;IACN,UAAU,EAAV,mBAAU;IACV,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;QAC3D,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,sBAAsB,CAAC,CAAA;QAE/D,IAAI,CAAC;YACH,MAAM,EACJ,MAAM,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,GAChC,GAAG,IAAA,0BAAQ,EAAC;gBACX,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;oBACf,MAAM,EAAE,+BAAsB;iBAC/B,CAAC;gBACF,OAAO;aACR,CAAC,CAAA;YAEF,MAAM,SAAS,GAAG,MAAM,IAAA,2BAAe,EAAC,UAAU,EAAE,OAAO,CAAC,CAAA;YAE5D,OAAO,CAAC,GAAG,CACT;gBACE,gBAAgB,EAAE,UAAU,CAAC,MAAM;gBACnC,OAAO;gBACP,eAAe,EAAE,SAAS,CAAC,MAAM;aAClC,EACD,uBAAuB,CACxB,CAAA;YAED,MAAM,UAAU,CAAC;gBACf,WAAW,EAAE;oBACX,SAAS;iBACV;aACF,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,GAAY,CAAC,CAAA;YAC3C,MAAM,KAAK,GAAG,GAAY,CAAA;YAC1B,MAAM,OAAO,CAAC;gBACZ,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;wBAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE;wBAC3B,KAAK,EAAE;4BACL,QAAQ,EAAE,cAAc;4BACxB,OAAO,EAAE,KAAK,CAAC,OAAO;yBACvB;qBACF;iBACF;aACF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/awell-extensions",
3
- "version": "2.1.178",
3
+ "version": "2.1.180",
4
4
  "packageManager": "yarn@4.5.3",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {