A schema manager for Parse Server
npm i -g @openinc/parse-server-schema
parse-server-schema --help
# or
npm i -D @openinc/parse-server-schema
npx parse-server-schema --help
Here's what a valid JSON file looks like:
{
"masterKey": "my-parse-master-key",
"publicServerURL": "https://my-parse-server.com",
"appId": "my-parse-app-id"
}
parse-server-schema down ./path/to/local/schemas --configPath ./path/to/my-parse-conf.json
parse-server-schema typescript ./path/to/my/local/types --configPath ./path/to/my-parse-conf.json
A GitHub workflow publishes the script automatically to npm when a new version is released. You can trigger this with the following commands:
npm version patch
git push --follow-tags
import { loadConfig, up, down, typescript } from "@openinc/parse-server-schema";
// load JSON file with config
const cfg = await loadConfig("./parse-server-config.json");
// or load config from process.env
const cfg = await loadConfig();
await up(cfg, schemaPath);
await down(cfg, schemaPath);
await typescript(cfg, typescriptPath);