@awell-health/awell-extensions 1.1.42-beta15 → 1.1.42-beta20

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.
@@ -1,16 +1,14 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.goalCreated = void 0;
7
4
  const lodash_1 = require("lodash");
8
5
  const types_1 = require("../lib/types");
9
- const zod_1 = __importDefault(require("zod"));
6
+ const zod_1 = require("zod");
7
+ const zod_validation_error_1 = require("zod-validation-error");
10
8
  const validatePayloadAndCreateSdk_1 = require("../lib/sdk/validatePayloadAndCreateSdk");
11
- const payloadSchema = zod_1.default
9
+ const payloadSchema = zod_1.z
12
10
  .object({
13
- resource_id: zod_1.default.string(),
11
+ resource_id: zod_1.z.string(),
14
12
  })
15
13
  .transform((data) => {
16
14
  return {
@@ -28,24 +26,58 @@ exports.goalCreated = {
28
26
  dataPoints,
29
27
  onWebhookReceived: async ({ payload, settings }, onSuccess, onError) => {
30
28
  var _a, _b;
31
- const { validatedPayload: { createdGoalId }, sdk, } = await (0, validatePayloadAndCreateSdk_1.validateWebhookPayloadAndCreateSdk)({
32
- payloadSchema,
33
- payload,
34
- settings,
35
- });
36
- const response = await sdk.getGoal({ id: createdGoalId });
37
- const healthiePatientId = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.goal) === null || _b === void 0 ? void 0 : _b.user_id;
38
- await onSuccess({
39
- data_points: {
40
- createdGoalId,
41
- },
42
- ...(!(0, lodash_1.isNil)(healthiePatientId) && {
43
- patient_identifier: {
44
- system: types_1.HEALTHIE_IDENTIFIER,
45
- value: healthiePatientId,
29
+ try {
30
+ const { validatedPayload: { createdGoalId }, sdk, } = await (0, validatePayloadAndCreateSdk_1.validateWebhookPayloadAndCreateSdk)({
31
+ payloadSchema,
32
+ payload,
33
+ settings,
34
+ });
35
+ const response = await sdk.getGoal({ id: createdGoalId });
36
+ const healthiePatientId = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.goal) === null || _b === void 0 ? void 0 : _b.user_id;
37
+ await onSuccess({
38
+ data_points: {
39
+ createdGoalId,
46
40
  },
47
- }),
48
- });
41
+ ...(!(0, lodash_1.isNil)(healthiePatientId) && {
42
+ patient_identifier: {
43
+ system: types_1.HEALTHIE_IDENTIFIER,
44
+ value: healthiePatientId,
45
+ },
46
+ }),
47
+ });
48
+ }
49
+ catch (error) {
50
+ if (error instanceof zod_1.ZodError) {
51
+ const err = (0, zod_validation_error_1.fromZodError)(error);
52
+ await onError({
53
+ events: [
54
+ {
55
+ date: new Date().toISOString(),
56
+ text: { en: err.name },
57
+ error: {
58
+ category: 'WRONG_INPUT',
59
+ message: `${err.message}`,
60
+ },
61
+ },
62
+ ],
63
+ });
64
+ }
65
+ else {
66
+ console.log('Error in goalCreated webhook:', error);
67
+ await onError({
68
+ events: [
69
+ {
70
+ date: new Date().toISOString(),
71
+ text: { en: 'Unable to process goalCreated webhook' },
72
+ error: {
73
+ category: 'SERVER_ERROR',
74
+ message: 'Unable to process goalCreated webhook',
75
+ },
76
+ },
77
+ ],
78
+ });
79
+ }
80
+ }
49
81
  }
50
82
  };
51
83
  //# sourceMappingURL=goalCreated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"goalCreated.js","sourceRoot":"","sources":["../../../../extensions/healthie/webhooks/goalCreated.ts"],"names":[],"mappings":";;;;;;AAAA,mCAA8B;AAK9B,wCAA+E;AAC/E,8CAAmB;AACnB,wFAA2F;AAG3F,MAAM,aAAa,GAAG,aAAC;KACpB,MAAM,CAAC;IACN,WAAW,EAAE,aAAC,CAAC,MAAM,EAAE;CACxB,CAAC;KACD,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;IAClB,OAAO;QACL,aAAa,EAAE,IAAI,CAAC,WAAW;KA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AAE,EAAE,EAAE,EAAE,GAAG,CAAC,IAAI,EAAE;4BACtB,KAAK,EAAE;gCACL,QAAQ,EAAE,aAAa;gCACvB,OAAO,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE;6BAC1B;yBACF;qBACF;iBACF,CAAC,CAAA;aACH;iBAAM;gBACL,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAA;gBACnD,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,uCAAuC,EAAE;4BACrD,KAAK,EAAE;gCACL,QAAQ,EAAE,cAAc;gCACxB,OAAO,EAAE,uCAAuC;6BACjD;yBACF;qBACF;iBACF,CAAC,CAAA;aACH;SAEF;IACH,CAAC;CACF,CAAA"}
@@ -13,18 +13,14 @@ export type { LabOrderUpdated } from './labOrderUpdated';
13
13
  export type { MessageCreated } from './messageCreated';
14
14
  export type { MessageDeleted } from './messageDeleted';
15
15
  export type { MetricEntryCreated } from './metricEntryCreated';
16
- export type { MetricEntryDeleted } from './metricEntryDeleted';
17
16
  export type { MetricEntryUpdated } from './metricEntryUpdated';
18
17
  export type { PatientUpdated } from './patientUpdated';
19
18
  export type { RequestFormCompletionCreated } from './requestedFormCompletionCreated';
20
- export type { RequestFormCompletionDeleted } from './requestedFormCompletionDeleted';
21
19
  export type { RequestFormCompletionUpdated } from './requestedFormCompletionUpdated';
22
20
  export type { TaskCreated } from './taskCreated';
23
- export type { TaskDeleted } from './taskDeleted';
24
21
  export type { TaskUpdated } from './taskUpdated';
25
22
  export type { GoalCreated } from './goalCreated';
26
23
  export type { GoalUpdated } from './goalUpdated';
27
- export type { GoalDeleted } from './goalDeleted';
28
24
  export declare const webhooks: (import("@awell-health/extensions-core").Webhook<"appointmentId" | "appointment", import("../lib/types").HealthieWebhookPayload, {
29
25
  apiUrl: {
30
26
  key: string;
@@ -235,7 +231,7 @@ export declare const webhooks: (import("@awell-health/extensions-core").Webhook<
235
231
  required: true;
236
232
  description: string;
237
233
  };
238
- }> | import("@awell-health/extensions-core").Webhook<"deletedMetricId", import("../lib/types").HealthieWebhookPayload, Record<string, import("@awell-health/extensions-core").Setting>> | import("@awell-health/extensions-core").Webhook<"updatedMetricId", import("../lib/types").HealthieWebhookPayload, {
234
+ }> | import("@awell-health/extensions-core").Webhook<"updatedMetricId", import("../lib/types").HealthieWebhookPayload, {
239
235
  apiUrl: {
240
236
  key: string;
241
237
  label: string;
@@ -265,7 +261,7 @@ export declare const webhooks: (import("@awell-health/extensions-core").Webhook<
265
261
  required: true;
266
262
  description: string;
267
263
  };
268
- }> | import("@awell-health/extensions-core").Webhook<"deletedFormCompletionId", import("../lib/types").HealthieWebhookPayload, Record<string, import("@awell-health/extensions-core").Setting>> | import("@awell-health/extensions-core").Webhook<"updatedFormCompletionId", import("../lib/types").HealthieWebhookPayload, {
264
+ }> | import("@awell-health/extensions-core").Webhook<"updatedFormCompletionId", import("../lib/types").HealthieWebhookPayload, {
269
265
  apiUrl: {
270
266
  key: string;
271
267
  label: string;
@@ -295,7 +291,7 @@ export declare const webhooks: (import("@awell-health/extensions-core").Webhook<
295
291
  required: true;
296
292
  description: string;
297
293
  };
298
- }> | import("@awell-health/extensions-core").Webhook<"deletedTaskId", import("../lib/types").HealthieWebhookPayload, Record<string, import("@awell-health/extensions-core").Setting>> | import("@awell-health/extensions-core").Webhook<"updatedTaskId", import("../lib/types").HealthieWebhookPayload, {
294
+ }> | import("@awell-health/extensions-core").Webhook<"updatedTaskId", import("../lib/types").HealthieWebhookPayload, {
299
295
  apiUrl: {
300
296
  key: string;
301
297
  label: string;
@@ -340,4 +336,4 @@ export declare const webhooks: (import("@awell-health/extensions-core").Webhook<
340
336
  required: true;
341
337
  description: string;
342
338
  };
343
- }> | import("@awell-health/extensions-core").Webhook<"deletedGoalId", import("../lib/types").HealthieWebhookPayload, Record<string, import("@awell-health/extensions-core").Setting>>)[];
339
+ }>)[];
@@ -16,18 +16,14 @@ const labOrderUpdated_1 = require("./labOrderUpdated");
16
16
  const messageCreated_1 = require("./messageCreated");
17
17
  const messageDeleted_1 = require("./messageDeleted");
18
18
  const metricEntryCreated_1 = require("./metricEntryCreated");
19
- const metricEntryDeleted_1 = require("./metricEntryDeleted");
20
19
  const metricEntryUpdated_1 = require("./metricEntryUpdated");
21
20
  const patientUpdated_1 = require("./patientUpdated");
22
21
  const requestedFormCompletionCreated_1 = require("./requestedFormCompletionCreated");
23
- const requestedFormCompletionDeleted_1 = require("./requestedFormCompletionDeleted");
24
22
  const requestedFormCompletionUpdated_1 = require("./requestedFormCompletionUpdated");
25
23
  const taskCreated_1 = require("./taskCreated");
26
- const taskDeleted_1 = require("./taskDeleted");
27
24
  const taskUpdated_1 = require("./taskUpdated");
28
25
  const goalCreated_1 = require("./goalCreated");
29
26
  const goalUpdated_1 = require("./goalUpdated");
30
- const goalDeleted_1 = require("./goalDeleted");
31
27
  exports.webhooks = [
32
28
  appointmentCreated_1.appointmentCreated,
33
29
  patientCreated_1.patientCreated,
@@ -44,17 +40,13 @@ exports.webhooks = [
44
40
  messageCreated_1.messageCreated,
45
41
  messageDeleted_1.messageDeleted,
46
42
  metricEntryCreated_1.metricEntryCreated,
47
- metricEntryDeleted_1.metricEntryDeleted,
48
43
  metricEntryUpdated_1.metricEntryUpdated,
49
44
  patientUpdated_1.patientUpdated,
50
45
  requestedFormCompletionCreated_1.requestFormCompletionCreated,
51
- requestedFormCompletionDeleted_1.requestFormCompletionDeleted,
52
46
  requestedFormCompletionUpdated_1.requestFormCompletionUpdated,
53
47
  taskCreated_1.taskCreated,
54
- taskDeleted_1.taskDeleted,
55
48
  taskUpdated_1.taskUpdated,
56
49
  goalCreated_1.goalCreated,
57
50
  goalUpdated_1.goalUpdated,
58
- goalDeleted_1.goalDeleted,
59
51
  ];
60
52
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/healthie/webhooks/index.ts"],"names":[],"mappings":";;;AAAA,6DAAyD;AACzD,qDAAiD;AACjD,2DAAuD;AACvD,2DAAuD;AACvD,6DAAyD;AACzD,6DAAyD;AACzD,qEAAiE;AACjE,qEAAiE;AACjE,mEAA+D;AAC/D,mEAA+D;AAC/D,uDAAmD;AACnD,uDAAmD;AACnD,qDAAiD;AACjD,qDAAiD;AACjD,6DAAyD;AACzD,6DAAyD;AACzD,6DAAyD;AACzD,qDAAiD;AACjD,qFAA+E;AAC/E,qFAA+E;AAC/E,qFAA+E;AAC/E,+CAA2C;AAC3C,+CAA2C;AAC3C,+CAA2C;AAC3C,+CAA2C;AAC3C,+CAA2C;AAC3C,+CAA2C;AA8B9B,QAAA,QAAQ,GAAG;IACtB,uCAAkB;IAClB,+BAAc;IACd,qCAAiB;IACjB,qCAAiB;IACjB,uCAAkB;IAClB,uCAAkB;IAClB,+CAAsB;IACtB,+CAAsB;IACtB,6CAAqB;IACrB,6CAAqB;IACrB,iCAAe;IACf,iCAAe;IACf,+BAAc;IACd,+BAAc;IACd,uCAAkB;IAClB,uCAAkB;IAClB,uCAAkB;IAClB,+BAAc;IACd,6DAA4B;IAC5B,6DAA4B;IAC5B,6DAA4B;IAC5B,yBAAW;IACX,yBAAW;IACX,yBAAW;IACX,yBAAW;IACX,yBAAW;IACX,yBAAW;CACZ,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/healthie/webhooks/index.ts"],"names":[],"mappings":";;;AAAA,6DAAyD;AACzD,qDAAiD;AACjD,2DAAuD;AACvD,2DAAuD;AACvD,6DAAyD;AACzD,6DAAyD;AACzD,qEAAiE;AACjE,qEAAiE;AACjE,mEAA+D;AAC/D,mEAA+D;AAC/D,uDAAmD;AACnD,uDAAmD;AACnD,qDAAiD;AACjD,qDAAiD;AACjD,6DAAyD;AACzD,6DAAyD;AACzD,qDAAiD;AACjD,qFAA+E;AAC/E,qFAA+E;AAC/E,+CAA2C;AAC3C,+CAA2C;AAC3C,+CAA2C;AAC3C,+CAA2C;AA0B9B,QAAA,QAAQ,GAAG;IACtB,uCAAkB;IAClB,+BAAc;IACd,qCAAiB;IACjB,qCAAiB;IACjB,uCAAkB;IAClB,uCAAkB;IAClB,+CAAsB;IACtB,+CAAsB;IACtB,6CAAqB;IACrB,6CAAqB;IACrB,iCAAe;IACf,iCAAe;IACf,+BAAc;IACd,+BAAc;IACd,uCAAkB;IAClB,uCAAkB;IAClB,+BAAc;IACd,6DAA4B;IAC5B,6DAA4B;IAC5B,yBAAW;IACX,yBAAW;IACX,yBAAW;IACX,yBAAW;CACZ,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/awell-extensions",
3
- "version": "1.1.42-beta15",
3
+ "version": "1.1.42-beta20",
4
4
  "packageManager": "yarn@3.4.1",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {
@@ -1,11 +0,0 @@
1
- import { type Webhook } from '@awell-health/extensions-core';
2
- import { type HealthieWebhookPayload } from '../lib/types';
3
- declare const dataPoints: {
4
- deletedGoalId: {
5
- key: string;
6
- valueType: "string";
7
- };
8
- };
9
- export declare const goalDeleted: Webhook<keyof typeof dataPoints, HealthieWebhookPayload>;
10
- export type GoalDeleted = typeof goalDeleted;
11
- export {};
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.goalDeleted = void 0;
4
- const lodash_1 = require("lodash");
5
- const dataPoints = {
6
- deletedGoalId: {
7
- key: 'deletedGoalId',
8
- valueType: 'string',
9
- },
10
- };
11
- exports.goalDeleted = {
12
- key: 'goalDeleted',
13
- dataPoints,
14
- onWebhookReceived: async ({ payload, settings }, onSuccess, onError) => {
15
- const { resource_id: deletedGoalId } = payload;
16
- if ((0, lodash_1.isNil)(deletedGoalId)) {
17
- await onError({
18
- // We should automatically send a 400 here, so no need to provide info
19
- });
20
- }
21
- else {
22
- await onSuccess({
23
- data_points: {
24
- deletedGoalId,
25
- },
26
- });
27
- }
28
- },
29
- };
30
- //# sourceMappingURL=goalDeleted.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"goalDeleted.js","sourceRoot":"","sources":["../../../../extensions/healthie/webhooks/goalDeleted.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAO9B,MAAM,UAAU,GAAG;IACjB,aAAa,EAAE;QACb,GAAG,EAAE,eAAe;QACpB,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA;AAElC,QAAA,WAAW,GAGpB;IACF,GAAG,EAAE,aAAa;IAClB,UAAU;IACV,iBAAiB,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;QACrE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,OAAO,CAAA;QAE9C,IAAI,IAAA,cAAK,EAAC,aAAa,CAAC,EAAE;YACxB,MAAM,OAAO,CAAC;YACZ,sEAAsE;aACvE,CAAC,CAAA;SACH;aAAM;YACL,MAAM,SAAS,CAAC;gBACd,WAAW,EAAE;oBACX,aAAa;iBACd;aACF,CAAC,CAAA;SACH;IACH,CAAC;CACF,CAAA"}
@@ -1,11 +0,0 @@
1
- import { type Webhook } from '@awell-health/extensions-core';
2
- import { type HealthieWebhookPayload } from '../lib/types';
3
- declare const dataPoints: {
4
- deletedMetricId: {
5
- key: string;
6
- valueType: "string";
7
- };
8
- };
9
- export declare const metricEntryDeleted: Webhook<keyof typeof dataPoints, HealthieWebhookPayload>;
10
- export type MetricEntryDeleted = typeof metricEntryDeleted;
11
- export {};
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.metricEntryDeleted = void 0;
4
- const lodash_1 = require("lodash");
5
- const dataPoints = {
6
- deletedMetricId: {
7
- key: 'deletedMetricId',
8
- valueType: 'string',
9
- },
10
- };
11
- exports.metricEntryDeleted = {
12
- key: 'metricEntryDeleted',
13
- dataPoints,
14
- onWebhookReceived: async ({ payload, settings }, onSuccess, onError) => {
15
- const { resource_id: deletedMetricId } = payload;
16
- if ((0, lodash_1.isNil)(deletedMetricId)) {
17
- await onError({
18
- // We should automatically send a 400 here, so no need to provide info
19
- });
20
- }
21
- else {
22
- await onSuccess({
23
- data_points: {
24
- deletedMetricId,
25
- },
26
- });
27
- }
28
- },
29
- };
30
- //# sourceMappingURL=metricEntryDeleted.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metricEntryDeleted.js","sourceRoot":"","sources":["../../../../extensions/healthie/webhooks/metricEntryDeleted.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAO9B,MAAM,UAAU,GAAG;IACjB,eAAe,EAAE;QACf,GAAG,EAAE,iBAAiB;QACtB,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA;AAElC,QAAA,kBAAkB,GAG3B;IACF,GAAG,EAAE,oBAAoB;IACzB,UAAU;IACV,iBAAiB,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;QACrE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,GAAG,OAAO,CAAA;QAEhD,IAAI,IAAA,cAAK,EAAC,eAAe,CAAC,EAAE;YAC1B,MAAM,OAAO,CAAC;YACZ,sEAAsE;aACvE,CAAC,CAAA;SACH;aAAM;YACL,MAAM,SAAS,CAAC;gBACd,WAAW,EAAE;oBACX,eAAe;iBAChB;aACF,CAAC,CAAA;SACH;IACH,CAAC;CACF,CAAA"}
@@ -1,11 +0,0 @@
1
- import { type Webhook } from '@awell-health/extensions-core';
2
- import { type HealthieWebhookPayload } from '../lib/types';
3
- declare const dataPoints: {
4
- deletedFormCompletionId: {
5
- key: string;
6
- valueType: "string";
7
- };
8
- };
9
- export declare const requestFormCompletionDeleted: Webhook<keyof typeof dataPoints, HealthieWebhookPayload>;
10
- export type RequestFormCompletionDeleted = typeof requestFormCompletionDeleted;
11
- export {};
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.requestFormCompletionDeleted = void 0;
4
- const lodash_1 = require("lodash");
5
- const dataPoints = {
6
- deletedFormCompletionId: {
7
- key: 'deletedFormCompletionId',
8
- valueType: 'string',
9
- },
10
- };
11
- exports.requestFormCompletionDeleted = {
12
- key: 'requestFormCompletionDeleted',
13
- dataPoints,
14
- onWebhookReceived: async ({ payload, settings }, onSuccess, onError) => {
15
- const { resource_id: deletedFormCompletionId } = payload;
16
- if ((0, lodash_1.isNil)(deletedFormCompletionId)) {
17
- await onError({
18
- // We should automatically send a 400 here, so no need to provide info
19
- });
20
- }
21
- else {
22
- await onSuccess({
23
- data_points: {
24
- deletedFormCompletionId,
25
- },
26
- });
27
- }
28
- },
29
- };
30
- //# sourceMappingURL=requestedFormCompletionDeleted.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"requestedFormCompletionDeleted.js","sourceRoot":"","sources":["../../../../extensions/healthie/webhooks/requestedFormCompletionDeleted.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAO9B,MAAM,UAAU,GAAG;IACjB,uBAAuB,EAAE;QACvB,GAAG,EAAE,yBAAyB;QAC9B,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA;AAElC,QAAA,4BAA4B,GAGrC;IACF,GAAG,EAAE,8BAA8B;IACnC,UAAU;IACV,iBAAiB,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;QACrE,MAAM,EAAE,WAAW,EAAE,uBAAuB,EAAE,GAAG,OAAO,CAAA;QAExD,IAAI,IAAA,cAAK,EAAC,uBAAuB,CAAC,EAAE;YAClC,MAAM,OAAO,CAAC;YACZ,sEAAsE;aACvE,CAAC,CAAA;SACH;aAAM;YACL,MAAM,SAAS,CAAC;gBACd,WAAW,EAAE;oBACX,uBAAuB;iBACxB;aACF,CAAC,CAAA;SACH;IACH,CAAC;CACF,CAAA"}
@@ -1,11 +0,0 @@
1
- import { type Webhook } from '@awell-health/extensions-core';
2
- import { type HealthieWebhookPayload } from '../lib/types';
3
- declare const dataPoints: {
4
- deletedTaskId: {
5
- key: string;
6
- valueType: "string";
7
- };
8
- };
9
- export declare const taskDeleted: Webhook<keyof typeof dataPoints, HealthieWebhookPayload>;
10
- export type TaskDeleted = typeof taskDeleted;
11
- export {};
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.taskDeleted = void 0;
4
- const lodash_1 = require("lodash");
5
- const dataPoints = {
6
- deletedTaskId: {
7
- key: 'deletedTaskId',
8
- valueType: 'string',
9
- },
10
- };
11
- exports.taskDeleted = {
12
- key: 'taskDeleted',
13
- dataPoints,
14
- onWebhookReceived: async ({ payload, settings }, onSuccess, onError) => {
15
- const { resource_id: deletedTaskId } = payload;
16
- if ((0, lodash_1.isNil)(deletedTaskId)) {
17
- await onError({
18
- // We should automatically send a 400 here, so no need to provide info
19
- });
20
- }
21
- else {
22
- await onSuccess({
23
- data_points: {
24
- deletedTaskId,
25
- },
26
- });
27
- }
28
- },
29
- };
30
- //# sourceMappingURL=taskDeleted.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"taskDeleted.js","sourceRoot":"","sources":["../../../../extensions/healthie/webhooks/taskDeleted.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAO9B,MAAM,UAAU,GAAG;IACjB,aAAa,EAAE;QACb,GAAG,EAAE,eAAe;QACpB,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA;AAElC,QAAA,WAAW,GAGpB;IACF,GAAG,EAAE,aAAa;IAClB,UAAU;IACV,iBAAiB,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;QACrE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,OAAO,CAAA;QAE9C,IAAI,IAAA,cAAK,EAAC,aAAa,CAAC,EAAE;YACxB,MAAM,OAAO,CAAC;YACZ,sEAAsE;aACvE,CAAC,CAAA;SACH;aAAM;YACL,MAAM,SAAS,CAAC;gBACd,WAAW,EAAE;oBACX,aAAa;iBACd;aACF,CAAC,CAAA;SACH;IACH,CAAC;CACF,CAAA"}