@awell-health/awell-extensions 2.1.178 → 2.1.179
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extensions/markdown.json +1 -1
- package/dist/extensions/transform/v1/actions/htmlToPdf/config/fields.d.ts +1 -1
- package/dist/extensions/transform/v1/actions/htmlToPdf/config/fields.js +39 -1
- package/dist/extensions/transform/v1/actions/htmlToPdf/config/fields.js.map +1 -1
- package/dist/extensions/transform/v1/actions/htmlToPdf/htmlToPdf.js +1 -1
- package/dist/extensions/transform/v1/actions/htmlToPdf/htmlToPdf.js.map +1 -1
- package/package.json +1 -1
|
@@ -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:
|
|
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,
|
|
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,SA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ACrC,CAAC,CAAA;QACF,OAAO,OAAC,CAAC,KAAK,CAAA;IAChB,CAAC;AACH,CAAC,CAAC,CAAA;AAES,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,OAAO,EAAE,aAAa;CACwB,CAAC,CAAA"}
|
|
@@ -12,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:
|
|
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,
|
|
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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