@awell-health/awell-extensions 1.0.129 → 1.0.130
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,8 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.createTask = void 0;
|
4
|
-
const zod_1 = require("zod");
|
5
|
-
const zod_validation_error_1 = require("zod-validation-error");
|
6
4
|
const extensions_core_1 = require("@awell-health/extensions-core");
|
7
5
|
const sdk_1 = require("../../gql/sdk");
|
8
6
|
const graphqlClient_1 = require("../../graphqlClient");
|
@@ -39,18 +37,7 @@ exports.createTask = {
|
|
39
37
|
});
|
40
38
|
}
|
41
39
|
else {
|
42
|
-
|
43
|
-
events: [
|
44
|
-
{
|
45
|
-
date: new Date().toISOString(),
|
46
|
-
text: { en: 'API client requires an API url and API key' },
|
47
|
-
error: {
|
48
|
-
category: 'MISSING_SETTINGS',
|
49
|
-
message: 'Missing api url or api key',
|
50
|
-
},
|
51
|
-
},
|
52
|
-
],
|
53
|
-
});
|
40
|
+
throw new Error('API Client is missing settings (api url or api key)');
|
54
41
|
}
|
55
42
|
}
|
56
43
|
catch (err) {
|
@@ -60,35 +47,8 @@ exports.createTask = {
|
|
60
47
|
events: errors,
|
61
48
|
});
|
62
49
|
}
|
63
|
-
else if (err instanceof zod_1.ZodError) {
|
64
|
-
const error = (0, zod_validation_error_1.fromZodError)(err);
|
65
|
-
await onError({
|
66
|
-
events: [
|
67
|
-
{
|
68
|
-
date: new Date().toISOString(),
|
69
|
-
text: { en: error.message },
|
70
|
-
error: {
|
71
|
-
category: 'WRONG_INPUT',
|
72
|
-
message: error.message,
|
73
|
-
},
|
74
|
-
},
|
75
|
-
],
|
76
|
-
});
|
77
|
-
}
|
78
50
|
else {
|
79
|
-
|
80
|
-
await onError({
|
81
|
-
events: [
|
82
|
-
{
|
83
|
-
date: new Date().toISOString(),
|
84
|
-
text: { en: 'Healthie API reported an error' },
|
85
|
-
error: {
|
86
|
-
category: 'SERVER_ERROR',
|
87
|
-
message: error.message,
|
88
|
-
},
|
89
|
-
},
|
90
|
-
],
|
91
|
-
});
|
51
|
+
throw err;
|
92
52
|
}
|
93
53
|
}
|
94
54
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createTask.js","sourceRoot":"","sources":["../../../../../extensions/healthie/actions/createTask/createTask.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"createTask.js","sourceRoot":"","sources":["../../../../../extensions/healthie/actions/createTask/createTask.ts"],"names":[],"mappings":";;;AACA,mEAAwD;AACxD,uCAAsC;AACtC,uDAAsD;AAEtD,oEAAkE;AAClE,yCAAwE;AACxE,qCAA6C;AAEhC,QAAA,UAAU,GAInB;IACF,GAAG,EAAE,YAAY;IACjB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,gCAAgC;IAC7C,MAAM,EAAN,eAAM;IACN,UAAU,EAAV,mBAAU;IACV,WAAW,EAAE,IAAI;IACjB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,EAAE;;QACvE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;QAEpC,IAAI;YACF,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAC7D,iCAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;YAEhC,MAAM,MAAM,GAAG,IAAA,gCAAgB,EAAC,QAAQ,CAAC,CAAA;YACzC,IAAI,MAAM,KAAK,SAAS,EAAE;gBACxB,MAAM,GAAG,GAAG,IAAA,YAAM,EAAC,MAAM,CAAC,CAAA;gBAC1B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC;oBACpC,SAAS,EAAE,SAAS;oBACpB,OAAO,EAAE,c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