@awell-health/awell-extensions 1.0.212 → 1.0.213

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. package/dist/extensions/experimental/index.js +1 -0
  2. package/dist/extensions/experimental/index.js.map +1 -1
  3. package/dist/extensions/experimental/v1/actions/index.d.ts +1 -0
  4. package/dist/extensions/experimental/v1/actions/index.js +3 -1
  5. package/dist/extensions/experimental/v1/actions/index.js.map +1 -1
  6. package/dist/extensions/experimental/v1/actions/wait/config/datapoints.d.ts +1 -0
  7. package/dist/extensions/experimental/v1/actions/wait/config/datapoints.js +5 -0
  8. package/dist/extensions/experimental/v1/actions/wait/config/datapoints.js.map +1 -0
  9. package/dist/extensions/experimental/v1/actions/wait/config/fields.d.ts +18 -0
  10. package/dist/extensions/experimental/v1/actions/wait/config/fields.js +18 -0
  11. package/dist/extensions/experimental/v1/actions/wait/config/fields.js.map +1 -0
  12. package/dist/extensions/experimental/v1/actions/wait/config/index.d.ts +2 -0
  13. package/dist/extensions/experimental/v1/actions/wait/config/index.js +9 -0
  14. package/dist/extensions/experimental/v1/actions/wait/config/index.js.map +1 -0
  15. package/dist/extensions/experimental/v1/actions/wait/index.d.ts +1 -0
  16. package/dist/extensions/experimental/v1/actions/wait/index.js +6 -0
  17. package/dist/extensions/experimental/v1/actions/wait/index.js.map +1 -0
  18. package/dist/extensions/experimental/v1/actions/wait/wait.d.ts +4 -0
  19. package/dist/extensions/experimental/v1/actions/wait/wait.js +34 -0
  20. package/dist/extensions/experimental/v1/actions/wait/wait.js.map +1 -0
  21. package/dist/extensions/experimental/v1/actions/wait/wait.test.d.ts +1 -0
  22. package/dist/extensions/experimental/v1/actions/wait/wait.test.js +22 -0
  23. package/dist/extensions/experimental/v1/actions/wait/wait.test.js.map +1 -0
  24. package/package.json +1 -1
@@ -17,6 +17,7 @@ exports.Experimental = {
17
17
  actions: {
18
18
  requestVideoVisit: actions_1.requestVideoVisit,
19
19
  enterMedication: actions_1.enterMedication,
20
+ wait: actions_1.wait,
20
21
  },
21
22
  };
22
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/experimental/index.ts"],"names":[],"mappings":";;;AAAA,0CAAuE;AAEvE,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;QACf,IAAI,EAAJ,cAAI;KACL;CACF,CAAA"}
@@ -1,2 +1,3 @@
1
1
  export { requestVideoVisit } from './requestVideoVisit';
2
2
  export { enterMedication } from './enterMedication';
3
+ export { wait } from './wait';
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.enterMedication = exports.requestVideoVisit = void 0;
3
+ exports.wait = 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
6
  var enterMedication_1 = require("./enterMedication");
7
7
  Object.defineProperty(exports, "enterMedication", { enumerable: true, get: function () { return enterMedication_1.enterMedication; } });
8
+ var wait_1 = require("./wait");
9
+ Object.defineProperty(exports, "wait", { enumerable: true, get: function () { return wait_1.wait; } });
8
10
  //# 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;AAC1B,qDAAmD;AAA1C,kHAAA,eAAe,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;AACxB,+BAA6B;AAApB,4FAAA,IAAI,OAAA"}
@@ -0,0 +1 @@
1
+ export declare const dataPoints: {};
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataPoints = void 0;
4
+ exports.dataPoints = {};
5
+ //# sourceMappingURL=datapoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datapoints.js","sourceRoot":"","sources":["../../../../../../../extensions/experimental/v1/actions/wait/config/datapoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,EAAgD,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { FieldType } from '@awell-health/extensions-core';
2
+ import { z } from 'zod';
3
+ export declare const fields: {
4
+ seconds: {
5
+ id: string;
6
+ label: string;
7
+ description: string;
8
+ type: FieldType.NUMERIC;
9
+ required: true;
10
+ };
11
+ };
12
+ export declare const FieldsValidationSchema: z.ZodObject<{
13
+ seconds: z.ZodNumber;
14
+ }, "strip", z.ZodTypeAny, {
15
+ seconds: number;
16
+ }, {
17
+ seconds: number;
18
+ }>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldsValidationSchema = exports.fields = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const zod_1 = require("zod");
6
+ exports.fields = {
7
+ seconds: {
8
+ id: 'seconds',
9
+ label: 'Seconds',
10
+ description: 'Number of seconds to wait before this action will be completed',
11
+ type: extensions_core_1.FieldType.NUMERIC,
12
+ required: true,
13
+ },
14
+ };
15
+ exports.FieldsValidationSchema = zod_1.z.object({
16
+ seconds: zod_1.z.number(),
17
+ });
18
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/experimental/v1/actions/wait/config/fields.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,6BAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,SAAS;QAChB,WAAW,EACT,gEAAgE;QAClE,IAAI,EAAE,2BAAS,CAAC,OAAO;QACvB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;CAC8B,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/experimental/v1/actions/wait/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 { wait } from './wait';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.wait = void 0;
4
+ var wait_1 = require("./wait");
5
+ Object.defineProperty(exports, "wait", { enumerable: true, get: function () { return wait_1.wait; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/experimental/v1/actions/wait/index.ts"],"names":[],"mappings":";;;AAAA,+BAA6B;AAApB,4FAAA,IAAI,OAAA"}
@@ -0,0 +1,4 @@
1
+ import { type Action } from '@awell-health/extensions-core';
2
+ import { type settings } from '../../../settings';
3
+ import { fields } from './config';
4
+ export declare const wait: Action<typeof fields, typeof settings>;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.wait = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const extensions_core_2 = require("@awell-health/extensions-core");
6
+ const config_1 = require("./config");
7
+ const zod_1 = require("zod");
8
+ exports.wait = {
9
+ key: 'wait',
10
+ category: extensions_core_2.Category.WORKFLOW,
11
+ title: 'Wait',
12
+ description: 'Wait n number of seconds before completing',
13
+ fields: config_1.fields,
14
+ dataPoints: config_1.dataPoints,
15
+ options: {
16
+ stakeholders: {
17
+ label: 'Stakeholder',
18
+ mode: 'single',
19
+ },
20
+ },
21
+ previewable: false,
22
+ onActivityCreated: async (payload, onComplete, onError) => {
23
+ const { fields: { seconds }, } = (0, extensions_core_1.validate)({
24
+ schema: zod_1.z.object({
25
+ fields: config_1.FieldsValidationSchema,
26
+ }),
27
+ payload,
28
+ });
29
+ const waitInMs = seconds * 1000;
30
+ await new Promise((resolve) => setTimeout(resolve, waitInMs));
31
+ await onComplete();
32
+ },
33
+ };
34
+ //# sourceMappingURL=wait.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wait.js","sourceRoot":"","sources":["../../../../../../extensions/experimental/v1/actions/wait/wait.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,mEAAwD;AACxD,qCAAqE;AACrE,6BAAuB;AAEV,QAAA,IAAI,GAA2C;IAC1D,GAAG,EAAE,MAAM;IACX,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,MAAM;IACb,WAAW,EAAE,4CAA4C;IACzD,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,MAAM,EACJ,MAAM,EAAE,EAAE,OAAO,EAAE,GACpB,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,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAA;QAC/B,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAA;QAE7D,MAAM,UAAU,EAAE,CAAA;IACpB,CAAC;CACF,CAAA"}
@@ -0,0 +1,22 @@
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
+ seconds: 3,
15
+ },
16
+ settings: {},
17
+ });
18
+ await _1.wait.onActivityCreated(mockOnActivityCreateParams, onComplete, onError);
19
+ expect(onComplete).toHaveBeenCalled();
20
+ });
21
+ });
22
+ //# sourceMappingURL=wait.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wait.test.js","sourceRoot":"","sources":["../../../../../../extensions/experimental/v1/actions/wait/wait.test.ts"],"names":[],"mappings":";;AAAA,wBAAwB;AACxB,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,OAAO,EAAE,CAAC;aACX;YACD,QAAQ,EAAE,EAAE;SACb,CAAC,CAAA;QAEF,MAAM,OAAI,CAAC,iBAAiB,CAC1B,0BAA0B,EAC1B,UAAU,EACV,OAAO,CACR,CAAA;QAED,MAAM,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAA;IACvC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/awell-extensions",
3
- "version": "1.0.212",
3
+ "version": "1.0.213",
4
4
  "packageManager": "yarn@3.4.1",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {