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

openapi-rim-app

v0.1.4

Published

Generates OpenAPI redux-immutable-model application

Downloads

8

Readme

openapi-rim-app

This package provides automatic generation of client source code for redux-immutable-model based applications.

Core Concepts

The intent of this package is to greatly simplify the process of using Redux to consume RESTful APIs that comply with the OpenAPI 3.0 specification. The underlying idea is to work from a specially annotated OpenAPI specification document to generate a set of data model objects and data model containers that act as services that you can leverage within a Redux application. This approach layers on top of Redux and Immutable in ways that should be interoperable.

In addition to generating the data model, this package also generates a set of unit tests that validate / provide code coverage for the generated code.

Data Model Object

Data model objects created by this package have the following characteristics:

  • They have a known inheritance hierarchy:
    • immutable-inherit
      • BaseRimObject
        • Orim

The immutable-inherit object provides a minimum set of key immutable attributes, so that it and its subclasses can be contained in Immutable containers and treated as Immutable objects.

The BaseRIMObject adds behaviors specific to a client representation of a data model object whose persistent state resides within an OpenAPI server. It adds behavior to immutable-inherit to track object state relative to the server (e.g. new, dirty)

The Orim class provides accessor methods for the data properties of the model object as specified in the OpenAPI specification, as well as methods to support API calls.

At the current time, there are some core assumptions about data model objects. The most significant is that each data model object has a UUID that identifies a unique instance of the object, and this object is the primary key for that data model object.

Data Model Services

The data model service class provides collection management for data model objects, as well as action methods to trigger API calls on data model objects.

Some key methods of a data model service include:

  • SaveNew - Save a new data model object
  • SaveUpdate - Save changes to a data model object
  • CreateNew - Return a new, initialized data model object
  • SaveDelete - Delete a data model object

Usage

To use, edit the config.json file to point to the OpenAPI 3.0 specification document in your source tree, then run npm run gen.

Version History

  • 0.1.4 - Added ability to create source directories if they don't exist