nhs-notify-event-schemas-template-management 1.1.1
Install from the command line:
Learn more about npm packages
$ npm install @nhsdigital/nhs-notify-event-schemas-template-management@1.1.1
Install via package.json:
"@nhsdigital/nhs-notify-event-schemas-template-management": "1.1.1"
About this version
Zod validators, TypeScript type definitions, JSON Schemas and Sample Events for events emitted by Template Management service
To install this package from GitHub package registry, you will need to configure an .npmrc file with the following:
//npm.pkg.github.com/:_authToken=<GITHUB_TOKEN>
@nhsdigital:registry=https://npm.pkg.github.comwhere GITHUB_TOKEN is a classic PAT with the packages:read scope.
Then run npm install @nhsdigital/nhs-notify-event-schemas-template-management
TemplateCompletedTemplateDeletedTemplateDrafted
Zod validators for each event type are exported along with an accompanying type definition:
import {
$TemplateCompletedEvent,
$TemplateDeletedEvent,
$TemplateDraftedEvent,
type TemplateCompletedEvent,
type TemplateDeletedEvent,
type TemplateDraftedEvent,
} from '@nhsdigital/nhs-notify-event-schemas-template-management';
$TemplateCompletedEvent.parse(event);
$TemplateDeletedEvent.parse(event);
$TemplateDraftedEvent.parse(event);JSON Schema files for each event type are included in the package. These are generated from the Zod schemas and can be imported as follows:
import TemplateCompletedEventV1Schema from '@nhsdigital/nhs-notify-event-schemas-template-management/schemas/TemplateCompleted/v1.json';
import TemplateDeletedEventV1Schema from '@nhsdigital/nhs-notify-event-schemas-template-management/schemas/TemplateDeleted/v1.json';
import TemplateDraftedEventV1Schema from '@nhsdigital/nhs-notify-event-schemas-template-management/schemas/TemplateDrafted/v1.json';A number of sample event files are also included for each event type. These can be imported as follows:
import EmailTemplateCompletedEvent from '@nhsdigital/nhs-notify-event-schemas-template-management/examples/TemplateCompleted/v1/email.json';
import SmsTemplateDeletedEventV1Schema from '@nhsdigital/nhs-notify-event-schemas-template-management/examples/TemplateDeleted/v1/sms.json';
import NhsAppTemplateDraftedEventV1Schema from '@nhsdigital/nhs-notify-event-schemas-template-management/examples/TemplateDrafted/v1/nhsapp.json';Details
- nhs-notify-event-schemas-template-management
-
NHSDigital
- 5 months ago
- MIT
- 11 dependencies
Assets
- nhs-notify-event-schemas-template-management-1.1.1.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0