import type { MappedYoutrackIssue, MappedYoutrackIssueComment, MappedYoutrackIssueDetails, MappedYoutrackWorkItem } from "./utils/mappers.js"; /** * Discriminator strings used by the YouTrack REST API in `$type` fields. * * Hard-coding these strings inline lets typos slip past the type-checker * (e.g. "StateIssueField" vs "StateIssueCustomField"). Reference this map * instead so that misspellings fail at compile time. */ export declare const YOUTRACK_ENTITY_TYPE: { readonly stateField: "StateIssueCustomField"; readonly stateMachineField: "StateMachineIssueCustomField"; readonly singleUserField: "SingleUserIssueCustomField"; readonly singleEnumField: "SingleEnumIssueCustomField"; readonly multiEnumField: "MultiEnumIssueCustomField"; readonly textField: "TextIssueCustomField"; readonly periodField: "PeriodIssueCustomField"; readonly dateField: "DateIssueCustomField"; readonly simpleField: "SimpleIssueCustomField"; readonly stateBundleElement: "StateBundleElement"; readonly enumBundleElement: "EnumBundleElement"; readonly event: "Event"; }; export type YoutrackEntityType = (typeof YOUTRACK_ENTITY_TYPE)[keyof typeof YOUTRACK_ENTITY_TYPE]; export interface ServiceInfo { name: string; version: string; description?: string | undefined; } export type UserAliasMap = Record; export interface YoutrackConfig { baseUrl: string; token: string; timezone: string; holidays?: string[] | undefined; preHolidays?: string[] | undefined; userAliases?: UserAliasMap | undefined; defaultProject?: string | undefined; outputDir: string; /** * Whitelist root for `issue_attachment_upload` source files. Defaults to * `outputDir` when not provided. Files outside this directory are rejected. */ uploadDir?: string | undefined; /** * Whether command-based fallbacks (link create/delete via `/api/commands`) * apply silently. Silent apply requires the YouTrack "Apply Commands * Silently" permission; accounts without it get HTTP 403. Defaults to false * so link operations work for any account that can run commands. */ silentCommands?: boolean | undefined; } export interface DurationValue { minutes?: number | undefined; presentation?: string | undefined; $type?: string; } export interface YoutrackProject { id: string; shortName: string; name?: string | undefined; } export interface YoutrackIssueWatchers { hasStar: boolean; $type: string; } export interface YoutrackIssue { id: string; idReadable: string; summary?: string | undefined; description?: string | undefined; wikifiedDescription?: string | undefined; usesMarkdown?: boolean | undefined; project?: YoutrackProject | undefined; parent?: { idReadable: string; id?: string; } | null; assignee?: YoutrackUser | null | undefined; watchers?: YoutrackIssueWatchers | null | undefined; customFields?: YoutrackCustomField[] | undefined; } export interface PartialOperationItemError { index: number; message: string; } export interface PartialOperationError { operation: string; message: string; details?: PartialOperationItemError[] | undefined; } export interface IssueCreatePayload extends IssueLookupPayload { partialErrors?: PartialOperationError[] | undefined; } export interface YoutrackIssueCreateCustomFieldInput { name: string; value: string | string[]; } export interface YoutrackIssueCreateInput { projectId?: string | undefined; summary: string; description?: string | undefined; parentIssueId?: string | undefined; assigneeLogin?: string | undefined; stateName?: string | undefined; customFields?: YoutrackIssueCreateCustomFieldInput[] | undefined; inheritCustomFieldsFromParent?: boolean | undefined; links?: Array<{ linkType: string; targetId: string; sourceId?: string | undefined; direction?: "inbound" | "outbound" | undefined; }> | undefined; usesMarkdown?: boolean | undefined; } export interface YoutrackIssueUpdateInput { issueId: string; summary?: string | undefined; description?: string | undefined; parentIssueId?: string | null | undefined; usesMarkdown?: boolean | undefined; } export interface YoutrackIssueAssignInput { issueId: string; assigneeLogin: string; } export interface YoutrackUser { id: string; login: string; name?: string | undefined; fullName?: string | undefined; email?: string | undefined; } export interface YoutrackUserListPayload { users: YoutrackUser[]; } export interface YoutrackProjectListPayload { projects: YoutrackProject[]; } export interface YoutrackWorkItem { id: string; date: number; updated?: number | undefined; duration: DurationValue; text?: string | undefined; textPreview?: string | undefined; usesMarkdown?: boolean | undefined; description?: string | undefined; issue: { idReadable: string; id?: string | undefined; }; author?: YoutrackUser | undefined; } export interface YoutrackWorkItemCreateInput { issueId: string; date: string | number | Date; minutes: number; summary?: string | undefined; description?: string | undefined; usesMarkdown?: boolean | undefined; } export interface YoutrackWorkItemUpdateInput { issueId: string; workItemId: string; date?: string | number | Date | undefined; minutes?: number | undefined; summary?: string | undefined; description?: string | undefined; usesMarkdown?: boolean | undefined; } export interface YoutrackWorkItemPeriodCreateInput { issueId: string; startDate: string | number | Date; endDate: string | number | Date; minutes: number; summary?: string | undefined; description?: string | undefined; usesMarkdown?: boolean | undefined; excludeWeekends?: boolean | undefined; excludeHolidays?: boolean | undefined; holidays?: Array | undefined; preHolidays?: Array | undefined; } export interface YoutrackWorkItemIdempotentCreateInput { issueId: string; date: string | number | Date; minutes: number; description: string; usesMarkdown?: boolean | undefined; } export interface YoutrackWorkItemReportOptions { author?: string | undefined; startDate?: string | number | Date | undefined; endDate?: string | number | Date | undefined; issueId?: string | undefined; expectedDailyMinutes?: number | undefined; excludeWeekends?: boolean | undefined; excludeHolidays?: boolean | undefined; holidays?: Array | undefined; preHolidays?: Array | undefined; allUsers?: boolean | undefined; } export interface ServiceStatusPayload { service: ServiceInfo; configuration: { hasToken: boolean; baseUrl: string | null; timezone?: string | undefined; outputDir?: string | undefined; holidays?: string[] | undefined; preHolidays?: string[] | undefined; }; } export interface IssueLookupPayload { issue: MappedYoutrackIssue; } export interface WorkItemsPayload { items: MappedYoutrackWorkItem[]; } export interface WorkItemCreatePayload { item: MappedYoutrackWorkItem; } export interface WorkItemUpdatePayload { item: MappedYoutrackWorkItem; } export interface WorkItemDeletePayload { issueId: string; workItemId: string; deleted: true; } export interface YoutrackIssueDetails extends YoutrackIssue { created?: number | null | undefined; updated?: number | null | undefined; resolved?: number | null | undefined; reporter?: YoutrackUser | undefined; updater?: YoutrackUser | undefined; } export interface IssueDetailsPayload { issue: MappedYoutrackIssueDetails; } export interface IssueStateInfo { id?: string | undefined; name?: string | undefined; presentation?: string | undefined; } export interface IssueStatePayload { issueId: string; state: IssueStateInfo | null; } export interface YoutrackIssueComment { id: string; text?: string | undefined; textPreview?: string | undefined; usesMarkdown?: boolean | undefined; author?: YoutrackUser | undefined; created: number; updated?: number | undefined; } export interface IssueCommentsPayload { comments: MappedYoutrackIssueComment[]; } export interface IssueCommentCreateInput { issueId: string; text: string; usesMarkdown?: boolean | undefined; } export interface IssueCommentUpdateInput { issueId: string; commentId: string; text?: string | undefined; usesMarkdown?: boolean | undefined; muteUpdateNotifications?: boolean | undefined; } export interface YoutrackActivityItem { id: string; timestamp: number; author?: YoutrackUser | undefined; category?: { id: string; } | undefined; target?: { text?: string; } | undefined; added?: Array<{ name?: string; id?: string; login?: string; }>; removed?: Array<{ name?: string; id?: string; login?: string; }>; $type?: string; } export interface IssueCommentCreatePayload { comment: MappedYoutrackIssueComment; } export interface IssueCommentUpdatePayload { comment: MappedYoutrackIssueComment; issueId: string; commentId: string; } export interface WorkItemReportDay { date: string; expectedMinutes: number; actualMinutes: number; difference: number; percent: number; items: MappedYoutrackWorkItem[]; } export interface WorkItemSummary { totalMinutes: number; totalHours: number; expectedMinutes: number; expectedHours: number; workDays: number; averageHoursPerDay: number; } export interface WorkItemReportPayload { summary: WorkItemSummary; days: WorkItemReportDay[]; period: { startDate: string; endDate: string; }; invalidDays: WorkItemInvalidDay[]; } export interface WorkItemBulkResultPayload { created: MappedYoutrackWorkItem[]; failed: Array<{ date: string; reason: string; }>; } export interface WorkItemInvalidDay { date: string; expectedMinutes: number; actualMinutes: number; difference: number; percent: number; items: MappedYoutrackWorkItem[]; } export interface WorkItemUsersReportPayload { reports: Array<{ userLogin: string; summary: WorkItemSummary; invalidDays: WorkItemInvalidDay[]; period: { startDate: string; endDate: string; }; }>; } export interface WorkItemsForUsersPayload { items: MappedYoutrackWorkItem[]; users: string[]; } export interface WorkItemsAllUsersPayload { items: MappedYoutrackWorkItem[]; } export interface WorkItemIdempotentCreatePayload { created: boolean; item: MappedYoutrackWorkItem | null; } export interface YoutrackArticle { id: string; idReadable: string; summary: string; content?: string | undefined; contentPreview?: string | undefined; usesMarkdown?: boolean | undefined; parentArticle?: { id: string; idReadable: string; }; childArticles?: Array<{ id: string; idReadable: string; summary: string; }>; project?: { id: string; shortName: string; name?: string | undefined; }; } export interface ArticlePayload { article: YoutrackArticle; } export interface ArticleListPayload { articles: YoutrackArticle[]; } export interface ArticleCreateInput { summary: string; content?: string | undefined; parentArticleId?: string | undefined; projectId?: string | undefined; usesMarkdown?: boolean | undefined; returnRendered?: boolean | undefined; } export interface ArticleUpdateInput { articleId: string; summary?: string | undefined; content?: string | undefined; usesMarkdown?: boolean | undefined; returnRendered?: boolean | undefined; } export interface ArticleSearchInput { query: string; projectId?: string | undefined; parentArticleId?: string | undefined; limit?: number | undefined; returnRendered?: boolean | undefined; } export interface ArticleSearchPayload { articles: YoutrackArticle[]; query: string; } export interface IssueSearchInput { userLogins: string[]; startDate?: string | number | Date | undefined; endDate?: string | number | Date | undefined; dateFilterMode?: "issue_updated" | "user_activity" | undefined; briefOutput?: boolean | undefined; limit?: number | undefined; skip?: number | undefined; } export interface IssueSearchPayload { issues: Array; userLogins: string[]; period?: { startDate?: string | undefined; endDate?: string | undefined; }; pagination: { returned: number; limit: number; skip: number; }; } export interface IssueListInput { projectIds?: string[] | undefined; createdAfter?: string | number | Date | undefined; createdBefore?: string | number | Date | undefined; updatedAfter?: string | number | Date | undefined; updatedBefore?: string | number | Date | undefined; statuses?: string[] | undefined; assigneeLogin?: string | undefined; types?: string[] | undefined; sortField?: "created" | "updated" | undefined; sortDirection?: "asc" | "desc" | undefined; briefOutput?: boolean | undefined; limit?: number | undefined; skip?: number | undefined; } export interface IssueListPayload { issues: MappedYoutrackIssue[]; filters: { projectIds?: string[] | undefined; createdAfter?: string | undefined; createdBefore?: string | undefined; updatedAfter?: string | undefined; updatedBefore?: string | undefined; statuses?: string[] | undefined; assigneeLogin?: string | undefined; types?: string[] | undefined; }; sort: { field: "created" | "updated"; direction: "asc" | "desc"; }; pagination: { returned: number; limit: number; skip: number; }; } export interface IssueCountInput { projectIds?: string[] | undefined; createdAfter?: string | number | Date | undefined; createdBefore?: string | number | Date | undefined; updatedAfter?: string | number | Date | undefined; updatedBefore?: string | number | Date | undefined; statuses?: string[] | undefined; assigneeLogin?: string | undefined; types?: string[] | undefined; top?: number | undefined; } export interface IssueProjectCount { projectId: string | null; projectShortName?: string | undefined; projectName?: string | undefined; requestedId?: string | undefined; count: number; } export interface IssueCountPayload { total: number; projects: IssueProjectCount[]; filters: { projectIds?: string[] | undefined; createdAfter?: string | undefined; createdBefore?: string | undefined; updatedAfter?: string | undefined; updatedBefore?: string | undefined; statuses?: string[] | undefined; assigneeLogin?: string | undefined; types?: string[] | undefined; top?: number | undefined; }; /** * True when the fallback pagination hit FALLBACK_COUNT_HARD_LIMIT before * exhausting the result set. Callers should treat `total` as a lower bound. */ partial?: boolean | undefined; } export interface IssueError { issueId: string; error: string; } export interface IssuesLookupPayload { issues: MappedYoutrackIssue[]; errors?: IssueError[] | undefined; } export interface IssuesDetailsPayload { issues: MappedYoutrackIssueDetails[]; errors?: IssueError[] | undefined; } export interface IssuesCommentsPayload { commentsByIssue: Record; errors?: IssueError[] | undefined; } export interface YoutrackIssueLinkType { id: string; name?: string | undefined; directed?: boolean | undefined; outwardName?: string | undefined; inwardName?: string | undefined; sourceToTarget?: string | undefined; targetToSource?: string | undefined; } export type YoutrackIssueLinkDirection = string; export interface YoutrackIssueLink { id: string; direction: YoutrackIssueLinkDirection; linkType: YoutrackIssueLinkType; source: { idReadable: string; }; issue: { idReadable: string; summary?: string | undefined; project?: { id: string; shortName: string; name?: string | undefined; } | undefined; assignee?: YoutrackUser | null | undefined; }; } export type MappedYoutrackIssueLink = YoutrackIssueLink; export interface IssueLinksPayload { issueId: string; links: MappedYoutrackIssueLink[]; } export interface IssueLinkTypesPayload { types: YoutrackIssueLinkType[]; } export interface IssueLinkCreateInput { sourceId: string; targetId: string; linkType: string; direction?: "inbound" | "outbound" | undefined; } export interface IssueLinkCreatePayload { link: MappedYoutrackIssueLink; } export interface IssueLinkDeleteInput { issueId: string; linkId: string; linkType?: string | undefined; targetId?: string | undefined; } export interface IssueLinkDeletePayload { deleted: boolean; issueId: string; linkId: string; message?: string | undefined; } export interface YoutrackAttachment { id: string; name: string; author?: YoutrackUser | undefined; created: number; updated?: number | undefined; size: number; mimeType?: string | undefined; url?: string | undefined; thumbnailURL?: string | undefined; extension?: string | undefined; charset?: string | undefined; base64Content?: string | undefined; } export interface MappedYoutrackAttachment { id: string; name: string; author?: { id: string; login: string; name?: string | undefined; } | undefined; created: string; updated?: string | undefined; size: number; sizeFormatted: string; mimeType?: string | undefined; extension?: string | undefined; url?: string | undefined; thumbnailURL?: string | undefined; } export interface AttachmentsListPayload { attachments: MappedYoutrackAttachment[]; issueId: string; } export interface AttachmentPayload { attachment: MappedYoutrackAttachment; issueId: string; } export interface AttachmentDownloadPayload { attachment: MappedYoutrackAttachment; downloadUrl: string; issueId: string; } export interface AttachmentUploadInput { issueId: string; filePaths: string[]; muteUpdateNotifications?: boolean | undefined; } export interface AttachmentUploadPayload { uploaded: MappedYoutrackAttachment[]; issueId: string; } export interface AttachmentDeleteInput { issueId: string; attachmentId: string; confirmation: boolean; } export interface AttachmentDeletePayload { deleted: true; issueId: string; attachmentId: string; attachmentName: string; } export interface YoutrackStateEvent { id: string; presentation: string; $type?: string; } export interface YoutrackCustomFieldValue { id?: string | undefined; name?: string | undefined; login?: string | undefined; presentation?: string | undefined; $type?: string; } export interface YoutrackCustomField { id: string; name: string; value?: YoutrackCustomFieldValue | undefined; possibleEvents?: YoutrackStateEvent[] | undefined; $type: string; } export interface YoutrackStateField extends YoutrackCustomField { $type: "StateMachineIssueCustomField"; possibleEvents: YoutrackStateEvent[]; } export interface YoutrackSimpleStateField extends YoutrackCustomField { $type: "StateIssueCustomField"; value?: { id: string; name: string; presentation?: string | undefined; $type: "StateBundleElement"; }; } export interface IssueChangeStateInput { issueId: string; stateName: string; } export interface IssueChangeStatePayload { issueId: string; previousState?: string | undefined; newState: string; transitionUsed?: string | undefined; } export interface IssueChangeTypeInput { issueId: string; typeName: string; } export interface IssueChangeTypePayload { issueId: string; previousType?: string | undefined; newType: string; } export interface MappedYoutrackActivityItem { id: string; timestamp: string; author?: { id: string; login: string; name?: string | undefined; } | undefined; category?: { id: string; } | undefined; target?: { text?: string | undefined; } | undefined; added?: Array<{ name?: string | undefined; id?: string | undefined; login?: string | undefined; }> | undefined; removed?: Array<{ name?: string | undefined; id?: string | undefined; login?: string | undefined; }> | undefined; $type?: string | undefined; } export interface IssueActivitiesPayload { activities: MappedYoutrackActivityItem[]; issueId: string; filters?: { author?: string | undefined; startDate?: string | undefined; endDate?: string | undefined; categories?: string | undefined; }; pagination?: { returned: number; total: number; limit?: number | undefined; skip?: number | undefined; }; } export interface YoutrackIssueWatcher { id: string; user: YoutrackUser; isStarred: boolean; $type: string; } export interface IssueStarInput { issueId: string; } export interface IssueStarBatchInput { issueIds: string[]; } export interface IssueStarPayload { issueId: string; starred: boolean; message?: string | undefined; } export interface IssueStarBatchPayload { successful: Array<{ issueId: string; starred: boolean; }>; failed: Array<{ issueId: string; error: string; }>; } export interface PaginationInfo { returned: number; limit: number; skip: number; } export interface IssuesStarredPayload { issues: MappedYoutrackIssue[]; returnedCount: number; pagination: PaginationInfo; } //# sourceMappingURL=types.d.ts.map