npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@redmine/json-api

v1.0.0

Published

The `RedmineBase` class serves as the base class for various other classes used in a Redmine integration. It provides a static method `toCreateFormat(objIns)` and an instance method `toCreate()`.

Downloads

1

Readme

Redmine JSON API

RedmineBase Class

The RedmineBase class serves as the base class for various other classes used in a Redmine integration. It provides a static method toCreateFormat(objIns) and an instance method toCreate().

Static Method

toCreateFormat(objIns)

The toCreateFormat(objIns) method is a static method that transforms an object instance or an array of object instances into a specific format suitable for creating or updating objects in the Redmine system. It recursively traverses the object instances and their prototypes to retrieve data to be sent to the Redmine API.

Parameters

  • objIns: The object instance or an array of object instances to be transformed.

Returns

The method returns an object in a format suitable for creating or updating objects in Redmine.

Instance Method

toCreate()

The toCreate() method is an instance method that should be implemented in the derived classes. It is used to provide data for creating or updating objects in the Redmine system. The method should return an object or a value that represents the data to be sent to Redmine.

Derived Classes

The following classes extend the RedmineBase class and provide specific functionality for creating or updating various Redmine entities.

RedmineValue Class

The RedmineValue class represents a basic Redmine entity with an id and name.

Constructor

  • RedmineValue(id, name): Creates a RedmineValue instance with the given id and name.

Methods

  • toJSON(): Returns an object representing the RedmineValue instance in JSON format.

RedmineProject, RedmineTracker, RedmineStatus, RedmineUser, RedmineAuthor, RedmineAssignedTo, RedmineWatcher Classes

These classes represent specific types of Redmine entities and inherit from the RedmineValue class. They have similar functionality to the RedmineValue class.

RedmineCustomField Class

The RedmineCustomField class represents a custom field in Redmine with an additional value property.

Constructor

  • RedmineCustomField(id, name): Creates a RedmineCustomField instance with the given id and name.

Methods

  • setValue(value): Sets the value property of the RedmineCustomField instance.
  • toJSON(): Returns an object representing the RedmineCustomField instance in JSON format.

RedmineCheckList Class

The RedmineCheckList class represents a checklist in Redmine.

Constructor

  • RedmineCheckList(): Creates a RedmineCheckList instance.

RedmineCustomFieldMultiple Class

The RedmineCustomFieldMultiple class represents a custom field in Redmine that can hold multiple values.

Constructor

  • RedmineCustomFieldMultiple(id, name): Creates a RedmineCustomFieldMultiple instance with the given id and name.

Methods

  • addValue(value): Adds a value to the value array of the RedmineCustomFieldMultiple instance.
  • setValue(list): Sets the value array of the RedmineCustomFieldMultiple instance with the given list of values.
  • toJSON(): Returns an object representing the RedmineCustomFieldMultiple instance in JSON format.

RedmineIssue Class

The RedmineIssue class represents an issue in Redmine and extends the RedmineBase class.

Constructor

  • RedmineIssue(): Creates a RedmineIssue instance.

Methods

  • setProject(project): Sets the project of the issue.
  • setTracker(tracker): Sets the tracker of the issue.
  • setStatus(status): Sets the status of the issue.
  • setAuthor(author): Sets the author of the issue.
  • setAssignedTo(assigned_to): Sets the assigned-to user of the issue.
  • setSubject(subject): Sets the subject of the issue.
  • setDescription(description): Sets the description of the issue.
  • addCustomFields(custom_field): Adds a custom field to the issue.
  • addWatchers(watcher): Adds a watcher to the issue.
  • setWatchers(...watchers): Sets the watchers of the issue with multiple watcher objects.
  • setDueDate(due_date): Sets the due date of the issue.
  • setEstimatedHours(estimated_hours): Sets the estimated hours of the issue.
  • addCheckList(subject, is_done): Adds a checklist item to the issue.
  • setCheckList(...list): Sets the checklist of the issue with multiple checklist items.

Note: The RedmineIssue class does not have a toCreate() method. It relies on the toCreate() method defined in its parent classes (RedmineBase and RedmineValue) to generate the necessary data for creating or updating the issue in Redmine.