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

@mj-biz-apps/orders-entities

v5.14.0

Published

MJ BizApps Orders Entity Subclasses

Readme

@mj-biz-apps/orders-entities

Generated entity subclasses and Zod schemas for every table in __mj_BizAppsOrders. Browser-safe: depends on @memberjunction/core and zod, nothing server-side.

Do not edit anything in src/generated/

CodeGen rewrites it wholesale from the database. Edits are lost at the next run, silently, and usually at the worst moment.

To change what appears here, change the schema:

# 1. edit the baseline migration (pre-1.0 practice: edit in place, never fix-up migrations)
# 2. rebuild from zero and regenerate
scripts/rebuild-db.sh          # trims the generated half, applies hand-authored DDL only
npm run mj:codegen             # regenerates everything, since the DB is now bare
scripts/append-codegen.sh      # puts the generated SQL back below the banner
npm run mj -- sync push --dir metadata

That cycle is self-consistent by construction: the rebuild deliberately drops the generated half first, because otherwise it produces a database whose metadata is already current and CodeGen emits only a delta.

What CodeGen gives you, and what it does not

Does: a typed class per entity, a Zod schema per entity, string-union types derived from CHECK constraints (OrderType, Status, PricingModel…), and field descriptions lifted from the migration's MS_Description extended properties.

That last one is why the migration is so heavily commented — those comments become the developer documentation and the AI-facing metadata. A column added without an extended property arrives here undocumented.

Does not: business rules. Every invariant lives in @mj-biz-apps/orders-core-entities-server, whose subclasses override Save() and are resolved by ClassFactory at runtime. Instantiating an entity from this package on the client gets you the shape; the rules run on the server.

Two things that will bite

Union types come from CHECK constraints. Widening a CHECK widens the type — a breaking change to consumers even though no TypeScript was touched. Narrowing one is worse: existing rows become unrepresentable.

A repeated column name inside a CHECK can break generation. CodeGen derives validation method names from the constraint expression, and repeating a column produced a call to ValidatePromotionOrReasonRequiredReasonRequiredReasonRequired against a method defined as ValidatePromotionOrReasonRequired — a build break in generated code. Name the column once (ISNULL(col, '') rather than col IS NOT NULL AND col <> ''). Reported upstream.