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

@waldyn/immersiv-training-shared

v0.13.2

Published

Shared database schema, validators, types, and constants for the Waldyn training platform

Downloads

2,341

Readme

@waldyn/immersiv-training-shared

Shared contract layer for the Waldyn / Teleperformance Immersiv AI Training platform. Consumed by authoring and trainee runtime apps that share the same Postgres-backed contract when they depend on this package from npm.

The package exports:

  • Drizzle table + enum + relation definitions (db/schema, db/enums, db/relations).
  • Zod validators for node configs, routing rules, training metadata, enrollment payloads, and the publish-time structural checklist (validators/*).
  • TypeScript types derived from Drizzle and Zod, plus typed envelopes for the publish-training and duplicate-training Supabase Edge Functions (types, types/publish).
  • Shared constants — node types, routing strategies, progress / training statuses, publish error codes, the canonical idempotency header name (constants, constants/publish).

Released versions of this package track the platform schema contract on npm; consuming apps pin a semver range and follow migration notes per release.


Install

pnpm add @waldyn/immersiv-training-shared
# peer deps used by some subpaths:
pnpm add drizzle-orm zod

0.11.0 adds waitConfigSchema, quiz time_limit_seconds, and node_progress.progress_metadata typing in Drizzle; 0.10.2 already documented videoConfigSchema.text_alternative as WYSIWYG HTML (TipTap, same family as reading rich text).


Common imports

// Top-level re-export (tree-shakeable): everything is available here.
import {
  // Zod validators
  trainingSchema,
  getConfigValidator,
  validateTrainingForPublish,
  // Constants
  NODE_TYPES,
  TRAINING_STATUSES,
  PUBLISH_ERROR_CODES,
  PUBLISH_IDEMPOTENCY_KEY_HEADER,
  // Types (erased at runtime)
  type PublishEdgeResponse,
  type PublishTrainingRpcArgs,
} from '@waldyn/immersiv-training-shared'

Subpath imports for callers that want narrower boundaries:

import { trainings, nodes } from '@waldyn/immersiv-training-shared/db/schema'
import { quizConfigSchema } from '@waldyn/immersiv-training-shared/validators/node-configs'
import { validateTrainingForPublish } from '@waldyn/immersiv-training-shared/validators/publish'
import { PUBLISH_ERROR_CODES } from '@waldyn/immersiv-training-shared/constants/publish'
import type { PublishEdgeResponse } from '@waldyn/immersiv-training-shared/types/publish'

Publish path

The publish path uses a Postgres RPC (publish_training_snapshot) reached through the publish-training Supabase Edge Function (Clerk-verified, service-role caller). See the back office docs/data-contract.md for full details. Consumers of this package should:

  1. Call validateTrainingForPublish(...) in the editor / publish dialog to collect warnings-only structural feedback (data-contract §7). The RPC does not run these checks — they are product guidance surfaced to the author.
  2. Send the publish request to the Edge Function, optionally with an x-idempotency-key UUID header (PUBLISH_IDEMPOTENCY_KEY_HEADER).
  3. Parse the response against PublishEdgeResponse and switch on PUBLISH_ERROR_CODES instead of string-matching messages.

Server-only ledger

The publishIdempotencyKeys Drizzle table is exported for server-side TypeScript only (Edge Functions, admin scripts). RLS is enabled with no policies and no PostgREST grants — there is no path from the browser to this table. Do not import it in browser bundles; it exists so server code gets the same typing the rest of the schema enjoys.


Versioning

This package follows SemVer against the data contract it mirrors. Bumping a table column, enum value, or Zod shape is a breaking change for both consumer apps — coordinate the deploy with the matching Postgres migration in the back office repo.

See the repository CHANGELOG (or git log) for the full version history.