@awell-health/awell-extensions 2.0.303 → 2.0.304
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.
@@ -6,7 +6,6 @@ const validatePayloadAndCreateSdk_1 = require("../../lib/validatePayloadAndCreat
|
|
6
6
|
const config_1 = require("./config");
|
7
7
|
const addEventLog_1 = require("../../../../src/lib/awell/addEventLog");
|
8
8
|
const axios_1 = require("axios");
|
9
|
-
const zod_1 = require("zod");
|
10
9
|
exports.updateTicket = {
|
11
10
|
key: 'updateTicket',
|
12
11
|
category: extensions_core_1.Category.CUSTOMER_SUPPORT,
|
@@ -50,18 +49,7 @@ exports.updateTicket = {
|
|
50
49
|
}
|
51
50
|
catch (error) {
|
52
51
|
// Some errors we want to handle explicitly for more human-readable logging
|
53
|
-
if (error instanceof
|
54
|
-
await onError({
|
55
|
-
events: [
|
56
|
-
{
|
57
|
-
date: new Date().toISOString(),
|
58
|
-
text: { en: error.message },
|
59
|
-
error: { category: 'WRONG_INPUT', message: error.message },
|
60
|
-
},
|
61
|
-
],
|
62
|
-
});
|
63
|
-
}
|
64
|
-
else if (error instanceof axios_1.AxiosError) {
|
52
|
+
if (error instanceof axios_1.AxiosError) {
|
65
53
|
const err = error;
|
66
54
|
if (((_a = err.response) === null || _a === void 0 ? void 0 : _a.status) === 404) {
|
67
55
|
await onError({
|
@@ -71,6 +59,7 @@ exports.updateTicket = {
|
|
71
59
|
}),
|
72
60
|
],
|
73
61
|
});
|
62
|
+
return;
|
74
63
|
}
|
75
64
|
if (((_b = err.response) === null || _b === void 0 ? void 0 : _b.status) === 400) {
|
76
65
|
await onError({
|
@@ -80,17 +69,13 @@ exports.updateTicket = {
|
|
80
69
|
}),
|
81
70
|
],
|
82
71
|
});
|
72
|
+
return;
|
83
73
|
}
|
74
|
+
// Throw other Axios errors
|
75
|
+
throw error;
|
84
76
|
}
|
85
|
-
|
86
|
-
|
87
|
-
events: [
|
88
|
-
(0, addEventLog_1.addActivityEventLog)({
|
89
|
-
message: `Error: ${JSON.stringify(error, null, 2)}`,
|
90
|
-
}),
|
91
|
-
],
|
92
|
-
});
|
93
|
-
}
|
77
|
+
// Throw all other errors
|
78
|
+
throw error;
|
94
79
|
}
|
95
80
|
},
|
96
81
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"updateTicket.js","sourceRoot":"","sources":["../../../../../extensions/freshdesk/actions/updateTicket/updateTicket.ts"],"names":[],"mappings":";;;AACA,mEAAwD;AACxD,uFAAmF;AAEnF,qCAAqE;AACrE,uEAA2E;AAC3E,iCAAkC;
|
1
|
+
{"version":3,"file":"updateTicket.js","sourceRoot":"","sources":["../../../../../extensions/freshdesk/actions/updateTicket/updateTicket.ts"],"names":[],"mappings":";;;AACA,mEAAwD;AACxD,uFAAmF;AAEnF,qCAAqE;AACrE,uEAA2E;AAC3E,iCAAkC;AAErB,QAAA,YAAY,GAIrB;IACF,GAAG,EAAE,cAAc;IACnB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,+BAA+B;IAC5C,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,KAAK;IAClB,UAAU,EAAV,mBAAU;IACV,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAiB,EAAE;;QACjE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,IAAA,yDAA2B,EAAC;YACjE,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,IAAI,CAAC;YACH,MAAM,cAAc,GAAG,MAAM,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YAEpE,MAAM,WAAW,GAAG;gBAClB,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,QAAQ,E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