@yrpri/api 9.0.90 → 9.0.92
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/active-citizen/engine/allOurIdeas/iconGenerator.js +29 -42
- package/active-citizen/llms/baseChatBot.js +9 -4
- package/active-citizen/llms/collectionImageGenerator.js +67 -31
- package/active-citizen/llms/imageGeneration/collectionImageGenerator.js +103 -0
- package/active-citizen/llms/imageGeneration/dalleImageGenerator.js +83 -0
- package/active-citizen/llms/imageGeneration/fluxImageGenerator.js +49 -0
- package/active-citizen/llms/imageGeneration/iImageGenerator.js +1 -0
- package/active-citizen/llms/imageGeneration/imageProcessorService.js +64 -0
- package/active-citizen/llms/imageGeneration/imagenImageGenerator.js +107 -0
- package/active-citizen/llms/imageGeneration/s3Service.js +110 -0
- package/active-citizen/models/ac_translation_cache.cjs +2 -0
- package/active-citizen/workers/generativeAi.js +1 -1
- package/agents/assistants/baseAssistant.js +38 -25
- package/agents/assistants/baseAssistantWithVoice.js +33 -6
- package/agents/assistants/voiceAssistant.js +31 -3
- package/agents/controllers/agentSubscriptionController.js +21 -16
- package/agents/controllers/assistantsController.js +29 -10
- package/agents/managers/newAiModelSetup.js +3 -0
- package/agents/managers/subscriptionManager.js +2 -2
- package/app.js +4 -130
- package/controllers/images.cjs +64 -10
- package/models/image.cjs +1 -1
- package/models/index.cjs +20 -12
- package/models/video.cjs +1 -1
- package/package.json +29 -28
- package/utils/manifest_generator.cjs +0 -1
- package/utils/sitemap_generator.cjs +6 -0
- package/webSockets.js +346 -0
package/app.js
CHANGED
|
@@ -108,9 +108,8 @@ process.on("unhandledRejection", (reason, promise) => {
|
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
import { botsWithJavascript, isBadBot, } from "./bot_control.js";
|
|
111
|
-
import { WebSocketServer } from "ws";
|
|
112
|
-
import { v4 as uuidv4 } from "uuid";
|
|
113
111
|
import { Op } from "sequelize";
|
|
112
|
+
import { WebSocketsManager } from "./webSockets.js";
|
|
114
113
|
export class YourPrioritiesApi {
|
|
115
114
|
constructor(port = undefined) {
|
|
116
115
|
this.determineVersion = (req) => {
|
|
@@ -581,7 +580,6 @@ export class YourPrioritiesApi {
|
|
|
581
580
|
this.app.use((req, res, next) => {
|
|
582
581
|
const baseDir = path.join(__dirname, "../webAppsDist");
|
|
583
582
|
const useNewVersion = req.useNewVersion;
|
|
584
|
-
console.log(`------XY-----------------------> Using new version: ${useNewVersion}`);
|
|
585
583
|
// Set the paths depending on the version
|
|
586
584
|
req.adminAppPath = useNewVersion
|
|
587
585
|
? path.join(baseDir, "client/dist")
|
|
@@ -592,7 +590,7 @@ export class YourPrioritiesApi {
|
|
|
592
590
|
const staticPath = req.path.startsWith("/admin")
|
|
593
591
|
? req.adminAppPath
|
|
594
592
|
: req.clientAppPath;
|
|
595
|
-
console.log("Static path", staticPath);
|
|
593
|
+
//console.log("Static path", staticPath);
|
|
596
594
|
// Check if the request is for index.html
|
|
597
595
|
if (req.path === "/" || req.path === "/index.html") {
|
|
598
596
|
index(req, res, next); // Use your dynamic handler
|
|
@@ -922,132 +920,8 @@ export class YourPrioritiesApi {
|
|
|
922
920
|
}
|
|
923
921
|
async listen() {
|
|
924
922
|
const server = await this.setupHttpsServer();
|
|
925
|
-
|
|
926
|
-
this.
|
|
927
|
-
this.ws.on("connection", (ws) => {
|
|
928
|
-
const clientId = uuidv4();
|
|
929
|
-
this.wsClients.set(clientId, ws);
|
|
930
|
-
console.log(`New WebSocket connection: clientId ${clientId}`);
|
|
931
|
-
ws.send(JSON.stringify({ clientId: clientId }));
|
|
932
|
-
ws.on("message", (message) => {
|
|
933
|
-
let parsedMessage;
|
|
934
|
-
try {
|
|
935
|
-
parsedMessage = JSON.parse(message);
|
|
936
|
-
}
|
|
937
|
-
catch (e) {
|
|
938
|
-
console.log(`Received non-JSON message from client ${clientId}:`, message);
|
|
939
|
-
parsedMessage = message;
|
|
940
|
-
}
|
|
941
|
-
if (parsedMessage && parsedMessage.type === "heartbeat") {
|
|
942
|
-
console.log(`Received heartbeat from client ${clientId}`);
|
|
943
|
-
ws.send(JSON.stringify({ type: "heartbeat_ack" }));
|
|
944
|
-
}
|
|
945
|
-
else if (!this.wsClients.has(clientId)) {
|
|
946
|
-
const messageToSend = JSON.stringify({
|
|
947
|
-
clientId,
|
|
948
|
-
action: "directMessage",
|
|
949
|
-
data: parsedMessage,
|
|
950
|
-
});
|
|
951
|
-
pub
|
|
952
|
-
.publish("ypWebsocketChannel", messageToSend)
|
|
953
|
-
.then((reply) => {
|
|
954
|
-
console.log(`Message published to ypWebsocketChannel: ${reply}`);
|
|
955
|
-
})
|
|
956
|
-
.catch((err) => {
|
|
957
|
-
console.error(`Error publishing to Redis channel ypWebsocketChannel:`, err);
|
|
958
|
-
});
|
|
959
|
-
}
|
|
960
|
-
});
|
|
961
|
-
ws.on("close", () => {
|
|
962
|
-
this.wsClients.delete(clientId);
|
|
963
|
-
console.log(`WebSocket connection closed: clientId ${clientId}`);
|
|
964
|
-
});
|
|
965
|
-
ws.on("error", (err) => {
|
|
966
|
-
this.wsClients.delete(clientId);
|
|
967
|
-
console.error(`WebSocket error with clientId ${clientId}:`, err);
|
|
968
|
-
});
|
|
969
|
-
});
|
|
970
|
-
}
|
|
971
|
-
async setupPubSub() {
|
|
972
|
-
const pub = this.redisClient.duplicate();
|
|
973
|
-
const sub = this.redisClient.duplicate();
|
|
974
|
-
pub.on("error", (err) => {
|
|
975
|
-
console.error("Publisher Redis client error:", err);
|
|
976
|
-
});
|
|
977
|
-
pub.on("connect", () => {
|
|
978
|
-
console.log("Publisher Redis client is connected");
|
|
979
|
-
});
|
|
980
|
-
pub.on("reconnecting", () => {
|
|
981
|
-
console.log("Publisher Redis client is reconnecting");
|
|
982
|
-
});
|
|
983
|
-
sub.on("error", (err) => {
|
|
984
|
-
console.error("Subscriber Redis client error:", err);
|
|
985
|
-
});
|
|
986
|
-
sub.on("connect", () => {
|
|
987
|
-
console.log("Subscriber Redis client is connected");
|
|
988
|
-
});
|
|
989
|
-
sub.on("reconnecting", () => {
|
|
990
|
-
console.log("Subscriber Redis client is reconnecting");
|
|
991
|
-
});
|
|
992
|
-
try {
|
|
993
|
-
await Promise.all([pub.connect(), sub.connect()]);
|
|
994
|
-
}
|
|
995
|
-
catch (err) {
|
|
996
|
-
console.error("Error connecting to Redis:", err);
|
|
997
|
-
}
|
|
998
|
-
sub.subscribe("ypWebsocketChannel", (message, channel) => {
|
|
999
|
-
try {
|
|
1000
|
-
const parsedMessage = JSON.parse(message);
|
|
1001
|
-
const { clientId, action, data } = parsedMessage;
|
|
1002
|
-
console.log(`Received message from Redis: ${message} at ${channel}`);
|
|
1003
|
-
switch (action) {
|
|
1004
|
-
case "broadcast":
|
|
1005
|
-
this.wsClients.forEach((ws, id) => {
|
|
1006
|
-
try {
|
|
1007
|
-
ws.send(JSON.stringify(data));
|
|
1008
|
-
}
|
|
1009
|
-
catch (err) {
|
|
1010
|
-
console.error(`Error sending broadcast message to client ${id}:`, err);
|
|
1011
|
-
}
|
|
1012
|
-
});
|
|
1013
|
-
break;
|
|
1014
|
-
case "directMessage":
|
|
1015
|
-
const ws = this.wsClients.get(clientId);
|
|
1016
|
-
if (ws) {
|
|
1017
|
-
try {
|
|
1018
|
-
ws.send(JSON.stringify(data));
|
|
1019
|
-
}
|
|
1020
|
-
catch (err) {
|
|
1021
|
-
console.error(`Error sending direct message to client ${clientId}:`, err);
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
else {
|
|
1025
|
-
console.warn(`No WebSocket found for clientId ${clientId}`);
|
|
1026
|
-
this.wsClients.delete(clientId);
|
|
1027
|
-
}
|
|
1028
|
-
break;
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1031
|
-
catch (e) {
|
|
1032
|
-
console.error("Error handling message from Redis:", e);
|
|
1033
|
-
}
|
|
1034
|
-
});
|
|
1035
|
-
return [pub, sub];
|
|
1036
|
-
}
|
|
1037
|
-
handleLocalMessage(clientId, parsedMessage) {
|
|
1038
|
-
const ws = this.wsClients.get(clientId);
|
|
1039
|
-
if (ws) {
|
|
1040
|
-
try {
|
|
1041
|
-
ws.send(parsedMessage);
|
|
1042
|
-
}
|
|
1043
|
-
catch (err) {
|
|
1044
|
-
console.error(`Error sending message to client ${clientId}:`, err);
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
else {
|
|
1048
|
-
console.warn(`No WebSocket found for clientId ${clientId}`);
|
|
1049
|
-
this.wsClients.delete(clientId);
|
|
1050
|
-
}
|
|
923
|
+
this.webSocketsManager = new WebSocketsManager(this.wsClients, this.redisClient, server);
|
|
924
|
+
await this.webSocketsManager.listen();
|
|
1051
925
|
}
|
|
1052
926
|
setupHttpsServer() {
|
|
1053
927
|
let server;
|
package/controllers/images.cjs
CHANGED
|
@@ -222,26 +222,71 @@ router.post("/:imageId/comment", auth.isLoggedInNoAnonymousCheck, auth.can("view
|
|
|
222
222
|
router.post("/", isAuthenticated, async function (req, res) {
|
|
223
223
|
try {
|
|
224
224
|
const s3 = new aws.S3();
|
|
225
|
-
//
|
|
226
|
-
const
|
|
225
|
+
// 1) Check if the file name ends with ".gif"
|
|
226
|
+
const isGifFilename = (filename) => {
|
|
227
|
+
const lowerCaseFilename = filename.toLowerCase();
|
|
228
|
+
console.log("filename===========>", filename);
|
|
229
|
+
console.log("lowerCaseFilename===========>", lowerCaseFilename);
|
|
230
|
+
return lowerCaseFilename.endsWith(".gif");
|
|
231
|
+
};
|
|
232
|
+
// 2) Create the storage with a Key callback that uses 'isGifFilename'
|
|
227
233
|
const storage = s3Storage({
|
|
228
234
|
Key: (req, file, cb) => {
|
|
229
235
|
crypto.pseudoRandomBytes(16, (err, raw) => {
|
|
230
|
-
|
|
236
|
+
if (err)
|
|
237
|
+
return cb(err);
|
|
238
|
+
const rawHex = raw.toString("hex");
|
|
239
|
+
console.log("file.originalname", file.originalname);
|
|
240
|
+
const isGif = isGifFilename(file.originalname);
|
|
241
|
+
console.log("gif===========>", isGif);
|
|
242
|
+
file.outputFormat = isGif ? "gif" : "png";
|
|
243
|
+
cb(null, `${rawHex}.${isGif ? "gif" : "png"}`);
|
|
231
244
|
});
|
|
232
245
|
},
|
|
233
246
|
s3,
|
|
234
247
|
Bucket: process.env.S3_BUCKET,
|
|
235
248
|
multiple: true,
|
|
236
249
|
resize: models.Image.getSharpVersions(req.query.itemType),
|
|
237
|
-
toFormat:
|
|
250
|
+
toFormat: "png",
|
|
238
251
|
});
|
|
239
|
-
|
|
252
|
+
// 3) Allowed MIME types that Sharp commonly supports
|
|
253
|
+
// (Adjust or expand as needed)
|
|
254
|
+
const allowedMimeTypes = [
|
|
255
|
+
"image/png",
|
|
256
|
+
"image/jpeg",
|
|
257
|
+
"image/jpg",
|
|
258
|
+
"image/gif",
|
|
259
|
+
"image/webp",
|
|
260
|
+
"image/tiff",
|
|
261
|
+
"image/svg+xml"
|
|
262
|
+
];
|
|
263
|
+
// 4) A fileFilter to reject non-image or invalid Sharp formats
|
|
264
|
+
const fileFilter = (req, file, cb) => {
|
|
265
|
+
console.log("file------------>", file);
|
|
266
|
+
// Check that it's an image and specifically in our allowed list
|
|
267
|
+
if (!allowedMimeTypes.includes(file.mimetype.toLowerCase())) {
|
|
268
|
+
return cb(new Error(`Unsupported file type: ${file.mimetype}. Allowed: ${allowedMimeTypes.join(", ")}`));
|
|
269
|
+
}
|
|
270
|
+
cb(null, true);
|
|
271
|
+
};
|
|
272
|
+
// 5) Construct multer with:
|
|
273
|
+
// - the custom S3-based storage
|
|
274
|
+
// - our fileFilter for validation
|
|
275
|
+
// - a file size limit of 50MB (you can adjust as needed)
|
|
276
|
+
const upload = multer({
|
|
277
|
+
storage,
|
|
278
|
+
fileFilter,
|
|
279
|
+
limits: { fileSize: 50 * 1024 * 1024 } // 50MB limit
|
|
280
|
+
});
|
|
281
|
+
// 6) Use upload.single, handle the success/error callback carefully
|
|
240
282
|
upload.single("file")(req, res, async function (error) {
|
|
241
283
|
if (error) {
|
|
242
|
-
|
|
284
|
+
// Multer will throw if file is too large or invalid
|
|
285
|
+
console.error("File upload error:", error);
|
|
286
|
+
return res.status(400).json({ error: error.message });
|
|
243
287
|
}
|
|
244
|
-
|
|
288
|
+
// Continue if there's a valid image file
|
|
289
|
+
try {
|
|
245
290
|
const formats = JSON.stringify(models.Image.createFormatsFromSharpFile(req.file));
|
|
246
291
|
const image = models.Image.build({
|
|
247
292
|
user_id: req.user.id,
|
|
@@ -257,12 +302,21 @@ router.post("/", isAuthenticated, async function (req, res) {
|
|
|
257
302
|
context: "create",
|
|
258
303
|
userId: req.user ? req.user.id : -1,
|
|
259
304
|
});
|
|
260
|
-
res.send(image);
|
|
305
|
+
return res.send(image);
|
|
306
|
+
}
|
|
307
|
+
catch (err) {
|
|
308
|
+
console.error("Error saving image record:", err);
|
|
309
|
+
return res.status(500).json({ error: "Failed to save image record" });
|
|
261
310
|
}
|
|
262
311
|
});
|
|
263
312
|
}
|
|
264
|
-
catch (
|
|
265
|
-
|
|
313
|
+
catch (err) {
|
|
314
|
+
console.error("Unexpected error:", err);
|
|
315
|
+
// If req.file exists, use its data; otherwise fallback
|
|
316
|
+
const fileName = req.file ? req.file.originalname : "unknown filename";
|
|
317
|
+
return res.status(500).json({
|
|
318
|
+
error: `Unhandled error while processing '${fileName}'`,
|
|
319
|
+
});
|
|
266
320
|
}
|
|
267
321
|
});
|
|
268
322
|
// Post User Images
|
package/models/image.cjs
CHANGED
|
@@ -291,7 +291,7 @@ module.exports = (sequelize, DataTypes) => {
|
|
|
291
291
|
if (removed) {
|
|
292
292
|
image.deleted = true;
|
|
293
293
|
await image.save();
|
|
294
|
-
import("../active-citizen/llms/collectionImageGenerator.js").then(async ({ CollectionImageGenerator }) => {
|
|
294
|
+
import("../active-citizen/llms/imageGeneration/collectionImageGenerator.js").then(async ({ CollectionImageGenerator }) => {
|
|
295
295
|
try {
|
|
296
296
|
const mediaManager = new CollectionImageGenerator();
|
|
297
297
|
await mediaManager.deleteMediaFormatsUrls(image.formats ? JSON.parse(image.formats) : []);
|
package/models/index.cjs
CHANGED
|
@@ -48,18 +48,26 @@ if (process.env.NODE_ENV === "production") {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
51
|
+
let config;
|
|
52
|
+
try {
|
|
53
|
+
sequelize = new Sequelize(process.env.YP_DEV_DATABASE_NAME, process.env.YP_DEV_DATABASE_USERNAME, process.env.YP_DEV_DATABASE_PASSWORD, {
|
|
54
|
+
dialect: "postgres",
|
|
55
|
+
protocol: "postgres",
|
|
56
|
+
host: process.env.YP_DEV_DATABASE_HOST,
|
|
57
|
+
port: process.env.YP_DEV_DATABASE_PORT,
|
|
58
|
+
minifyAliases: true,
|
|
59
|
+
dialectOptions: {
|
|
60
|
+
ssl: false,
|
|
61
|
+
rejectUnauthorized: false,
|
|
62
|
+
},
|
|
63
|
+
logging: false,
|
|
64
|
+
operatorsAliases: operatorsAliases,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
console.error("Error reading or parsing config file:", error);
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
63
71
|
}
|
|
64
72
|
const db = {};
|
|
65
73
|
async function createCompoundIndexes(indexCommands) {
|
package/models/video.cjs
CHANGED
|
@@ -821,7 +821,7 @@ module.exports = (sequelize, DataTypes) => {
|
|
|
821
821
|
if (removed) {
|
|
822
822
|
video.deleted = true;
|
|
823
823
|
await video.save();
|
|
824
|
-
import("../active-citizen/llms/collectionImageGenerator.js").then(async ({ CollectionImageGenerator }) => {
|
|
824
|
+
import("../active-citizen/llms/imageGeneration/collectionImageGenerator.js").then(async ({ CollectionImageGenerator }) => {
|
|
825
825
|
try {
|
|
826
826
|
const mediaManager = new CollectionImageGenerator();
|
|
827
827
|
let formats = video.formats;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yrpri/api",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.92",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Robert Bjarnason & Citizens Foundation",
|
|
6
6
|
"repository": {
|
|
@@ -18,50 +18,51 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@airbrake/node": "^2.1.4",
|
|
20
20
|
"@aws-sdk/client-s3": "^3.617.0",
|
|
21
|
-
"@
|
|
21
|
+
"@google-cloud/aiplatform": "^3.34.0",
|
|
22
22
|
"@google-cloud/speech": "^6.7.0",
|
|
23
|
-
"@google-cloud/storage": "^7.
|
|
24
|
-
"@google-cloud/translate": "^8.0
|
|
23
|
+
"@google-cloud/storage": "^7.15.0",
|
|
24
|
+
"@google-cloud/translate": "^8.5.0",
|
|
25
|
+
"@google-cloud/vertexai": "^1.9.3",
|
|
25
26
|
"@google-cloud/vision": "^4.0.3",
|
|
26
|
-
"@policysynth/agents": "^1.3.
|
|
27
|
-
"async": "^3.2.
|
|
27
|
+
"@policysynth/agents": "^1.3.64",
|
|
28
|
+
"async": "^3.2.6",
|
|
28
29
|
"authorized": "^1.0.0",
|
|
29
|
-
"aws-sdk": "^2.
|
|
30
|
-
"axios": "^1.
|
|
30
|
+
"aws-sdk": "^2.1692.0",
|
|
31
|
+
"axios": "^1.7.9",
|
|
31
32
|
"bcrypt": "^5.1.0",
|
|
32
|
-
"body-parser": "^1.20.
|
|
33
|
-
"bull": "^4.
|
|
33
|
+
"body-parser": "^1.20.3",
|
|
34
|
+
"bull": "^4.16.5",
|
|
34
35
|
"bunyan": "^1.8.12",
|
|
35
36
|
"bunyan-prettystream": "git+https://github.com/rbjarnason/node-bunyan-prettystream.git",
|
|
36
|
-
"cheerio": "^1.0.0
|
|
37
|
+
"cheerio": "^1.0.0",
|
|
37
38
|
"color-hash": "^2.0.1",
|
|
38
39
|
"colors": "^1.4.0",
|
|
39
|
-
"compression": "^1.
|
|
40
|
+
"compression": "^1.8.0",
|
|
40
41
|
"concat-stream": "^2.0.0",
|
|
41
42
|
"connect-redis": "^7.1.0",
|
|
42
|
-
"cookie-parser": "^1.4.
|
|
43
|
+
"cookie-parser": "^1.4.7",
|
|
43
44
|
"cors": "^2.8.5",
|
|
44
45
|
"deep-equal": "^2.1.0",
|
|
45
46
|
"docx": "^8.5.0",
|
|
46
47
|
"download-file": "^0.1.5",
|
|
47
48
|
"ejs": "^3.1.8",
|
|
48
49
|
"exceljs": "^4.2.0",
|
|
49
|
-
"express": "^4.
|
|
50
|
+
"express": "^4.21.2",
|
|
50
51
|
"express-rate-limit": "^7.4.0",
|
|
51
52
|
"express-session": "git+https://github.com/rbjarnason/session.git#upgrade-21",
|
|
52
53
|
"express-useragent": "^1.0.13",
|
|
53
54
|
"farmhash": "3.3.1",
|
|
54
55
|
"html-to-docx": "^1.8.0",
|
|
55
|
-
"i18next": "^
|
|
56
|
+
"i18next": "^24.2.2",
|
|
56
57
|
"i18next-node-fs-backend": "^2.1.3",
|
|
57
58
|
"image-size": "^1.0.2",
|
|
58
59
|
"ip": "^2.0.1",
|
|
59
|
-
"isbot": "^5.1.
|
|
60
|
+
"isbot": "^5.1.22",
|
|
60
61
|
"iso-639-1": "^3.1.0",
|
|
61
|
-
"jsonrepair": "^3.
|
|
62
|
+
"jsonrepair": "^3.12.0",
|
|
62
63
|
"knuth-shuffle-seeded": "^1.0.6",
|
|
63
64
|
"lodash": "^4.17.15",
|
|
64
|
-
"marked": "^15.0.
|
|
65
|
+
"marked": "^15.0.7",
|
|
65
66
|
"moment": "^2.24.0",
|
|
66
67
|
"morgan": "~1.10.0",
|
|
67
68
|
"multer": "1.4.5-lts.1",
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
"nodemailer": "^6.9.9",
|
|
72
73
|
"nodemailer-sendgrid": "^1.0.3",
|
|
73
74
|
"open-graph-scraper": "^6.7.0",
|
|
74
|
-
"openai": "^4.
|
|
75
|
+
"openai": "^4.85.1",
|
|
75
76
|
"passport": "^0.6.0",
|
|
76
77
|
"passport-facebook": "^3.0.0",
|
|
77
78
|
"passport-github": "^1.0.0",
|
|
@@ -80,24 +81,24 @@
|
|
|
80
81
|
"passport-openidconnect": "git+https://github.com/rbjarnason/passport-openidconnect.git",
|
|
81
82
|
"passport-saml": "git+https://github.com/rbjarnason/passport-saml.git#smarternj",
|
|
82
83
|
"passport-sso": "git+https://github.com/rbjarnason/passport-sso.git",
|
|
83
|
-
"pg": "^8.
|
|
84
|
+
"pg": "^8.13.3",
|
|
84
85
|
"pg-hstore": "^2.3.4",
|
|
85
86
|
"pgvector": "^0.2.0",
|
|
86
87
|
"ps": "^1.0.0",
|
|
87
88
|
"pug": "^3.0.2",
|
|
88
89
|
"randomstring": "^1.2.3",
|
|
89
90
|
"rate-limit-redis": "^4.2.0",
|
|
90
|
-
"redis": "^4.
|
|
91
|
+
"redis": "^4.7.0",
|
|
91
92
|
"replicate": "^0.32.0",
|
|
92
93
|
"request": "^2.88.2",
|
|
93
94
|
"request-ip": "^3.3.0",
|
|
94
95
|
"sanitize-filename": "^1.6.3",
|
|
95
96
|
"sequelize": "^6.36.0",
|
|
96
97
|
"sequelize-cli": "^6.2.0",
|
|
97
|
-
"sharp": "^0.33.
|
|
98
|
+
"sharp": "^0.33.5",
|
|
98
99
|
"sitemap": "^7.1.2",
|
|
99
|
-
"socket.io": "^4.
|
|
100
|
-
"stripe": "^17.
|
|
100
|
+
"socket.io": "^4.8.1",
|
|
101
|
+
"stripe": "^17.6.0",
|
|
101
102
|
"striptags": "^3.2.0",
|
|
102
103
|
"uuid": "^10.0.0",
|
|
103
104
|
"weaviate-ts-client": "^2.0.0",
|
|
@@ -116,15 +117,15 @@
|
|
|
116
117
|
"@types/html-docx-js": "^0.3.4",
|
|
117
118
|
"@types/marked": "^6.0.0",
|
|
118
119
|
"@types/morgan": "^1.9.9",
|
|
119
|
-
"@types/node": "^
|
|
120
|
+
"@types/node": "^22.13.4",
|
|
120
121
|
"@types/passport": "^1.0.16",
|
|
121
|
-
"@types/pg": "^8.
|
|
122
|
+
"@types/pg": "^8.11.11",
|
|
122
123
|
"@types/request-ip": "^0.0.41",
|
|
123
124
|
"@types/sequelize": "^4.28.9",
|
|
124
125
|
"@types/sharp": "^0.32.0",
|
|
125
126
|
"@types/uuid": "^10.0.0",
|
|
126
127
|
"@types/validator": "^13.11.9",
|
|
127
|
-
"@types/ws": "^8.5.
|
|
128
|
+
"@types/ws": "^8.5.14",
|
|
128
129
|
"axios": "^1.4.0",
|
|
129
130
|
"colors": "^1.4.0",
|
|
130
131
|
"csv-parse": "^5.3.1",
|
|
@@ -163,6 +164,6 @@
|
|
|
163
164
|
"node_modules"
|
|
164
165
|
],
|
|
165
166
|
"engines": {
|
|
166
|
-
"node": "
|
|
167
|
+
"node": "22.14.0"
|
|
167
168
|
}
|
|
168
169
|
}
|
|
@@ -12,12 +12,18 @@ const wildCardDomainNames = [
|
|
|
12
12
|
"betrireykjavik.is",
|
|
13
13
|
"betraisland.is",
|
|
14
14
|
"yrpri.org",
|
|
15
|
+
"evoly.ai",
|
|
15
16
|
"tarsalgo.net",
|
|
16
17
|
"ypus.org",
|
|
17
18
|
"idea-synergy.com",
|
|
18
19
|
"localhost:4242",
|
|
19
20
|
];
|
|
20
21
|
var generateSitemap = async function (req, res) {
|
|
22
|
+
if (!req.ypDomain) {
|
|
23
|
+
log.error("No domain found in sitemap generation");
|
|
24
|
+
res.status(500);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
21
27
|
const domainId = req.ypDomain.id;
|
|
22
28
|
const domainName = req.ypDomain.domain_name;
|
|
23
29
|
let community = req.ypCommunity && req.ypCommunity.id ? req.ypCommunity : null;
|