@yrpri/api 9.0.154 → 9.0.156
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/app.js +9 -7
- package/package.json +2 -2
package/app.js
CHANGED
|
@@ -55,7 +55,8 @@ import { Notifier } from "@airbrake/node";
|
|
|
55
55
|
import { fileURLToPath } from "url";
|
|
56
56
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
57
57
|
let airbrake;
|
|
58
|
-
if (process.env.AIRBRAKE_PROJECT_ID &&
|
|
58
|
+
if (process.env.AIRBRAKE_PROJECT_ID &&
|
|
59
|
+
(process.env.AIRBRAKE_API_KEY || process.env.AIRBRAKE_PROJECT_KEY)) {
|
|
59
60
|
airbrake = new Notifier({
|
|
60
61
|
projectId: parseInt(process.env.AIRBRAKE_PROJECT_ID),
|
|
61
62
|
projectKey: process.env.AIRBRAKE_API_KEY || process.env.AIRBRAKE_PROJECT_KEY || "",
|
|
@@ -203,12 +204,12 @@ export class YourPrioritiesApi {
|
|
|
203
204
|
this.completeRegisterUserLogin(user, loginProvider, req, done);
|
|
204
205
|
}
|
|
205
206
|
else {
|
|
206
|
-
log.
|
|
207
|
+
log.error("Did not find user for login registration", { userId });
|
|
207
208
|
done();
|
|
208
209
|
}
|
|
209
210
|
})
|
|
210
211
|
.catch((error) => {
|
|
211
|
-
log.
|
|
212
|
+
log.error("Error saving user for login registration", { error });
|
|
212
213
|
done();
|
|
213
214
|
});
|
|
214
215
|
}
|
|
@@ -307,7 +308,7 @@ export class YourPrioritiesApi {
|
|
|
307
308
|
req.redisClient = this.redisClient;
|
|
308
309
|
}
|
|
309
310
|
else {
|
|
310
|
-
log.
|
|
311
|
+
log.error("Redis client get method not found or client not initialized");
|
|
311
312
|
}
|
|
312
313
|
next();
|
|
313
314
|
});
|
|
@@ -895,7 +896,8 @@ export class YourPrioritiesApi {
|
|
|
895
896
|
log.error("User Unauthorized", {
|
|
896
897
|
context: "unauthorizedError",
|
|
897
898
|
user: toJson(req.user),
|
|
898
|
-
|
|
899
|
+
url: req.originalUrl,
|
|
900
|
+
err: err ? (err.message ? err.message : err) : "Unauthorized",
|
|
899
901
|
errorStatus: 401,
|
|
900
902
|
});
|
|
901
903
|
res.sendStatus(401);
|
|
@@ -932,7 +934,7 @@ export class YourPrioritiesApi {
|
|
|
932
934
|
});
|
|
933
935
|
}
|
|
934
936
|
if (status >= 500) {
|
|
935
|
-
log.
|
|
937
|
+
log.error("General Error", {
|
|
936
938
|
context: "generalError",
|
|
937
939
|
user: req.user ? toJson(req.user) : null,
|
|
938
940
|
err: err,
|
|
@@ -989,7 +991,7 @@ export class YourPrioritiesApi {
|
|
|
989
991
|
else {
|
|
990
992
|
server = this.app.listen(portNumber, function (err) {
|
|
991
993
|
if (err) {
|
|
992
|
-
log.
|
|
994
|
+
log.error("Error listening on port", { err });
|
|
993
995
|
}
|
|
994
996
|
log.info("Your Priorities Platform API Server listening on port " +
|
|
995
997
|
server.address().port +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yrpri/api",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.156",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Robert Bjarnason & Citizens Foundation",
|
|
6
6
|
"repository": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@google-cloud/vertexai": "^1.10.0",
|
|
26
26
|
"@google-cloud/vision": "^5.1.0",
|
|
27
27
|
"@node-saml/passport-saml": "^5.0.1",
|
|
28
|
-
"@policysynth/agents": "^1.3.
|
|
28
|
+
"@policysynth/agents": "^1.3.126",
|
|
29
29
|
"async": "^3.2.6",
|
|
30
30
|
"authorized": "^1.0.0",
|
|
31
31
|
"aws-sdk": "^2.1692.0",
|