Skip to content

Convert old Adapt schema into conformant JSON schema

Notifications You must be signed in to change notification settings

adapt-security/adapt-octopus

 
 

Repository files navigation

🐙 adapt-octopus

Utility for converting old Adapt schema from the non-conformant properties.schema style into the new conformant JSON schema format.

Command-line

The utility can be used directly from a command line. See below for details.

Installation

Note: requires Node.js to be installed.

From the command line, run:

npm install -g adapt-security/adapt-octopus

Usage

To convert a single schema, simply run the following:

adapt-octopus <inputPath> <id>
  • ID should match the value of the component/extension/menu/theme attribute in a plugin’s bower.json.

To convert all schemas in a framework source repository, run:

adapt-octopus <inputPath>

Programmatic

The utility also exports a Node.js API for use programatically.

import octopus from 'adapt-security/adapt-octopus'
// to run for a single schema, use the following (returns a promise)
octopus.run(options);
// to run for multiple schemas, use the following (returns a promise)
octopus.runRecursive(options);

Options

The following options can be passed to the run functions:

  • cwd: the current working directory (used when searching and writing files)
  • inputPath: required when calling run should be the path to the input schema
  • inputId: required when calling run the type of the schema being converted (accepted values: component, extension, menu, theme)
  • logger: an instance to a logger to be used when logging status messages (must export a log function)

About

Convert old Adapt schema into conformant JSON schema

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%