@yrpri/api 9.0.140 → 9.0.141
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/agents/managers/newAiModelSetup.js +19 -19
- package/deleteUnwantedDeclerations.cjs +1 -0
- package/package.json +2 -2
- package/scripts/bulkStatusUpdates/performUpdateForGroup.cjs +1 -0
- package/scripts/change/setUseNewVersion.cjs +1 -0
- package/scripts/cleanups/deleteAnonNotifications.cjs +1 -0
- package/scripts/cleanups/deleteYearOldNotifications.cjs +1 -0
- package/scripts/keys/addOidcToDomain.cjs +1 -0
- package/scripts/setAdminOnAll.cjs +1 -0
- package/scripts/setDomainAdmin.cjs +1 -0
- package/scripts/setEarlQuestionIdOnGroup.cjs +1 -0
- package/services/engine/analytics/utils.cjs +1 -0
- package/services/engine/marketing/campaign.cjs +1 -0
- package/services/engine/moderation/fraud/FraudBase.cjs +1 -0
- package/services/engine/moderation/fraud/FraudDeleteBase.cjs +1 -0
- package/services/engine/moderation/fraud/FraudGetBase.cjs +1 -0
- package/services/engine/moderation/fraud/FraudGetEndorsements.cjs +1 -0
- package/services/engine/moderation/fraud/FraudGetPointQualities.cjs +1 -0
- package/services/engine/moderation/fraud/FraudGetPoints.cjs +1 -0
- package/services/engine/moderation/fraud/FraudGetPosts.cjs +1 -0
- package/services/engine/moderation/fraud/FraudGetRatings.cjs +1 -0
- package/services/engine/moderation/fraud/FraudScannerNotifier.cjs +1 -0
- package/services/engine/notifications/process_general_notifications.cjs +1 -0
- package/services/engine/reports/add_points_to_sheet.cjs +1 -0
- package/services/scripts/analytics/setup_all_plausible_goals.cjs +1 -0
- package/utils/airbrake.cjs +1 -0
- package/utils/community_mapping_tools.cjs +1 -0
- package/utils/copy_utils.cjs +1 -0
- package/utils/manifest_generator.cjs +1 -0
- package/utils/recount_utils.cjs +1 -0
|
@@ -80,7 +80,7 @@ export class NewAiModelSetup {
|
|
|
80
80
|
log.info("Created Anthropic model:", createdModel);
|
|
81
81
|
}
|
|
82
82
|
else {
|
|
83
|
-
log.
|
|
83
|
+
log.debug("Anthropic model already exists: Anthropic Sonnet 3.5");
|
|
84
84
|
anthropicSonnet.set("configuration", anthropicSonnetConfig);
|
|
85
85
|
anthropicSonnet.changed("configuration", true);
|
|
86
86
|
await anthropicSonnet.save();
|
|
@@ -115,7 +115,7 @@ export class NewAiModelSetup {
|
|
|
115
115
|
log.info("Created Anthropic model:", createdModel);
|
|
116
116
|
}
|
|
117
117
|
else {
|
|
118
|
-
log.
|
|
118
|
+
log.debug("Anthropic model already exists: Anthropic Sonnet 3.7");
|
|
119
119
|
anthropicSonnet.set("configuration", anthropicSonnetConfig);
|
|
120
120
|
anthropicSonnet.changed("configuration", true);
|
|
121
121
|
await anthropicSonnet.save();
|
|
@@ -156,7 +156,7 @@ export class NewAiModelSetup {
|
|
|
156
156
|
log.info("Created OpenAI model: GPT-4o");
|
|
157
157
|
}
|
|
158
158
|
else {
|
|
159
|
-
log.
|
|
159
|
+
log.debug("OpenAI model already exists: GPT-4o updating");
|
|
160
160
|
openAiGpt4.set("configuration", openAiGpt4oConfig);
|
|
161
161
|
openAiGpt4.changed("configuration", true);
|
|
162
162
|
await openAiGpt4.save();
|
|
@@ -193,7 +193,7 @@ export class NewAiModelSetup {
|
|
|
193
193
|
openAiGpt4Mini.set("configuration", openAiGpt4oMiniConfig);
|
|
194
194
|
openAiGpt4Mini.changed("configuration", true);
|
|
195
195
|
await openAiGpt4Mini.save();
|
|
196
|
-
log.
|
|
196
|
+
log.debug("OpenAI model already exists: GPT-4o Mini");
|
|
197
197
|
}
|
|
198
198
|
// o1 Mini
|
|
199
199
|
const openAio1Mini = await PsAiModel.findOne({
|
|
@@ -227,7 +227,7 @@ export class NewAiModelSetup {
|
|
|
227
227
|
openAio1Mini.set("configuration", openAio1MiniConfig);
|
|
228
228
|
openAio1Mini.changed("configuration", true);
|
|
229
229
|
await openAio1Mini.save();
|
|
230
|
-
log.
|
|
230
|
+
log.debug("OpenAI model already exists: o1 Mini");
|
|
231
231
|
}
|
|
232
232
|
// o1 Preview
|
|
233
233
|
const openAio1Preview = await PsAiModel.findOne({
|
|
@@ -261,7 +261,7 @@ export class NewAiModelSetup {
|
|
|
261
261
|
openAio1Preview.set("configuration", openAio1PreviewConfig);
|
|
262
262
|
openAio1Preview.changed("configuration", true);
|
|
263
263
|
await openAio1Preview.save();
|
|
264
|
-
log.
|
|
264
|
+
log.debug("OpenAI model already exists: o1 Preview");
|
|
265
265
|
}
|
|
266
266
|
// o1 24
|
|
267
267
|
const openAio11712 = await PsAiModel.findOne({
|
|
@@ -292,7 +292,7 @@ export class NewAiModelSetup {
|
|
|
292
292
|
log.info("Created OpenAI model: o1 24");
|
|
293
293
|
}
|
|
294
294
|
else {
|
|
295
|
-
log.
|
|
295
|
+
log.debug("OpenAI model already exists: o1 24 updating");
|
|
296
296
|
openAio11712.set("configuration", openAio11712Config);
|
|
297
297
|
openAio11712.changed("configuration", true);
|
|
298
298
|
await openAio11712.save();
|
|
@@ -329,7 +329,7 @@ export class NewAiModelSetup {
|
|
|
329
329
|
openAio3Mini.set("configuration", openAio3MiniConfig);
|
|
330
330
|
openAio3Mini.changed("configuration", true);
|
|
331
331
|
await openAio3Mini.save();
|
|
332
|
-
log.
|
|
332
|
+
log.debug("OpenAI model already exists: o3 mini");
|
|
333
333
|
}
|
|
334
334
|
const openAiGpt45 = await PsAiModel.findOne({
|
|
335
335
|
where: { name: "GPT-4.5 Preview" },
|
|
@@ -362,7 +362,7 @@ export class NewAiModelSetup {
|
|
|
362
362
|
openAiGpt45.set("configuration", openAiGpt45Config);
|
|
363
363
|
openAiGpt45.changed("configuration", true);
|
|
364
364
|
await openAiGpt45.save();
|
|
365
|
-
log.
|
|
365
|
+
log.debug("OpenAI model already exists: GPT-4.5 Preview");
|
|
366
366
|
}
|
|
367
367
|
const openAio3 = await PsAiModel.findOne({
|
|
368
368
|
where: { name: "o3" },
|
|
@@ -392,7 +392,7 @@ export class NewAiModelSetup {
|
|
|
392
392
|
log.info("Created OpenAI model: o3");
|
|
393
393
|
}
|
|
394
394
|
else {
|
|
395
|
-
log.
|
|
395
|
+
log.debug("OpenAI model already exists: o3 updating");
|
|
396
396
|
openAio3.set("configuration", openAio3Config);
|
|
397
397
|
openAio3.changed("configuration", true);
|
|
398
398
|
await openAio3.save();
|
|
@@ -428,7 +428,7 @@ export class NewAiModelSetup {
|
|
|
428
428
|
openAio4mini.set("configuration", openAio4miniConfig);
|
|
429
429
|
openAio4mini.changed("configuration", true);
|
|
430
430
|
await openAio4mini.save();
|
|
431
|
-
log.
|
|
431
|
+
log.debug("OpenAI model already exists: o4 mini");
|
|
432
432
|
}
|
|
433
433
|
const openAiGpt41 = await PsAiModel.findOne({
|
|
434
434
|
where: { name: "GPT-4.1" },
|
|
@@ -443,7 +443,7 @@ export class NewAiModelSetup {
|
|
|
443
443
|
currency: "USD",
|
|
444
444
|
costInCachedContextTokensPerMillion: 0.5,
|
|
445
445
|
},
|
|
446
|
-
maxTokensOut:
|
|
446
|
+
maxTokensOut: 32768,
|
|
447
447
|
defaultTemperature: 0.7,
|
|
448
448
|
model: "gpt-4.1",
|
|
449
449
|
active: true,
|
|
@@ -461,7 +461,7 @@ export class NewAiModelSetup {
|
|
|
461
461
|
openAiGpt41.set("configuration", openAiGpt41Config);
|
|
462
462
|
openAiGpt41.changed("configuration", true);
|
|
463
463
|
await openAiGpt41.save();
|
|
464
|
-
log.
|
|
464
|
+
log.debug("OpenAI model already exists: GPT-4.1");
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
467
|
/**
|
|
@@ -501,7 +501,7 @@ export class NewAiModelSetup {
|
|
|
501
501
|
geminiPro.set("configuration", geminiProConfig);
|
|
502
502
|
geminiPro.changed("configuration", true);
|
|
503
503
|
await geminiPro.save();
|
|
504
|
-
log.
|
|
504
|
+
log.debug("Google model already exists: Gemini 1.5 Pro 2");
|
|
505
505
|
}
|
|
506
506
|
// Gemini 1.5 Flash 2
|
|
507
507
|
const geminiPro15Flash = await PsAiModel.findOne({
|
|
@@ -535,7 +535,7 @@ export class NewAiModelSetup {
|
|
|
535
535
|
geminiPro15Flash.set("configuration", geminiPro15FlashConfig);
|
|
536
536
|
geminiPro15Flash.changed("configuration", true);
|
|
537
537
|
await geminiPro15Flash.save();
|
|
538
|
-
log.
|
|
538
|
+
log.debug("Google model already exists: Gemini 1.5 Flash 2");
|
|
539
539
|
}
|
|
540
540
|
// Gemini 2.0 Flash
|
|
541
541
|
const gemini20Flash = await PsAiModel.findOne({
|
|
@@ -569,7 +569,7 @@ export class NewAiModelSetup {
|
|
|
569
569
|
gemini20Flash.set("configuration", gemini20FlashConfig);
|
|
570
570
|
gemini20Flash.changed("configuration", true);
|
|
571
571
|
await gemini20Flash.save();
|
|
572
|
-
log.
|
|
572
|
+
log.debug("Google model already exists: Gemini 2.0 Flash");
|
|
573
573
|
}
|
|
574
574
|
const gemini25Pro = await PsAiModel.findOne({
|
|
575
575
|
where: { name: "Gemini 2.5 Pro" },
|
|
@@ -606,7 +606,7 @@ export class NewAiModelSetup {
|
|
|
606
606
|
gemini25Pro.set("configuration", gemini25ProConfig);
|
|
607
607
|
gemini25Pro.changed("configuration", true);
|
|
608
608
|
await gemini25Pro.save();
|
|
609
|
-
log.
|
|
609
|
+
log.debug("Google model already exists: Gemini 2.5 Pro");
|
|
610
610
|
}
|
|
611
611
|
const gemini25FlashPreview1 = await PsAiModel.findOne({
|
|
612
612
|
where: { name: "Gemini 2.5 Flash Preview 1" },
|
|
@@ -643,7 +643,7 @@ export class NewAiModelSetup {
|
|
|
643
643
|
gemini25FlashPreview1.set("configuration", gemini25FlashPreview1Config);
|
|
644
644
|
gemini25FlashPreview1.changed("configuration", true);
|
|
645
645
|
await gemini25FlashPreview1.save();
|
|
646
|
-
log.
|
|
646
|
+
log.debug("Google model already exists: Gemini 2.5 Flash Preview 1");
|
|
647
647
|
}
|
|
648
648
|
const gemini25FlashPreview = await PsAiModel.findOne({
|
|
649
649
|
where: { name: "Gemini 2.5 Flash Preview" },
|
|
@@ -676,7 +676,7 @@ export class NewAiModelSetup {
|
|
|
676
676
|
gemini25FlashPreview.set("configuration", gemini25FlashPreviewConfig);
|
|
677
677
|
gemini25FlashPreview.changed("configuration", true);
|
|
678
678
|
await gemini25FlashPreview.save();
|
|
679
|
-
log.
|
|
679
|
+
log.debug("Google model already exists: Gemini 2.5 Flash Preview");
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
682
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yrpri/api",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.141",
|
|
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.111",
|
|
29
29
|
"async": "^3.2.6",
|
|
30
30
|
"authorized": "^1.0.0",
|
|
31
31
|
"aws-sdk": "^2.1692.0",
|
|
@@ -3,6 +3,7 @@ var models = require('../../models/index.cjs');
|
|
|
3
3
|
var async = require('async');
|
|
4
4
|
var _ = require('lodash');
|
|
5
5
|
var moment = require('moment');
|
|
6
|
+
const log = require('../../utils/logger.cjs');
|
|
6
7
|
var id = process.argv[2];
|
|
7
8
|
var userIdToPostNewsStory = process.argv[3];
|
|
8
9
|
var groupId = process.argv[4];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const models = require("../../models/index.cjs");
|
|
3
|
+
const log = require("../../utils/logger.cjs");
|
|
3
4
|
const domainId = process.argv[2];
|
|
4
5
|
const useNewVersionStatus = process.argv[3];
|
|
5
6
|
models.Domain.findOne({ where: { id: domainId } }).then(async (domain) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const models = require('../../models/index.cjs');
|
|
3
3
|
const moment = require('moment');
|
|
4
|
+
const log = require('../../utils/logger.cjs');
|
|
4
5
|
const maxNumberFromPath = process.argv[2];
|
|
5
6
|
const maxNumberOfNotificationsToDelete = maxNumberFromPath ? maxNumberFromPath : 1000;
|
|
6
7
|
let numberOfDeletedNotifications = 0;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const models = require('../../models/index.cjs');
|
|
3
3
|
const moment = require('moment');
|
|
4
|
+
const log = require('../../utils/logger.cjs');
|
|
4
5
|
const maxNumberFromPath = process.argv[2];
|
|
5
6
|
// Default to 1,000,000 if no command line arg given, adjust as you see fit
|
|
6
7
|
const maxNumberOfNotificationsToDelete = maxNumberFromPath ? parseInt(maxNumberFromPath) : 1000000;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var models = require('../models/index.cjs');
|
|
3
3
|
var async = require('async');
|
|
4
|
+
const log = require('../utils/logger.cjs');
|
|
4
5
|
var userEmail = process.argv[2];
|
|
5
6
|
var user;
|
|
6
7
|
log.info("Adding " + userEmail + " as admin to all public communities and groups + domains");
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const models = require("../../../models/index.cjs");
|
|
3
3
|
const async = require('async');
|
|
4
|
+
const log = require("../../../utils/logger.cjs");
|
|
4
5
|
const sendSmsToUser = (twilioClient, listUser, campaign, configuration, done) => {
|
|
5
6
|
/*const body = campaign.message + " "+ campaign.data.baseUrl+"?yu="+listUser.id+"&yc="+campaign.id;
|
|
6
7
|
twilioClient.messages.create({
|
|
@@ -3,6 +3,7 @@ const _ = require("lodash");
|
|
|
3
3
|
const moment = require("moment");
|
|
4
4
|
const models = require("../../../../models/index.cjs");
|
|
5
5
|
const FraudBase = require('./FraudBase.cjs');
|
|
6
|
+
const log = require("../../../../utils/logger.cjs");
|
|
6
7
|
const recountCommunity = require('../../../../utils/recount_utils.cjs').recountCommunity;
|
|
7
8
|
const recountPosts = require('../../../../utils/recount_utils.cjs').recountPosts;
|
|
8
9
|
const recountPoints = require('../../../../utils/recount_utils.cjs').recountPoints;
|
|
@@ -4,6 +4,7 @@ const moment = require("moment");
|
|
|
4
4
|
const FraudBase = require('./FraudBase.cjs');
|
|
5
5
|
const models = require("../../../../models/index.cjs");
|
|
6
6
|
const ColorHash = require('color-hash').default;
|
|
7
|
+
const log = require("../../../../utils/logger.cjs");
|
|
7
8
|
class FraudGetBase extends FraudBase {
|
|
8
9
|
constructor(workPackage) {
|
|
9
10
|
super(workPackage);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const _ = require("lodash");
|
|
3
3
|
const FraudGetBase = require('./FraudGetBase.cjs');
|
|
4
4
|
const models = require("../../../../models/index.cjs");
|
|
5
|
+
const log = require("../../../../utils/logger.cjs");
|
|
5
6
|
//TODO: Change to native JS instead of lodash
|
|
6
7
|
class FraudGetEndorsements extends FraudGetBase {
|
|
7
8
|
async getAllModelItems(model, getGroup) {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const _ = require("lodash");
|
|
3
3
|
const FraudGetBase = require('./FraudGetBase.cjs');
|
|
4
4
|
const models = require("../../../../models/index.cjs");
|
|
5
|
+
const log = require("../../../../utils/logger.cjs");
|
|
5
6
|
//TODO: Change to native JS instead of lodash
|
|
6
7
|
class FraudGetPointQualities extends FraudGetBase {
|
|
7
8
|
async getAllItems() {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const _ = require("lodash");
|
|
3
3
|
const FraudGetBase = require('./FraudGetBase.cjs');
|
|
4
4
|
const models = require("../../../../models/index.cjs");
|
|
5
|
+
const log = require("../../../../utils/logger.cjs");
|
|
5
6
|
//TODO: Change to native JS instead of lodash
|
|
6
7
|
class FraudGetPointQualities extends FraudGetBase {
|
|
7
8
|
async getAllItems() {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const _ = require("lodash");
|
|
3
3
|
const FraudGetBase = require('./FraudGetBase.cjs');
|
|
4
4
|
const models = require("../../../../models/index.cjs");
|
|
5
|
+
const log = require("../../../../utils/logger.cjs");
|
|
5
6
|
class FraudGetPoints extends FraudGetBase {
|
|
6
7
|
async getAllItems() {
|
|
7
8
|
return await new Promise(async (resolve, reject) => {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const _ = require("lodash");
|
|
3
3
|
const FraudGetEndorsements = require('./FraudGetEndorsements.cjs');
|
|
4
4
|
const models = require("../../../../models/index.cjs");
|
|
5
|
+
const log = require("../../../../utils/logger.cjs");
|
|
5
6
|
class FraudGetRatings extends FraudGetEndorsements {
|
|
6
7
|
constructor(workPackage) {
|
|
7
8
|
super(workPackage);
|
|
@@ -3,6 +3,7 @@ const _ = require("lodash");
|
|
|
3
3
|
const models = require("../../../../models/index.cjs");
|
|
4
4
|
const i18n = require('../../../utils/i18n.cjs');
|
|
5
5
|
const deepEqual = require('deep-equal');
|
|
6
|
+
const log = require("../../../../utils/logger.cjs");
|
|
6
7
|
const FraudGetEndorsements = require("./FraudGetEndorsements");
|
|
7
8
|
const FraudGetPointQualities = require("./FraudGetPointQualities");
|
|
8
9
|
const FraudGetRatings = require("./FraudGetRatings");
|
|
@@ -5,6 +5,7 @@ var truncate = require('../../utils/truncate_text.cjs');
|
|
|
5
5
|
const async = require('async');
|
|
6
6
|
const _ = require('lodash');
|
|
7
7
|
var i18n = require('../../utils/i18n.cjs');
|
|
8
|
+
const log = require("../../../utils/logger.cjs");
|
|
8
9
|
var linkTo = function (url) {
|
|
9
10
|
return '<a href="' + url + '">' + url + '</a>';
|
|
10
11
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const moment = require("moment");
|
|
3
3
|
const getMediaTranscripts = require("./common_utils.cjs").getMediaTranscripts;
|
|
4
|
+
const log = require("../../../utils/logger.cjs");
|
|
4
5
|
const getPointMediaUrls = require("./common_utils.cjs").getPointMediaUrls;
|
|
5
6
|
const getPointTextWithEverything = (group, post, point) => {
|
|
6
7
|
if (group && post && point && point.PointRevisions && point.PointRevisions.length === 0) {
|
package/utils/airbrake.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const models = require('../models/index.cjs');
|
|
3
|
+
const log = require('./logger.cjs');
|
|
3
4
|
async function getTranslationForMap(textType, model, targetLanguage) {
|
|
4
5
|
return await new Promise((resolve, reject) => {
|
|
5
6
|
models.AcTranslationCache.getTranslation({ query: { textType, targetLanguage } }, model, async (error, translation) => {
|
package/utils/copy_utils.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var models = require("../models/index.cjs");
|
|
3
3
|
var async = require("async");
|
|
4
|
+
const log = require('./logger.cjs');
|
|
4
5
|
const { cloneTranslationForGroup, } = require("../services/utils/translation_cloning.cjs");
|
|
5
6
|
const { cloneTranslationForCommunity, } = require("../services/utils/translation_cloning.cjs");
|
|
6
7
|
const { cloneTranslationForPoint, } = require("../services/utils/translation_cloning.cjs");
|
package/utils/recount_utils.cjs
CHANGED
|
@@ -4,6 +4,7 @@ const models = require('../models/index.cjs');
|
|
|
4
4
|
const _ = require('lodash');
|
|
5
5
|
const fs = require('fs');
|
|
6
6
|
const request = require('request');
|
|
7
|
+
const log = require('./logger.cjs');
|
|
7
8
|
const recountPosts = (postIds, done) => {
|
|
8
9
|
async.forEachSeries(postIds, (postId, forEachPostCallback) => {
|
|
9
10
|
recountPost(postId, forEachPostCallback);
|