@awell-health/awell-extensions 1.1.48 → 1.1.50
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/extensions/markdown.json +1 -1
- package/dist/extensions/transform/index.js +1 -0
- package/dist/extensions/transform/index.js.map +1 -1
- package/dist/extensions/transform/v1/actions/index.d.ts +1 -0
- package/dist/extensions/transform/v1/actions/index.js +3 -1
- package/dist/extensions/transform/v1/actions/index.js.map +1 -1
- package/dist/extensions/transform/v1/actions/serializeJson/config/dataPoints.d.ts +6 -0
- package/dist/extensions/transform/v1/actions/serializeJson/config/dataPoints.js +10 -0
- package/dist/extensions/transform/v1/actions/serializeJson/config/dataPoints.js.map +1 -0
- package/dist/extensions/transform/v1/actions/serializeJson/config/fields.d.ts +18 -0
- package/dist/extensions/transform/v1/actions/serializeJson/config/fields.js +45 -0
- package/dist/extensions/transform/v1/actions/serializeJson/config/fields.js.map +1 -0
- package/dist/extensions/transform/v1/actions/serializeJson/config/index.d.ts +2 -0
- package/dist/extensions/transform/v1/actions/serializeJson/config/index.js +9 -0
- package/dist/extensions/transform/v1/actions/serializeJson/config/index.js.map +1 -0
- package/dist/extensions/transform/v1/actions/serializeJson/index.d.ts +1 -0
- package/dist/extensions/transform/v1/actions/serializeJson/index.js +6 -0
- package/dist/extensions/transform/v1/actions/serializeJson/index.js.map +1 -0
- package/dist/extensions/transform/v1/actions/serializeJson/serializeJson.d.ts +4 -0
- package/dist/extensions/transform/v1/actions/serializeJson/serializeJson.js +29 -0
- package/dist/extensions/transform/v1/actions/serializeJson/serializeJson.js.map +1 -0
- package/dist/extensions/transform/v1/actions/serializeJson/serializeJson.test.d.ts +1 -0
- package/dist/extensions/transform/v1/actions/serializeJson/serializeJson.test.js +29 -0
- package/dist/extensions/transform/v1/actions/serializeJson/serializeJson.test.js.map +1 -0
- package/package.json +1 -1
@@ -60,7 +60,7 @@
|
|
60
60
|
"changelog": "# Formsort changelog"
|
61
61
|
},
|
62
62
|
"healthie": {
|
63
|
-
"readme": "---\ntitle: Healthie\ndescription: Healthie offers infrastructure for next generation digital health organizations that provide virtual-first care.\n---\n\n# What is Healthie?\n\nHealthie offers infrastructure for next generation digital health organizations that provide virtual-first care. Healthie’s API-first and fully brandable suite of solutions (Scheduling, EMR, Client Engagement) enables healthcare builders to launch and scale best-in-class experiences for their members. Healthie also offers a built-in marketplace of business and clinical integrations used by our organizations.\n\nTo learn more, visit [www.gethealthie.com](https://refer.gethealthie.com/
|
63
|
+
"readme": "---\ntitle: Healthie\ndescription: Healthie offers infrastructure for next generation digital health organizations that provide virtual-first care.\n---\n\n# What is Healthie?\n\nHealthie offers infrastructure for next generation digital health organizations that provide virtual-first care. Healthie’s API-first and fully brandable suite of solutions (Scheduling, EMR, Client Engagement) enables healthcare builders to launch and scale best-in-class experiences for their members. Healthie also offers a built-in marketplace of business and clinical integrations used by our organizations.\n\nTo learn more, visit [www.gethealthie.com](https://refer.gethealthie.com/dejebp5gm06x).\n\n## Healthie x Awell\n\nWith this extension, organizations are able to build clinical workflows in Awell’s low-code platform and easily integrate them into Healthie. By doing so, Healthie’s customers can automate routine clinical tasks, synchronize data between systems and drive seamless coordination between care team and patients.\n\nBy combining Healthie’s web and mobile platform with our clinical workflows, clinicians will be able to provide the right care, at the right time for the right patient.\n\n# Extension settings\n\nIn order to set up this extension, **you will need to provide a Healthie API key and Api url**. You can obtain an API key via the Healthie portal (`Settings > Developer > API keys`). You can obtain API url in the [DOCUMENTATION](https://docs.gethealthie.com/docs/#environments) in `Environments` section.\n\nPlease note that the extension automatically prefixes the API key with `Basic ` so please provide your raw API key without `Basic ` in front.\n\n# Custom Actions\n\n## Send chat message action\n\nSends a chat message to a patient in name of the provided provider ID. Will create a new conversation if no active conversation between patient and provider exists or sends a message in an existing conversation if there is an active conversation between the two.\n\n## Create patient\n\nCreates a new patient according to the passed fields. After completion the `healthiePatientId` will be exposed as a data point in the care flow.\n\n## Update patient\n\nUpdates a specific patient (defined by the provided `id`) according to the passed fields.\n\n## Apply tag to patient\n\nAdds a tag (existing one, identified by an `id`) to a patient. Although the Healthie API call allows assigning multiple tags per API call, for simplicity of the logic this action can only take one tag as input. Assigning multiple tags is possible by adding multiple actions.\n\n## Remove tag from patient\n\nRemoves a tag (identified by an `id`) from a patient.\n\n## Create charting note\n\nCreates a charting note with the provided `note_content`.\n\n**Prerequisites and set-up:**\n\n1. The form specified by the `form_id` exists in Healthie.\n2. The form specified by the `form_id` is a charting form (click \"Convert to charting form\" in the form options).\n3. The form contains at least one question of type `textarea` (long text answer). The action will write the content of the charting note in the first question of that type it finds in the form.\n\n## Send form completion request\n\nSend a form completion request to the patient. You will need the Healthie patient ID and the ID of the form you would like the patient to complete.\n\nAlthough the Healthie API call allows sending form completion requests to multiple users per API call (see recipient_ids in their docs), we decided that every action only sends one form completion request. This heavily simplifies the logic and better fits our domain model (1-to-1 relationship between patient and pathway). If a user would like to send multiple form completion requests, they you can just add multiple actions.\n\n## Archive patient\n\nArchives a patient with a given `id`.\n\n## Create location\n\nCreates a location. ID of the created location is stored as `locationId` data point.\n\n## Close chat conversation\n\nCloses chat conversation with a given `id` as a provider with the given `provider_id`.\n\n## Delete appointment\n\nDeletes an appointment with a given `id`.\n\n## Cancel appointment\n\nCancels an appointment with a given `id`.\n\n## Get metric entry\n\nRetrieve the most recent metric entry from a given `category`.\n\n## Create metric entry\n\nCreate a metric entry for a patient in Healthie. The category of the metric is the literal name of the metric in Healthie. So if you have a metric in Healthie called \"Weight\", you should use \"Weight\" as the category.\n\n## Check patient tag\n\nChecks that a patient has an active tag with given `id`\n\n## Check scheduled appointments\n\nChecks that a patient has active scheduled appointment with given `appointmentTypeId`\n\n## Get form answers\n\nThis action will retrieve the form answers for a answer group with a given ID. The complete form answers object will be stored as JSON and will be available in Awell Studio as a data point\n\nExample of a form answers response:\n\n```json\n[\n {\n \"id\": \"640\",\n \"label\": \"Please enter some information about the person who referred you.\",\n \"answer\": \"\"\n },\n {\n \"id\": \"641\",\n \"label\": \"Name\",\n \"answer\": \"Chris\"\n }\n]\n```\n\nDerrived data points can be used to then store the answer of a specific question in a data point. You can use the following JSONPath expression to retrieve the answer for a given question ID: `$[?(@.id == '<ID>')].answer`",
|
64
64
|
"changelog": "# Healthie changelog\n\n## January 2024\n\n- Add \"Check patient tag\" action\n- Add \"Check scheduled appointments\" action\n\n## October 2023\n\n- Add \"Update patient quick notes\" action\n- Add \"Create metric entry\" action.\n\n## September 5, 2023\n\n- add Healthie gender to Sex in iso format mapper in `getPatient`\n\n## May 2023\n\n- New webhooks added: `appliedTagCreated`, `appliedTagDeleted`, `appointmentDeleted`, `appointmentUpdated`, `formAnswerGroupCreated`, `formAnswerGroupDeleted`, `formAnswerGroupLocked`, `formAnswerGroupSigned`, `labOrderCreated`, `labOrderUpdated`, `messageCreated`, `messageDeleted`, `metricEntryCreated`, `metricEntryDeleted`, `metricEntryUpdated`, `patientUpdated`, `requestFormCompletionCreated`, `requestFormCompletionDeleted`, `requestFormCompletionUpdated`, `taskCreated`, `taskDeleted`, `taskUpdated`\n\n## April 2023\n\n- Create task action: now also adds support for reminders.\n"
|
65
65
|
},
|
66
66
|
"hello-world": {
|
@@ -22,6 +22,7 @@ exports.Transform = {
|
|
22
22
|
parseNumberToTextWithDictionary: actions_1.parseNumberToTextWithDictionary,
|
23
23
|
generateDynamicUrl: actions_1.generateDynamicUrl,
|
24
24
|
parseStringToPhoneNumber: actions_1.parseStringToPhoneNumber,
|
25
|
+
serializeJson: actions_1.serializeJson,
|
25
26
|
},
|
26
27
|
settings: settings_1.settings,
|
27
28
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/transform/index.ts"],"names":[],"mappings":";;;AACA,mEAAoE;AACpE,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/transform/index.ts"],"names":[],"mappings":";;;AACA,mEAAoE;AACpE,0CAUqB;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;QACxB,aAAa,EAAb,uBAAa;KACd;IACD,QAAQ,EAAR,mBAAQ;CACT,CAAA"}
|
@@ -6,3 +6,4 @@ export { parseNumberToTextWithDictionary } from './parseNumberToTextWithDictiona
|
|
6
6
|
export { generateDynamicUrl } from './generateDynamicUrl';
|
7
7
|
export { parseStringToPhoneNumber } from './parseStringToPhoneNumber';
|
8
8
|
export { feetAndInchesToInches } from './feetAndInchesToInches';
|
9
|
+
export { serializeJson } from './serializeJson';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.feetAndInchesToInches = exports.parseStringToPhoneNumber = exports.generateDynamicUrl = exports.parseNumberToTextWithDictionary = exports.parseUnixTimestampToDate = exports.parseNumberToText = exports.parseDateToUnixTimestamp = exports.parseTextToNumber = void 0;
|
3
|
+
exports.serializeJson = 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");
|
@@ -17,4 +17,6 @@ var parseStringToPhoneNumber_1 = require("./parseStringToPhoneNumber");
|
|
17
17
|
Object.defineProperty(exports, "parseStringToPhoneNumber", { enumerable: true, get: function () { return parseStringToPhoneNumber_1.parseStringToPhoneNumber; } });
|
18
18
|
var feetAndInchesToInches_1 = require("./feetAndInchesToInches");
|
19
19
|
Object.defineProperty(exports, "feetAndInchesToInches", { enumerable: true, get: function () { return feetAndInchesToInches_1.feetAndInchesToInches; } });
|
20
|
+
var serializeJson_1 = require("./serializeJson");
|
21
|
+
Object.defineProperty(exports, "serializeJson", { enumerable: true, get: function () { return serializeJson_1.serializeJson; } });
|
20
22
|
//# 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;AACjC,iEAA+D;AAAtD,8HAAA,qBAAqB,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;AAC9B,iDAA+C;AAAtC,8GAAA,aAAa,OAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../../../extensions/transform/v1/actions/serializeJson/config/dataPoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,cAAc,EAAE;QACd,GAAG,EAAE,gBAAgB;QACrB,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
import { FieldType } from '@awell-health/extensions-core';
|
3
|
+
export declare const fields: {
|
4
|
+
json: {
|
5
|
+
id: string;
|
6
|
+
label: string;
|
7
|
+
description: string;
|
8
|
+
type: FieldType.JSON;
|
9
|
+
required: true;
|
10
|
+
};
|
11
|
+
};
|
12
|
+
export declare const FieldsValidationSchema: z.ZodObject<{
|
13
|
+
json: z.ZodEffects<z.ZodString, object, string>;
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
15
|
+
json: object;
|
16
|
+
}, {
|
17
|
+
json: string;
|
18
|
+
}>;
|
@@ -0,0 +1,45 @@
|
|
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
|
+
const lodash_1 = require("lodash");
|
7
|
+
exports.fields = {
|
8
|
+
json: {
|
9
|
+
id: 'json',
|
10
|
+
label: 'JSON',
|
11
|
+
description: 'The data object you would like to stringify',
|
12
|
+
type: extensions_core_1.FieldType.JSON,
|
13
|
+
required: true,
|
14
|
+
},
|
15
|
+
};
|
16
|
+
exports.FieldsValidationSchema = zod_1.z.object({
|
17
|
+
json: zod_1.z
|
18
|
+
.string()
|
19
|
+
.min(1)
|
20
|
+
.trim()
|
21
|
+
.transform((str, ctx) => {
|
22
|
+
if ((0, lodash_1.isNil)(str) || (0, lodash_1.isEmpty)(str)) {
|
23
|
+
return {};
|
24
|
+
}
|
25
|
+
try {
|
26
|
+
const parsedJson = JSON.parse(str);
|
27
|
+
if ((0, lodash_1.isEmpty)(parsedJson)) {
|
28
|
+
return {};
|
29
|
+
}
|
30
|
+
if (typeof parsedJson !== 'object' || Array.isArray(parsedJson)) {
|
31
|
+
ctx.addIssue({
|
32
|
+
code: 'custom',
|
33
|
+
message: 'JSON input is not a valid object',
|
34
|
+
});
|
35
|
+
return zod_1.z.NEVER;
|
36
|
+
}
|
37
|
+
return parsedJson;
|
38
|
+
}
|
39
|
+
catch (e) {
|
40
|
+
ctx.addIssue({ code: 'custom', message: 'Invalid JSON' });
|
41
|
+
return zod_1.z.NEVER;
|
42
|
+
}
|
43
|
+
}),
|
44
|
+
});
|
45
|
+
//# sourceMappingURL=fields.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/transform/v1/actions/serializeJson/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAwC;AACxC,mEAAqE;AACrE,mCAAuC;AAE1B,QAAA,MAAM,GAAG;IACpB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,WAAW,EAAE,6CAA6C;QAC1D,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,IAAI,EAAE,OAAC;SACJ,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,IAAI,EAAE;SACN,SAAS,CAAC,CAAC,GAAG,EAAE,GAAG,EAAU,EAAE;QAC9B,IAAI,IAAA,cAAK,EAAC,GAAG,CAAC,IAAI,IAAA,gBAAO,EAAC,GAAG,CAAC,EAAE;YAC9B,OAAO,EAAE,CAAA;SACV;QAED,IAAI;YACF,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAElC,IAAI,IAAA,gBAAO,EAAC,UAAU,CAAC,EAAE;gBACvB,OAAO,EAAE,CAAA;aACV;YAED,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;gBAC/D,GAAG,CAAC,QAAQ,CAAC;oBACX,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,kCAAkC;iBAC5C,CAAC,CAAA;gBACF,OAAO,OAAC,CAAC,KAAK,CAAA;aACf;YAED,OAAO,UAAU,CAAA;SAClB;QAAC,OAAO,CAAC,EAAE;YACV,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAA;YACzD,OAAO,OAAC,CAAC,KAAK,CAAA;SACf;IACH,CAAC,CAAC;CAC6C,CAAC,CAAA"}
|
@@ -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/serializeJson/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { serializeJson } from './serializeJson';
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.serializeJson = void 0;
|
4
|
+
var serializeJson_1 = require("./serializeJson");
|
5
|
+
Object.defineProperty(exports, "serializeJson", { enumerable: true, get: function () { return serializeJson_1.serializeJson; } });
|
6
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/transform/v1/actions/serializeJson/index.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAAtC,8GAAA,aAAa,OAAA"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.serializeJson = 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.serializeJson = {
|
8
|
+
key: 'serializeJson',
|
9
|
+
title: 'Serialize JSON',
|
10
|
+
description: 'Serialize a JSON object',
|
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: { json }, } = (0, extensions_core_1.validate)({
|
17
|
+
schema: zod_1.z.object({
|
18
|
+
fields: config_1.FieldsValidationSchema,
|
19
|
+
}),
|
20
|
+
payload,
|
21
|
+
});
|
22
|
+
await onComplete({
|
23
|
+
data_points: {
|
24
|
+
serializedJson: JSON.stringify(json),
|
25
|
+
},
|
26
|
+
});
|
27
|
+
},
|
28
|
+
};
|
29
|
+
//# sourceMappingURL=serializeJson.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"serializeJson.js","sourceRoot":"","sources":["../../../../../../extensions/transform/v1/actions/serializeJson/serializeJson.ts"],"names":[],"mappings":";;;AACA,mEAAkE;AAElE,qCAAqE;AACrE,6BAAuB;AAEV,QAAA,aAAa,GAItB;IACF,GAAG,EAAE,eAAe;IACpB,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,yBAAyB;IACtC,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,GACjB,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,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;aACrC;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const _1 = require(".");
|
4
|
+
const tests_1 = require("../../../../../src/tests");
|
5
|
+
describe('Transform - Serialize JSON', () => {
|
6
|
+
const onComplete = jest.fn();
|
7
|
+
const onError = jest.fn();
|
8
|
+
beforeEach(() => {
|
9
|
+
jest.clearAllMocks();
|
10
|
+
});
|
11
|
+
test('Should serialize a JSON object to a string', async () => {
|
12
|
+
const object = {
|
13
|
+
hello: 'world',
|
14
|
+
};
|
15
|
+
const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
|
16
|
+
fields: {
|
17
|
+
json: JSON.stringify(object),
|
18
|
+
},
|
19
|
+
settings: {},
|
20
|
+
});
|
21
|
+
await _1.serializeJson.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
|
22
|
+
expect(onComplete).toHaveBeenCalledWith({
|
23
|
+
data_points: {
|
24
|
+
serializedJson: JSON.stringify(object),
|
25
|
+
},
|
26
|
+
});
|
27
|
+
});
|
28
|
+
});
|
29
|
+
//# sourceMappingURL=serializeJson.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"serializeJson.test.js","sourceRoot":"","sources":["../../../../../../extensions/transform/v1/actions/serializeJson/serializeJson.test.ts"],"names":[],"mappings":";;AAAA,wBAAiC;AACjC,oDAA8D;AAE9D,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,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,4CAA4C,EAAE,KAAK,IAAI,EAAE;QAC5D,MAAM,MAAM,GAAG;YACb,KAAK,EAAE,OAAO;SACf,CAAA;QAED,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;aAC7B;YACD,QAAQ,EAAE,EAAE;SACb,CAAC,CAAA;QAEF,MAAM,gBAAa,CAAC,iBAAiB,CACnC,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC;YACtC,WAAW,EAAE;gBACX,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;aACvC;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|