Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bugzilla

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bugzilla

A NodeJS module to access Bugzilla instances through the REST API.

  • 1.1.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
186
increased by4550%
Maintainers
1
Weekly downloads
 
Created
Source

Bugzilla

Typesafe access to Bugzilla's REST API.

Very early work in progress, getting info from a bug or searching bugs is the main priority right now.

No tests as yet. This is a quick and dirty implementation to support a side project I'm working on.

API

Creating the API instance

import BugzillaAPI from "bugzilla";

let api = new BugzillaAPI("https://bugzilla.mozilla.org", "<api key>");
await api.version();

Or for username/password authentication:

import BugzillaAPI from "bugzilla";

let api = new BugzillaAPI("https://bugzilla.mozilla.org", "<username>", "<password>");
await api.version();

Retrieving bugs by ID

let bug = await api.getBug(123456);

let bugs = await api.getBugs([123456, 123457]);

Querying bugs

You can use a quicksearch string:

let bugs = await api.quicksearch("severity:blocker,critical");

Or any advanced search which can be passed in a number of ways:

// You can just pass a full advanced search url:
let bugs = await api.advancedSearch("https://bugzilla.mozilla.org/buglist.cgi?email1=dtownsend%40mozilla.com&emailassigned_to1=1&resolution=---&emailtype1=exact&list_id=15603348");

// Or just the query string part:
let bugs = await api.advancedSearch("email1=dtownsend%40mozilla.com&emailassigned_to1=1&resolution=---&emailtype1=exact&list_id=15603348");

// Or as a record:
let bugs = await api.advancedSearch({
  email1: "dtownsend@mozilla.com",
  emailassigned_to1: "1",
  resolution: "---",
  emailtype1: "exact",
});

Filtering bug fields

To reduce bandwidth or improve performance it is possible to filter the fields returned by functions that return bugs:

// To only retrieve certain fields.
let bug = await api.getBug(123456).include(["id", "product", "component"]);

// Or to filter out certain fields.
let bug = await api.getBug(123456).exclude(["cc_detail"]);

Assuming you use a static array the returned types will correctly reflect to available fields.

Currently the _all, _default, _extra and _custom special field shortcuts are not currently supported.

Custom fields are not currently returned.

Keywords

FAQs

Package last updated on 21 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc