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

@massdriver/forms

v1.0.25

Published

Massdriver's wrapper for RJSF providing access to custom fields, widgets, & templates.

Downloads

39

Readme

massdriver-forms

Massdriver's wrapper for RJSF.

Getting Started

  1. Run npm install @massdriver/forms

  2. Create a new Form.js file.

  3. Create a list of services to provide the Form. These services will be consumed by specific fields to populate them with data from a remote source.

  4. Create a wrapper with your custom Form services configuration:

import createForm from '@massdriver/forms'

const Form = props => {

  const MassdriverForm = createForm({
    services: {
      // services go here
    }
  })

  return (
    <MassdriverForm {...props} />
  )
}

Services

Here is an entire list of services and where they are consumed:

getContainerRepositories

Consumed by: containerRepositoriesDropdown

/**
* @param {Object: { cloud: String }}
*
* @return {Object: {
*  data: [
*   {
*     cloud: String,
*     cloudProviderId: String,
*     location: String,
*     name: String
*   },
*   ...
* ],
* loading: Boolean,
* error: Undefined || {
*   messages: [message: String, ...]
* }
* }}
*/

// Example:

const getContainerRepositories(options) => {
  const {cloud} = options

  return {
    data: [
      {
        cloud: 'aws',
        cloudProviderId: '1',
        location: 'us-west',
        name: 'Repository 1'
      },
      {
        cloud: 'gcp',
        cloudProviderId: '2',
        location: 'us-east',
        name: 'Repository 2'
      }
    ],
    loading: false,
    error: undefined
  }
}

getFilteredArtifactCredentials

Consumed by: filteredArtifactCredentialsDropdown

/**
* @param {Object: { type: String }}
*
* @return {Object: {
*  data: [
*   {
*     id: String,
*     name: String
*   },
*   ...
* ],
* loading: Boolean,
* error: Undefined || {
*   messages: [message: String, ...]
* }
* }}
*/

// Example:

const getFilteredArtifactCredentials(options) => {
  const {type} = options

  return {
    data: [
      {
        id: '1',
        name: 'Credential 1'
      },
      {
        id: '2',
        name: 'Credential 2'
      }
    ],
    loading: false,
    error: undefined
  }
}

getSupportedCloudLocations

Consumed by: supportedCloudLocationsDropdown

/**
* @param {Object: { cloudService: String }}
*
* @return {Object: {
*  data: [location: String, ...],
* loading: Boolean,
* error: Undefined || {
*   messages: [message: String, ...]
* }
* }}
*/

// Example:

const getSupportedCloudLocations(options) => {
  const {cloudService} = options

  return {
    data: [
      "us-west",
      "us-east"
    ],
    loading: false,
    error: undefined
  }
}

getDnsZones

Consumed by: dnsZonesDropdown

/**
* @param {Object: { cloud: String }}
*
* @return {Object: {
*  data: [
*   {
*     cloud: String,
*     cloudProviderId: String,
*     location: String,
*     name: String,
*     id: String
*   },
*   ...
* ],
* loading: Boolean,
* error: Undefined || {
*   messages: [message: String, ...]
* }
* }}
*/

// Example:

const getDnsZones(options) => {
  const {cloud} = options

  return {
    data: [
      {
        cloud: 'aws',
        cloudProviderId: '1',
        location: 'us-west',
        name: 'DNS Zone 1',
        id: '1'
      },
      {
        cloud: 'gcp',
        cloudProviderId: '2',
        location: 'us-east',
        name: 'DNS Zone 2',
        id: '2'
      }
    ],
    loading: false,
    error: undefined
  }
}

getInstanceTypes

Consumed by: instanceTypesDropdown

/**
* @param {Object: {
*   manifestId: String,
*   targetId: String,
*   query: String,
*   service: String
* }}
*
* @return {Object: {
*  data: [
*   {
*     name: String,
*     size: String,
*     iops: String,
*     vCpus: String,
*     memoryGB: String
*   },
*   ...
* ],
* loading: Boolean,
* error: Undefined || {
*   messages: [message: String, ...]
* }
* }}
*/

// Example:

const getInstanceTypes(options) => {
  const {manifestId, targetId, query, service} = options

  return {
    data: [
      {
        name: 'GP_Standard_D2ds_v4',
        size: 'D2ds',
        iops: '3200',
        vCpus: '2',
        memoryGB: '8'
      },
      {
        name: 'GP_Standard_D4ds_v4',
        size: 'D4ds',
        iops: '6400',
        vCpus: '4',
        memoryGB: '16'
      },
    ],
    loading: false,
    error: undefined
  }
}

getArtifactDefinitions

Consumed by: artifactDefinitionsDropdown

/**
* @param {Object: {
*   filter: {
*     isCredential: Boolean,
*     service: String
*   }
* }}
*
* @return {Object: {
*  data: [
*   {
*     name: String,
*     id: String
*   },
*   ...
* ],
* loading: Boolean,
* error: Undefined || {
*   messages: [message: String, ...]
* }
* }}
*/

// Example:

const getArtifactDefinitions(options) => {
  const {filter} = options

  return {
    data: [
      {
        name: 'massdriver/aws-api-gateway',
        id: '1'
      },
      {
        name: 'massdriver/aws-vpc',
        id: '2'
      },
    ],
    loading: false,
    error: undefined
  }
}

getCredentials

Consumed by: credentialsDropdown

/**
* @param {}
*
* @return {Object: {
*  data: [
*   {
*     type: String,
*     name: String,
*     id: String
*   },
*   ...
* ],
* loading: Boolean,
* error: Undefined || {
*   messages: [message: String, ...]
* }
* }}
*/

// Example:

const getCredentials(options) => {
  const {filter} = options

  return {
    data: [
      {
        name: 'AWS Credential',
        type: 'massdriver/aws-iam-role',
        id: '1'
      },
      {
        name: 'GCP Credential',
        type: 'massdriver/gcp-service-account',
        id: '2'
      },
    ],
    loading: false,
    error: undefined
  }
}