npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@eventconnectors/ndtrc_model

v1.2.1

Published

Zod schemas for the NDTRC tourism data model — TypeScript port of the Groovy ndtrc_model library

Downloads

113

Readme

@eventconnectors/ndtrc_model

Zod schemas for the NDTRC tourism data model — a TypeScript port of the Groovy ndtrc_model library. Every entity, enum, and nested type from the Groovy source has a matching Zod schema with field-for-field parity, enforced by automated tests.

Installation

npm install @eventconnectors/ndtrc_model

Requires zod as a peer dependency (v3.x).

Quick start

Validating an API response

Use the *Response schema variants for data coming back from the FeedFactory API. These require server-guaranteed fields (trcid, entitytype, creationdate, etc.) to be present:

import { TRCItemResponseSchema } from "@eventconnectors/ndtrc_model";

const response = await fetch("https://api.feedfactory.nl/...");
const json = await response.json();

const item = TRCItemResponseSchema.parse(json);
// item.trcid is string (required, not optional)

Building a request body

Use the primary schema for constructing outbound payloads. All fields are optional — you only set what you need:

import { TRCItemSchema } from "@eventconnectors/ndtrc_model";

const draft = TRCItemSchema.parse({
  entitytype: "EVENEMENT",
  trcItemDetails: [{ lang: "nl", shortdescription: "Koningsdag" }],
});

Entity type aliases

Convenience types narrow entitytype to a specific literal:

import type { Event, LocationItemEntity, Venue, Route, EventGroup } from "@eventconnectors/ndtrc_model";

These are intersection types (TRCItem & { entitytype: "EVENEMENT" }, etc.) and work with any Zod-parsed TRCItem.

.passthrough() policy

All schemas use .passthrough() by default — unknown keys in the input are preserved, not stripped. This means the API can add new fields without breaking your code.

To opt into strict validation (reject unknown keys), call .strict() on any schema:

import { GISCoordinateSchema } from "@eventconnectors/ndtrc_model";

const strict = GISCoordinateSchema.strict();
strict.parse({ xcoordinate: "5.12", unknownField: true }); // throws ZodError

Extending schemas

Use Zod's .extend() to add fields that exist in the wire format but aren't in the Groovy model:

import { TRCItemSchema } from "@eventconnectors/ndtrc_model";
import { z } from "zod";

const MyTRCItemSchema = TRCItemSchema.extend({
  customScore: z.number().optional(),
});

Version lockstep

This package version tracks the Groovy ndtrc_model version. When the Groovy model adds or changes fields, a corresponding release of this package follows with the same version bump. Automated parity tests ensure no field drift between the two.

Exported schemas

Every schema and its inferred TypeScript type are exported from the package root. Key entities:

| Schema | Description | |---|---| | TRCItemSchema / TRCItemResponseSchema | Core tourism item (event, location, venue, route) | | TRCItemGroupSchema | Event group with event links | | CalendarSchema / CalendarResponseSchema | Opening hours, single dates, patterns, exceptions | | ContactinfoSchema | Phone, mail, fax, URLs | | FileSchema | Media files and titles | | LocationSchema | Location with address and GIS coordinates | | PriceElementSchema | Pricing with descriptions and values | | PromotionSchema | Promotions, discounts, validity strategies | | RouteInfoSchema | Route details with POIs and coordinates | | SeoMetadataSchema | SEO configuration and canonical URLs | | ConvertedEntrySchema | Converter pipeline wrapper | | FetchedEntrySchema | Fetcher pipeline wrapper |

See the source index for the full export list.

License

Apache-2.0