bugzilla
Version:
A NodeJS module to access Bugzilla instances through the REST API.
282 lines (281 loc) • 7.54 kB
TypeScript
import type { DateTime } from 'luxon';
import { int, datetime, ObjectSpec, double } from './validators';
type int = number;
type double = number;
type datetime = DateTime;
export interface LoginResponse {
id: int;
token: string;
}
export declare const LoginResponseSpec: ObjectSpec<LoginResponse>;
export interface Version {
version: string;
}
export declare const VersionSpec: ObjectSpec<Version>;
export interface User {
id: int;
name: string;
real_name: string;
}
export declare const UserSpec: ObjectSpec<User>;
export interface SetFlag {
status: string;
name?: string;
type_id?: int;
requestee?: string;
}
export declare const SetFlagSpec: ObjectSpec<SetFlag>;
export interface UpdateFlag extends SetFlag {
id?: int;
new?: boolean;
}
export declare const UpdateFlagSpec: ObjectSpec<UpdateFlag>;
export interface Flag extends SetFlag {
id: int;
creation_date: datetime;
modification_date: datetime;
setter: string;
}
export declare const FlagSpec: ObjectSpec<Flag>;
export interface Bug {
alias: string | string[];
assigned_to: string;
assigned_to_detail: User;
blocks: number[];
cc: string[];
cc_detail: User[];
classification: string;
component: string | string[];
creation_time: datetime;
creator: string;
creator_detail: User;
depends_on: number[];
dupe_of: int | null;
flags: Flag[] | undefined;
groups: string[];
id: int;
is_cc_accessible: boolean;
is_confirmed: boolean;
is_open: boolean;
is_creator_accessible: boolean;
keywords: string[];
last_change_time: datetime;
op_sys: string;
platform: string;
priority: string;
product: string;
qa_contact: string;
qa_contact_detail?: User;
resolution: string;
see_also: string[] | undefined;
severity: string;
status: string;
summary: string;
target_milestone: string;
update_token?: string;
url: string;
version: string | string[];
whiteboard: string;
}
export declare const BugSpec: ObjectSpec<Bug>;
export interface Change {
field_name: string;
removed: string;
added: string;
attachment_id?: int;
}
export declare const ChangeSpec: ObjectSpec<Change>;
export interface History {
when: datetime;
who: string;
changes: Change[];
}
export declare const HistorySpec: ObjectSpec<History>;
export interface BugHistory {
id: int;
alias: string[];
history: History[];
}
export declare const BugHistorySpec: ObjectSpec<BugHistory>;
export interface HistoryLookup {
bugs: BugHistory[];
}
export declare const HistoryLookupSpec: ObjectSpec<HistoryLookup>;
export interface Comment {
attachment_id?: int | null;
bug_id: int;
count: int;
creation_time: datetime;
creator: string;
id: int;
is_private: boolean;
tags: string[];
time: datetime;
text: string;
}
export declare const CommentSpec: ObjectSpec<Comment>;
export interface CommentsTemplate {
comments: Comment[];
}
export declare const CommentsTemplateSpec: ObjectSpec<CommentsTemplate>;
export interface Comments {
bugs: Map<number, CommentsTemplate>;
comments: Map<number, Comment>;
}
export declare const CommentsSpec: ObjectSpec<Comments>;
export interface CreateCommentContent {
comment: string;
is_private: boolean;
}
export interface CreatedComment {
id: int;
}
export declare const CreatedCommentSpec: ObjectSpec<CreatedComment>;
export interface CreateBugContent {
product: string;
component: string;
summary: string;
version: string;
description: string;
op_sys: string;
platform: string;
priority: string;
severity: string;
alias?: string[];
assigned_to?: string;
cc?: string[];
comment_is_private?: boolean;
comment_tags?: string[];
groups?: string[];
keywords?: string[];
qa_contact?: string;
status?: string;
resolution?: string;
target_milestone?: string;
flags?: SetFlag[];
}
export interface CreatedBug {
id: int;
}
export declare const CreatedBugSpec: ObjectSpec<CreatedBug>;
export interface UpdateList<T> {
add?: T[];
remove?: T[];
}
export type UpdateOrReplaceList<T> = UpdateList<T> | {
set?: T[];
};
export interface UpdateBugContent {
id_or_alias: int | string | string[];
ids: (int | string)[];
alias?: UpdateOrReplaceList<string>;
assigned_to?: string;
blocks?: UpdateOrReplaceList<int>;
depends_on?: UpdateOrReplaceList<int>;
cc?: UpdateList<string>;
is_cc_accessible?: boolean;
comment?: CreateCommentContent;
comment_is_private?: Map<number, boolean>;
comment_tags?: string[];
component?: string;
deadline?: datetime;
dupe_of?: int;
estimated_time?: double;
flags?: UpdateFlag[];
groups?: UpdateList<string>;
keywords?: UpdateOrReplaceList<string>;
op_sys?: string;
platform?: string;
priority?: string;
product?: string;
qa_contact?: string;
is_creator_accessible?: boolean;
remaining_time?: double;
reset_assigned_to?: boolean;
reset_qa_contact?: boolean;
resolution?: string;
see_also?: UpdateList<string>;
severity?: string;
status?: string;
summary?: string;
target_milestone?: string;
url?: string;
version?: string;
whiteboard?: string;
work_time?: double;
}
export interface Changes {
added: string;
removed: string;
}
export interface UpdatedBug {
id: int;
alias: string[];
last_change_time: datetime;
changes: Map<Omit<keyof UpdateBugContent, 'id_or_alias' | 'ids' | 'alias'>, Changes>;
}
export declare const UpdatedBugSpec: ObjectSpec<UpdatedBug>;
export interface UpdatedBugTemplate {
bugs: UpdatedBug[];
}
export declare const UpdatedBugTemplateSpec: ObjectSpec<UpdatedBugTemplate>;
export interface Attachment {
data: Buffer;
size: int;
creation_time: datetime;
last_change_time: datetime;
id: int;
bug_id: int;
file_name: string;
summary: string;
content_type: string;
is_private: boolean | int;
is_obsolete: boolean | int;
is_patch: boolean | int;
creator: string;
flags: Flag[];
}
export declare const AttachmentSpec: ObjectSpec<Attachment>;
export interface Attachments {
bugs: Map<number, Attachment[]>;
attachments: Map<number, Attachment>;
}
export declare const AttachmentsSpec: ObjectSpec<Attachments>;
export interface CreateAttachmentContent {
ids: int[];
data: Buffer | ArrayBuffer;
file_name: string;
summary: string;
content_type: string;
comment?: string;
is_patch?: boolean;
is_private?: boolean;
flags?: SetFlag[];
}
export interface CreatedAttachment {
ids: int[];
}
export declare const CreatedAttachmentSpec: ObjectSpec<CreatedAttachment>;
export interface UpdateAttachmentContent {
attachment_id?: int;
ids?: int[];
file_name?: string;
summary?: string;
comment?: string;
content_type?: string;
is_patch?: boolean;
is_private?: boolean;
is_obsolete?: boolean | int;
flags?: UpdateFlag[];
}
export interface UpdatedAttachment {
id: int;
last_change_time: datetime;
changes: Map<Omit<keyof UpdateAttachmentContent, 'attachment_id' | 'ids'>, Changes>;
}
export declare const UpdatedAttachmentSpec: ObjectSpec<UpdatedAttachment>;
export interface UpdatedAttachmentTemplate {
attachments: UpdatedAttachment[];
}
export declare const UpdatedAttachmentTemplateSpec: ObjectSpec<UpdatedAttachmentTemplate>;
export {};