Utility for converting old Adapt schema from the non-conformant properties.schema
style into the new conformant JSON schema format.
The utility can be used directly from a command line. See below for details.
Note: requires Node.js to be installed.
From the command line, run:
npm install -g adapt-security/adapt-octopus
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>
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);
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)