@awell-health/awell-extensions 1.1.31 → 1.1.33

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. package/dist/extensions/experimental/v1/actions/enterMedication/config/datapoints.d.ts +2 -2
  2. package/dist/extensions/experimental/v1/actions/enterMedication/config/datapoints.js +3 -3
  3. package/dist/extensions/experimental/v1/actions/enterMedication/config/datapoints.js.map +1 -1
  4. package/dist/extensions/experimental/v1/actions/enterMedication/config/fields.d.ts +17 -2
  5. package/dist/extensions/experimental/v1/actions/enterMedication/config/fields.js +13 -2
  6. package/dist/extensions/experimental/v1/actions/enterMedication/config/fields.js.map +1 -1
  7. package/dist/extensions/experimental/v1/actions/enterMedication/enterMedication.test.js +3 -1
  8. package/dist/extensions/experimental/v1/actions/enterMedication/enterMedication.test.js.map +1 -1
  9. package/dist/extensions/markdown.json +2 -2
  10. package/dist/extensions/transform/index.js +1 -0
  11. package/dist/extensions/transform/index.js.map +1 -1
  12. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/config/dataPoints.d.ts +6 -0
  13. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/config/dataPoints.js +10 -0
  14. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/config/dataPoints.js.map +1 -0
  15. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/config/fields.d.ts +26 -0
  16. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/config/fields.js +24 -0
  17. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/config/fields.js.map +1 -0
  18. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/config/index.d.ts +2 -0
  19. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/config/index.js +9 -0
  20. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/config/index.js.map +1 -0
  21. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/feetAndInchesToInches.d.ts +4 -0
  22. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/feetAndInchesToInches.js +30 -0
  23. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/feetAndInchesToInches.js.map +1 -0
  24. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/feetAndInchesToInches.test.d.ts +1 -0
  25. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/feetAndInchesToInches.test.js +42 -0
  26. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/feetAndInchesToInches.test.js.map +1 -0
  27. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/index.d.ts +1 -0
  28. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/index.js +6 -0
  29. package/dist/extensions/transform/v1/actions/feetAndInchesToInches/index.js.map +1 -0
  30. package/dist/extensions/transform/v1/actions/index.d.ts +1 -0
  31. package/dist/extensions/transform/v1/actions/index.js +3 -1
  32. package/dist/extensions/transform/v1/actions/index.js.map +1 -1
  33. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  export declare const dataPoints: {
2
- stringifiedMedicationData: {
2
+ medicationData: {
3
3
  key: string;
4
- valueType: "string";
4
+ valueType: "json";
5
5
  };
6
6
  };
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.dataPoints = void 0;
4
4
  exports.dataPoints = {
5
- stringifiedMedicationData: {
6
- key: 'stringifiedMedicationData',
7
- valueType: 'string',
5
+ medicationData: {
6
+ key: 'medicationData',
7
+ valueType: 'json',
8
8
  },
9
9
  };
10
10
  //# sourceMappingURL=datapoints.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"datapoints.js","sourceRoot":"","sources":["../../../../../../../extensions/experimental/v1/actions/enterMedication/config/datapoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,yBAAyB,EAAE;QACzB,GAAG,EAAE,2BAA2B;QAChC,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
1
+ {"version":3,"file":"datapoints.js","sourceRoot":"","sources":["../../../../../../../extensions/experimental/v1/actions/enterMedication/config/datapoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,cAAc,EAAE;QACd,GAAG,EAAE,gBAAgB;QACrB,SAAS,EAAE,MAAM;KAClB;CAC4C,CAAA"}
@@ -1,3 +1,18 @@
1
+ import { FieldType } from '@awell-health/extensions-core';
1
2
  import { z } from 'zod';
2
- export declare const fields: {};
3
- export declare const FieldsValidationSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
3
+ export declare const fields: {
4
+ label: {
5
+ id: string;
6
+ label: string;
7
+ type: FieldType.HTML;
8
+ required: false;
9
+ description: string;
10
+ };
11
+ };
12
+ export declare const FieldsValidationSchema: z.ZodObject<{
13
+ label: z.ZodOptional<z.ZodString>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ label?: string | undefined;
16
+ }, {
17
+ label?: string | undefined;
18
+ }>;
@@ -1,7 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FieldsValidationSchema = exports.fields = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
4
5
  const zod_1 = require("zod");
5
- exports.fields = {};
6
- exports.FieldsValidationSchema = zod_1.z.object({});
6
+ exports.fields = {
7
+ label: {
8
+ id: 'label',
9
+ label: 'Label',
10
+ type: extensions_core_1.FieldType.HTML,
11
+ required: false,
12
+ description: 'A label or description that will be shown above the question',
13
+ },
14
+ };
15
+ exports.FieldsValidationSchema = zod_1.z.object({
16
+ label: zod_1.z.string().optional(),
17
+ });
7
18
  //# sourceMappingURL=fields.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/experimental/v1/actions/enterMedication/config/fields.ts"],"names":[],"mappings":";;;AACA,6BAAwC;AAE3B,QAAA,MAAM,GAAG,EAAkC,CAAA;AAE3C,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAC5C,EAAoD,CACrD,CAAA"}
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/experimental/v1/actions/enterMedication/config/fields.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,6BAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,KAAK,EAAE;QACL,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,8DAA8D;KAC5E;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACqB,CAAC,CAAA"}
@@ -10,7 +10,9 @@ describe('Experimental - Enter medication', () => {
10
10
  });
11
11
  test('Should work', async () => {
12
12
  const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
13
- fields: {},
13
+ fields: {
14
+ label: '<p>Test</p>',
15
+ },
14
16
  settings: {},
15
17
  });
16
18
  await _1.enterMedication.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
@@ -1 +1 @@
1
- {"version":3,"file":"enterMedication.test.js","sourceRoot":"","sources":["../../../../../../extensions/experimental/v1/actions/enterMedication/enterMedication.test.ts"],"names":[],"mappings":";;AAAA,wBAAmC;AACnC,oDAA8D;AAE9D,QAAQ,CAAC,iCAAiC,EAAE,GAAG,EAAE;IAC/C,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAEzB,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE;QAC7B,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,EAAE;SACb,CAAC,CAAA;QAEF,MAAM,kBAAe,CAAC,iBAAiB,CACrC,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,CAAA;QAChC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"enterMedication.test.js","sourceRoot":"","sources":["../../../../../../extensions/experimental/v1/actions/enterMedication/enterMedication.test.ts"],"names":[],"mappings":";;AAAA,wBAAmC;AACnC,oDAA8D;AAE9D,QAAQ,CAAC,iCAAiC,EAAE,GAAG,EAAE;IAC/C,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAEzB,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE;QAC7B,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,KAAK,EAAE,aAAa;aACrB;YACD,QAAQ,EAAE,EAAE;SACb,CAAC,CAAA;QAEF,MAAM,kBAAe,CAAC,iBAAiB,CACrC,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,CAAA;QAChC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -128,8 +128,8 @@
128
128
  "changelog": "# TextLine changelog\n\n## 2024-03-11\n\n1. Add option to set department ID when sending messages and when retrieving messages. Check official documentation here: https://textline.docs.apiary.io/#reference/conversations/phone-numbers/message-a-phone-number\n## 2024-03-5\n\n1. Add capability to set contact consent status (https://textline.docs.apiary.io/#reference/customers/set-contact-consent/set-contact-consent)\n2. Add several fixes and tweaks to improve current actions\n\n## 2024-02-26\n\n1. Add capability to search for messages using all the allowed filters provided by TextLine API.\n2. Add \"Send SMS\" action\n"
129
129
  },
130
130
  "transform": {
131
- "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```",
132
- "changelog": "# Transform changelog\n\n## March 2024\n\n- Added \"Generate dynamic URL\" action\n\n## January 2024\n\n- Added \"Parse number to text with dictionary\" action"
131
+ "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.",
132
+ "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"
133
133
  },
134
134
  "twilio": {
135
135
  "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## 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",
@@ -14,6 +14,7 @@ exports.Transform = {
14
14
  authorType: extensions_core_1.AuthorType.AWELL,
15
15
  },
16
16
  actions: {
17
+ feetAndInchesToInches: actions_1.feetAndInchesToInches,
17
18
  parseDateToUnixTimestamp: actions_1.parseDateToUnixTimestamp,
18
19
  parseNumberToText: actions_1.parseNumberToText,
19
20
  parseTextToNumber: actions_1.parseTextToNumber,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/transform/index.ts"],"names":[],"mappings":";;;AACA,mEAAoE;AACpE,0CAQqB;AACrB,yCAAqC;AAExB,QAAA,SAAS,GAAc;IAClC,GAAG,EAAE,WAAW;IAChB,KAAK,EAAE,WAAW;IAClB,QAAQ,EACN,mLAAmL;IACrL,WAAW,EACT,qIAAqI;IACvI,QAAQ,EAAE,0BAAQ,CAAC,IAAI;IACvB,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,OAAO,EAAE;QACP,wBAAwB,EAAxB,kCAAwB;QACxB,iBAAiB,EAAjB,2BAAiB;QACjB,iBAAiB,EAAjB,2BAAiB;QACjB,wBAAwB,EAAxB,kCAAwB;QACxB,+BAA+B,EAA/B,yCAA+B;QAC/B,kBAAkB,EAAlB,4BAAkB;QAClB,wBAAwB,EAAxB,kCAAwB;KACzB;IACD,QAAQ,EAAR,mBAAQ;CACT,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/transform/index.ts"],"names":[],"mappings":";;;AACA,mEAAoE;AACpE,0CASqB;AACrB,yCAAqC;AAExB,QAAA,SAAS,GAAc;IAClC,GAAG,EAAE,WAAW;IAChB,KAAK,EAAE,WAAW;IAClB,QAAQ,EACN,mLAAmL;IACrL,WAAW,EACT,qIAAqI;IACvI,QAAQ,EAAE,0BAAQ,CAAC,IAAI;IACvB,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,OAAO,EAAE;QACP,qBAAqB,EAArB,+BAAqB;QACrB,wBAAwB,EAAxB,kCAAwB;QACxB,iBAAiB,EAAjB,2BAAiB;QACjB,iBAAiB,EAAjB,2BAAiB;QACjB,wBAAwB,EAAxB,kCAAwB;QACxB,+BAA+B,EAA/B,yCAA+B;QAC/B,kBAAkB,EAAlB,4BAAkB;QAClB,wBAAwB,EAAxB,kCAAwB;KACzB;IACD,QAAQ,EAAR,mBAAQ;CACT,CAAA"}
@@ -0,0 +1,6 @@
1
+ export declare const dataPoints: {
2
+ inches: {
3
+ key: string;
4
+ valueType: "number";
5
+ };
6
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataPoints = void 0;
4
+ exports.dataPoints = {
5
+ inches: {
6
+ key: 'inches',
7
+ valueType: 'number',
8
+ },
9
+ };
10
+ //# sourceMappingURL=dataPoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../../../extensions/transform/v1/actions/feetAndInchesToInches/config/dataPoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,MAAM,EAAE;QACN,GAAG,EAAE,QAAQ;QACb,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ import { FieldType } from '@awell-health/extensions-core';
3
+ export declare const fields: {
4
+ feet: {
5
+ id: string;
6
+ label: string;
7
+ type: FieldType.NUMERIC;
8
+ required: true;
9
+ };
10
+ inches: {
11
+ id: string;
12
+ label: string;
13
+ type: FieldType.NUMERIC;
14
+ required: true;
15
+ };
16
+ };
17
+ export declare const FieldsValidationSchema: z.ZodObject<{
18
+ feet: z.ZodNumber;
19
+ inches: z.ZodNumber;
20
+ }, "strip", z.ZodTypeAny, {
21
+ feet: number;
22
+ inches: number;
23
+ }, {
24
+ feet: number;
25
+ inches: number;
26
+ }>;
@@ -0,0 +1,24 @@
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
+ exports.fields = {
7
+ feet: {
8
+ id: 'feet',
9
+ label: 'Feet',
10
+ type: extensions_core_1.FieldType.NUMERIC,
11
+ required: true,
12
+ },
13
+ inches: {
14
+ id: 'inches',
15
+ label: 'Inches',
16
+ type: extensions_core_1.FieldType.NUMERIC,
17
+ required: true,
18
+ },
19
+ };
20
+ exports.FieldsValidationSchema = zod_1.z.object({
21
+ feet: zod_1.z.number(),
22
+ inches: zod_1.z.number(),
23
+ });
24
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/transform/v1/actions/feetAndInchesToInches/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAwC;AACxC,mEAAqE;AAExD,QAAA,MAAM,GAAG;IACpB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,2BAAS,CAAC,OAAO;QACvB,QAAQ,EAAE,IAAI;KACf;IACD,MAAM,EAAE;QACN,EAAE,EAAE,QAAQ;QACZ,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,2BAAS,CAAC,OAAO;QACvB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;CAC+B,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { fields, FieldsValidationSchema } from './fields';
2
+ export { dataPoints } from './dataPoints';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataPoints = exports.FieldsValidationSchema = exports.fields = void 0;
4
+ var fields_1 = require("./fields");
5
+ Object.defineProperty(exports, "fields", { enumerable: true, get: function () { return fields_1.fields; } });
6
+ Object.defineProperty(exports, "FieldsValidationSchema", { enumerable: true, get: function () { return fields_1.FieldsValidationSchema; } });
7
+ var dataPoints_1 = require("./dataPoints");
8
+ Object.defineProperty(exports, "dataPoints", { enumerable: true, get: function () { return dataPoints_1.dataPoints; } });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../extensions/transform/v1/actions/feetAndInchesToInches/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
@@ -0,0 +1,4 @@
1
+ import { type Action } from '@awell-health/extensions-core';
2
+ import { type settings } from '../../../settings';
3
+ import { dataPoints, fields } from './config';
4
+ export declare const feetAndInchesToInches: Action<typeof fields, typeof settings, keyof typeof dataPoints>;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.feetAndInchesToInches = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const config_1 = require("./config");
6
+ const zod_1 = require("zod");
7
+ exports.feetAndInchesToInches = {
8
+ key: 'feetAndInchesToInches',
9
+ title: 'Feet and inches to inches',
10
+ description: 'Transform feet and inches to inches',
11
+ category: extensions_core_1.Category.DATA,
12
+ fields: config_1.fields,
13
+ dataPoints: config_1.dataPoints,
14
+ previewable: true,
15
+ onActivityCreated: async (payload, onComplete, onError) => {
16
+ const { fields: { feet, inches }, } = (0, extensions_core_1.validate)({
17
+ schema: zod_1.z.object({
18
+ fields: config_1.FieldsValidationSchema,
19
+ }),
20
+ payload,
21
+ });
22
+ const totalInches = feet * 12 + inches;
23
+ await onComplete({
24
+ data_points: {
25
+ inches: String(totalInches),
26
+ },
27
+ });
28
+ },
29
+ };
30
+ //# sourceMappingURL=feetAndInchesToInches.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feetAndInchesToInches.js","sourceRoot":"","sources":["../../../../../../extensions/transform/v1/actions/feetAndInchesToInches/feetAndInchesToInches.ts"],"names":[],"mappings":";;;AACA,mEAAkE;AAElE,qCAAqE;AACrE,6BAAuB;AAEV,QAAA,qBAAqB,GAI9B;IACF,GAAG,EAAE,uBAAuB;IAC5B,KAAK,EAAE,2BAA2B;IAClC,WAAW,EAAE,qCAAqC;IAClD,QAAQ,EAAE,0BAAQ,CAAC,IAAI;IACvB,MAAM,EAAN,eAAM;IACN,UAAU,EAAV,mBAAU;IACV,WAAW,EAAE,IAAI;IACjB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;QACxD,MAAM,EACJ,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GACzB,GAAG,IAAA,0BAAQ,EAAC;YACX,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;gBACf,MAAM,EAAE,+BAAsB;aAC/B,CAAC;YACF,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,WAAW,GAAG,IAAI,GAAG,EAAE,GAAG,MAAM,CAAA;QAEtC,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC;aAC5B;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require(".");
4
+ const tests_1 = require("../../../../../src/tests");
5
+ describe('Transform - Feet and inches to inches', () => {
6
+ const onComplete = jest.fn();
7
+ const onError = jest.fn();
8
+ beforeEach(() => {
9
+ jest.clearAllMocks();
10
+ });
11
+ test('Should work with whole numbers', async () => {
12
+ const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
13
+ fields: {
14
+ feet: 6,
15
+ inches: 5,
16
+ },
17
+ settings: {},
18
+ });
19
+ await _1.feetAndInchesToInches.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
20
+ expect(onComplete).toHaveBeenCalledWith({
21
+ data_points: {
22
+ inches: '77',
23
+ },
24
+ });
25
+ });
26
+ test('Should work with decimal numbers', async () => {
27
+ const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
28
+ fields: {
29
+ feet: 6.1,
30
+ inches: 5.4,
31
+ },
32
+ settings: {},
33
+ });
34
+ await _1.feetAndInchesToInches.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
35
+ expect(onComplete).toHaveBeenCalledWith({
36
+ data_points: {
37
+ inches: '78.6',
38
+ },
39
+ });
40
+ });
41
+ });
42
+ //# sourceMappingURL=feetAndInchesToInches.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feetAndInchesToInches.test.js","sourceRoot":"","sources":["../../../../../../extensions/transform/v1/actions/feetAndInchesToInches/feetAndInchesToInches.test.ts"],"names":[],"mappings":";;AAAA,wBAAyC;AACzC,oDAA8D;AAE9D,QAAQ,CAAC,uCAAuC,EAAE,GAAG,EAAE;IACrD,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAEzB,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;QAChD,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,IAAI,EAAE,CAAC;gBACP,MAAM,EAAE,CAAC;aACV;YACD,QAAQ,EAAE,EAAE;SACb,CAAC,CAAA;QAEF,MAAM,wBAAqB,CAAC,iBAAiB,CAC3C,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC;YACtC,WAAW,EAAE;gBACX,MAAM,EAAE,IAAI;aACb;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,kCAAkC,EAAE,KAAK,IAAI,EAAE;QAClD,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,IAAI,EAAE,GAAG;gBACT,MAAM,EAAE,GAAG;aACZ;YACD,QAAQ,EAAE,EAAE;SACb,CAAC,CAAA;QAEF,MAAM,wBAAqB,CAAC,iBAAiB,CAC3C,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC;YACtC,WAAW,EAAE;gBACX,MAAM,EAAE,MAAM;aACf;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export { feetAndInchesToInches } from './feetAndInchesToInches';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.feetAndInchesToInches = void 0;
4
+ var feetAndInchesToInches_1 = require("./feetAndInchesToInches");
5
+ Object.defineProperty(exports, "feetAndInchesToInches", { enumerable: true, get: function () { return feetAndInchesToInches_1.feetAndInchesToInches; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/transform/v1/actions/feetAndInchesToInches/index.ts"],"names":[],"mappings":";;;AAAA,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA"}
@@ -5,3 +5,4 @@ export { parseUnixTimestampToDate } from './parseUnixTimestampToDate';
5
5
  export { parseNumberToTextWithDictionary } from './parseNumberToTextWithDictionary';
6
6
  export { generateDynamicUrl } from './generateDynamicUrl';
7
7
  export { parseStringToPhoneNumber } from './parseStringToPhoneNumber';
8
+ export { feetAndInchesToInches } from './feetAndInchesToInches';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseStringToPhoneNumber = exports.generateDynamicUrl = exports.parseNumberToTextWithDictionary = exports.parseUnixTimestampToDate = exports.parseNumberToText = exports.parseDateToUnixTimestamp = exports.parseTextToNumber = void 0;
3
+ exports.feetAndInchesToInches = exports.parseStringToPhoneNumber = exports.generateDynamicUrl = exports.parseNumberToTextWithDictionary = exports.parseUnixTimestampToDate = exports.parseNumberToText = exports.parseDateToUnixTimestamp = exports.parseTextToNumber = void 0;
4
4
  var parseTextToNumber_1 = require("./parseTextToNumber");
5
5
  Object.defineProperty(exports, "parseTextToNumber", { enumerable: true, get: function () { return parseTextToNumber_1.parseTextToNumber; } });
6
6
  var parseDateToUnixTimestamp_1 = require("./parseDateToUnixTimestamp");
@@ -15,4 +15,6 @@ var generateDynamicUrl_1 = require("./generateDynamicUrl");
15
15
  Object.defineProperty(exports, "generateDynamicUrl", { enumerable: true, get: function () { return generateDynamicUrl_1.generateDynamicUrl; } });
16
16
  var parseStringToPhoneNumber_1 = require("./parseStringToPhoneNumber");
17
17
  Object.defineProperty(exports, "parseStringToPhoneNumber", { enumerable: true, get: function () { return parseStringToPhoneNumber_1.parseStringToPhoneNumber; } });
18
+ var feetAndInchesToInches_1 = require("./feetAndInchesToInches");
19
+ Object.defineProperty(exports, "feetAndInchesToInches", { enumerable: true, get: function () { return feetAndInchesToInches_1.feetAndInchesToInches; } });
18
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/transform/v1/actions/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,qFAAmF;AAA1E,kJAAA,+BAA+B,OAAA;AACxC,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/transform/v1/actions/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,qFAAmF;AAA1E,kJAAA,+BAA+B,OAAA;AACxC,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/awell-extensions",
3
- "version": "1.1.31",
3
+ "version": "1.1.33",
4
4
  "packageManager": "yarn@3.4.1",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {