From 116d3c0c81d0ab807ad9ee70536a0810ffd69d23 Mon Sep 17 00:00:00 2001 From: Tessa Thornton Date: Thu, 12 Dec 2019 11:41:57 -0500 Subject: [PATCH] fix jsdoc warnings (#2750) --- .../server/graph/tenant/subscriptions/publisher.ts | 11 +++++++---- src/core/server/models/comment/comment.ts | 6 +++++- src/core/server/models/tenant/tenant.ts | 1 + src/core/server/models/user/user.ts | 5 +++-- src/core/server/queue/tasks/mailer/content.ts | 6 +++--- src/core/server/queue/tasks/mailer/processor.ts | 1 + .../services/comments/pipeline/phases/toxic.ts | 2 +- src/core/server/services/users/auth/reset.ts | 1 + src/core/server/services/users/users.ts | 14 ++++++++++---- 9 files changed, 32 insertions(+), 15 deletions(-) diff --git a/src/core/server/graph/tenant/subscriptions/publisher.ts b/src/core/server/graph/tenant/subscriptions/publisher.ts index 9c5177892..faf1815c2 100644 --- a/src/core/server/graph/tenant/subscriptions/publisher.ts +++ b/src/core/server/graph/tenant/subscriptions/publisher.ts @@ -21,10 +21,13 @@ export interface PublisherOptions { * over the pubsub broker to facilitate live updates and notifications. * * TODO: Update - * @param pubsub the pubsub broker to be used to facilitate the publish action - * @param notifier - * @param tenantID the ID of the Tenant where the event will be published with - * @param clientID the ID of the client to de-duplicate mutation responses + * + * @param options options object + * @param options.pubsub the pubsub broker to be used to facilitate the publish action + * @param options.slackPublisher the slack publisher instance + * @param options.notifierQueue the queue + * @param options.tenantID the ID of the Tenant where the event will be published with + * @param options.clientID the ID of the client to de-duplicate mutation responses */ export const createPublisher = ({ pubsub, diff --git a/src/core/server/models/comment/comment.ts b/src/core/server/models/comment/comment.ts index d76ee8d1f..ceb7cfd72 100644 --- a/src/core/server/models/comment/comment.ts +++ b/src/core/server/models/comment/comment.ts @@ -412,6 +412,8 @@ function cursorGetterFactory( * replies. * * @param mongo database connection + * @param tenantID the tenant id + * @param storyID the id of the story the comment belongs to * @param parentID the parent id for the comment to retrieve * @param input connection configuration */ @@ -437,7 +439,7 @@ export const retrieveCommentRepliesConnection = ( * * @param mongo the database connection to use when retrieving comments * @param tenantID the tenant id for where the comment exists - * @param commentID the id of the comment to retrieve parents of + * @param comment the comment to retrieve parents of * @param pagination pagination options to paginate the results */ export async function retrieveCommentParentsConnection( @@ -507,6 +509,7 @@ export async function retrieveCommentParentsConnection( * comments. * * @param mongo database connection + * @param tenantID the Tenant id * @param storyID the Story id for the comment to retrieve * @param input connection configuration */ @@ -763,6 +766,7 @@ export async function updateCommentStatus( * @param mongo the database handle * @param tenantID the id of the Tenant * @param id the id of the Comment being updated + * @param revisionID the id of the Comment revision being updated * @param actionCounts the action counts to merge into the Comment */ export async function updateCommentActionCounts( diff --git a/src/core/server/models/tenant/tenant.ts b/src/core/server/models/tenant/tenant.ts index 32535bdcc..289535c50 100644 --- a/src/core/server/models/tenant/tenant.ts +++ b/src/core/server/models/tenant/tenant.ts @@ -61,6 +61,7 @@ export type CreateTenantInput = Pick< * create will create a new Tenant. * * @param mongo the MongoDB connection used to create the tenant. + * @param i18n i18n instance * @param input the customizable parts of the Tenant available during creation */ export async function createTenant( diff --git a/src/core/server/models/user/user.ts b/src/core/server/models/user/user.ts index 7d7d823cf..837cd65e8 100644 --- a/src/core/server/models/user/user.ts +++ b/src/core/server/models/user/user.ts @@ -1434,7 +1434,7 @@ export async function premodUser( * @param mongo the mongo database handle * @param tenantID the Tenant's ID where the User exists * @param id the ID of the user having their ban lifted - * @param modifiedBy the ID of the user lifting the premod + * @param createdBy the ID of the user lifting the premod * @param now the current date */ export async function removeUserPremod( @@ -1635,7 +1635,7 @@ export async function removeUserBan( * @param tenantID the Tenant's ID where the User exists * @param id the ID of the user being suspended * @param createdBy the ID of the user banning the above mentioned user - * @param from the range of time that the user is being banned for + * @param finish the date the suspension ends * @param message the message sent to suspended user in email * @param now the current date */ @@ -2335,6 +2335,7 @@ export async function pullUserNotificationDigests( * @param mongo the database to pull scheduled users to delete from * @param tenantID the tenant ID to pull users that have been scheduled for * deletion on + * @param rescheduledDuration duration in which to reschedule * @param now the current time */ export async function retrieveUserScheduledForDeletion( diff --git a/src/core/server/queue/tasks/mailer/content.ts b/src/core/server/queue/tasks/mailer/content.ts index 6e672725f..0560c9687 100644 --- a/src/core/server/queue/tasks/mailer/content.ts +++ b/src/core/server/queue/tasks/mailer/content.ts @@ -85,9 +85,9 @@ export default class MailerContent { * generateHTML will generate the HTML for a template and optionally cache * the compiled template based on the configured environment. * - * @param options configuration for generating HTML based on the email - * template. - */ + * @param tenant the tenant + * @param template the HTML email template + **/ public async generateHTML( tenant: Tenant, template: EmailTemplate diff --git a/src/core/server/queue/tasks/mailer/processor.ts b/src/core/server/queue/tasks/mailer/processor.ts index ab974ae7f..325e8ad43 100644 --- a/src/core/server/queue/tasks/mailer/processor.ts +++ b/src/core/server/queue/tasks/mailer/processor.ts @@ -94,6 +94,7 @@ function createMessageTranslator(i18n: I18n) { * translateMessage will translate the message to the specified locale as well * a juice the contents. * + * @param tenant the tenant * @param templateName the name of the template to base the translations off of * @param locale the locale to translate the email content into * @param fromAddress the address that is sending the email (from the Tenant) diff --git a/src/core/server/services/comments/pipeline/phases/toxic.ts b/src/core/server/services/comments/pipeline/phases/toxic.ts index e6f750188..bf49e5158 100644 --- a/src/core/server/services/comments/pipeline/phases/toxic.ts +++ b/src/core/server/services/comments/pipeline/phases/toxic.ts @@ -185,7 +185,7 @@ function convertLanguage(locale: LanguageCode): PerspectiveLanguage { * * @param text comment text to check for toxicity * @param model the specific model to use when storing the toxicity - * @param settings integration settings used to communicate with the perspective api + * @param language language to run perspective api * @param timeout timeout for communicating with the perspective api */ async function getScore( diff --git a/src/core/server/services/users/auth/reset.ts b/src/core/server/services/users/auth/reset.ts index 0ad833b25..9dda8a899 100644 --- a/src/core/server/services/users/auth/reset.ts +++ b/src/core/server/services/users/auth/reset.ts @@ -60,6 +60,7 @@ export function isResetToken(token: ResetToken | object): token is ResetToken { * * @param mongo MongoDB instance to interact with * @param tenant Tenant that the user exists on + * @param config the convict config object * @param signingConfig signing configuration that will be used to sign the token * @param user User to create the password reset URL for * @param now the current time diff --git a/src/core/server/services/users/users.ts b/src/core/server/services/users/users.ts index b85c865ca..08fd8bfbf 100644 --- a/src/core/server/services/users/users.ts +++ b/src/core/server/services/users/users.ts @@ -204,6 +204,7 @@ export async function setUsername( * one associated with them. * * @param mongo mongo database to interact with + * @param mailer the mailer * @param tenant Tenant where the User will be interacted with * @param user User that should get their username changed * @param email the new email for the User @@ -273,9 +274,11 @@ export async function setPassword( * will fail. * * @param mongo mongo database to interact with + * @param mailer the mailer * @param tenant Tenant where the User will be interacted with * @param user User that should get their password changed - * @param password the new password for the User + * @param oldPassword the old password for the User + * @param newPassword the new password for the User */ export async function updatePassword( mongo: Db, @@ -481,7 +484,6 @@ export async function createToken( * * @param mongo mongo database to interact with * @param tenant Tenant where the User will be interacted with - * @param config signing configuration to create the signed token * @param user User that should get updated * @param id of the Token to be deactivated */ @@ -600,6 +602,7 @@ export async function updateUsernameByID( * * @param mongo mongo database to interact with * @param tenant Tenant where the User will be interacted with + * @param user the user making the request * @param userID the User's ID that we are updating * @param role the role that we are setting on the User */ @@ -669,8 +672,9 @@ function canUpdateLocalProfile(tenant: Tenant, user: User): boolean { * @param tenant Tenant where the User will be interacted with * @param mailer The mailer queue * @param config Convict config + * @param signingConfig jwt signing config * @param user the User that we are updating - * @param email the email address that we are setting on the User + * @param emailAddress the email address that we are setting on the User * @param password the users password for confirmation */ export async function updateEmail( @@ -800,8 +804,9 @@ export async function destroyModeratorNote( * ban will ban a specific user from interacting with Coral. * * @param mongo mongo database to interact with + * @param mailer the mailer * @param tenant Tenant where the User will be banned on - * @param user the User that is banning the User + * @param banner the User that is banning the User * @param userID the ID of the User being banned * @param message message to banned user * @param now the current time that the ban took effect @@ -919,6 +924,7 @@ export async function removePremod( * suspend will suspend a give user from interacting with Coral. * * @param mongo mongo database to interact with + * @param mailer the mailer * @param tenant Tenant where the User will be suspended on * @param user the User that is suspending the User * @param userID the ID of the user being suspended