Skip to content

Type-Definitions for PolicyNexus Repositories.

License

Notifications You must be signed in to change notification settings

policynexus/source-repository-types

Repository files navigation

PolicyNexus Source-Repository Types

Type-Definitions for the Interface formats used in PolicyNexus Repositories.

Installation

You can install the Typescript-Types via npm or yarn.

npm install @policynexus/source-repository-types

The installation is only necessary for use with Typescript. For use with JSON-Schema see below.

Use with Typescript

import * as PolicyNexus from '@policynexus/source-repository-types'

const policyNexusDocument: PolicyNexus.Document = {
    "$schema": "https://raw.githubusercontent.com/policynexus/source-repository-types/main/schemas/policynexus-document.schema.json",
    "name": "Example Document",
    "published": "2024-04-08",
    // ...
}

More TypeScript examples:

Use with JSON-Schema

{
    "$schema": "https://raw.githubusercontent.com/policynexus/source-repository-types/main/schemas/policynexus-document.schema.json",
    "name": "Example Policy",
    "publishedOn": "2021-01-01",
    "artifacts": [
        {
            "type": "pdf",
            "uri": "https://example.com/policy.pdf"
        }
    ],
    // ...
}

More JSON-Schama Examples:

Available JSON-Schemas

Development for Source-Repository Types

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/source-repository-types
cd source-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/source-repository-types
cd source-repository-types
# ...
npm login
npm publish --access public

About

Type-Definitions for PolicyNexus Repositories.

Topics

Resources

License

Stars

Watchers

Forks