@blade-and-brawn/domain
Shared models, enums, and utility functions with no dependencies on any other
workspace package — used by packages/calculator, packages/commerce,
apps/api, and apps/portal to avoid duplicating core types.
Exports
Models (src/models.ts)
Attribute—Strength/Power/Endurance/AgilityActivity—BackSquat/Deadlift/BenchPress/Run/BroadJump/ConeDrillGender—Male/FemaleMetrics/Player/ActivityPerformance— typebox schemas + types for a player's age/weight/gender and their performance on a given activity
Utils (src/utils.ts)
- Unit conversions:
lbToKg,kgToLb,minToMs,secToMs,msToMin,ftToCm,inToCm,cmToIn,msToTime range(length),clamp(x, lo, hi)parseRetryAfterMs(header, defaultMs)— parses aRetry-Afterheader (seconds or HTTP date) for backoff, used by the Printful/Webflow clientsRateLimitError— thrown bypackages/commerceclients on HTTP 429