10.1.0 • Published 1 year ago

tuan-plugin-manifest-validator v10.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@kintone/plugin-manifest-validator

npm version Node.js version License

Validate manifest.json of kintone plugin. Used in @kintone/plugin-packer.

How to install

$ npm install @kintone/plugin-manifest-validator

Usage

const validator = require("@kintone/plugin-manifest-validator");

const manifestJson = require("./path/to/your/manifest.json");
const result = validator(manifestJson);
console.log(result.valid); // true or false
console.log(result.errors); // array of ajv error objects
console.log(result.warnings); // string array

ajv error objects is like:

{
  dataPath: '/version',
  keyword: 'type',
  message: 'should be integer',
  params: {
    type: 'integer',
  },
  schemaPath: '#/properties/version/type',
}

manifest-schema.json

JSON schema for manifest.json is available.

const manifestJsonSchema = require("@kintone/plugin-manifest-validator/manifest-schema.json");

manifest-schema.d.ts

TypeScript type definition (d.ts) for manifest.json is available.

import { KintonePluginManifestJson } from "@kintone/plugin-manifest-validator/manifest-schema";

let manifest: KintonePluginManifestJson;

License

MIT License

10.1.0

1 year ago