import type { Article, ArticleAttachment, ArticleComment, DeepPartial, Entity, FieldsParam, ListParams, MuteUpdateNotificationsParam, Reaction, Schema, Tag } from "../types"; import { ResourceApi } from "./common"; type ArticleSchema = Schema
; type ArticleCommentSchema = Schema; type ArticleAttachmentSchema = Schema; type ReactionSchema = Schema; type TagSchema = Schema; type ArticleEntity = Entity; type ArticleCommentEntity = Entity; type ArticleAttachmentEntity = Entity; type ReactionEntity = Entity; type TagEntity = Entity; /** * This resource lets you access articles in the YouTrack knowledge base. * https://www.jetbrains.com/help/youtrack/devportal/resource-api-articles.html */ export declare class ArticlesApi extends ResourceApi { /** * Gets all articles. * @param params.fields - A list of Article attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.$top - Optional. Specifies the maximum number of entries that are returned in the response. * @param params.$skip - Optional. Specifies the number of returned entities to skip before returning the first one. * @returns The list of articles. */ getArticles(params?: ListParams & FieldsParam): Promise[]>; /** * Creates a new article. * @param body - Required fields: id (the database ID of the article to be linked as a sub-article). * @param params.fields - A list of Article attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.draftId - ID of a draft to publish as a new article. If no draftId is provided, the article is created from scratch. In this case, you must specify the project in the request payload. * @param params.muteUpdateNotifications - Set to true if no notifications should be sent on changes made by this request. * @returns The created article. */ createArticle(body: { id: string; } | Partial
, params?: FieldsParam & MuteUpdateNotificationsParam & { draftId?: string; }): Promise>; /** * Reads an article with a specific ID. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param params.fields - A list of Article attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns The requested article. */ getArticle(articleId: string, params?: FieldsParam): Promise>; /** * Updates a single article. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param body - The updated article data. * @param params.fields - A list of Article attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.muteUpdateNotifications - Set this parameter to true if no notifications should be sent on changes made by this request. This doesn't mute notifications sent by any workflow rules. Using this parameter requires Apply Commands Silently permission in all projects affected by the request. * @returns The updated article. */ updateArticle(articleId: string, body: DeepPartial
, params?: FieldsParam & MuteUpdateNotificationsParam): Promise>; /** * Deletes an article. Note that this operation cannot be undone. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param params.fields - A list of Article attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns The deleted article. */ deleteArticle(articleId: string, params?: FieldsParam): Promise>; /** * Gets a list of all attachments to a specific article. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param params.fields - A list of ArticleAttachment attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.$top - Optional. Specifies the maximum number of entries that are returned in the response. * @param params.$skip - Optional. Specifies the number of returned entities to skip before returning the first one. * @returns The list of attachments for the specified article. */ getArticleAttachments(articleId: string, params?: ListParams & FieldsParam): Promise[]>; /** * Adds an attachment to the article. * @param articleId - ID of the article to which the attachment will be added. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param body - A FormData object with attachment data. * @param params.fields - A list of ArticleAttachment attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.muteUpdateNotifications - Set to true if no notifications should be sent on changes made by this request. * @returns The added attachment. */ createArticleAttachment(articleId: string, body: FormData, params?: FieldsParam & MuteUpdateNotificationsParam): Promise>; /** * Reads a specific attachment in the article. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param attachmentId - The database ID of the attachment. * @param params.fields - A list of ArticleAttachment attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns The requested article attachment. */ getArticleAttachment(articleId: string, attachmentId: string, params?: FieldsParam): Promise>; /** * Updates a specific attachment in the article. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param attachmentId - The database ID of the attachment. * @param body - The fields of the attachment to update. * @param params.fields - A list of ArticleAttachment attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns The updated article attachment. */ updateArticleAttachment(articleId: string, attachmentId: string, body: DeepPartial, params?: FieldsParam): Promise>; /** * Deletes a specific attachment from the article. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param attachmentId - The database ID of the attachment. * @param params.fields - A list of ArticleAttachment attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns The deleted article attachment. */ deleteArticleAttachment(articleId: string, attachmentId: string, params?: FieldsParam): Promise; /** * Gets the list of sub-articles of the current article. * @param articleId - ID of the parent article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param params.fields - A list of Article attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.$top - Optional. Specifies the maximum number of entries that are returned in the response. * @param params.$skip - Optional. Specifies the number of returned entities to skip before returning the first one. * @returns The list of sub-articles. */ getChildArticles(articleId: string, params?: ListParams & FieldsParam): Promise[]>; /** * Adds a new sub-article to the current article. * @param articleId - ID of the parent article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param body - Contains the ID of the sub-article to be linked. * @param params.fields - A list of Article attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.muteUpdateNotifications - Optional. Set to true to mute notifications sent on changes made by this request. * @returns The updated parent article with the sub-article. */ addChildArticle(articleId: string, body: { id: string; } | Partial
, params?: FieldsParam & MuteUpdateNotificationsParam): Promise>; /** * Gets a specific sub-article of the current article. * @param articleId - Id of the parent article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param subArticleId - Id of the sub-article to retrieve. * @param params.fields - A list of Article attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns The requested sub-article. */ getChildArticle(articleId: string, subArticleId: string, params?: FieldsParam): Promise>; /** * Updates a specific sub-article. * @param articleId - ID of the parent article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param subArticleId - ID of the sub-article to update. * @param body - The updated sub-article content. * @param params.fields - A list of Article attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.muteUpdateNotifications - Set to true if no notifications should be sent on changes made by this request. * @returns The updated sub-article. */ updateChildArticle(articleId: string, subArticleId: string, body: DeepPartial
, params?: FieldsParam & MuteUpdateNotificationsParam): Promise>; /** * Removes the parent-child link between the specific sub-article and the current article. * This operation does not delete the specified sub-article. * @param articleId - ID of the parent article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param subArticleId - ID of the sub-article to unlink. * @param params.fields - A list of Article attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns The unlinked sub-article entity. */ removeChildArticleLink(articleId: string, subArticleId: string, params?: FieldsParam): Promise>; /** * Gets all accessible comments to a specific article. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param params.fields - A list of ArticleComment attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.$top - Optional. Specifies the maximum number of entries that are returned in the response. * @param params.$skip - Optional. Specifies the number of returned entities to skip before returning the first one. * @returns The list of article comments. */ getArticleComments(articleId: string, params?: ListParams & FieldsParam): Promise[]>; /** * Adds a new comment to the article. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param body - Required fields: text. * @param params.fields - A list of ArticleComment attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.draftId - Optional. The ID of an existing draft that should be published. * @param params.muteUpdateNotifications - Optional. Set this to true to suppress notifications on changes made by this request. * @returns The added comment. */ createArticleComment(articleId: string, body: { text: string; } | DeepPartial, params?: FieldsParam & MuteUpdateNotificationsParam & { draftId?: string; }): Promise>; /** * Reads a comment with a specific ID. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param commentId - The database ID of the comment. * @param params.fields - A list of ArticleComment attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns The specified comment. */ getArticleComment(articleId: string, commentId: string, params?: FieldsParam): Promise>; /** * Updates an existing comment to a specific article. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param commentId - The database ID of the comment. * @param body - Comment parameters * @param params.fields - A list of ArticleComment attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.muteUpdateNotifications - Set this parameter to true if no notifications should be sent on changes made by this request. * @returns The updated comment. */ updateArticleComment(articleId: string, commentId: string, body: { text: string; } | DeepPartial, params?: FieldsParam & MuteUpdateNotificationsParam): Promise>; /** * Deletes an existing comment to a specific article. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param commentId - The database ID of the comment. * @param params.fields - A list of ArticleComment attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns The deleted comment. */ deleteArticleComment(articleId: string, commentId: string, params?: FieldsParam): Promise>; /** * Gets all accessible reactions to a specific article comment. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param commentId - The database ID of the comment. * @param params.fields - A list of Reaction attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.$top - Optional. Specifies the maximum number of entries that are returned in the response. * @param params.$skip - Optional. Specifies the number of returned entities to skip before returning the first one. * @returns The list of reactions to the comment. */ getArticleCommentReactions(articleId: string, commentId: string, params?: ListParams & FieldsParam): Promise[]>; /** * Adds a new reaction to a comment with a specific ID. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param commentId - The database ID of the comment. * @param body - The reaction paramenters. Required fields: reaction. * @param params.fields - A list of Reaction attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns The added reaction. */ createCommentReaction(articleId: string, commentId: string, body: { reaction: string; } | DeepPartial, params?: FieldsParam): Promise>; /** * Gets a reaction with a specific ID. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param commentId - The database ID of the comment. * @param reactionId - The database ID of the reaction. * @param params.fields - A list of Reaction attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns The specified reaction. */ getCommnetReaction(articleId: string, commentId: string, reactionId: string, params?: FieldsParam): Promise>; /** * Removes a reaction from a comment. Only the author of the reaction can remove it. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param commentId - The database ID of the comment. * @param reactionId - The database ID of the reaction. * @param params.fields - A list of Reaction attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns The result of the delete operation. */ removeCommnetReaction(articleId: string, commentId: string, reactionId: string, params?: FieldsParam): Promise>; /** * Gets the article that is the parent for the current one. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param params.fields - A list of Article attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns The parent article. */ getParentArticle(articleId: string, params?: FieldsParam): Promise>; /** * Gets all tags added to the article that are visible to the current user. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param params.fields - A list of Tag attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @param params.$top - Optional. Specifies the maximum number of entries that are returned in the response. * @param params.$skip - Optional. Specifies the number of returned entities to skip before returning the first one. * @returns The list of tags. */ getArticleTags(articleId: string, params?: ListParams & FieldsParam): Promise[]>; /** * Tags the article with an existing tag. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param body - Tag parameters. Required fields: id - the database ID of the tag. * @param params.fields - A list of Tag attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns The tagged article with updated information. */ createArticleTag(articleId: string, body: { id: string; } | DeepPartial, params?: FieldsParam): Promise>; /** * Reads a specific tag added to the article. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param tagId - The database ID of the tag. * @param params.fields - A list of Tag attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns The requested tag. */ getArticleTag(articleId: string, tagId: string, params?: FieldsParam): Promise>; /** * Removes a specific tag from the article. * @param articleId - ID of the article. You can specify either the database ID (for example, 226-0) or the article ID in the project (for example, NP-A-1). * @param tagId - Database ID of the tag. * @param params.fields - A list of Tag attributes that should be returned in the response. If no field is specified, only the entityId is returned. * @returns The response after removing the tag. */ removeArticleTag(articleId: string, tagId: string, params?: FieldsParam): Promise>; } export {};