@awell-health/awell-extensions 2.1.201 → 2.1.203
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/awell/index.js +1 -0
- package/dist/extensions/awell/index.js.map +1 -1
- package/dist/extensions/awell/v1/actions/getHostedPagesLink/config/dataPoints.d.ts +6 -0
- package/dist/extensions/awell/v1/actions/getHostedPagesLink/config/dataPoints.js +10 -0
- package/dist/extensions/awell/v1/actions/getHostedPagesLink/config/dataPoints.js.map +1 -0
- package/dist/extensions/awell/v1/actions/getHostedPagesLink/config/fields.d.ts +22 -0
- package/dist/extensions/awell/v1/actions/getHostedPagesLink/config/fields.js +29 -0
- package/dist/extensions/awell/v1/actions/getHostedPagesLink/config/fields.js.map +1 -0
- package/dist/extensions/awell/v1/actions/getHostedPagesLink/config/index.d.ts +2 -0
- package/dist/extensions/awell/v1/actions/getHostedPagesLink/config/index.js +9 -0
- package/dist/extensions/awell/v1/actions/getHostedPagesLink/config/index.js.map +1 -0
- package/dist/extensions/awell/v1/actions/getHostedPagesLink/getHostedPagesLink.d.ts +4 -0
- package/dist/extensions/awell/v1/actions/getHostedPagesLink/getHostedPagesLink.js +96 -0
- package/dist/extensions/awell/v1/actions/getHostedPagesLink/getHostedPagesLink.js.map +1 -0
- package/dist/extensions/awell/v1/actions/getHostedPagesLink/index.d.ts +1 -0
- package/dist/extensions/awell/v1/actions/getHostedPagesLink/index.js +6 -0
- package/dist/extensions/awell/v1/actions/getHostedPagesLink/index.js.map +1 -0
- package/dist/extensions/awell/v1/actions/index.d.ts +1 -0
- package/dist/extensions/awell/v1/actions/index.js +3 -1
- package/dist/extensions/awell/v1/actions/index.js.map +1 -1
- package/dist/extensions/awell/v1/actions/startHostedPagesSession/startHostedPagesSession.js +11 -26
- package/dist/extensions/awell/v1/actions/startHostedPagesSession/startHostedPagesSession.js.map +1 -1
- package/dist/extensions/markdown.json +4 -4
- package/dist/extensions/zendesk/settings.d.ts +38 -5
- package/dist/extensions/zendesk/settings.js +109 -16
- package/dist/extensions/zendesk/settings.js.map +1 -1
- package/dist/extensions/zendesk/v1/client/auth.d.ts +59 -0
- package/dist/extensions/zendesk/v1/client/auth.js +102 -0
- package/dist/extensions/zendesk/v1/client/auth.js.map +1 -0
- package/dist/extensions/zendesk/v1/client/client.d.ts +30 -3
- package/dist/extensions/zendesk/v1/client/client.js +74 -24
- package/dist/extensions/zendesk/v1/client/client.js.map +1 -1
- package/dist/extensions/zendesk/v1/client/index.d.ts +3 -1
- package/dist/extensions/zendesk/v1/client/index.js +7 -1
- package/dist/extensions/zendesk/v1/client/index.js.map +1 -1
- package/dist/extensions/zendesk/v1/lib/ticketDataPoints.d.ts +12 -1
- package/dist/extensions/zendesk/v1/lib/ticketDataPoints.js +99 -2
- package/dist/extensions/zendesk/v1/lib/ticketDataPoints.js.map +1 -1
- package/dist/extensions/zendesk/v1/webhooks/index.d.ts +53 -3
- package/dist/extensions/zendesk/v1/webhooks/ticketEvent/__testdata__/ticketEvent.mock.d.ts +6 -1
- package/dist/extensions/zendesk/v1/webhooks/ticketEvent/__testdata__/ticketEvent.mock.js +6 -1
- package/dist/extensions/zendesk/v1/webhooks/ticketEvent/__testdata__/ticketEvent.mock.js.map +1 -1
- package/dist/extensions/zendesk/v1/webhooks/ticketEvent/ticketEvent.d.ts +4 -0
- package/dist/extensions/zendesk/v1/webhooks/ticketEvent/ticketEvent.js +79 -41
- package/dist/extensions/zendesk/v1/webhooks/ticketEvent/ticketEvent.js.map +1 -1
- package/dist/extensions/zendesk/v1/webhooks/ticketEvent/types.d.ts +90 -0
- package/dist/extensions/zendesk/v1/webhooks/ticketEvent/types.js +56 -10
- package/dist/extensions/zendesk/v1/webhooks/ticketEvent/types.js.map +1 -1
- package/dist/src/lib/awell/getStakeholderId/getStakeholderId.d.ts +18 -0
- package/dist/src/lib/awell/getStakeholderId/getStakeholderId.js +41 -0
- package/dist/src/lib/awell/getStakeholderId/getStakeholderId.js.map +1 -0
- package/dist/src/lib/awell/getStakeholderId/index.d.ts +1 -0
- package/dist/src/lib/awell/getStakeholderId/index.js +18 -0
- package/dist/src/lib/awell/getStakeholderId/index.js.map +1 -0
- package/dist/src/lib/awell/index.d.ts +1 -0
- package/dist/src/lib/awell/index.js +1 -0
- package/dist/src/lib/awell/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -29,6 +29,7 @@ exports.Awell = {
|
|
|
29
29
|
isPatientEnrolledInTrack: actions_1.isPatientEnrolledInTrack,
|
|
30
30
|
updateBaselineInfo: actions_1.updateBaselineInfo,
|
|
31
31
|
startHostedPagesSession: actions_1.startHostedPagesSession,
|
|
32
|
+
getHostedPagesLink: actions_1.getHostedPagesLink,
|
|
32
33
|
startCareFlowAndSession: actions_1.startCareFlowAndSession,
|
|
33
34
|
getDataPointValue: actions_1.getDataPointValue,
|
|
34
35
|
listFormAnswers: actions_1.listFormAnswers,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/awell/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/awell/index.ts"],"names":[],"mappings":";;;AAAA,0CAmBqB;AAErB,yCAAqC;AACrC,4CAAwC;AACxC,8CAA0C;AAC1C,mEAAoE;AAEvD,QAAA,KAAK,GAAc;IAC9B,GAAG,EAAE,OAAO;IACZ,KAAK,EAAE,gBAAgB;IACvB,QAAQ,EACN,iGAAiG;IACnG,WAAW,EAAE,qDAAqD;IAClE,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,QAAQ,EAAR,mBAAQ;IACR,OAAO,EAAE;QACP,aAAa,EAAb,uBAAa;QACb,sBAAsB,EAAtB,gCAAsB;QACtB,sBAAsB,EAAtB,gCAAsB;QACtB,aAAa,EAAb,uBAAa;QACb,aAAa,EAAb,uBAAa;QACb,YAAY,EAAZ,sBAAY;QACZ,SAAS,EAAT,mBAAS;QACT,2BAA2B,EAA3B,qCAA2B;QAC3B,2BAA2B,EAA3B,qCAA2B;QAC3B,wBAAwB,EAAxB,kCAAwB;QACxB,kBAAkB,EAAlB,4BAAkB;QAClB,uBAAuB,EAAvB,iCAAuB;QACvB,kBAAkB,EAAlB,4BAAkB;QAClB,uBAAuB,EAAvB,iCAAuB;QACvB,iBAAiB,EAAjB,2BAAiB;QACjB,eAAe,EAAf,yBAAe;QACf,iBAAiB,EAAjB,2BAAiB;QACjB,oBAAoB,EAApB,8BAAoB;KACrB;IACD,QAAQ,EAAR,mBAAQ;IACR,UAAU,EAAE,EAAE,MAAM,EAAE,yBAAyB,EAAE;IACjD,SAAS,EAAT,qBAAS;CACV,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../../../extensions/awell/v1/actions/getHostedPagesLink/config/dataPoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,OAAO,EAAE;QACP,GAAG,EAAE,SAAS;QACd,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FieldType } from '@awell-health/extensions-core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const fields: {
|
|
4
|
+
careFlowId: {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
type: FieldType.STRING;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
stakeholder: {
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
description: string;
|
|
15
|
+
type: FieldType.STRING;
|
|
16
|
+
required: false;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const FieldsValidationSchema: z.ZodObject<{
|
|
20
|
+
careFlowId: z.ZodString;
|
|
21
|
+
stakeholder: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string, string | undefined>>;
|
|
22
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,29 @@
|
|
|
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 lodash_1 = require("lodash");
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
exports.fields = {
|
|
8
|
+
careFlowId: {
|
|
9
|
+
id: 'careFlowId',
|
|
10
|
+
label: 'Care flow ID',
|
|
11
|
+
description: 'The instance ID of the care flow to fetch the link for',
|
|
12
|
+
type: extensions_core_1.FieldType.STRING,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
stakeholder: {
|
|
16
|
+
id: 'stakeholder',
|
|
17
|
+
label: 'Stakeholder',
|
|
18
|
+
description: 'The name of the stakeholder to fetch the static Hosted Pages link for. Defaults to "patient" when left empty.',
|
|
19
|
+
type: extensions_core_1.FieldType.STRING,
|
|
20
|
+
required: false,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
exports.FieldsValidationSchema = zod_1.z.object({
|
|
24
|
+
careFlowId: zod_1.z.string().min(1),
|
|
25
|
+
stakeholder: zod_1.z
|
|
26
|
+
.optional(zod_1.z.string())
|
|
27
|
+
.transform((value) => ((0, lodash_1.isNil)(value) || (0, lodash_1.isEmpty)(value) ? 'patient' : value)),
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/awell/v1/actions/getHostedPagesLink/config/fields.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,mCAAuC;AACvC,6BAAqC;AAExB,QAAA,MAAM,GAAG;IACpB,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,wDAAwD;QACrE,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,WAAW,EAAE;QACX,EAAE,EAAE,aAAa;QACjB,KAAK,EAAE,aAAa;QACpB,WAAW,EACT,+GAA+G;QACjH,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;KAChB;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,WAAW,EAAE,OAAC;SACX,QAAQ,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;SACpB,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,IAAA,cAAK,EAAC,KAAK,CAAC,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;CAC/B,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/awell/v1/actions/getHostedPagesLink/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getHostedPagesLink = 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
|
+
const addEventLog_1 = require("../../../../../src/lib/awell/addEventLog");
|
|
8
|
+
const getStakeholderId_1 = require("../../../../../src/lib/awell/getStakeholderId");
|
|
9
|
+
exports.getHostedPagesLink = {
|
|
10
|
+
key: 'getHostedPagesLink',
|
|
11
|
+
category: extensions_core_1.Category.WORKFLOW,
|
|
12
|
+
title: 'Get Hosted Pages Link',
|
|
13
|
+
description: 'Fetch the static Hosted Pages link for a stakeholder (defaults to the patient)',
|
|
14
|
+
fields: config_1.fields,
|
|
15
|
+
dataPoints: config_1.dataPoints,
|
|
16
|
+
previewable: false,
|
|
17
|
+
supports_automated_retries: true,
|
|
18
|
+
onEvent: async ({ payload, onComplete, onError, helpers }) => {
|
|
19
|
+
var _a, _b, _c;
|
|
20
|
+
helpers.log({ fields: payload.fields }, 'Processing getHostedPagesLink');
|
|
21
|
+
try {
|
|
22
|
+
const { fields: { careFlowId, stakeholder }, } = (0, extensions_core_1.validate)({
|
|
23
|
+
schema: zod_1.z.object({
|
|
24
|
+
fields: config_1.FieldsValidationSchema,
|
|
25
|
+
}),
|
|
26
|
+
payload,
|
|
27
|
+
});
|
|
28
|
+
const sdk = await helpers.awellSdk();
|
|
29
|
+
const pathwayRes = await sdk.orchestration.query({
|
|
30
|
+
pathway: {
|
|
31
|
+
__args: {
|
|
32
|
+
id: careFlowId,
|
|
33
|
+
},
|
|
34
|
+
pathway: {
|
|
35
|
+
release_id: true,
|
|
36
|
+
patient_id: true,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
const releaseId = (_a = pathwayRes === null || pathwayRes === void 0 ? void 0 : pathwayRes.pathway.pathway) === null || _a === void 0 ? void 0 : _a.release_id;
|
|
41
|
+
const patientId = (_b = pathwayRes === null || pathwayRes === void 0 ? void 0 : pathwayRes.pathway.pathway) === null || _b === void 0 ? void 0 : _b.patient_id;
|
|
42
|
+
if (releaseId === undefined)
|
|
43
|
+
throw new Error('Could not retrieve the release ID for this care flow.');
|
|
44
|
+
const stakeholderId = await (0, getStakeholderId_1.getStakeholderId)({
|
|
45
|
+
awellSdk: sdk,
|
|
46
|
+
pathwayId: careFlowId,
|
|
47
|
+
releaseId,
|
|
48
|
+
patientId,
|
|
49
|
+
stakeholder,
|
|
50
|
+
});
|
|
51
|
+
const res = await sdk.orchestration.query({
|
|
52
|
+
hostedPagesLink: {
|
|
53
|
+
__args: {
|
|
54
|
+
pathway_id: careFlowId,
|
|
55
|
+
stakeholder_id: stakeholderId,
|
|
56
|
+
},
|
|
57
|
+
success: true,
|
|
58
|
+
hosted_pages_link: {
|
|
59
|
+
id: true,
|
|
60
|
+
url: true,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
const linkUrl = (_c = res.hostedPagesLink.hosted_pages_link) === null || _c === void 0 ? void 0 : _c.url;
|
|
65
|
+
if (linkUrl === undefined || linkUrl === null)
|
|
66
|
+
throw new Error(`Could not find a Hosted Pages link for stakeholder ${stakeholder} in care flow ${careFlowId}. There may be no activity for this stakeholder in this care flow.`);
|
|
67
|
+
await onComplete({
|
|
68
|
+
data_points: {
|
|
69
|
+
linkUrl,
|
|
70
|
+
},
|
|
71
|
+
events: [
|
|
72
|
+
(0, addEventLog_1.addActivityEventLog)({
|
|
73
|
+
message: `Fetched the Hosted Pages link for care flow instance id ${careFlowId} and stakeholder ${stakeholder} (${stakeholderId}). Link URL is ${linkUrl}.`,
|
|
74
|
+
}),
|
|
75
|
+
],
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
helpers.log({ err }, 'error', err);
|
|
80
|
+
const error = err;
|
|
81
|
+
await onError({
|
|
82
|
+
events: [
|
|
83
|
+
{
|
|
84
|
+
date: new Date().toISOString(),
|
|
85
|
+
text: { en: error.message },
|
|
86
|
+
error: {
|
|
87
|
+
category: 'SERVER_ERROR',
|
|
88
|
+
message: error.message,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=getHostedPagesLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getHostedPagesLink.js","sourceRoot":"","sources":["../../../../../../extensions/awell/v1/actions/getHostedPagesLink/getHostedPagesLink.ts"],"names":[],"mappings":";;;AAEA,mEAAkE;AAClE,qCAAqE;AACrE,6BAAuB;AACvB,0EAA8E;AAC9E,oFAAgF;AAEnE,QAAA,kBAAkB,GAA2C;IACxE,GAAG,EAAE,oBAAoB;IACzB,QAAQ,EAAE,0BAAQ,CAAC,QAAQ;IAC3B,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EACT,gFAAgF;IAClF,MAAM,EAAN,eAAM;IACN,UAAU,EAAV,mBAAU;IACV,WAAW,EAAE,KAAK;IAClB,0BAA0B,EAAE,IAAI;IAChC,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAiB,EAAE;;QAC1E,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,+BAA+B,CAAC,CAAA;QAExE,IAAI,CAAC;YACH,MAAM,EACJ,MAAM,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,GACpC,GAAG,IAAA,0BAAQ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YAE1D,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI;gBAC3C,MAAM,IAAI,KAAK,CACb,sDAAsD,WAAW,iBAAiB,UAAU,oEAAoE,CACjK,CAAA;YAEH,MAAM,UAAU,CAAC;gBACf,WAAW,EAAE;oBACX,OAAO;iBACR;gBACD,MAAM,EAAE;oBACN,IAAA,iCAAmB,EAAC;wBAClB,OAAO,EAAE,2DAA2D,UAAU,oBAAoB,WAAW,KAAK,aAAa,kBAAkB,OAAO,GAAG;qBAC5J,CAAC;iBACH;aACF,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,GAAY,CAAC,CAAA;YAC3C,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,KAAK,CAAC,OAAO,EAAE;wBAC3B,KAAK,EAAE;4BACL,QAAQ,EAAE,cAAc;4BACxB,OAAO,EAAE,KAAK,CAAC,OAAO;yBACvB;qBACF;iBACF;aACF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getHostedPagesLink } from './getHostedPagesLink';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getHostedPagesLink = void 0;
|
|
4
|
+
var getHostedPagesLink_1 = require("./getHostedPagesLink");
|
|
5
|
+
Object.defineProperty(exports, "getHostedPagesLink", { enumerable: true, get: function () { return getHostedPagesLink_1.getHostedPagesLink; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/awell/v1/actions/getHostedPagesLink/index.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA"}
|
|
@@ -10,6 +10,7 @@ export { updateBaselineInfo } from './updateBaselineInfo';
|
|
|
10
10
|
export { getPatientByIdentifier } from './getPatientByIdentifier';
|
|
11
11
|
export { addIdentifierToPatient } from './addIdentifierToPatient';
|
|
12
12
|
export { startHostedPagesSession } from './startHostedPagesSession';
|
|
13
|
+
export { getHostedPagesLink } from './getHostedPagesLink';
|
|
13
14
|
export { startCareFlowAndSession } from './startCareFlowAndSession';
|
|
14
15
|
export { getDataPointValue } from './getDataPointValue';
|
|
15
16
|
export { listFormAnswers } from './listFormAnswers';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCurrentCareflowId = exports.createNaviSession = exports.listFormAnswers = exports.getDataPointValue = exports.startCareFlowAndSession = exports.startHostedPagesSession = exports.addIdentifierToPatient = exports.getPatientByIdentifier = exports.updateBaselineInfo = exports.isPatientEnrolledInTrack = exports.isPatientEnrolledInCareFlow = exports.searchPatientsByPatientCode = exports.stopTrack = exports.stopCareFlow = exports.updatePatient = exports.startCareFlow = exports.addAdhocTrack = void 0;
|
|
3
|
+
exports.getCurrentCareflowId = exports.createNaviSession = exports.listFormAnswers = exports.getDataPointValue = exports.startCareFlowAndSession = exports.getHostedPagesLink = exports.startHostedPagesSession = exports.addIdentifierToPatient = exports.getPatientByIdentifier = exports.updateBaselineInfo = exports.isPatientEnrolledInTrack = exports.isPatientEnrolledInCareFlow = exports.searchPatientsByPatientCode = exports.stopTrack = exports.stopCareFlow = exports.updatePatient = exports.startCareFlow = exports.addAdhocTrack = void 0;
|
|
4
4
|
var addAdhocTrack_1 = require("./addAdhocTrack");
|
|
5
5
|
Object.defineProperty(exports, "addAdhocTrack", { enumerable: true, get: function () { return addAdhocTrack_1.addAdhocTrack; } });
|
|
6
6
|
var startCareFlow_1 = require("./startCareFlow");
|
|
@@ -25,6 +25,8 @@ var addIdentifierToPatient_1 = require("./addIdentifierToPatient");
|
|
|
25
25
|
Object.defineProperty(exports, "addIdentifierToPatient", { enumerable: true, get: function () { return addIdentifierToPatient_1.addIdentifierToPatient; } });
|
|
26
26
|
var startHostedPagesSession_1 = require("./startHostedPagesSession");
|
|
27
27
|
Object.defineProperty(exports, "startHostedPagesSession", { enumerable: true, get: function () { return startHostedPagesSession_1.startHostedPagesSession; } });
|
|
28
|
+
var getHostedPagesLink_1 = require("./getHostedPagesLink");
|
|
29
|
+
Object.defineProperty(exports, "getHostedPagesLink", { enumerable: true, get: function () { return getHostedPagesLink_1.getHostedPagesLink; } });
|
|
28
30
|
var startCareFlowAndSession_1 = require("./startCareFlowAndSession");
|
|
29
31
|
Object.defineProperty(exports, "startCareFlowAndSession", { enumerable: true, get: function () { return startCareFlowAndSession_1.startCareFlowAndSession; } });
|
|
30
32
|
var getDataPointValue_1 = require("./getDataPointValue");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/awell/v1/actions/index.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,+CAA6C;AAApC,4GAAA,YAAY,OAAA;AACrB,yCAAuC;AAA9B,sGAAA,SAAS,OAAA;AAClB,6EAA2E;AAAlE,0IAAA,2BAA2B,OAAA;AACpC,6EAA2E;AAAlE,0IAAA,2BAA2B,OAAA;AACpC,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,mEAAiE;AAAxD,gIAAA,sBAAsB,OAAA;AAC/B,mEAAiE;AAAxD,gIAAA,sBAAsB,OAAA;AAC/B,qEAAmE;AAA1D,kIAAA,uBAAuB,OAAA;AAChC,qEAAmE;AAA1D,kIAAA,uBAAuB,OAAA;AAChC,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,qDAAmD;AAA1C,kHAAA,eAAe,OAAA;AACxB,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,+DAA6D;AAApD,4HAAA,oBAAoB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/awell/v1/actions/index.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,+CAA6C;AAApC,4GAAA,YAAY,OAAA;AACrB,yCAAuC;AAA9B,sGAAA,SAAS,OAAA;AAClB,6EAA2E;AAAlE,0IAAA,2BAA2B,OAAA;AACpC,6EAA2E;AAAlE,0IAAA,2BAA2B,OAAA;AACpC,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,mEAAiE;AAAxD,gIAAA,sBAAsB,OAAA;AAC/B,mEAAiE;AAAxD,gIAAA,sBAAsB,OAAA;AAC/B,qEAAmE;AAA1D,kIAAA,uBAAuB,OAAA;AAChC,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,qEAAmE;AAA1D,kIAAA,uBAAuB,OAAA;AAChC,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,qDAAmD;AAA1C,kHAAA,eAAe,OAAA;AACxB,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,+DAA6D;AAApD,4HAAA,oBAAoB,OAAA"}
|
|
@@ -5,6 +5,7 @@ const extensions_core_1 = require("@awell-health/extensions-core");
|
|
|
5
5
|
const config_1 = require("./config");
|
|
6
6
|
const zod_1 = require("zod");
|
|
7
7
|
const addEventLog_1 = require("../../../../../src/lib/awell/addEventLog");
|
|
8
|
+
const getStakeholderId_1 = require("../../../../../src/lib/awell/getStakeholderId");
|
|
8
9
|
const delay = async (ms) => {
|
|
9
10
|
await new Promise((resolve) => setTimeout(resolve, ms));
|
|
10
11
|
};
|
|
@@ -18,7 +19,7 @@ exports.startHostedPagesSession = {
|
|
|
18
19
|
previewable: false,
|
|
19
20
|
supports_automated_retries: true,
|
|
20
21
|
onEvent: async ({ payload, onComplete, onError, helpers }) => {
|
|
21
|
-
var _a;
|
|
22
|
+
var _a, _b;
|
|
22
23
|
helpers.log({ fields: payload.fields }, 'Processing startHostedPagesSession');
|
|
23
24
|
try {
|
|
24
25
|
const { fields: { careFlowId, stakeholder }, } = (0, extensions_core_1.validate)({
|
|
@@ -29,7 +30,6 @@ exports.startHostedPagesSession = {
|
|
|
29
30
|
});
|
|
30
31
|
// To make sure the care flow activated the activity for the stakeholder :-)
|
|
31
32
|
await delay(4000);
|
|
32
|
-
const normalizedStakeholder = stakeholder.toLowerCase();
|
|
33
33
|
const sdk = await helpers.awellSdk();
|
|
34
34
|
const pathwayRes = await sdk.orchestration.query({
|
|
35
35
|
pathway: {
|
|
@@ -38,36 +38,21 @@ exports.startHostedPagesSession = {
|
|
|
38
38
|
},
|
|
39
39
|
pathway: {
|
|
40
40
|
release_id: true,
|
|
41
|
+
patient_id: true,
|
|
41
42
|
},
|
|
42
43
|
},
|
|
43
44
|
});
|
|
44
45
|
const releaseId = (_a = pathwayRes === null || pathwayRes === void 0 ? void 0 : pathwayRes.pathway.pathway) === null || _a === void 0 ? void 0 : _a.release_id;
|
|
46
|
+
const patientId = (_b = pathwayRes === null || pathwayRes === void 0 ? void 0 : pathwayRes.pathway.pathway) === null || _b === void 0 ? void 0 : _b.patient_id;
|
|
45
47
|
if (releaseId === undefined)
|
|
46
48
|
throw new Error('Could not retrieve the release ID for this care flow.');
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
success: true,
|
|
55
|
-
stakeholders: {
|
|
56
|
-
id: true,
|
|
57
|
-
label: {
|
|
58
|
-
en: true,
|
|
59
|
-
},
|
|
60
|
-
definition_id: true,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
helpers.log({ careFlowId, stakeholdersInRelease }, 'stakeholdersInRelease');
|
|
65
|
-
const stakeholderMatchId = (_a = stakeholdersInRelease.stakeholdersByReleaseIds.stakeholders.find((stakeholder) => stakeholder.label.en.toLowerCase() === normalizedStakeholder)) === null || _a === void 0 ? void 0 : _a.id;
|
|
66
|
-
if (stakeholderMatchId === undefined)
|
|
67
|
-
throw new Error(`Could not find stakeholder ID for ${normalizedStakeholder} in care flow ${careFlowId}`);
|
|
68
|
-
return stakeholderMatchId;
|
|
69
|
-
};
|
|
70
|
-
const stakeholderId = await getStakeholderId(releaseId);
|
|
49
|
+
const stakeholderId = await (0, getStakeholderId_1.getStakeholderId)({
|
|
50
|
+
awellSdk: sdk,
|
|
51
|
+
pathwayId: careFlowId,
|
|
52
|
+
releaseId,
|
|
53
|
+
patientId,
|
|
54
|
+
stakeholder,
|
|
55
|
+
});
|
|
71
56
|
const res = await sdk.orchestration.mutation({
|
|
72
57
|
startHostedActivitySession: {
|
|
73
58
|
__args: {
|
package/dist/extensions/awell/v1/actions/startHostedPagesSession/startHostedPagesSession.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startHostedPagesSession.js","sourceRoot":"","sources":["../../../../../../extensions/awell/v1/actions/startHostedPagesSession/startHostedPagesSession.ts"],"names":[],"mappings":";;;AAEA,mEAAkE;AAClE,qCAAqE;AACrE,6BAAuB;AACvB,0EAA8E;
|
|
1
|
+
{"version":3,"file":"startHostedPagesSession.js","sourceRoot":"","sources":["../../../../../../extensions/awell/v1/actions/startHostedPagesSession/startHostedPagesSession.ts"],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1B,MAAM,OAAO,CAAC;gBACZ,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;wBAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE;wBAC3B,KAAK,EAAE;4BACL,QAAQ,EAAE,cAAc;4BACxB,OAAO,EAAE,KAAK,CAAC,OAAO;yBACvB;qBACF;iBACF;aACF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA"}
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"changelog": "# CHANGELOG"
|
|
13
13
|
},
|
|
14
14
|
"awell": {
|
|
15
|
-
"readme": "---\ntitle: Awell Workflow\ndescription: Enrich your care flows with powerful Awell actions.\n---\n\n# Awell API extension\n\n## Extension settings\n\nYou will need to provide the [API URL](https://developers.awellhealth.com/awell-orchestration/api-reference/overview/endpoints) and an [API key](https://developers.awellhealth.com/awell-orchestration/api-reference/overview/authorization).\n\n## Custom Actions\n\n### Start care flow\n\nStarts a new care flow for the patient enrolled in your current care flow.\n\n**Passing baseline info:**\nPlease read the documentation on [our developer hub](https://developers.awellhealth.com/awell-orchestration/api-reference/mutations/start-pathway) to learn more about how to pass baseline info.\n\n**Example of how to configure a value for the baseline info action field:**\n\n```json\n[\n {\n \"data_point_definition_id\": \"age\",\n \"value\": \"29\"\n },\n {\n \"data_point_definition_id\": \"dob\",\n \"value\": \"1993-11-30\"\n }\n]\n```\n\n### Stop care flow\n\nStops the care flow the patient is currently enrolled in. A reason is why you are stopping the care flow is mandatory.\n\n### Update patient\n\nAllows updating patient data for the patient currently enrolled in the care flow.\n\n### Is patient already enrolled in care flow\n\nChecks whether the patient is already enrolled in a care flow definition. The care flow the patient is currently enrolled in does not count and is excluded from the results.\n\n**Action fields:**\n\n- pathwayStatus: a comma-separated string of care flow statuses that will be used when looking for care flows the patient is already enrolled in. By default, we only look at active care flows. Options: \"active\", \"completed\", \"missing_baseline_info\", \"starting\", and \"stopped\".\n- careFlowDefinitionIds: a comma-separated string of care flow definition ids that will be used when looking for care flows the patient is already enrolled in. By default, we only search for care flows that match the current care flow definition id (i.e. is the patient already included in the current care flow?).\n\n**Data points:**\n\n- result: a boolean indicating whether the patient is already enrolled in another care flow that matches your criteria (status & care flow definition id)\n- nbrOfResults: the number of care flows found for the patient that match the criteria.\n- careFlowIds: a comma-separated string of care flow ids that matched your search criteria. It will be empty when the result is `false` because then there are no other care flow ids that match your criteria.\n\n### Search patients by patient code\n\nNote that this action is deprecated and we recommend using [identifiers](https://developers.awellhealth.com/awell-orchestration/docs/misc/patient-identifiers) instead.\n\nSearch whether, apart from the patient currently enrolled in the care flow, another patient with the same `patient_code` already exists.\n\n**Data points:**\n\n1. patientAlreadyExists: a boolean which will be true if minimum one patient with the patient code already exists.\n2. numberOfPatientsFound: the number of patients found with the same patient code.\n3. awellPatientIds: a comma-separated string of all Awell patient ids (except the current patient) that have the same patient code as the patient currently enrolled in the care flow. Will return an empty string when there are no other patients with the same patient code.\n\n### Get patient by identifier\n\nThis action lets you check if a patient with a specific identifier already exists in Awell. It's particularly useful when a patient's identity is initially anonymous during the start of the care flow, but later becomes identifiable through the identifiers collected during the care flow. This check ensures whether a patient with that identifier is already present or not.\n\n### Add identifier to patient\n\nThis action allows you to add a unique identifier to the current patient's profile. If the patient already has an identifier with the same system but a different value, this action will update the existing identifier with the new value provided. \n\nFirst, it checks if this identifier (system and value) is already associated with another patient. If it's safe to proceed, it will add or update the identifier as needed. However, if another patient already has this identifier, the action will stop and notify you, preventing duplicates. To avoid conflicts, we recommend first running the \"Get patient by identifier\" action to check for any existing matches.\n\n### Get data point value\n\nThis action allows you to read the most recent data point value of a given data point definition id from a care flow different from the current one. The action returns multiple data points, each with a different value type. Pick the one you need from the returned data points based on the value type of the data point you want to read the value from.\n\n**Example:**\nIf the data point you want to read the value from is of type `number`, then you should use the `valueNumber` data point.\n\n## Webhooks\n\nWebhooks in the Awell extension offer ways to trigger a care flow based on the end of another care flow, or from any event that happens in your system (via the pathwayStart webhook).\n",
|
|
16
|
-
"changelog": "# Awell changelog\n\n## April 2024\n\nTwo new action were added: \"Get patient by identifier\" and \"Add identifier to patient\".\n\n## October 26, 2023\n\nGeneric webhook to start a care flow added\n\n## April 19, 2023\n\nStop care flow action added.\nSearch patients by patient code action was added.\n\"Is patient enrolled in care flow\" action added.\n"
|
|
15
|
+
"readme": "---\ntitle: Awell Workflow\ndescription: Enrich your care flows with powerful Awell actions.\n---\n\n# Awell API extension\n\n## Extension settings\n\nYou will need to provide the [API URL](https://developers.awellhealth.com/awell-orchestration/api-reference/overview/endpoints) and an [API key](https://developers.awellhealth.com/awell-orchestration/api-reference/overview/authorization).\n\n## Custom Actions\n\n### Start care flow\n\nStarts a new care flow for the patient enrolled in your current care flow.\n\n**Passing baseline info:**\nPlease read the documentation on [our developer hub](https://developers.awellhealth.com/awell-orchestration/api-reference/mutations/start-pathway) to learn more about how to pass baseline info.\n\n**Example of how to configure a value for the baseline info action field:**\n\n```json\n[\n {\n \"data_point_definition_id\": \"age\",\n \"value\": \"29\"\n },\n {\n \"data_point_definition_id\": \"dob\",\n \"value\": \"1993-11-30\"\n }\n]\n```\n\n### Stop care flow\n\nStops the care flow the patient is currently enrolled in. A reason is why you are stopping the care flow is mandatory.\n\n### Update patient\n\nAllows updating patient data for the patient currently enrolled in the care flow.\n\n### Is patient already enrolled in care flow\n\nChecks whether the patient is already enrolled in a care flow definition. The care flow the patient is currently enrolled in does not count and is excluded from the results.\n\n**Action fields:**\n\n- pathwayStatus: a comma-separated string of care flow statuses that will be used when looking for care flows the patient is already enrolled in. By default, we only look at active care flows. Options: \"active\", \"completed\", \"missing_baseline_info\", \"starting\", and \"stopped\".\n- careFlowDefinitionIds: a comma-separated string of care flow definition ids that will be used when looking for care flows the patient is already enrolled in. By default, we only search for care flows that match the current care flow definition id (i.e. is the patient already included in the current care flow?).\n\n**Data points:**\n\n- result: a boolean indicating whether the patient is already enrolled in another care flow that matches your criteria (status & care flow definition id)\n- nbrOfResults: the number of care flows found for the patient that match the criteria.\n- careFlowIds: a comma-separated string of care flow ids that matched your search criteria. It will be empty when the result is `false` because then there are no other care flow ids that match your criteria.\n\n### Search patients by patient code\n\nNote that this action is deprecated and we recommend using [identifiers](https://developers.awellhealth.com/awell-orchestration/docs/misc/patient-identifiers) instead.\n\nSearch whether, apart from the patient currently enrolled in the care flow, another patient with the same `patient_code` already exists.\n\n**Data points:**\n\n1. patientAlreadyExists: a boolean which will be true if minimum one patient with the patient code already exists.\n2. numberOfPatientsFound: the number of patients found with the same patient code.\n3. awellPatientIds: a comma-separated string of all Awell patient ids (except the current patient) that have the same patient code as the patient currently enrolled in the care flow. Will return an empty string when there are no other patients with the same patient code.\n\n### Get patient by identifier\n\nThis action lets you check if a patient with a specific identifier already exists in Awell. It's particularly useful when a patient's identity is initially anonymous during the start of the care flow, but later becomes identifiable through the identifiers collected during the care flow. This check ensures whether a patient with that identifier is already present or not.\n\n### Add identifier to patient\n\nThis action allows you to add a unique identifier to the current patient's profile. If the patient already has an identifier with the same system but a different value, this action will update the existing identifier with the new value provided. \n\nFirst, it checks if this identifier (system and value) is already associated with another patient. If it's safe to proceed, it will add or update the identifier as needed. However, if another patient already has this identifier, the action will stop and notify you, preventing duplicates. To avoid conflicts, we recommend first running the \"Get patient by identifier\" action to check for any existing matches.\n\n### Get data point value\n\nThis action allows you to read the most recent data point value of a given data point definition id from a care flow different from the current one. The action returns multiple data points, each with a different value type. Pick the one you need from the returned data points based on the value type of the data point you want to read the value from.\n\n**Example:**\nIf the data point you want to read the value from is of type `number`, then you should use the `valueNumber` data point.\n\n### Get Hosted Pages Link\n\nFetches the static Hosted Pages link for a stakeholder in a care flow. Unlike \"Start Hosted Pages Session\", this does not start a session - it returns the persistent link that can be shared with (or re-used by) the stakeholder, e.g. to send it in a reminder message.\n\n**Action fields:**\n\n- careFlowId (required): the instance ID of the care flow to fetch the link for.\n- stakeholder (optional): the name of the stakeholder to fetch the link for. Defaults to the patient when left empty. There must be activity for the stakeholder in the care flow, otherwise no link exists yet and the action will error.\n\n**Data points:**\n\n- linkUrl: the static Hosted Pages link for the stakeholder.\n\n## Webhooks\n\nWebhooks in the Awell extension offer ways to trigger a care flow based on the end of another care flow, or from any event that happens in your system (via the pathwayStart webhook).\n",
|
|
16
|
+
"changelog": "# Awell changelog\n\n## Unreleased\n\n- New action \"Get Hosted Pages Link\": fetches the static Hosted Pages link for a stakeholder in a care flow. The stakeholder field is optional and defaults to the patient when left empty.\n\n## April 2024\n\nTwo new action were added: \"Get patient by identifier\" and \"Add identifier to patient\".\n\n## October 26, 2023\n\nGeneric webhook to start a care flow added\n\n## April 19, 2023\n\nStop care flow action added.\nSearch patients by patient code action was added.\n\"Is patient enrolled in care flow\" action added.\n"
|
|
17
17
|
},
|
|
18
18
|
"awellTasks": {
|
|
19
19
|
"readme": "---\ntitle: Awell Tasks\ndescription: Awell Tasks is an extension that allows communication with the Task Service module.\n---\n\n# Awell Tasks\n\nAwell Tasks is an extension that allows communication with the Task Service module.\n",
|
|
@@ -232,8 +232,8 @@
|
|
|
232
232
|
"changelog": "# Workramp changelog\n\n## 2024-08-28\n\nCreated the extension."
|
|
233
233
|
},
|
|
234
234
|
"zendesk": {
|
|
235
|
-
"readme": "---\ntitle: Zendesk Support\ndescription: Zendesk Support is a customer service platform that provides ticketing, knowledge base, and customer communication tools.\n---\n\n# Zendesk Support\n\nZendesk Support is a customer service platform that provides ticketing, knowledge base, and customer communication tools.\n\n## Extension settings\n\nTo set up this extension, you will need to provide the following:\n\n1. **Zendesk Subdomain:** your Zendesk subdomain (e.g., \"company\" for company.zendesk.com)\n2. **
|
|
236
|
-
"changelog": "# Changelog\n\nAll notable changes to this project will be documented in this file.\n\n## [1.1.0] - 2026-09-16\n\n### Added\n\n- Ticket event webhook. Accepts a webhook connected to a Zendesk trigger or automation (JSON body with `ticket_id`) as well as a webhook subscribed to Zendesk ticket events (`zen:event-type:ticket.*`). Fetches the full ticket, including the requester's name and email, and exposes it as data points.\n- Get Ticket action, returning the ticket fields, requester details, tags, custom fields and the full ticket as JSON.\n\n## [1.0.0] - 2025-01-10\n\n### Added\n\n- Initial release of Zendesk Support extension\n- Create Ticket action with OAuth authentication\n- Support for all major ticket fields: subject, comment, group_id, priority, external_id, tags\n"
|
|
235
|
+
"readme": "---\ntitle: Zendesk Support\ndescription: Zendesk Support is a customer service platform that provides ticketing, knowledge base, and customer communication tools.\n---\n\n# Zendesk Support\n\nZendesk Support is a customer service platform that provides ticketing, knowledge base, and customer communication tools.\n\n## Extension settings\n\nTo set up this extension, you will need to provide the following:\n\n1. **Zendesk Subdomain:** your Zendesk subdomain only (e.g., \"company\" for company.zendesk.com)\n2. Credentials, using **one** of the two methods below.\n\n### Authentication with an OAuth client (recommended)\n\nZendesk is [removing API tokens](https://support.zendesk.com/hc/en-us/articles/10840968198042). Accounts created on or after July 28, 2026 cannot create them, no account can create new ones from October 27, 2026, and all API tokens stop working on April 30, 2027. New installs should use an OAuth client:\n\n1. In Zendesk Admin Center, go to **Apps and integrations > APIs > OAuth clients** and click **Add client**.\n2. Give it a name (e.g. \"Awell\"), set **Client kind** to **Confidential**, and leave Redirect URLs empty. Note the **Unique identifier**.\n3. Save and copy the **Secret**. Zendesk shows it only once.\n4. In Awell, fill in **OAuth Client Identifier** and **OAuth Client Secret**.\n\nThe extension exchanges these for short-lived access tokens using the client credentials grant (via the shared extensions-core OAuth client, which caches and refreshes them automatically). API calls are attributed to the Zendesk user who created the OAuth client.\n\n### Authentication with a user email and API token (legacy)\n\nExisting installs can keep using a **User Email** and **API Token** (created under Apps and integrations > APIs > API tokens) until Zendesk deactivates API tokens. Note that Zendesk also deactivates tokens that have not been used for 30 days. When the OAuth settings are filled in, the email and API token are ignored.\n\n## Actions\n\n### Create Ticket\n\nCreates a new support ticket in Zendesk with the specified details.\n\n**Required fields:**\n- Subject: The subject line of the ticket\n- Comment: The initial comment/description for the ticket\n\n**Optional fields:**\n- Group ID: The ID of the group to assign the ticket to\n- Priority: The priority level (urgent, high, normal, or low)\n- External ID: An external identifier to link this ticket to your system\n- Tag: A tag to add to the ticket\n\n**Returns:**\n- Ticket ID: The unique identifier of the created ticket\n- Ticket URL: Direct link to the ticket in Zendesk agent interface\n\n**Note:** a failed request is retried once. If Zendesk created the ticket but the response was lost (for example a timeout), the retry can create a duplicate ticket.\n\n### Get Ticket\n\nRetrieves a support ticket from Zendesk, including the requester's name and email.\n\n**Required fields:**\n- Ticket ID: The unique identifier of the ticket to retrieve\n\n**Returns:**\n- Ticket ID, Ticket URL, Subject, Description (first comment), Status, Priority, Type, Channel\n- Tags (array), External ID\n- Requester ID, Requester Name, Requester Email\n- Assignee ID, Group ID, Organization ID\n- Created At, Updated At\n- Custom Fields (JSON array of `{ id, value }`)\n- Ticket (the full ticket object as JSON)\n\n### Update Ticket\n\nUpdates an existing support ticket in Zendesk.\n\n**Required fields:**\n- Ticket ID: The unique identifier of the ticket to update\n\n**Optional fields:**\n- Comment: A comment to add to the ticket\n- Priority: The priority level (urgent, high, normal, or low)\n- Status: The new status (new, open, pending, hold, solved, or closed)\n\n### Delete Ticket\n\nDeletes a support ticket in Zendesk. This action permanently removes the ticket from your Zendesk instance.\n\n**Required fields:**\n- Ticket ID: The unique identifier of the ticket to delete\n\n**Note:** This action cannot be undone. Deleted tickets are permanently removed from Zendesk.\n\n## Webhooks\n\n### Ticket event\n\nStarts a care flow when Zendesk sends a webhook about a ticket. The webhook only needs the ticket ID: the extension fetches the full ticket from the Zendesk API (using the extension settings) so the data points do not depend on what is included in the request body.\n\nIf the ticket cannot be fetched (credentials missing or invalid, Zendesk API unavailable), the care flow still starts. The data points are then populated from the request body instead, the `ticketFetched` data point is `false`, and an activity event explains why. Including the optional fields in the body below therefore makes the integration resilient.\n\nZendesk lets you connect a webhook in one of two ways. The Ticket event webhook supports both.\n\n#### Option 1: connect the webhook to a trigger or automation (recommended for ticket activity)\n\n1. In Awell, create an incoming webhook of type \"Extension webhook\", select the Zendesk extension and the \"Ticket event\" event. Copy the generated URL.\n2. In Zendesk Admin Center, go to **Apps and integrations > Webhooks > Actions > Create webhook** and choose **Trigger or automation**.\n3. Set the endpoint URL to the Awell webhook URL, request method `POST` and request format `JSON`.\n4. Create (or edit) a trigger under **Objects and rules > Business rules > Triggers**. Set the conditions that should start the care flow (for example, a tag is added or a status changes) and add the action **Notify active webhook**, selecting the webhook created above.\n5. Use the following JSON body. `ticket_id` is required; `event_type` is an optional label that is exposed on the `eventType` data point. The other keys are optional and are used to fill the data points when the ticket cannot be fetched from the API (`tags` may be the space-separated string that `{{ticket.tags}}` renders to). Any additional properties are passed through on the `payload` data point. Avoid `{{ticket.description}}` and comment placeholders in the body: free text with quotes or line breaks produces invalid JSON.\n\n```json\n{\n \"ticket_id\": \"{{ticket.id}}\",\n \"event_type\": \"kit_retrieval_requested\",\n \"subject\": \"{{ticket.title}}\",\n \"status\": \"{{ticket.status}}\",\n \"priority\": \"{{ticket.priority}}\",\n \"tags\": \"{{ticket.tags}}\",\n \"external_id\": \"{{ticket.external_id}}\",\n \"requester_name\": \"{{ticket.requester.name}}\",\n \"requester_email\": \"{{ticket.requester.email}}\",\n \"channel\": \"{{ticket.via}}\",\n \"created_at\": \"{{ticket.created_at_with_timestamp}}\",\n \"updated_at\": \"{{ticket.updated_at_with_timestamp}}\",\n \"ticket_url\": \"{{ticket.url}}\"\n}\n```\n\nTo fire once per ticket, add the condition `Ticket > Ticket` `Is` `Created` to the trigger. Triggers otherwise run on every ticket update.\n\n#### Option 2: subscribe the webhook to Zendesk ticket events\n\nWhen creating the webhook in Zendesk Admin Center, choose **Zendesk events** and subscribe to one or more ticket events (for example `Ticket created` or `Ticket status changed`). Zendesk sends its standard event envelope (`type` starting with `zen:event-type:ticket.`) and the extension reads the ticket ID from `detail.id`. The Zendesk event type is exposed on the `eventType` data point.\n\nNote: a webhook's connection method cannot be changed after it is created, and Zendesk's documentation is not consistent about which accounts can subscribe to ticket events. If ticket events are not available in your account, use option 1.\n\n**Data points:**\n- Event Type: the `event_type` from the trigger body (defaults to `trigger`), or the Zendesk event type\n- Ticket Fetched: `true` when the data points come from the Zendesk API, `false` when they were populated from the request body only\n- Payload: the raw request body as JSON\n- All data points returned by the Get Ticket action (Ticket ID, Ticket URL, Subject, Description, Status, Priority, Type, Channel, Tags, External ID, Requester ID/Name/Email, Assignee ID, Group ID, Organization ID, Created At, Updated At, Custom Fields, Ticket)\n\n**Responses:**\n- `400` when the body contains neither a `ticket_id` nor a Zendesk ticket event\n- `404` when Zendesk reports that the ticket does not exist in the configured account; no care flow is started, because a genuine webhook always refers to an existing ticket\n- `200` otherwise, including when the ticket could not be fetched for another reason (see `ticketFetched`)\n\nThe request body is not verified when the ticket cannot be fetched, so flows that act on requester details should branch on `ticketFetched`. A ticket URL from the body is only passed on when it points at a `*.zendesk.com` host.\n",
|
|
236
|
+
"changelog": "# Changelog\n\nAll notable changes to this project will be documented in this file.\n\n## [1.2.0] - 2026-09-23\n\n### Added\n\n- OAuth client credentials authentication (new optional settings \"OAuth Client Identifier\" and \"OAuth Client Secret\"). Zendesk is removing API tokens: accounts created on or after 2026-07-28 cannot create them and all tokens stop working on 2027-04-30. Access tokens are fetched with the client credentials grant through the extensions-core `OAuthClientCredentials`/`APIClient` classes, which cache them until they expire.\n- Ticket event webhook now falls back to the request body when the ticket cannot be fetched from the Zendesk API (missing or invalid credentials, API unavailable). A ticket that Zendesk reports as not found still responds `404` without starting a care flow. New `ticketFetched` data point indicates which path was taken; the trigger body contract gained optional well-known keys (subject, status, priority, tags, external_id, requester_name, requester_email, ...).\n\n### Changed\n\n- \"User Email\" and \"API Token\" settings are now optional (legacy) and only required when the OAuth settings are empty.\n- The \"Zendesk Subdomain\" setting accepts a pasted host (`company.zendesk.com`, `https://company.zendesk.com/`) and is normalised to the subdomain. Values that are not a single DNS label are rejected, so credentials can only be sent to a `*.zendesk.com` host.\n- API calls now go through the extensions-core `APIClient`, which retries a failed call once after 250ms (and, on a 401, fetches a fresh OAuth token first). **Known limitation:** this also applies to \"Create Ticket\", so a request that Zendesk processed but whose response was lost (for example a timeout) can create a duplicate ticket. Sending a Zendesk `Idempotency-Key` would prevent this and is not done yet.\n\n## [1.1.0] - 2026-09-16\n\n### Added\n\n- Ticket event webhook. Accepts a webhook connected to a Zendesk trigger or automation (JSON body with `ticket_id`) as well as a webhook subscribed to Zendesk ticket events (`zen:event-type:ticket.*`). Fetches the full ticket, including the requester's name and email, and exposes it as data points.\n- Get Ticket action, returning the ticket fields, requester details, tags, custom fields and the full ticket as JSON.\n\n## [1.0.0] - 2025-01-10\n\n### Added\n\n- Initial release of Zendesk Support extension\n- Create Ticket action with OAuth authentication\n- Support for all major ticket fields: subject, comment, group_id, priority, external_id, tags\n"
|
|
237
237
|
},
|
|
238
238
|
"zendeskSell": {
|
|
239
239
|
"readme": "---\ntitle: Zendesk Sell\ndescription: Zendesk Sell is a customer service and support platform that provides a suite of tools and software for businesses to manage their customer interactions.\n---\n\n# Zendesk Sell\n\nZendesk Sell is a customer service and support platform that provides a suite of tools and software for businesses to manage their customer interactions. It offers a range of customer service solutions, including help desk ticketing systems, customer support and engagement, and self-service options. Zendesk is designed to help companies streamline their customer support processes, improve communication with their customers, and resolve issues more efficiently.\n\n## Extension settings\n\nIn order to set up this extension, you will to authenticate with the Sell API and need an API token. You can visit Zendesk Sales CRM dashboard and go to **Settings > Integration > OAuth** to enable and create an API token. Read more about how to get an access token for the Sell API [here](https://developer.zendesk.com/documentation/sales-crm/first-call/).\n\n## Custom Actions\n\n### Create task\n\nCreates a new task. You can create either a floating task or create a related task and associate it with one of the resource types: Leads, Contacts, Deals.\n\n### Complete task\n\nMarks a task as completed.\n",
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Zendesk is removing API tokens as an authentication method:
|
|
4
|
+
* - Accounts created on or after 2026-07-28 cannot create API tokens.
|
|
5
|
+
* - From 2026-10-27 no account can create new API tokens.
|
|
6
|
+
* - On 2027-04-30 all API tokens stop working.
|
|
7
|
+
* https://support.zendesk.com/hc/en-us/articles/10840968198042
|
|
8
|
+
*
|
|
9
|
+
* The extension therefore supports two authentication methods:
|
|
10
|
+
* 1. OAuth client credentials (recommended): an OAuth client created in
|
|
11
|
+
* Zendesk Admin Center. The extension exchanges the identifier and secret
|
|
12
|
+
* for short-lived bearer tokens.
|
|
13
|
+
* 2. User email + API token (legacy): kept so existing installs keep working
|
|
14
|
+
* until Zendesk deactivates API tokens.
|
|
15
|
+
*/
|
|
2
16
|
export declare const settings: {
|
|
3
17
|
subdomain: {
|
|
4
18
|
label: string;
|
|
@@ -7,23 +21,42 @@ export declare const settings: {
|
|
|
7
21
|
required: true;
|
|
8
22
|
description: string;
|
|
9
23
|
};
|
|
24
|
+
oauth_client_id: {
|
|
25
|
+
label: string;
|
|
26
|
+
key: string;
|
|
27
|
+
obfuscated: false;
|
|
28
|
+
required: false;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
oauth_client_secret: {
|
|
32
|
+
label: string;
|
|
33
|
+
key: string;
|
|
34
|
+
obfuscated: true;
|
|
35
|
+
required: false;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
10
38
|
user_email: {
|
|
11
39
|
label: string;
|
|
12
40
|
key: string;
|
|
13
41
|
obfuscated: false;
|
|
14
|
-
required:
|
|
42
|
+
required: false;
|
|
15
43
|
description: string;
|
|
16
44
|
};
|
|
17
45
|
api_token: {
|
|
18
46
|
label: string;
|
|
19
47
|
key: string;
|
|
20
48
|
obfuscated: true;
|
|
21
|
-
required:
|
|
49
|
+
required: false;
|
|
22
50
|
description: string;
|
|
23
51
|
};
|
|
24
52
|
};
|
|
53
|
+
export declare const MISSING_CREDENTIALS_MESSAGE = "Missing Zendesk credentials in the extension settings. Provide either an \"OAuth Client Identifier\" and \"OAuth Client Secret\" (recommended), or a \"User Email\" and \"API Token\".";
|
|
54
|
+
export declare const zSubdomain: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
25
55
|
export declare const SettingsValidationSchema: z.ZodObject<{
|
|
26
|
-
subdomain: z.ZodString
|
|
27
|
-
|
|
28
|
-
|
|
56
|
+
subdomain: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
57
|
+
oauth_client_id: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
58
|
+
oauth_client_secret: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
59
|
+
user_email: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
60
|
+
api_token: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<string | undefined, string | undefined>>;
|
|
29
61
|
}, z.core.$strip>;
|
|
62
|
+
export type ValidatedSettings = z.infer<typeof SettingsValidationSchema>;
|