@awell-health/awell-extensions 1.0.152 → 1.0.154
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/collectData/index.js +3 -3
- package/dist/extensions/collectData/index.js.map +1 -1
- package/dist/extensions/collectData/v1/actions/remoteSingleSelect/config/fields.d.ts +7 -7
- package/dist/extensions/collectData/v1/actions/remoteSingleSelect/config/fields.js +12 -12
- package/dist/extensions/collectData/v1/actions/remoteSingleSelect/config/fields.js.map +1 -1
- package/dist/extensions/collectData/v1/actions/remoteSingleSelect/remoteSingleSelect.js +5 -2
- package/dist/extensions/collectData/v1/actions/remoteSingleSelect/remoteSingleSelect.js.map +1 -1
- package/dist/extensions/markdown.json +1 -1
- package/package.json +1 -1
@@ -6,15 +6,15 @@ const actions_1 = require("./v1/actions");
|
|
6
6
|
const settings_1 = require("./settings");
|
7
7
|
exports.CollectData = {
|
8
8
|
key: 'collectData',
|
9
|
-
title: '
|
9
|
+
title: 'Advanced data collection',
|
10
10
|
icon_url: 'https://res.cloudinary.com/da7x4rzl4/image/upload/v1678870116/Awell%20Extensions/Awell_Logo.png',
|
11
|
-
description: '
|
11
|
+
description: 'This extension allows you to collect data from your users using a variety of more advanced input types and data sources.',
|
12
12
|
category: extensions_core_1.Category.FORMS,
|
13
13
|
author: {
|
14
14
|
authorType: extensions_core_1.AuthorType.AWELL,
|
15
15
|
},
|
16
16
|
actions: {
|
17
|
-
remoteSingleSelect: actions_1.remoteSingleSelect
|
17
|
+
remoteSingleSelect: actions_1.remoteSingleSelect,
|
18
18
|
},
|
19
19
|
settings: settings_1.settings,
|
20
20
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/collectData/index.ts"],"names":[],"mappings":";;;AACA,mEAAoE;AACpE,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/collectData/index.ts"],"names":[],"mappings":";;;AACA,mEAAoE;AACpE,0CAAiD;AACjD,yCAAqC;AAExB,QAAA,WAAW,GAAc;IACpC,GAAG,EAAE,aAAa;IAClB,KAAK,EAAE,0BAA0B;IACjC,QAAQ,EACN,iGAAiG;IACnG,WAAW,EACT,0HAA0H;IAC5H,QAAQ,EAAE,0BAAQ,CAAC,KAAK;IACxB,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,OAAO,EAAE;QACP,kBAAkB,EAAlB,4BAAkB;KACnB;IACD,QAAQ,EAAR,mBAAQ;CACT,CAAA"}
|
@@ -8,6 +8,13 @@ export declare const fields: {
|
|
8
8
|
type: FieldType.STRING;
|
9
9
|
required: true;
|
10
10
|
};
|
11
|
+
mandatory: {
|
12
|
+
id: string;
|
13
|
+
label: string;
|
14
|
+
description: string;
|
15
|
+
type: FieldType.BOOLEAN;
|
16
|
+
required: true;
|
17
|
+
};
|
11
18
|
url: {
|
12
19
|
id: string;
|
13
20
|
label: string;
|
@@ -29,13 +36,6 @@ export declare const fields: {
|
|
29
36
|
type: FieldType.STRING;
|
30
37
|
required: false;
|
31
38
|
};
|
32
|
-
mandatory: {
|
33
|
-
id: string;
|
34
|
-
label: string;
|
35
|
-
description: string;
|
36
|
-
type: FieldType.BOOLEAN;
|
37
|
-
required: true;
|
38
|
-
};
|
39
39
|
};
|
40
40
|
export declare const FieldsValidationSchema: z.ZodObject<{
|
41
41
|
label: z.ZodString;
|
@@ -7,39 +7,39 @@ const validation_1 = require("../../../../../sendbird/v1/validation");
|
|
7
7
|
exports.fields = {
|
8
8
|
label: {
|
9
9
|
id: 'label',
|
10
|
-
label: 'Label
|
10
|
+
label: 'Select - Label',
|
11
11
|
description: 'Enter the label text that will be displayed before the selector.',
|
12
12
|
type: extensions_core_1.FieldType.STRING,
|
13
13
|
required: true,
|
14
14
|
},
|
15
|
+
mandatory: {
|
16
|
+
id: 'mandatory',
|
17
|
+
label: 'Select - Response required?',
|
18
|
+
description: 'The user must select an option before continuing.',
|
19
|
+
type: extensions_core_1.FieldType.BOOLEAN,
|
20
|
+
required: true,
|
21
|
+
},
|
15
22
|
url: {
|
16
23
|
id: 'url',
|
17
|
-
label: 'Options
|
18
|
-
description: 'Enter the URL where the options to display
|
24
|
+
label: 'Options - Endpoint URL',
|
25
|
+
description: 'Enter the URL (starting with `https://`) where the options to display can be fetched. The endpoint must return an array of objects with the following properties: `id`, `label` and `value`.',
|
19
26
|
type: extensions_core_1.FieldType.STRING,
|
20
27
|
required: true,
|
21
28
|
},
|
22
29
|
headers: {
|
23
30
|
id: 'headers',
|
24
|
-
label: 'Options
|
31
|
+
label: 'Options - Headers',
|
25
32
|
description: 'Enter the headers to send to the options source URL. The headers must be in JSON format.',
|
26
33
|
type: extensions_core_1.FieldType.JSON,
|
27
34
|
required: false,
|
28
35
|
},
|
29
36
|
queryParam: {
|
30
37
|
id: 'queryParam',
|
31
|
-
label: 'Options
|
38
|
+
label: 'Options - Search query param',
|
32
39
|
description: 'Enter the key of the free text search query param if the endpoint supports this e.g. `search` for `https://example.com/options?search=foo`.',
|
33
40
|
type: extensions_core_1.FieldType.STRING,
|
34
41
|
required: false,
|
35
42
|
},
|
36
|
-
mandatory: {
|
37
|
-
id: 'mandatory',
|
38
|
-
label: 'Is response required?',
|
39
|
-
description: 'The user must select an option before continuing.',
|
40
|
-
type: extensions_core_1.FieldType.BOOLEAN,
|
41
|
-
required: true,
|
42
|
-
},
|
43
43
|
};
|
44
44
|
exports.FieldsValidationSchema = zod_1.z.object({
|
45
45
|
label: zod_1.z.string().nonempty(),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/collectData/v1/actions/remoteSingleSelect/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAwC;AACxC,mEAIsC;AACtC,sEAAkF;AAErE,QAAA,MAAM,GAAG;IACpB,KAAK,EAAE;QACL,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/collectData/v1/actions/remoteSingleSelect/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAwC;AACxC,mEAIsC;AACtC,sEAAkF;AAErE,QAAA,MAAM,GAAG;IACpB,KAAK,EAAE;QACL,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,gBAAgB;QACvB,WAAW,EACT,kEAAkE;QACpE,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,SAAS,EAAE;QACT,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,6BAA6B;QACpC,WAAW,EAAE,mDAAmD;QAChE,IAAI,EAAE,2BAAS,CAAC,OAAO;QACvB,QAAQ,EAAE,IAAI;KACf;IACD,GAAG,EAAE;QACH,EAAE,EAAE,KAAK;QACT,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EACT,8LAA8L;QAChM,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EACT,0FAA0F;QAC5F,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,KAAK;KAChB;IACD,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,8BAA8B;QACrC,WAAW,EACT,6IAA6I;QAC/I,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;KAChB;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACrB,OAAO,EAAE,IAAA,oCAAkB,EAAC,uCAA0B,CAAC;IACvD,UAAU,EAAE,IAAA,oCAAkB,EAAC,OAAC,CAAC,MAAM,EAAE,CAAC;IAC1C,SAAS,EAAE,OAAC,CAAC,OAAO,EAAE;CAC2B,CAAC,CAAA;AAE7C,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"}
|
@@ -8,8 +8,8 @@ const zod_validation_error_1 = require("zod-validation-error");
|
|
8
8
|
const zod_1 = require("zod");
|
9
9
|
exports.remoteSingleSelect = {
|
10
10
|
key: 'remoteSingleSelect',
|
11
|
-
title: '
|
12
|
-
description: '
|
11
|
+
title: 'Dynamic choice selector',
|
12
|
+
description: 'The dynamic choice selector allow you to set up a select question where the available choices are dynamically populated through an API lookup',
|
13
13
|
category: extensions_core_1.Category.FORMS,
|
14
14
|
fields: config_1.fields,
|
15
15
|
dataPoints: config_1.dataPoints,
|
@@ -23,6 +23,9 @@ exports.remoteSingleSelect = {
|
|
23
23
|
onActivityCreated: async (payload, onComplete, onError) => {
|
24
24
|
try {
|
25
25
|
(0, fields_1.validateActionFields)(payload.fields);
|
26
|
+
/**
|
27
|
+
* Completion happens in Awell Hosted Pages
|
28
|
+
*/
|
26
29
|
}
|
27
30
|
catch (err) {
|
28
31
|
if (err instanceof zod_1.ZodError) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"remoteSingleSelect.js","sourceRoot":"","sources":["../../../../../../extensions/collectData/v1/actions/remoteSingleSelect/remoteSingleSelect.ts"],"names":[],"mappings":";;;AACA,qCAA6C;AAC7C,mEAAwD;AAExD,4CAAsD;AACtD,+DAAmD;AACnD,6BAA8B;AAEjB,QAAA,kBAAkB,GAA2C;IACxE,GAAG,EAAE,oBAAoB;IACzB,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"remoteSingleSelect.js","sourceRoot":"","sources":["../../../../../../extensions/collectData/v1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BACnE,KAAK,EAAE;4BACL,QAAQ,EAAE,cAAc;4BACxB,OAAO,EAAE,KAAK,CAAC,OAAO;yBACvB;qBACF;iBACF;aACF,CAAC,CAAA;SACH;IACH,CAAC;CACF,CAAA"}
|
@@ -28,7 +28,7 @@
|
|
28
28
|
"changelog": "# CM.com changelog\n"
|
29
29
|
},
|
30
30
|
"collectData": {
|
31
|
-
"readme": "---\ntitle:
|
31
|
+
"readme": "---\ntitle: Advanced data collection\ndescription: Collect data from your users using a variety of input types and data sources\n---\n\nThis extension allows you to collect data from your users using a variety of more advanced input types and data sources.\n\n## Extension settings\n\nIn order to set up this extension, no settings are required.\n\n## Custom Actions\n\n### Remote Single Select\n\nStandard select questions in Awell forms have a discrete set of choices to select from that are defined at the time that the form is created. If the list of choices to present to your responders isn't known at the time the form is being built, or changes often, this action allows you to load choices dynamically from a remote data source.\n\nDynamically-loaded choices must adhere to the following format in a list form (i.e. an array):\n\n```json\n{\n \"id\": \"unique-id\",\n \"label\": \"Choice label\",\n \"value\": \"Choice value\"\n}\n```\n\nAdditionally, you can specify a free text search field (`Options - Search query param` field) to allow users to search through the choices. This is optional but highly recommended. If not specified, the choices will be fetched on question load and presented in a static list that cannot be filtered.\n\nAs an example, using the endpoint `https://example.com/choices` with a query parameter `search` (e.g. `https://example.com/choices?search=QUERY` where `QUERY` is whatever the user typed into the input), then the API is expected to return the choices based on that match the search term.\n\nWe recommend that your search logic returns an _alphabetically-sorted_ list of all options where the _lowercase_ label names _contain_ the _lowercase_ search term.\n\n```js\n// Example search logic\nconst searchTerm = req.query.search\nconst results = []\n\noptions.forEach((option) => {\n if (option.label.toLowerCase().includes(searchTerm.toLowerCase())) {\n results.push({\n label: option.label,\n value: option.value,\n id: option.id,\n })\n }\n})\n\nconst sortedResults = results.sort((a, b) => a.label.localeCompare(b.label))\nres.json(results)\n```\n",
|
32
32
|
"changelog": "# Collect Data changelog\n"
|
33
33
|
},
|
34
34
|
"docuSign": {
|