@yrpri/api 9.0.109 → 9.0.111
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/controllers/activities.d.cts +2 -0
- package/active-citizen/controllers/news_feeds.d.cts +2 -0
- package/active-citizen/controllers/notifications.d.cts +2 -0
- package/active-citizen/controllers/recommendations.d.cts +2 -0
- package/active-citizen/engine/allOurIdeas/aiHelper.d.ts +22 -0
- package/active-citizen/engine/allOurIdeas/explainAnswersAssistant.d.ts +13 -0
- package/active-citizen/engine/allOurIdeas/iconGenerator.d.ts +7 -0
- package/active-citizen/engine/analytics/export_anon_community_activities.d.ts +1 -0
- package/active-citizen/engine/analytics/importer.d.ts +1 -0
- package/active-citizen/engine/analytics/manager.d.cts +6 -0
- package/active-citizen/engine/analytics/plausible/manager.d.cts +5 -0
- package/active-citizen/engine/analytics/statsCalc.d.cts +94 -0
- package/active-citizen/engine/analytics/utils.d.cts +5 -0
- package/active-citizen/engine/marketing/campaign.d.cts +1 -0
- package/active-citizen/engine/moderation/fraud/CreateFraudAuditReport.d.cts +1 -0
- package/active-citizen/engine/moderation/fraud/FraudBase.d.cts +31 -0
- package/active-citizen/engine/moderation/fraud/FraudDeleteBase.d.cts +21 -0
- package/active-citizen/engine/moderation/fraud/FraudDeleteEndorsements.d.cts +8 -0
- package/active-citizen/engine/moderation/fraud/FraudDeletePointQualities.d.cts +6 -0
- package/active-citizen/engine/moderation/fraud/FraudDeletePoints.d.cts +6 -0
- package/active-citizen/engine/moderation/fraud/FraudDeletePosts.d.cts +4 -0
- package/active-citizen/engine/moderation/fraud/FraudDeleteRatings.d.cts +4 -0
- package/active-citizen/engine/moderation/fraud/FraudGetBase.d.cts +8 -0
- package/active-citizen/engine/moderation/fraud/FraudGetEndorsements.d.cts +7 -0
- package/active-citizen/engine/moderation/fraud/FraudGetPointQualities.d.cts +7 -0
- package/active-citizen/engine/moderation/fraud/FraudGetPoints.d.cts +6 -0
- package/active-citizen/engine/moderation/fraud/FraudGetPosts.d.cts +6 -0
- package/active-citizen/engine/moderation/fraud/FraudGetRatings.d.cts +5 -0
- package/active-citizen/engine/moderation/fraud/FraudScannerNotifier.d.cts +1 -0
- package/active-citizen/engine/moderation/get_moderation_items.d.cts +55 -0
- package/active-citizen/engine/moderation/image_labeling/CommunityLabeling.d.cts +6 -0
- package/active-citizen/engine/moderation/image_labeling/GroupLabeling.d.cts +6 -0
- package/active-citizen/engine/moderation/image_labeling/ImageLabelingBase.d.cts +30 -0
- package/active-citizen/engine/moderation/image_labeling/PointLabeling.d.cts +6 -0
- package/active-citizen/engine/moderation/image_labeling/PostLabeling.d.cts +6 -0
- package/active-citizen/engine/moderation/perspective_api_client.d.cts +33 -0
- package/active-citizen/engine/moderation/process_moderation_items.d.cts +2 -0
- package/active-citizen/engine/moderation/toxicity_analysis.d.cts +3 -0
- package/active-citizen/engine/news_feeds/activity_and_item_index_definitions.d.cts +7 -0
- package/active-citizen/engine/news_feeds/generate_dynamically.d.cts +2 -0
- package/active-citizen/engine/news_feeds/generate_from_notifications.d.cts +2 -0
- package/active-citizen/engine/news_feeds/news_feeds_utils.d.cts +99 -0
- package/active-citizen/engine/notifications/emails_utils.d.cts +2 -0
- package/active-citizen/engine/notifications/generate_point_notifications.d.cts +2 -0
- package/active-citizen/engine/notifications/generate_post_notifications.d.cts +2 -0
- package/active-citizen/engine/notifications/generate_post_status_change_notifications.d.cts +2 -0
- package/active-citizen/engine/notifications/notifications_utils.d.cts +3 -0
- package/active-citizen/engine/notifications/point_delivery.d.cts +2 -0
- package/active-citizen/engine/notifications/post_delivery.d.cts +2 -0
- package/active-citizen/engine/notifications/process_delayed_notifications.d.cts +1 -0
- package/active-citizen/engine/notifications/process_general_notifications.d.cts +2 -0
- package/active-citizen/engine/old/exporters/categories_dataset.d.ts +1 -0
- package/active-citizen/engine/old/exporters/dataset_tools.d.ts +3 -0
- package/active-citizen/engine/old/exporters/sentiment_dataset.d.ts +1 -0
- package/active-citizen/engine/recommendations/events_importer.d.cts +1 -0
- package/active-citizen/engine/recommendations/events_manager.d.cts +5 -0
- package/active-citizen/engine/reports/add_points_to_sheet.d.cts +1 -0
- package/active-citizen/engine/reports/commonUtils.d.ts +5 -0
- package/active-citizen/engine/reports/common_utils.d.cts +44 -0
- package/active-citizen/engine/reports/docx_group_report.d.cts +1 -0
- package/active-citizen/engine/reports/xlsAllOurIdeasExport.d.ts +1 -0
- package/active-citizen/engine/reports/xls_community_users_report.d.cts +2 -0
- package/active-citizen/engine/reports/xls_group_report.d.cts +1 -0
- package/active-citizen/llms/baseChatBot.d.ts +33 -0
- package/active-citizen/llms/imageGeneration/chatGptImageGenerator.d.ts +13 -0
- package/active-citizen/llms/imageGeneration/collectionImageGenerator.d.ts +23 -0
- package/active-citizen/llms/imageGeneration/dalleImageGenerator.d.ts +10 -0
- package/active-citizen/llms/imageGeneration/fluxImageGenerator.d.ts +9 -0
- package/active-citizen/llms/imageGeneration/iImageGenerator.d.ts +7 -0
- package/active-citizen/llms/imageGeneration/imageProcessorService.d.ts +12 -0
- package/active-citizen/llms/imageGeneration/imagenImageGenerator.d.ts +16 -0
- package/active-citizen/llms/imageGeneration/s3Service.d.ts +12 -0
- package/active-citizen/llms/llmTranslation.d.ts +26 -0
- package/active-citizen/models/ac_activity.d.cts +2 -0
- package/active-citizen/models/ac_background_job.d.cts +2 -0
- package/active-citizen/models/ac_campaign.d.cts +2 -0
- package/active-citizen/models/ac_client_activity.d.cts +2 -0
- package/active-citizen/models/ac_delayed_notification.d.cts +2 -0
- package/active-citizen/models/ac_following.d.cts +2 -0
- package/active-citizen/models/ac_list.d.cts +2 -0
- package/active-citizen/models/ac_list_users.d.cts +2 -0
- package/active-citizen/models/ac_mute.d.cts +2 -0
- package/active-citizen/models/ac_news_feed_item.d.cts +2 -0
- package/active-citizen/models/ac_news_feed_processed_range.d.cts +2 -0
- package/active-citizen/models/ac_notification.d.cts +2 -0
- package/active-citizen/models/ac_translation_cache.d.cts +2 -0
- package/active-citizen/models/ac_watching.d.cts +2 -0
- package/active-citizen/scripts/analytics/setup_all_plausible_goals.d.cts +1 -0
- package/active-citizen/scripts/fix_old_delayed_notifications.d.ts +1 -0
- package/active-citizen/scripts/kue_status.d.ts +2 -0
- package/active-citizen/scripts/kue_watch_stuck_jobs.d.ts +2 -0
- package/active-citizen/scripts/translation_clear_language.d.ts +1 -0
- package/active-citizen/scripts/translation_delete.d.ts +1 -0
- package/active-citizen/scripts/translation_replace_text_from_url.d.ts +1 -0
- package/active-citizen/scripts/translation_update.d.ts +1 -0
- package/active-citizen/scripts/translations_list.d.ts +1 -0
- package/active-citizen/utils/airbrake.d.cts +2 -0
- package/active-citizen/utils/get_anonymous_system_user.d.cts +2 -0
- package/active-citizen/utils/i18n.d.cts +2 -0
- package/active-citizen/utils/logger.d.cts +2 -0
- package/active-citizen/utils/redisConnection.d.cts +2 -0
- package/active-citizen/utils/to_json.d.cts +2 -0
- package/active-citizen/utils/translation_cloning.d.cts +5 -0
- package/active-citizen/utils/translation_helpers.d.cts +8 -0
- package/active-citizen/utils/truncate_text.d.cts +2 -0
- package/active-citizen/utils/updateAllLocalesFromEn.d.ts +20 -0
- package/active-citizen/utils/updateLocaleFolders.d.ts +1 -0
- package/active-citizen/workers/activity.cjs +13 -2
- package/active-citizen/workers/activity.d.cts +16 -0
- package/active-citizen/workers/anonymizations.cjs +13 -2
- package/active-citizen/workers/anonymizations.d.cts +16 -0
- package/active-citizen/workers/bulk_status_update.cjs +12 -1
- package/active-citizen/workers/bulk_status_update.d.cts +16 -0
- package/active-citizen/workers/delayed_jobs.cjs +13 -2
- package/active-citizen/workers/delayed_jobs.d.cts +16 -0
- package/active-citizen/workers/deletions.cjs +14 -3
- package/active-citizen/workers/deletions.d.cts +16 -0
- package/active-citizen/workers/email.cjs +12 -1
- package/active-citizen/workers/email.d.cts +16 -0
- package/active-citizen/workers/fraud_management.cjs +13 -2
- package/active-citizen/workers/fraud_management.d.cts +16 -0
- package/active-citizen/workers/generativeAi.d.ts +3 -0
- package/active-citizen/workers/main.d.cts +1 -0
- package/active-citizen/workers/marketing.cjs +13 -2
- package/active-citizen/workers/marketing.d.cts +16 -0
- package/active-citizen/workers/moderation.cjs +13 -2
- package/active-citizen/workers/moderation.d.cts +16 -0
- package/active-citizen/workers/notification_delivery.cjs +12 -1
- package/active-citizen/workers/notification_delivery.d.cts +16 -0
- package/active-citizen/workers/notification_news_feed.cjs +12 -1
- package/active-citizen/workers/notification_news_feed.d.cts +16 -0
- package/active-citizen/workers/queue.d.cts +21 -0
- package/active-citizen/workers/recount.d.cts +1 -0
- package/active-citizen/workers/reports.d.cts +2 -0
- package/active-citizen/workers/similarities.cjs +13 -2
- package/active-citizen/workers/similarities.d.cts +16 -0
- package/active-citizen/workers/speech_to_text.cjs +13 -2
- package/active-citizen/workers/speech_to_text.d.cts +16 -0
- package/agents/assistants/agentAssistant.d.ts +27 -0
- package/agents/assistants/baseAssistant.d.ts +115 -0
- package/agents/assistants/baseAssistantWithVoice.d.ts +18 -0
- package/agents/assistants/modes/agentDirectConnection.d.ts +16 -0
- package/agents/assistants/modes/agentSelectionMode.d.ts +12 -0
- package/agents/assistants/modes/baseAssistantMode.d.ts +10 -0
- package/agents/assistants/modes/tools/agentTools.d.ts +100 -0
- package/agents/assistants/modes/tools/baseTools.d.ts +21 -0
- package/agents/assistants/modes/tools/loginTools.d.ts +51 -0
- package/agents/assistants/modes/tools/models/agents.d.ts +27 -0
- package/agents/assistants/modes/tools/models/subscriptions.d.ts +13 -0
- package/agents/assistants/modes/tools/models/users.d.ts +7 -0
- package/agents/assistants/modes/tools/navigationTools.d.ts +33 -0
- package/agents/assistants/modes/tools/subscriptionTools.d.ts +53 -0
- package/agents/assistants/modes/tools/workflowConverstationTools.d.ts +49 -0
- package/agents/assistants/voiceAssistant.d.ts +78 -0
- package/agents/controllers/agentProductController.d.ts +23 -0
- package/agents/controllers/agentSubscriptionController.d.ts +30 -0
- package/agents/controllers/assistantsController.d.ts +47 -0
- package/agents/controllers/policySynthAgents.d.ts +49 -0
- package/agents/managers/agentProductManager.d.ts +12 -0
- package/agents/managers/emailInvitesManager.d.ts +6 -0
- package/agents/managers/emailTemplateRenderer.d.ts +25 -0
- package/agents/managers/newAiModelSetup.d.ts +37 -0
- package/agents/managers/newAiModelSetup.js +14 -6
- package/agents/managers/notificationAgentQueueManager.d.ts +23 -0
- package/agents/managers/subscriptionManager.d.ts +29 -0
- package/agents/managers/workflowConversationManager.d.ts +14 -0
- package/agents/models/agentProduct.d.ts +31 -0
- package/agents/models/agentProductBoosterPurchase.d.ts +27 -0
- package/agents/models/agentProductBundle.d.ts +12 -0
- package/agents/models/agentProductRun.d.ts +23 -0
- package/agents/models/discount.d.ts +21 -0
- package/agents/models/subscription.d.ts +26 -0
- package/agents/models/subscriptionPlan.d.ts +17 -0
- package/agents/models/subscriptionUser.d.ts +11 -0
- package/agents/models/testData/createEvolyAgentProduct.d.ts +1 -0
- package/agents/models/testData/old/updateAgentWorkflowConfiguration.d.ts +1 -0
- package/agents/models/testData/setupEvolyAgentProductConfig.d.ts +1 -0
- package/agents/models/testData/updateAgentWorkflowConfiguration.d.ts +1 -0
- package/agents/models/workflowConversation.d.ts +11 -0
- package/agents/tools/setTemplateWorkflowCommunityId.d.ts +1 -0
- package/app.d.ts +53 -0
- package/authorization.d.cts +1 -0
- package/bot_control.d.ts +4 -0
- package/controllers/allOurIdeas.d.ts +40 -0
- package/controllers/audios.d.cts +2 -0
- package/controllers/bulkStatusUpdates.d.cts +2 -0
- package/controllers/categories.d.cts +2 -0
- package/controllers/communities.d.cts +2 -0
- package/controllers/domains.d.cts +2 -0
- package/controllers/externalIds.d.cts +2 -0
- package/controllers/groups.d.cts +2 -0
- package/controllers/images.d.cts +2 -0
- package/controllers/index.d.cts +2 -0
- package/controllers/legacyPages.d.cts +2 -0
- package/controllers/legacyPosts.d.cts +2 -0
- package/controllers/legacyUsers.d.cts +2 -0
- package/controllers/nonSpa.d.cts +2 -0
- package/controllers/organizations.d.cts +2 -0
- package/controllers/points.d.cts +2 -0
- package/controllers/posts.d.cts +2 -0
- package/controllers/ratings.d.cts +2 -0
- package/controllers/users.d.cts +2 -0
- package/controllers/videos.d.cts +2 -0
- package/deleteUnwantedDeclerations.d.cts +1 -0
- package/migrations/agentAuditLogs.d.cts +1 -0
- package/migrations/agentClasses.d.cts +1 -0
- package/migrations/agentConnectorClasses.d.cts +1 -0
- package/migrations/agentConnectors.d.cts +1 -0
- package/migrations/agentEvals.d.cts +1 -0
- package/migrations/agentRegistries.d.cts +1 -0
- package/migrations/agents.d.cts +1 -0
- package/migrations/aiModels.d.cts +1 -0
- package/migrations/apiUsage.d.cts +1 -0
- package/migrations/apis.d.cts +1 -0
- package/migrations/groupPrivateData.d.cts +2 -0
- package/migrations/modelUsage.d.cts +2 -0
- package/migrations/privateAccessStore.d.cts +1 -0
- package/migrations/zzz_associations.d.cts +1 -0
- package/migrations/zzzz_createUsersAndAdminsForClasses.d.cts +1 -0
- package/migrations/zzzzz_create_agent_runs.d.cts +2 -0
- package/migrations/zzzzzz_create_agent_runs_fix.d.cts +2 -0
- package/migrations/zzzzzzz_create_trees.d.cts +2 -0
- package/models/audio.d.cts +2 -0
- package/models/bulk_status_update.d.cts +2 -0
- package/models/campaign.d.cts +2 -0
- package/models/category.d.cts +2 -0
- package/models/community.d.cts +2 -0
- package/models/domain.d.cts +2 -0
- package/models/endorsement.d.cts +2 -0
- package/models/general_data_store.d.cts +2 -0
- package/models/group.d.cts +2 -0
- package/models/image.d.cts +2 -0
- package/models/index.cjs +2 -2
- package/models/index.d.cts +3 -0
- package/models/invite.d.cts +2 -0
- package/models/iso_country.d.cts +2 -0
- package/models/organization.d.cts +2 -0
- package/models/page.d.cts +2 -0
- package/models/point.d.cts +2 -0
- package/models/point_quality.d.cts +2 -0
- package/models/point_revision.d.cts +2 -0
- package/models/post.d.cts +2 -0
- package/models/post_revision.d.cts +2 -0
- package/models/post_status_change.d.cts +2 -0
- package/models/promotion.d.cts +2 -0
- package/models/rating.d.cts +2 -0
- package/models/relationship.d.cts +2 -0
- package/models/request_to_join.d.cts +2 -0
- package/models/user.d.cts +2 -0
- package/models/user_legacy_password.d.cts +2 -0
- package/models/video.d.cts +2 -0
- package/package.json +3 -1
- package/publish.d.ts +1 -0
- package/repack.d.ts +1 -0
- package/scripts/addRatingUsersToGroup.d.ts +1 -0
- package/scripts/addUserToOrganization.d.ts +1 -0
- package/scripts/analyseRatingsForCommunity.d.ts +1 -0
- package/scripts/analyzeAndFixBrokenPointUsers.d.ts +1 -0
- package/scripts/analyzeEndorsementsByCountry.d.ts +1 -0
- package/scripts/analyzePostsForCommunity.d.ts +1 -0
- package/scripts/bulkStatusUpdates/listUpdates.d.ts +1 -0
- package/scripts/bulkStatusUpdates/mergeLatestPostsToUpdate.d.ts +1 -0
- package/scripts/bulkStatusUpdates/performUpdate.d.ts +1 -0
- package/scripts/bulkStatusUpdates/performUpdateForGroup.d.cts +1 -0
- package/scripts/bulkStatusUpdates/performUpdateForStatus.d.ts +1 -0
- package/scripts/change/changeVideoAspectTo.d.ts +1 -0
- package/scripts/change/setUseNewVersion.d.cts +1 -0
- package/scripts/changeCommunityGroupcount.d.ts +1 -0
- package/scripts/changeCommunityPostCount.d.ts +1 -0
- package/scripts/changeGroupPostCount.d.ts +1 -0
- package/scripts/changeLanguage.d.ts +1 -0
- package/scripts/changeOfficalStatus.d.ts +1 -0
- package/scripts/cleanups/deleteAnonNotifications.d.cts +1 -0
- package/scripts/cleanups/deleteLinkGroupsWithDeletedCommunities.d.ts +1 -0
- package/scripts/cleanups/deleteYearOldNotifications.d.cts +1 -0
- package/scripts/cleanups/removeAllUsersFromHiddenPublicGroup.d.ts +1 -0
- package/scripts/clearAllEndorsementInGroup.d.ts +1 -0
- package/scripts/cloning/clearUsersForCommunitiesFromUrl.d.ts +1 -0
- package/scripts/cloning/cloneFromUrlScript.d.ts +1 -0
- package/scripts/cloning/cloneWBFromUrlScriptAndCreateLinks.d.ts +1 -0
- package/scripts/cloning/cloneWBFromUrlScriptNoUsersOrPoints.d.ts +1 -0
- package/scripts/cloning/cloneWBSerbianFromUrlScriptAndCreateLinks.d.ts +1 -0
- package/scripts/cloning/copyCommunityConfigAndTranslationsFromURL.d.ts +1 -0
- package/scripts/cloning/copyCommunityOneGroupToDomainNoUsersNoEndorsements.d.ts +1 -0
- package/scripts/cloning/copyCommunityToDomainNoUsersNoEndorsements.d.ts +1 -0
- package/scripts/cloning/copyCommunityToDomainWithEverything.d.ts +1 -0
- package/scripts/cloning/copyCommunityToDomainWithOnlyGroups.d.ts +1 -0
- package/scripts/cloning/copyGroupConfigAndTranslationsFromURL.d.ts +1 -0
- package/scripts/cloning/copyPostToGroupOld.d.ts +1 -0
- package/scripts/cloning/copyPostVideosFromURL.d.ts +1 -0
- package/scripts/cloning/copyPostWithOutAnyVotingOrActivities.d.ts +1 -0
- package/scripts/cloning/deepCloneSerbianWBFromUrlScriptAndCreateLinks.d.ts +1 -0
- package/scripts/cloning/deepCloneWBFromUrlScriptAndCreateLinks.d.ts +1 -0
- package/scripts/cloning/setAdminsFromURL.d.ts +1 -0
- package/scripts/cloning/setExternalIdsFromURL.d.ts +1 -0
- package/scripts/countCommunity.d.ts +1 -0
- package/scripts/countCommunityUsers.d.ts +1 -0
- package/scripts/countDelayedNotifications.d.ts +1 -0
- package/scripts/countGroup.d.ts +1 -0
- package/scripts/countStuff.d.ts +1 -0
- package/scripts/countUniqueVotersInAGroup.d.ts +1 -0
- package/scripts/createInvitesAndShow.d.ts +1 -0
- package/scripts/database/sync_database.d.ts +1 -0
- package/scripts/database/sync_dev_database.d.ts +1 -0
- package/scripts/debugNotifications.d.ts +1 -0
- package/scripts/deleteAllNewsFeeds.d.ts +1 -0
- package/scripts/deleteCategory.d.ts +1 -0
- package/scripts/deleteOldAppActivities.d.ts +1 -0
- package/scripts/deletePostContactDataForCommunity.d.ts +1 -0
- package/scripts/destroy/destroy_all_but_one_domain.d.ts +1 -0
- package/scripts/displayAuthorForPost.d.ts +1 -0
- package/scripts/endorsementFraudDetection/analyseEndorsementsForCommunity.d.ts +1 -0
- package/scripts/endorsementFraudDetection/bulkDeleteDuplicateEndorsmentsFromUrl.d.ts +1 -0
- package/scripts/exportAllStatusChanges.d.ts +1 -0
- package/scripts/exportClientAcitivity.d.ts +1 -0
- package/scripts/exportEndorsementsForCommunity.d.ts +1 -0
- package/scripts/exportPointQualitiesForCommunity.d.ts +1 -0
- package/scripts/exportPostsAndPointsForCommunity.d.ts +1 -0
- package/scripts/exportPostsDataSetForDomain.d.ts +1 -0
- package/scripts/exportPostsForGroup.d.ts +1 -0
- package/scripts/exportRatingsForPost.d.ts +1 -0
- package/scripts/exportUserEndorsementsWithUserAnalysis.d.ts +1 -0
- package/scripts/exportUsersForCommunity.d.ts +1 -0
- package/scripts/exportUsersForDomain.d.ts +1 -0
- package/scripts/exportUsersForGroup.d.ts +1 -0
- package/scripts/exports/ratingDistribution.d.ts +1 -0
- package/scripts/exports/whoEndorsedWhatByCommunity.d.ts +1 -0
- package/scripts/findUnusedClientImports.d.ts +1 -0
- package/scripts/fixAllPostPointCounts.d.ts +1 -0
- package/scripts/fixAnonNotificationsSettings.d.ts +1 -0
- package/scripts/fixCountKopavogur.d.ts +1 -0
- package/scripts/fixEndorsementsAfterCopyPostToGroup.d.ts +1 -0
- package/scripts/fixExternalUserId.d.ts +1 -0
- package/scripts/fixGroupAccess.d.ts +1 -0
- package/scripts/fixGroupIdeasAndPointsCount.d.ts +1 -0
- package/scripts/fixNotificationSettings.d.ts +1 -0
- package/scripts/fixSurveyRadioBakedInSubCodes.d.ts +1 -0
- package/scripts/fixWrongUserIdForStatusUpdates.d.ts +1 -0
- package/scripts/gallery/exportGalleryData.d.ts +1 -0
- package/scripts/gallery/importGalleryForCommunity.d.ts +1 -0
- package/scripts/gallery/readJsonAndDownloadImagesVersion2.d.ts +1 -0
- package/scripts/gallery/refreshAcApiPostIdsForCommunity.d.ts +1 -0
- package/scripts/genderAnalysis.d.ts +1 -0
- package/scripts/genderAnalysisByStatus.d.ts +1 -0
- package/scripts/importAllLocalesFromLocalFolders.d.ts +1 -0
- package/scripts/importDomain.d.ts +1 -0
- package/scripts/keys/addOidcToDomain.d.cts +1 -0
- package/scripts/landUseGame/export3Ddata.d.ts +1 -0
- package/scripts/listLanguagesForGroup.d.ts +1 -0
- package/scripts/loadTestCreateDummyContentForGroup.d.ts +1 -0
- package/scripts/makeRecursiveMapData.d.ts +1 -0
- package/scripts/mapping/community_map_csv.d.ts +1 -0
- package/scripts/moveCommunityToDomain.d.ts +1 -0
- package/scripts/moveGroupToCommunity.d.ts +1 -0
- package/scripts/movePostToGroup.d.ts +1 -0
- package/scripts/movePostsToGroupsRecountGroupFromUrl.d.ts +1 -0
- package/scripts/oldMovePostToGroup.d.ts +1 -0
- package/scripts/processCsvForPdfUrls.d.ts +1 -0
- package/scripts/processCsvForTranslationAndToxicity.d.ts +1 -0
- package/scripts/recount/recount_recursive_communities.d.ts +1 -0
- package/scripts/recountALLCommunityGroupCounts.d.ts +1 -0
- package/scripts/recountAll.d.ts +1 -0
- package/scripts/recountCommunitesFromUrl.d.ts +1 -0
- package/scripts/recountCommunity.d.ts +1 -0
- package/scripts/recountGroup.d.ts +1 -0
- package/scripts/recountGroupNoUserChange.d.ts +1 -0
- package/scripts/resetAllEndorsementsForGroup.d.ts +1 -0
- package/scripts/resetEnTranslationForGroup.d.ts +1 -0
- package/scripts/setAdminOnAll.d.cts +1 -0
- package/scripts/setDomainAdmin.d.cts +1 -0
- package/scripts/setDomainLocales.d.ts +1 -0
- package/scripts/setEarlQuestionIdOnGroup.d.cts +1 -0
- package/scripts/setLanguageOnGroupCommunitesFromUrl.d.ts +1 -0
- package/scripts/setMemberOfAll.d.ts +1 -0
- package/scripts/setNewUserForContentOfCommunity.d.ts +1 -0
- package/scripts/setOfficialStatusOnAllPostsForCommunity.d.ts +1 -0
- package/scripts/setUserOnAll.d.ts +1 -0
- package/scripts/showCategoryForGroup.d.ts +1 -0
- package/scripts/showOldActivityTypes.d.ts +1 -0
- package/scripts/showPostsMissingCategoryForGroup.d.ts +1 -0
- package/scripts/showStatuses.d.ts +1 -0
- package/scripts/showUniqueVotersInCommunity.d.ts +1 -0
- package/scripts/showUserAgentsAndIpsForEmails.d.ts +1 -0
- package/scripts/simpleExportForGroupsForCommunity.d.ts +1 -0
- package/scripts/simpleExportForPointsForCommunity.d.ts +1 -0
- package/scripts/simpleExportForPostsForCommunity.d.ts +1 -0
- package/scripts/testForEndorsments.d.ts +1 -0
- package/scripts/undeleteGroupAndAllContent.d.ts +1 -0
- package/scripts/undeletePost.d.ts +1 -0
- package/scripts/unlinkSsn.d.ts +1 -0
- package/scripts/updateFromAlthingi.d.ts +1 -0
- package/server.d.ts +1 -104
- package/utils/airbrake.d.cts +2 -0
- package/utils/cjsCodeReview.d.ts +13 -0
- package/utils/community_mapping_tools.d.cts +1 -0
- package/utils/copy_utils.d.cts +11 -0
- package/utils/docx_utils.d.cts +1 -0
- package/utils/export_utils.d.cts +21 -0
- package/utils/i18n.d.cts +2 -0
- package/utils/is_valid_db_id.d.cts +1 -0
- package/utils/logger.d.cts +2 -0
- package/utils/loggerTs.d.ts +3 -0
- package/utils/manifest_generator.d.cts +2 -0
- package/utils/manifest_generator.d.ts +1 -3
- package/utils/parse_domain.d.cts +6 -0
- package/utils/recount_utils.d.cts +7 -0
- package/utils/seedModels.d.ts +2 -0
- package/utils/seedModels.js +388 -0
- package/utils/sharing_parameters.d.cts +8 -0
- package/utils/sitemap_generator.d.cts +2 -0
- package/utils/to_json.d.cts +2 -0
- package/utils/ypLanguages.d.ts +16 -0
- package/webSockets.d.ts +26 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A flexible renderer for "Competitor Agent" (or any) workflow emails.
|
|
3
|
+
*
|
|
4
|
+
* - The CTA block (button + instructions) is inserted *within* the loop,
|
|
5
|
+
* right after the step that is currently active (currentStepIndex).
|
|
6
|
+
* - Branding (logo, brand name, footer text, etc.) are all passed in,
|
|
7
|
+
* so they are not hardcoded in the template.
|
|
8
|
+
*/
|
|
9
|
+
export declare class EmailTemplateRenderer {
|
|
10
|
+
/**
|
|
11
|
+
* Render the dynamic email with steps, highlighting the current step,
|
|
12
|
+
* and inserting the CTA block immediately after the current step only.
|
|
13
|
+
*
|
|
14
|
+
* @param recipientName - e.g. "Petur".
|
|
15
|
+
* @param invitedBy - e.g. "Robert Bjarnason".
|
|
16
|
+
* @param agentName - e.g. "Competitor Agent".
|
|
17
|
+
* @param workflow - The workflow with steps + currentStepIndex.
|
|
18
|
+
* @param ctaLink - Destination URL when clicking the CTA button.
|
|
19
|
+
* @param brandLogoUrl - URL to your brand’s logo.
|
|
20
|
+
* @param brandName - Display name of the brand (e.g., "amplifier powered by Evoly").
|
|
21
|
+
* @param footerText - Footer text, e.g. "© 2024 Evoly ehf, Vegmuli 8..."
|
|
22
|
+
* @param footerEmailSettingsLink - Link to "Change email settings".
|
|
23
|
+
*/
|
|
24
|
+
static renderEmail(recipientName: string, invitedBy: string, agentName: string, workflow: YpAgentRunWorkflowConfiguration, ctaLink: string, brandLogoUrl: string, brandName: string, footerText: string, footerEmailSettingsLink: string): string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare class NewAiModelSetup {
|
|
2
|
+
/**
|
|
3
|
+
* Initializes all models by calling their associate methods (if present).
|
|
4
|
+
*/
|
|
5
|
+
static initializeModels(): Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Seeds the test AI models (and a top-level agent class) if they do not exist.
|
|
8
|
+
* @param userId the user id to associate with the new models
|
|
9
|
+
*/
|
|
10
|
+
static seedAnthropicModels(userId: number): Promise<void>;
|
|
11
|
+
static seedAnthropic37Models(userId: number): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Seeds OpenAI models.
|
|
14
|
+
* This currently creates several models including GPT-4o, GPT-4o Mini, o1 Mini,
|
|
15
|
+
* o1 Preview, o1 24, and o3 mini.
|
|
16
|
+
*/
|
|
17
|
+
static seedOpenAiModels(userId: number): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Seeds Google models.
|
|
20
|
+
* Currently, this creates Gemini 1.5 Pro 2 and Gemini 1.5 Flash 2.
|
|
21
|
+
*/
|
|
22
|
+
static seedGoogleModels(userId: number): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Master seeding function which calls the provider-specific functions
|
|
25
|
+
* and also seeds a top-level agent class.
|
|
26
|
+
*/
|
|
27
|
+
static seedAiModels(userId: number): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Helper to delay model seeding slightly.
|
|
30
|
+
*/
|
|
31
|
+
static setupAiModels(userId: number): void;
|
|
32
|
+
/**
|
|
33
|
+
* Sets up the API keys for a given group based on the latest active AI models.
|
|
34
|
+
* @param group The group instance on which to set the API keys
|
|
35
|
+
*/
|
|
36
|
+
static setupApiKeysForGroup(group: any): Promise<void>;
|
|
37
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sequelize as psSequelize } from "@policysynth/agents/dbModels/index.js";
|
|
1
|
+
import { sequelize as psSequelize, User, } from "@policysynth/agents/dbModels/index.js";
|
|
2
2
|
import { PsAiModel } from "@policysynth/agents/dbModels/aiModel.js";
|
|
3
3
|
import { PsAgentClass } from "@policysynth/agents/dbModels/agentClass.js";
|
|
4
4
|
import { PsAgentClassCategories } from "@policysynth/agents/agentCategories.js";
|
|
@@ -33,15 +33,15 @@ export class NewAiModelSetup {
|
|
|
33
33
|
*/
|
|
34
34
|
static async initializeModels() {
|
|
35
35
|
try {
|
|
36
|
+
if (process.env.FORCE_DB_SYNC || process.env.NODE_ENV === "development") {
|
|
37
|
+
await psSequelize.sync();
|
|
38
|
+
}
|
|
36
39
|
console.log("All Models Loaded Init");
|
|
37
40
|
for (const modelName of Object.keys(psModels)) {
|
|
38
41
|
if (typeof psModels[modelName].associate === "function") {
|
|
39
42
|
await psModels[modelName].associate(psSequelize.models);
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
|
-
if (process.env.FORCE_DB_SYNC || process.env.NODE_ENV === "development") {
|
|
43
|
-
await psSequelize.sync();
|
|
44
|
-
}
|
|
45
45
|
console.log("All models initialized successfully.");
|
|
46
46
|
}
|
|
47
47
|
catch (error) {
|
|
@@ -410,7 +410,7 @@ export class NewAiModelSetup {
|
|
|
410
410
|
costInTokensPerMillion: 2,
|
|
411
411
|
costOutTokensPerMillion: 8,
|
|
412
412
|
currency: "USD",
|
|
413
|
-
cacheCostInTokensPerMillion: 0.5
|
|
413
|
+
cacheCostInTokensPerMillion: 0.5,
|
|
414
414
|
},
|
|
415
415
|
maxTokensOut: 100000,
|
|
416
416
|
defaultTemperature: 0.7,
|
|
@@ -587,7 +587,15 @@ export class NewAiModelSetup {
|
|
|
587
587
|
static setupAiModels(userId) {
|
|
588
588
|
setTimeout(async () => {
|
|
589
589
|
console.log("Seeding AI models");
|
|
590
|
-
await
|
|
590
|
+
const user = await User.findOne({
|
|
591
|
+
attributes: ["id"],
|
|
592
|
+
where: { id: userId },
|
|
593
|
+
});
|
|
594
|
+
if (!user) {
|
|
595
|
+
console.error("User not found");
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
await NewAiModelSetup.seedAiModels(user.id);
|
|
591
599
|
}, 100);
|
|
592
600
|
}
|
|
593
601
|
/**
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Queue } from "bullmq";
|
|
2
|
+
import { Redis } from "ioredis";
|
|
3
|
+
import { AgentQueueManager } from "@policysynth/agents/operations/agentQueueManager.js";
|
|
4
|
+
import { PsAgent } from "@policysynth/agents/dbModels/agent.js";
|
|
5
|
+
import WebSocket from "ws";
|
|
6
|
+
import { YpAgentProductRun } from "../models/agentProductRun.js";
|
|
7
|
+
export declare class NotificationAgentQueueManager extends AgentQueueManager {
|
|
8
|
+
redisClient: Redis;
|
|
9
|
+
queues: Map<string, Queue>;
|
|
10
|
+
wsClients: Map<string, WebSocket>;
|
|
11
|
+
constructor(wsClients: Map<string, WebSocket>);
|
|
12
|
+
sendNotification(agent: PsAgent, agentRun: YpAgentProductRun, action: string, wsClientId: string, status: string, result: any, agentRunId?: number, updatedWorkflow?: YpAgentRunWorkflowConfiguration): Promise<void>;
|
|
13
|
+
sendNotificationEmail(agent: PsAgent, agentRun: YpAgentProductRun, updatedWorkflow: YpAgentRunWorkflowConfiguration): Promise<void>;
|
|
14
|
+
goBackOneWorkflowStepIfNeeded(agentRunId: number, status: string, wsClientId: string, currentWorkflowStepIndex?: number | undefined): Promise<void>;
|
|
15
|
+
advanceWorkflowStepOrCompleteAgentRun(agentRunId: number, status: string, wsClientId: string, currentWorkflowStepIndex?: number | undefined): Promise<YpAgentRunWorkflowConfiguration | undefined>;
|
|
16
|
+
static getAgentRun(agentRunId: number): Promise<YpAgentProductRun | null>;
|
|
17
|
+
getQueue(queueName: string): Queue;
|
|
18
|
+
controlAgent(agentId: number, action: string): Promise<string>;
|
|
19
|
+
startAgentProcessingWithWsClient(agentId: number, agentRunId: number, wsClientId: string, structuredAnswersOverrides?: YpStructuredAnswer[]): Promise<string | undefined>;
|
|
20
|
+
stopAgentProcessing(agentId: number, wsClientId: string, agentRunId: number): Promise<boolean>;
|
|
21
|
+
getAgentStatus(agentId: number): Promise<PsAgentStatus | null>;
|
|
22
|
+
updateAgentStatus(agentId: number, state: PsAgentStatus["state"], progress?: number, message?: string, details?: Record<string, any>): Promise<boolean>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { YpSubscriptionPlan } from "../models/subscriptionPlan.js";
|
|
2
|
+
import { YpSubscription } from "../models/subscription.js";
|
|
3
|
+
import { YpAgentProduct } from "../models/agentProduct.js";
|
|
4
|
+
import { YpAgentProductRun } from "../models/agentProductRun.js";
|
|
5
|
+
import WebSocket from "ws";
|
|
6
|
+
export declare class SubscriptionManager {
|
|
7
|
+
constructor();
|
|
8
|
+
getPlans(): Promise<YpSubscriptionPlan[]>;
|
|
9
|
+
cloneCommunityTemplate(communityTemplateId: number, toDomainId: number): Promise<any>;
|
|
10
|
+
cloneCommunityWorkflowTemplate(agentProduct: YpAgentProduct, domainId: number, currentUser: UserClass): Promise<{
|
|
11
|
+
workflow: YpAgentRunWorkflowConfiguration;
|
|
12
|
+
requiredQuestions?: any[];
|
|
13
|
+
}>;
|
|
14
|
+
createSubscriptions(userId: number, planIds: number[], paymentMethodId: string | null): Promise<{
|
|
15
|
+
clientSecret?: string;
|
|
16
|
+
subscriptionId?: string;
|
|
17
|
+
freeSubscription?: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
handleSuccessfulPayment(paymentIntentId: string): Promise<YpSubscription[]>;
|
|
20
|
+
startAgentRun(subscriptionId: number, wsClients: Map<string, WebSocket>, wsClientId: string, currentUser: UserClass): Promise<{
|
|
21
|
+
agentRun: YpAgentProductRun;
|
|
22
|
+
subscription: YpSubscription;
|
|
23
|
+
}>;
|
|
24
|
+
startFirstAgent(agentProductRun: YpAgentProductRun, wsClients: Map<string, WebSocket>, wsClientId: string): Promise<boolean>;
|
|
25
|
+
stopAgentRun(agentProductRunId: number): Promise<void>;
|
|
26
|
+
private calculateNextBillingDate;
|
|
27
|
+
private incrementRunsUsed;
|
|
28
|
+
private checkRunsLimit;
|
|
29
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { YpWorkflowConversation } from "../models/workflowConversation.js";
|
|
2
|
+
export declare class WorkflowConversationManager {
|
|
3
|
+
constructor();
|
|
4
|
+
createWorkflowConversation(data: {
|
|
5
|
+
agentProductId: number;
|
|
6
|
+
userId?: number;
|
|
7
|
+
configuration?: Record<string, any>;
|
|
8
|
+
}): Promise<YpWorkflowConversation>;
|
|
9
|
+
getWorkflowConversation(workflowConversationId: number): Promise<YpWorkflowConversation | null>;
|
|
10
|
+
updateWorkflowConversation(workflowConversationId: number, updates: Record<string, any>): Promise<YpWorkflowConversation>;
|
|
11
|
+
connectToWorkflowConversation(workflowConversationId: number, connectionData: Record<string, any>): Promise<YpWorkflowConversation>;
|
|
12
|
+
getWorkflowConversationsForUser(userId: number): Promise<YpWorkflowConversation[]>;
|
|
13
|
+
getRunningWorkflowConversationsForUser(userId: number): Promise<YpWorkflowConversation[]>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Model } from "sequelize";
|
|
2
|
+
import { YpSubscriptionUser } from "./subscriptionUser.js";
|
|
3
|
+
import { YpAgentProductBoosterPurchase } from "./agentProductBoosterPurchase.js";
|
|
4
|
+
import { YpSubscription } from "./subscription.js";
|
|
5
|
+
import { YpAgentProductRun } from "./agentProductRun.js";
|
|
6
|
+
import { YpSubscriptionPlan } from "./subscriptionPlan.js";
|
|
7
|
+
import { YpAgentProductBundle } from "./agentProductBundle.js";
|
|
8
|
+
export declare class YpAgentProduct extends Model {
|
|
9
|
+
id: number;
|
|
10
|
+
uuid: string;
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
user_id: number;
|
|
14
|
+
group_id: number;
|
|
15
|
+
domain_id: number;
|
|
16
|
+
parent_agent_product_id: number;
|
|
17
|
+
configuration: YpAgentProductConfiguration;
|
|
18
|
+
status?: YpAgentProductStatus;
|
|
19
|
+
created_at: Date;
|
|
20
|
+
updated_at: Date;
|
|
21
|
+
User?: YpSubscriptionUser;
|
|
22
|
+
Group?: YpGroupData;
|
|
23
|
+
BoosterPurchases?: YpAgentProductBoosterPurchase[];
|
|
24
|
+
Subscriptions?: YpSubscription[];
|
|
25
|
+
SubscriptionPlans?: YpSubscriptionPlan[];
|
|
26
|
+
Runs?: YpAgentProductRun[];
|
|
27
|
+
AgentBundles?: YpAgentProductBundle[];
|
|
28
|
+
AgentBundle?: YpAgentProductBundle;
|
|
29
|
+
ParentAgentProduct?: YpAgentProduct;
|
|
30
|
+
ChildAgentProducts?: YpAgentProduct[];
|
|
31
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Model } from 'sequelize';
|
|
2
|
+
import { YpSubscriptionUser } from './subscriptionUser.js';
|
|
3
|
+
import { YpAgentProduct } from './agentProduct.js';
|
|
4
|
+
import { YpSubscriptionPlan } from './subscriptionPlan.js';
|
|
5
|
+
import { YpDiscount } from './discount.js';
|
|
6
|
+
export declare class YpAgentProductBoosterPurchase extends Model {
|
|
7
|
+
id: number;
|
|
8
|
+
uuid: string;
|
|
9
|
+
user_id: number;
|
|
10
|
+
agent_product_id: number;
|
|
11
|
+
subscription_plan_id: number;
|
|
12
|
+
runs_purchased: number;
|
|
13
|
+
amount: number;
|
|
14
|
+
currency: string;
|
|
15
|
+
purchase_date: Date;
|
|
16
|
+
payment_method?: string;
|
|
17
|
+
status: string;
|
|
18
|
+
transaction_id?: string;
|
|
19
|
+
metadata?: any;
|
|
20
|
+
discount_id?: number;
|
|
21
|
+
created_at: Date;
|
|
22
|
+
updated_at: Date;
|
|
23
|
+
User?: YpSubscriptionUser;
|
|
24
|
+
AgentProduct?: YpAgentProduct;
|
|
25
|
+
SubscriptionPlan?: YpSubscriptionPlan;
|
|
26
|
+
Discount?: YpDiscount;
|
|
27
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Model } from "sequelize";
|
|
2
|
+
import { YpAgentProduct } from './agentProduct.js';
|
|
3
|
+
export declare class YpAgentProductBundle extends Model {
|
|
4
|
+
id: number;
|
|
5
|
+
uuid: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
configuration?: YpAgentProductBundleConfiguration;
|
|
9
|
+
created_at: Date;
|
|
10
|
+
updated_at: Date;
|
|
11
|
+
AgentProducts?: YpAgentProduct[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Model } from 'sequelize';
|
|
2
|
+
import { YpSubscription } from './subscription.js';
|
|
3
|
+
export declare class YpAgentProductRun extends Model {
|
|
4
|
+
id: number;
|
|
5
|
+
uuid: string;
|
|
6
|
+
subscription_id: number;
|
|
7
|
+
start_time: Date;
|
|
8
|
+
end_time?: Date;
|
|
9
|
+
duration?: number;
|
|
10
|
+
status: YpAgentProductRunStatus;
|
|
11
|
+
input_data?: any;
|
|
12
|
+
output_data?: any;
|
|
13
|
+
error_message?: string;
|
|
14
|
+
run_type?: string;
|
|
15
|
+
metadata?: any;
|
|
16
|
+
workflow: YpAgentRunWorkflowConfiguration;
|
|
17
|
+
parent_agent_product_run_id?: number;
|
|
18
|
+
created_at: Date;
|
|
19
|
+
updated_at: Date;
|
|
20
|
+
Subscription?: YpSubscription;
|
|
21
|
+
ParentAgentProductRun?: YpAgentProductRun;
|
|
22
|
+
ChildAgentProductRuns?: YpAgentProductRun[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Model } from 'sequelize';
|
|
2
|
+
import { YpSubscription } from './subscription.js';
|
|
3
|
+
import { YpAgentProductBoosterPurchase } from './agentProductBoosterPurchase.js';
|
|
4
|
+
export declare class YpDiscount extends Model {
|
|
5
|
+
id: number;
|
|
6
|
+
uuid: string;
|
|
7
|
+
code: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
discount_type: 'percentage' | 'fixed';
|
|
10
|
+
discount_value: number;
|
|
11
|
+
max_uses?: number;
|
|
12
|
+
uses: number;
|
|
13
|
+
start_date?: Date;
|
|
14
|
+
end_date?: Date;
|
|
15
|
+
applicable_to: 'agent_product' | 'booster' | 'subscription' | 'both';
|
|
16
|
+
created_at: Date;
|
|
17
|
+
updated_at: Date;
|
|
18
|
+
Subscriptions?: YpSubscription[];
|
|
19
|
+
BoosterPurchases?: YpAgentProductBoosterPurchase[];
|
|
20
|
+
static associate(models: any): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Model } from 'sequelize';
|
|
2
|
+
import { YpSubscriptionUser } from './subscriptionUser.js';
|
|
3
|
+
import { YpAgentProduct } from './agentProduct.js';
|
|
4
|
+
import { YpSubscriptionPlan } from './subscriptionPlan.js';
|
|
5
|
+
export declare class YpSubscription extends Model {
|
|
6
|
+
id: number;
|
|
7
|
+
uuid: string;
|
|
8
|
+
user_id: number;
|
|
9
|
+
domain_id: number;
|
|
10
|
+
agent_product_id: number;
|
|
11
|
+
subscription_plan_id: number;
|
|
12
|
+
start_date: Date;
|
|
13
|
+
end_date?: Date;
|
|
14
|
+
next_billing_date: Date;
|
|
15
|
+
status: 'active' | 'paused' | 'cancelled' | 'expired';
|
|
16
|
+
payment_method?: string;
|
|
17
|
+
transaction_id?: string;
|
|
18
|
+
configuration?: YpSubscriptionConfiguration;
|
|
19
|
+
metadata?: any;
|
|
20
|
+
created_at: Date;
|
|
21
|
+
updated_at: Date;
|
|
22
|
+
User: YpSubscriptionUser;
|
|
23
|
+
AgentProduct: YpAgentProduct;
|
|
24
|
+
SubscriptionPlan: YpSubscriptionPlan;
|
|
25
|
+
Plan: YpSubscriptionPlan;
|
|
26
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Model } from 'sequelize';
|
|
2
|
+
import { YpSubscription } from './subscription.js';
|
|
3
|
+
import { YpAgentProductBoosterPurchase } from './agentProductBoosterPurchase.js';
|
|
4
|
+
import { YpAgentProduct } from './agentProduct.js';
|
|
5
|
+
export declare class YpSubscriptionPlan extends Model {
|
|
6
|
+
id: number;
|
|
7
|
+
uuid: string;
|
|
8
|
+
agent_product_id: number;
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
configuration: YpSubscriptionPlanConfiguration;
|
|
12
|
+
created_at: Date;
|
|
13
|
+
updated_at: Date;
|
|
14
|
+
AgentProduct?: YpAgentProduct;
|
|
15
|
+
Subscriptions?: YpSubscription[];
|
|
16
|
+
BoosterPurchases?: YpAgentProductBoosterPurchase[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Model } from 'sequelize';
|
|
2
|
+
import { YpAgentProduct } from './agentProduct.js';
|
|
3
|
+
import { YpAgentProductBoosterPurchase } from './agentProductBoosterPurchase.js';
|
|
4
|
+
import { YpSubscription } from './subscription.js';
|
|
5
|
+
export declare class YpSubscriptionUser extends Model {
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
AgentProducts?: YpAgentProduct[];
|
|
9
|
+
AgentProductBoosterPurchases?: YpAgentProductBoosterPurchase[];
|
|
10
|
+
Subscriptions?: YpSubscription[];
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Model } from "sequelize";
|
|
2
|
+
export declare class YpWorkflowConversation extends Model {
|
|
3
|
+
id: number;
|
|
4
|
+
agentProductId: number;
|
|
5
|
+
userId: number | null;
|
|
6
|
+
configuration: YpWorkflowConversationConfiguration;
|
|
7
|
+
created_at: Date;
|
|
8
|
+
updated_at: Date;
|
|
9
|
+
static initModel(sequelizeInstance?: import("sequelize").Sequelize): typeof YpWorkflowConversation;
|
|
10
|
+
static associate(models: Record<string, any>): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/app.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import express from "express";
|
|
2
|
+
import WebSocket, { WebSocketServer } from "ws";
|
|
3
|
+
import { RedisClientType } from "@redis/client";
|
|
4
|
+
import { WebSocketsManager } from "./webSockets.js";
|
|
5
|
+
interface YpRequest extends express.Request {
|
|
6
|
+
ypDomain?: any;
|
|
7
|
+
ypCommunity?: any;
|
|
8
|
+
sso?: any;
|
|
9
|
+
redisClient?: any;
|
|
10
|
+
user?: any;
|
|
11
|
+
clientAppPath?: string;
|
|
12
|
+
adminAppPath?: string;
|
|
13
|
+
dirName?: string;
|
|
14
|
+
useNewVersion?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare class YourPrioritiesApi {
|
|
17
|
+
app: express.Application;
|
|
18
|
+
port: number;
|
|
19
|
+
httpServer: any;
|
|
20
|
+
ws: WebSocketServer;
|
|
21
|
+
redisClient: RedisClientType;
|
|
22
|
+
wsClients: Map<string, WebSocket>;
|
|
23
|
+
webSocketsManager: WebSocketsManager;
|
|
24
|
+
constructor(port?: number | undefined);
|
|
25
|
+
initialize(): Promise<void>;
|
|
26
|
+
setupNewWebAppVersionHandling(): void;
|
|
27
|
+
initializeRedis(): Promise<void>;
|
|
28
|
+
addRedisToRequest(): void;
|
|
29
|
+
addDirnameToRequest(): void;
|
|
30
|
+
addInviteAsAnonMiddleWare(): void;
|
|
31
|
+
forceHttps(): void;
|
|
32
|
+
determineVersion: (req: YpRequest) => boolean;
|
|
33
|
+
handleShortenedRedirects(): void;
|
|
34
|
+
handleServiceWorker(req: YpRequest, res: express.Response): void;
|
|
35
|
+
setupDomainAndCommunity(): void;
|
|
36
|
+
initializeRateLimiting(): Promise<void>;
|
|
37
|
+
setupSitemapRoute(): void;
|
|
38
|
+
bearerCallback: () => void;
|
|
39
|
+
checkAuthForSsoInit(): void;
|
|
40
|
+
initializeMiddlewares(): void;
|
|
41
|
+
initializeEsControllers(): Promise<void>;
|
|
42
|
+
setupStaticFileServing(): void;
|
|
43
|
+
initializeRoutes(): void;
|
|
44
|
+
initializePassportStrategies(): void;
|
|
45
|
+
completeRegisterUserLogin: (user: any, // Replace 'any' with the actual user type
|
|
46
|
+
loginType: string, req: YpRequest, // Replace 'any' with 'YpRequest' if it's the correct type
|
|
47
|
+
done: () => void) => void;
|
|
48
|
+
registerUserLogin: (user: any | null, userId: number, loginProvider: string, req: YpRequest, done: () => void) => void;
|
|
49
|
+
setupErrorHandler(): void;
|
|
50
|
+
listen(): Promise<void>;
|
|
51
|
+
setupHttpsServer(): any;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export = auth;
|
package/bot_control.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import WebSocket from "ws";
|
|
2
|
+
import express, { Request, Response } from "express";
|
|
3
|
+
interface YpRequest extends express.Request {
|
|
4
|
+
ypDomain?: any;
|
|
5
|
+
ypCommunity?: any;
|
|
6
|
+
sso?: any;
|
|
7
|
+
redisClient?: any;
|
|
8
|
+
user?: any;
|
|
9
|
+
}
|
|
10
|
+
export declare class AllOurIdeasController {
|
|
11
|
+
path: string;
|
|
12
|
+
router: import("express-serve-static-core").Router;
|
|
13
|
+
wsClients: Map<string, WebSocket>;
|
|
14
|
+
constructor(wsClients: Map<string, WebSocket>);
|
|
15
|
+
initializeRoutes(): Promise<void>;
|
|
16
|
+
getAoiSiteStats(req: Request, res: Response): Promise<void>;
|
|
17
|
+
addIdea(req: Request, res: Response): Promise<void>;
|
|
18
|
+
getModerationFlag(data: string): Promise<boolean>;
|
|
19
|
+
getModerationResults(data: string): Promise<void>;
|
|
20
|
+
deactivateChoice(req: Request, choice: AoiChoiceData): Promise<void>;
|
|
21
|
+
getTranslatedText(req: Request, res: Response): Promise<void>;
|
|
22
|
+
generateIdeas(req: Request, res: Response): Promise<void>;
|
|
23
|
+
getXlsExportProgress(req: Request, res: Response): Promise<void>;
|
|
24
|
+
exportXls(req: Request, res: Response): Promise<void>;
|
|
25
|
+
llmAnswerExplain(req: Request, res: Response): Promise<void>;
|
|
26
|
+
showEarl(req: Request, res: Response): Promise<void>;
|
|
27
|
+
vote(req: Request, res: Response): Promise<void>;
|
|
28
|
+
createQuestion(req: Request, res: Response): Promise<void>;
|
|
29
|
+
updateCoiceData(req: Request, res: Response): Promise<void>;
|
|
30
|
+
updateActive(req: Request, res: Response): Promise<void>;
|
|
31
|
+
updateQuestionName(req: Request, res: Response): Promise<void>;
|
|
32
|
+
skip(req: Request, res: Response): Promise<void>;
|
|
33
|
+
analysis(req: YpRequest, res: Response): Promise<void>;
|
|
34
|
+
private fetchChoices;
|
|
35
|
+
getChoices(req: Request, res: Response): Promise<void>;
|
|
36
|
+
getQuestionChoicePath(questionId: number, choiceId: number): string;
|
|
37
|
+
getNextPromptOptions(req: Request): any;
|
|
38
|
+
getVoteRequestOptions(req: Request, requestType: "vote" | "skip" | "skip_after_flag"): any;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function up(queryInterface: any, Sequelize: any): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function up(queryInterface: any, Sequelize: any): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function up(queryInterface: any, Sequelize: any): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function up(queryInterface: any, Sequelize: any): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function up(queryInterface: any, Sequelize: any): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function up(queryInterface: any, Sequelize: any): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function up(queryInterface: any, Sequelize: any): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function up(queryInterface: any, Sequelize: any): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function up(queryInterface: any, Sequelize: any): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function up(queryInterface: any, Sequelize: any): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function up(queryInterface: any, Sequelize: any): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function up(queryInterface: any, Sequelize: any): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function up(queryInterface: any, Sequelize: any): Promise<void>;
|