@policynexus/repository-types
v0.1.1
Published
Typedefinitions for PolicyNexus repositories
Downloads
1
Readme
PolicyNexus Repository Types
Type-Definitions for PolicyNexus Repositories. Contains definitions for:
To Contribute to "PolicyNexus Repository Types" please have a look at:
Usage
TypeScript
You can install the Typescript-Types via npm
or yarn
.
npm install @policynexus/repository-types
After that just import the Types into your project aus usual:
import * as PolicyNexus from '@policynexus/repository-types'
const policyNexusDocument: PolicyNexus.Document = {
"$schema": "https://raw.githubusercontent.com/policynexus/repository-types/main/schemas/policynexus-document.schema.json",
"name": "Example Document",
"published": "2024-04-08",
// ...
}
The following types are included in this repository:
- Document
- RepositoryConfig
For more information about these types check out: main.js
JSON-Schema
As the JSON-Schema files are already included in the Repository it is recommended to just use the following files schema-files in a PolicyNexus Repository.
- Document: https://raw.githubusercontent.com/policynexus/repository-types/main/schemas/policynexus-document.schema.json
- RepositoryConfig: https://raw.githubusercontent.com/policynexus/repository-types/main/schemas/policynexus-repository.schema.json
Local Development
Schema Generation
Schema files are generated from the corresponding typescript types. You can update the schema files as follows:
git clone https://github.com/policynexus/repository-types
cd repository-types
npm install --dev
# ...
npm run build
Publish to NPM
If you have access to the PolicyNexus NPM Organization use the following lines to publish your changes:
git clone https://github.com/policynexus/repository-types
cd repository-types
# ...
npm login
npm publish --access public