@yrpri/api 9.0.173 → 9.0.175
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 +35 -0
- package/models/index.cjs +3 -0
- package/package.json +2 -2
package/app.js
CHANGED
|
@@ -214,43 +214,78 @@ export class YourPrioritiesApi {
|
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
216
|
};
|
|
217
|
+
log.debug("YourPrioritiesApi constructor");
|
|
217
218
|
this.app = express();
|
|
219
|
+
log.debug("Have setup express app");
|
|
218
220
|
this.port = port || (process.env.PORT ? parseInt(process.env.PORT) : 4242);
|
|
219
221
|
this.wsClients = new Map();
|
|
220
222
|
this.initializeRedis();
|
|
223
|
+
log.debug("Have initialized redis");
|
|
221
224
|
this.addRedisToRequest();
|
|
225
|
+
log.debug("Have added redis to request");
|
|
222
226
|
this.addDirnameToRequest();
|
|
227
|
+
log.debug("Have added dirname to request");
|
|
223
228
|
this.forceHttps();
|
|
229
|
+
log.debug("Have forced https");
|
|
224
230
|
this.initializeMiddlewares();
|
|
231
|
+
log.debug("Have initialized middlewares");
|
|
225
232
|
this.handleShortenedRedirects();
|
|
233
|
+
log.debug("Have handled shortened redirects");
|
|
226
234
|
this.initializeRateLimiting();
|
|
235
|
+
log.debug("Have initialized rate limiting");
|
|
227
236
|
this.setupDomainAndCommunity();
|
|
237
|
+
log.debug("Have setup domain and community");
|
|
228
238
|
this.setupNewWebAppVersionHandling();
|
|
239
|
+
log.debug("Have setup new web app version handling");
|
|
229
240
|
this.setupSitemapRoute();
|
|
241
|
+
log.debug("Have setup sitemap route");
|
|
230
242
|
this.initializePassportStrategies();
|
|
243
|
+
log.debug("Have initialized passport strategies");
|
|
231
244
|
this.addInviteAsAnonMiddleWare();
|
|
245
|
+
log.debug("Have added invite as anon middle ware");
|
|
232
246
|
this.setupStaticFileServing();
|
|
247
|
+
log.debug("Have setup static file serving");
|
|
233
248
|
this.checkAuthForSsoInit();
|
|
249
|
+
log.debug("Have checked auth for sso init");
|
|
234
250
|
this.initializeRoutes();
|
|
251
|
+
log.debug("Have initialized routes");
|
|
235
252
|
this.initializeEsControllers();
|
|
253
|
+
log.debug("Have initialized es controllers");
|
|
236
254
|
}
|
|
237
255
|
async initialize() {
|
|
256
|
+
log.debug("YourPrioritiesApi initialize");
|
|
238
257
|
await this.initializeRedis();
|
|
258
|
+
log.debug("Have initialized redis");
|
|
239
259
|
this.addRedisToRequest();
|
|
260
|
+
log.debug("Have added redis to request");
|
|
240
261
|
this.addDirnameToRequest();
|
|
262
|
+
log.debug("Have added dirname to request");
|
|
241
263
|
this.forceHttps();
|
|
264
|
+
log.debug("Have forced https");
|
|
242
265
|
this.initializeMiddlewares();
|
|
266
|
+
log.debug("Have initialized middlewares");
|
|
243
267
|
this.handleShortenedRedirects();
|
|
268
|
+
log.debug("Have handled shortened redirects");
|
|
244
269
|
this.initializeRateLimiting();
|
|
270
|
+
log.debug("Have initialized rate limiting");
|
|
245
271
|
this.setupDomainAndCommunity();
|
|
272
|
+
log.debug("Have setup domain and community");
|
|
246
273
|
this.setupNewWebAppVersionHandling();
|
|
274
|
+
log.debug("Have setup new web app version handling");
|
|
247
275
|
this.setupSitemapRoute();
|
|
276
|
+
log.debug("Have setup sitemap route");
|
|
248
277
|
this.initializePassportStrategies();
|
|
278
|
+
log.debug("Have initialized passport strategies");
|
|
249
279
|
this.addInviteAsAnonMiddleWare();
|
|
280
|
+
log.debug("Have added invite as anon middle ware");
|
|
250
281
|
this.setupStaticFileServing();
|
|
282
|
+
log.debug("Have setup static file serving");
|
|
251
283
|
this.checkAuthForSsoInit();
|
|
284
|
+
log.debug("Have checked auth for sso init");
|
|
252
285
|
this.initializeRoutes();
|
|
286
|
+
log.debug("Have initialized routes");
|
|
253
287
|
this.initializeEsControllers();
|
|
288
|
+
log.debug("Have initialized es controllers");
|
|
254
289
|
}
|
|
255
290
|
setupNewWebAppVersionHandling() {
|
|
256
291
|
this.app.use((req, res, next) => {
|
package/models/index.cjs
CHANGED
|
@@ -33,6 +33,7 @@ const operatorsAliases = {
|
|
|
33
33
|
};
|
|
34
34
|
if (process.env.NODE_ENV === "production") {
|
|
35
35
|
if (process.env.DISABLE_PG_SSL) {
|
|
36
|
+
logger_cjs_1.default.debug("Creating Sequelize instance with DISABLE_PG_SSL");
|
|
36
37
|
sequelize = new Sequelize(process.env.DATABASE_URL, {
|
|
37
38
|
dialect: "postgres",
|
|
38
39
|
minifyAliases: true,
|
|
@@ -41,6 +42,7 @@ if (process.env.NODE_ENV === "production") {
|
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
else {
|
|
45
|
+
logger_cjs_1.default.debug("Creating Sequelize instance with ENABLE_PG_SSL");
|
|
44
46
|
sequelize = new Sequelize(process.env.DATABASE_URL, {
|
|
45
47
|
dialect: "postgres",
|
|
46
48
|
dialectOptions: { ssl: { rejectUnauthorized: false } },
|
|
@@ -52,6 +54,7 @@ if (process.env.NODE_ENV === "production") {
|
|
|
52
54
|
}
|
|
53
55
|
else {
|
|
54
56
|
try {
|
|
57
|
+
logger_cjs_1.default.debug("Creating Sequelize instance with YP_DEV_DATABASE_NAME");
|
|
55
58
|
sequelize = new Sequelize(process.env.YP_DEV_DATABASE_NAME, process.env.YP_DEV_DATABASE_USERNAME, process.env.YP_DEV_DATABASE_PASSWORD, {
|
|
56
59
|
dialect: "postgres",
|
|
57
60
|
protocol: "postgres",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yrpri/api",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.175",
|
|
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.143",
|
|
29
29
|
"async": "^3.2.6",
|
|
30
30
|
"authorized": "^1.0.0",
|
|
31
31
|
"aws-sdk": "^2.1692.0",
|