@awell-health/awell-extensions 1.0.204 → 1.0.205
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/extensions/experimental/index.js +1 -0
- package/dist/extensions/experimental/index.js.map +1 -1
- package/dist/extensions/experimental/v1/actions/enterMedication/config/datapoints.d.ts +6 -0
- package/dist/extensions/experimental/v1/actions/enterMedication/config/datapoints.js +10 -0
- package/dist/extensions/experimental/v1/actions/enterMedication/config/datapoints.js.map +1 -0
- package/dist/extensions/experimental/v1/actions/enterMedication/config/fields.d.ts +3 -0
- package/dist/extensions/experimental/v1/actions/enterMedication/config/fields.js +7 -0
- package/dist/extensions/experimental/v1/actions/enterMedication/config/fields.js.map +1 -0
- package/dist/extensions/experimental/v1/actions/enterMedication/config/index.d.ts +2 -0
- package/dist/extensions/experimental/v1/actions/enterMedication/config/index.js +9 -0
- package/dist/extensions/experimental/v1/actions/enterMedication/config/index.js.map +1 -0
- package/dist/extensions/experimental/v1/actions/enterMedication/enterMedication.d.ts +4 -0
- package/dist/extensions/experimental/v1/actions/enterMedication/enterMedication.js +24 -0
- package/dist/extensions/experimental/v1/actions/enterMedication/enterMedication.js.map +1 -0
- package/dist/extensions/experimental/v1/actions/enterMedication/enterMedication.test.d.ts +1 -0
- package/dist/extensions/experimental/v1/actions/enterMedication/enterMedication.test.js +21 -0
- package/dist/extensions/experimental/v1/actions/enterMedication/enterMedication.test.js.map +1 -0
- package/dist/extensions/experimental/v1/actions/enterMedication/index.d.ts +1 -0
- package/dist/extensions/experimental/v1/actions/enterMedication/index.js +6 -0
- package/dist/extensions/experimental/v1/actions/enterMedication/index.js.map +1 -0
- package/dist/extensions/experimental/v1/actions/index.d.ts +1 -0
- package/dist/extensions/experimental/v1/actions/index.js +3 -1
- package/dist/extensions/experimental/v1/actions/index.js.map +1 -1
- package/dist/extensions/experimental/v1/actions/requestVideoVisit/config/fields.d.ts +17 -2
- package/dist/extensions/experimental/v1/actions/requestVideoVisit/config/fields.js +13 -2
- package/dist/extensions/experimental/v1/actions/requestVideoVisit/config/fields.js.map +1 -1
- package/dist/extensions/experimental/v1/actions/requestVideoVisit/requestVideoVisit.js +46 -2
- package/dist/extensions/experimental/v1/actions/requestVideoVisit/requestVideoVisit.js.map +1 -1
- package/dist/extensions/experimental/v1/actions/requestVideoVisit/requestVideoVisit.test.d.ts +1 -0
- package/dist/extensions/experimental/v1/actions/requestVideoVisit/requestVideoVisit.test.js +34 -0
- package/dist/extensions/experimental/v1/actions/requestVideoVisit/requestVideoVisit.test.js.map +1 -0
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/experimental/index.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/experimental/index.ts"],"names":[],"mappings":";;;AAAA,0CAAiE;AAEjE,yCAAqC;AACrC,mEAAoE;AAEvD,QAAA,YAAY,GAAc;IACrC,GAAG,EAAE,cAAc;IACnB,KAAK,EAAE,wBAAwB;IAC/B,QAAQ,EAAE,yDAAyD;IACnE,WAAW,EAAE,qCAAqC;IAClD,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,QAAQ,EAAR,mBAAQ;IACR,OAAO,EAAE;QACP,iBAAiB,EAAjB,2BAAiB;QACjB,eAAe,EAAf,yBAAe;KAChB;CACF,CAAA"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.dataPoints = void 0;
|
4
|
+
exports.dataPoints = {
|
5
|
+
stringifiedMedicationData: {
|
6
|
+
key: 'stringifiedMedicationData',
|
7
|
+
valueType: 'string',
|
8
|
+
},
|
9
|
+
};
|
10
|
+
//# sourceMappingURL=datapoints.js.map
|
@@ -0,0 +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"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.FieldsValidationSchema = exports.fields = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
exports.fields = {};
|
6
|
+
exports.FieldsValidationSchema = zod_1.z.object({});
|
7
|
+
//# sourceMappingURL=fields.js.map
|
@@ -0,0 +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"}
|
@@ -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/experimental/v1/actions/enterMedication/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.enterMedication = void 0;
|
4
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
5
|
+
const config_1 = require("./config");
|
6
|
+
exports.enterMedication = {
|
7
|
+
key: 'enterMedication',
|
8
|
+
category: extensions_core_1.Category.FORMS,
|
9
|
+
title: 'Enter medication',
|
10
|
+
description: 'Allow a user to enter medication',
|
11
|
+
fields: config_1.fields,
|
12
|
+
dataPoints: config_1.dataPoints,
|
13
|
+
options: {
|
14
|
+
stakeholders: {
|
15
|
+
label: 'Stakeholder',
|
16
|
+
mode: 'single',
|
17
|
+
},
|
18
|
+
},
|
19
|
+
previewable: false,
|
20
|
+
onActivityCreated: async (payload, onComplete, onError) => {
|
21
|
+
// Completion happens in Hosted Pages
|
22
|
+
},
|
23
|
+
};
|
24
|
+
//# sourceMappingURL=enterMedication.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"enterMedication.js","sourceRoot":"","sources":["../../../../../../extensions/experimental/v1/actions/enterMedication/enterMedication.ts"],"names":[],"mappings":";;;AAEA,mEAAwD;AACxD,qCAA6C;AAEhC,QAAA,eAAe,GAA2C;IACrE,GAAG,EAAE,iBAAiB;IACtB,QAAQ,EAAE,0BAAQ,CAAC,KAAK;IACxB,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,kCAAkC;IAC/C,MAAM,EAAN,eAAM;IACN,UAAU,EAAV,mBAAU;IACV,OAAO,EAAE;QACP,YAAY,EAAE;YACZ,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;SACf;KACF;IACD,WAAW,EAAE,KAAK;IAClB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,EAAE;QACvE,qCAAqC;IACvC,CAAC;CACF,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const _1 = require(".");
|
4
|
+
const tests_1 = require("../../../../../src/tests");
|
5
|
+
describe('Experimental - Enter medication', () => {
|
6
|
+
const onComplete = jest.fn();
|
7
|
+
const onError = jest.fn();
|
8
|
+
beforeEach(() => {
|
9
|
+
jest.clearAllMocks();
|
10
|
+
});
|
11
|
+
test('Should work', async () => {
|
12
|
+
const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
|
13
|
+
fields: {},
|
14
|
+
settings: {},
|
15
|
+
});
|
16
|
+
await _1.enterMedication.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
|
17
|
+
expect(onError).not.toBeCalled();
|
18
|
+
expect(onComplete).not.toBeCalled();
|
19
|
+
});
|
20
|
+
});
|
21
|
+
//# sourceMappingURL=enterMedication.test.js.map
|
@@ -0,0 +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"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { enterMedication } from './enterMedication';
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.enterMedication = void 0;
|
4
|
+
var enterMedication_1 = require("./enterMedication");
|
5
|
+
Object.defineProperty(exports, "enterMedication", { enumerable: true, get: function () { return enterMedication_1.enterMedication; } });
|
6
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/experimental/v1/actions/enterMedication/index.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAA1C,kHAAA,eAAe,OAAA"}
|
@@ -1,6 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.requestVideoVisit = void 0;
|
3
|
+
exports.enterMedication = exports.requestVideoVisit = void 0;
|
4
4
|
var requestVideoVisit_1 = require("./requestVideoVisit");
|
5
5
|
Object.defineProperty(exports, "requestVideoVisit", { enumerable: true, get: function () { return requestVideoVisit_1.requestVideoVisit; } });
|
6
|
+
var enterMedication_1 = require("./enterMedication");
|
7
|
+
Object.defineProperty(exports, "enterMedication", { enumerable: true, get: function () { return enterMedication_1.enterMedication; } });
|
6
8
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/experimental/v1/actions/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/experimental/v1/actions/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,qDAAmD;AAA1C,kHAAA,eAAe,OAAA"}
|
@@ -1,3 +1,18 @@
|
|
1
|
+
import { FieldType } from '@awell-health/extensions-core';
|
1
2
|
import { z } from 'zod';
|
2
|
-
export declare const fields: {
|
3
|
-
|
3
|
+
export declare const fields: {
|
4
|
+
deepLink: {
|
5
|
+
id: string;
|
6
|
+
label: string;
|
7
|
+
description: string;
|
8
|
+
type: FieldType.STRING;
|
9
|
+
required: false;
|
10
|
+
};
|
11
|
+
};
|
12
|
+
export declare const FieldsValidationSchema: z.ZodObject<{
|
13
|
+
deepLink: z.ZodOptional<z.ZodString>;
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
15
|
+
deepLink?: string | undefined;
|
16
|
+
}, {
|
17
|
+
deepLink?: 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
|
-
|
6
|
+
exports.fields = {
|
7
|
+
deepLink: {
|
8
|
+
id: 'deepLink',
|
9
|
+
label: 'Deep link',
|
10
|
+
description: 'Insert a deep link for testing',
|
11
|
+
type: extensions_core_1.FieldType.STRING,
|
12
|
+
required: false,
|
13
|
+
},
|
14
|
+
};
|
15
|
+
exports.FieldsValidationSchema = zod_1.z.object({
|
16
|
+
deepLink: 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/requestVideoVisit/config/fields.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/experimental/v1/actions/requestVideoVisit/config/fields.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,6BAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,QAAQ,EAAE;QACR,EAAE,EAAE,UAAU;QACd,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,gCAAgC;QAC7C,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;KAChB;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACkB,CAAC,CAAA"}
|
@@ -2,10 +2,13 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.requestVideoVisit = void 0;
|
4
4
|
const extensions_core_1 = require("@awell-health/extensions-core");
|
5
|
+
const extensions_core_2 = require("@awell-health/extensions-core");
|
5
6
|
const config_1 = require("./config");
|
7
|
+
const zod_1 = require("zod");
|
8
|
+
const zod_validation_error_1 = require("zod-validation-error");
|
6
9
|
exports.requestVideoVisit = {
|
7
10
|
key: 'requestVideoVisit',
|
8
|
-
category:
|
11
|
+
category: extensions_core_2.Category.WORKFLOW,
|
9
12
|
title: 'Request video visit',
|
10
13
|
description: 'Allow user to choose between requesting a video visit or simply continue',
|
11
14
|
fields: config_1.fields,
|
@@ -18,7 +21,48 @@ exports.requestVideoVisit = {
|
|
18
21
|
},
|
19
22
|
previewable: false,
|
20
23
|
onActivityCreated: async (payload, onComplete, onError) => {
|
21
|
-
|
24
|
+
try {
|
25
|
+
(0, extensions_core_1.validate)({
|
26
|
+
schema: zod_1.z.object({
|
27
|
+
fields: config_1.FieldsValidationSchema,
|
28
|
+
}),
|
29
|
+
payload,
|
30
|
+
});
|
31
|
+
/**
|
32
|
+
* Completion happens in Hosted Pages
|
33
|
+
*/
|
34
|
+
}
|
35
|
+
catch (err) {
|
36
|
+
if (err instanceof zod_1.ZodError) {
|
37
|
+
const error = (0, zod_validation_error_1.fromZodError)(err);
|
38
|
+
await onError({
|
39
|
+
events: [
|
40
|
+
{
|
41
|
+
date: new Date().toISOString(),
|
42
|
+
text: { en: error.name },
|
43
|
+
error: {
|
44
|
+
category: 'WRONG_INPUT',
|
45
|
+
message: `${error.message}`,
|
46
|
+
},
|
47
|
+
},
|
48
|
+
],
|
49
|
+
});
|
50
|
+
return;
|
51
|
+
}
|
52
|
+
const error = err;
|
53
|
+
await onError({
|
54
|
+
events: [
|
55
|
+
{
|
56
|
+
date: new Date().toISOString(),
|
57
|
+
text: { en: 'Something went wrong while orchestration the action' },
|
58
|
+
error: {
|
59
|
+
category: 'SERVER_ERROR',
|
60
|
+
message: error.message,
|
61
|
+
},
|
62
|
+
},
|
63
|
+
],
|
64
|
+
});
|
65
|
+
}
|
22
66
|
},
|
23
67
|
};
|
24
68
|
//# sourceMappingURL=requestVideoVisit.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"requestVideoVisit.js","sourceRoot":"","sources":["../../../../../../extensions/experimental/v1/actions/requestVideoVisit/requestVideoVisit.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"requestVideoVisit.js","sourceRoot":"","sources":["../../../../../../extensions/experimental/v1/actions/requestVideoVisit/requestVideoVisit.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,mEAAwD;AACxD,qCAAqE;AACrE,6BAAiC;AACjC,+DAAmD;AAEtC,QAAA,iBAAiB,GAA2C;IACvE,GAAG,EAAE,mBAAmB;IACxB,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EACT,0EAA0E;IAC5E,MAAM,EAAN,eAAM;IACN,UAAU,EAAV,mBAAU;IACV,OAAO,EAAE;QACP,YAAY,EAAE;YACZ,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,QAAQ;SACf;KACF;IACD,WAAW,EAAE,KAAK;IAClB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,EAAE;QACvE,IAAI;YACF,IAAA,0BAAQ,EAAC;gBACP,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;oBACf,MAAM,EAAE,+BAAsB;iBAC/B,CAAC;gBACF,OAAO;aACR,CAAC,CAAA;YAEF;;eAEG;SACJ;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,YAAY,cAAQ,EAAE;gBAC3B,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;aACP;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;SACH;IACH,CAAC;CACF,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,34 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const _1 = require(".");
|
4
|
+
const tests_1 = require("../../../../../src/tests");
|
5
|
+
describe('Experimental - Request video visit', () => {
|
6
|
+
const onComplete = jest.fn();
|
7
|
+
const onError = jest.fn();
|
8
|
+
beforeEach(() => {
|
9
|
+
jest.clearAllMocks();
|
10
|
+
});
|
11
|
+
test('Should work', async () => {
|
12
|
+
const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
|
13
|
+
fields: {
|
14
|
+
deepLink: 'https://www.google.be',
|
15
|
+
},
|
16
|
+
settings: {},
|
17
|
+
});
|
18
|
+
await _1.requestVideoVisit.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
|
19
|
+
expect(onError).not.toBeCalled();
|
20
|
+
});
|
21
|
+
test('Should not work', async () => {
|
22
|
+
const mockOnActivityCreateParams = (0, tests_1.generateTestPayload)({
|
23
|
+
fields: {
|
24
|
+
deepLink: true,
|
25
|
+
},
|
26
|
+
settings: {},
|
27
|
+
});
|
28
|
+
await _1.requestVideoVisit.onActivityCreated(
|
29
|
+
// @ts-expect-error zod will catch this
|
30
|
+
mockOnActivityCreateParams, onComplete, onError);
|
31
|
+
expect(onError).toBeCalled();
|
32
|
+
});
|
33
|
+
});
|
34
|
+
//# sourceMappingURL=requestVideoVisit.test.js.map
|
package/dist/extensions/experimental/v1/actions/requestVideoVisit/requestVideoVisit.test.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"requestVideoVisit.test.js","sourceRoot":"","sources":["../../../../../../extensions/experimental/v1/actions/requestVideoVisit/requestVideoVisit.test.ts"],"names":[],"mappings":";;AAAA,wBAAqC;AACrC,oDAA8D;AAE9D,QAAQ,CAAC,oCAAoC,EAAE,GAAG,EAAE;IAClD,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,QAAQ,EAAE,uBAAuB;aAClC;YACD,QAAQ,EAAE,EAAE;SACb,CAAC,CAAA;QAEF,MAAM,oBAAiB,CAAC,iBAAiB,CACvC,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,CAAA;IAClC,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;QACjC,MAAM,0BAA0B,GAAG,IAAA,2BAAmB,EAAC;YACrD,MAAM,EAAE;gBACN,QAAQ,EAAE,IAAI;aACf;YACD,QAAQ,EAAE,EAAE;SACb,CAAC,CAAA;QAEF,MAAM,oBAAiB,CAAC,iBAAiB;QACvC,uCAAuC;QACvC,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,CAAA;IAC9B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|