@happyvertical/smrt-products 0.51.32 → 0.51.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/lib/app/main.d.ts +9 -0
  2. package/dist/lib/chunks/{__smrt-register__-BBA7MNne.js → __smrt-register__-BEtlNhX9.js} +2 -2
  3. package/dist/lib/chunks/{__smrt-register__-BBA7MNne.js.map → __smrt-register__-BEtlNhX9.js.map} +1 -1
  4. package/dist/lib/chunks/{collections-DsvZvlcc.js → collections-BjoIglyI.js} +2 -2
  5. package/dist/lib/chunks/{collections-DsvZvlcc.js.map → collections-BjoIglyI.js.map} +1 -1
  6. package/dist/lib/chunks/{generated-Co-Mj97W.js → generated-Djxxc_bW.js} +2 -2
  7. package/dist/lib/chunks/{generated-Co-Mj97W.js.map → generated-Djxxc_bW.js.map} +1 -1
  8. package/dist/lib/chunks/models-DfljuffS.js +2 -0
  9. package/dist/lib/collections.js +1 -1
  10. package/dist/lib/generated.js +1 -1
  11. package/dist/lib/index.d.ts +18 -0
  12. package/dist/lib/index.js +4 -4
  13. package/dist/lib/lib/collections/CategoryCollection.d.ts +3 -0
  14. package/dist/lib/lib/collections/MaterialCollection.d.ts +7 -1
  15. package/dist/lib/lib/collections/ProductAssetCollection.d.ts +3 -2
  16. package/dist/lib/lib/collections/ProductCollection.d.ts +1 -1
  17. package/dist/lib/lib/collections/ProductVariantCollection.d.ts +8 -0
  18. package/dist/lib/lib/collections/SkuCollection.d.ts +5 -0
  19. package/dist/lib/lib/collections/index.d.ts +1 -0
  20. package/dist/lib/lib/generated/index.d.ts +9 -0
  21. package/dist/lib/lib/mock-smrt-client.d.ts +7 -1
  22. package/dist/lib/lib/models/Category.d.ts +6 -1
  23. package/dist/lib/lib/models/Material.d.ts +14 -3
  24. package/dist/lib/lib/models/Product.d.ts +7 -2
  25. package/dist/lib/lib/models/ProductAsset.d.ts +2 -1
  26. package/dist/lib/lib/models/ProductVariant.d.ts +24 -1
  27. package/dist/lib/lib/models/Sku.d.ts +22 -1
  28. package/dist/lib/lib/models/index.d.ts +11 -0
  29. package/dist/lib/manifest.json +1 -1
  30. package/dist/lib/models.js +1 -1
  31. package/dist/lib/smrt-knowledge.json +4 -4
  32. package/package.json +10 -10
  33. package/dist/lib/chunks/models-CIZqZgKA.js +0 -2
@@ -1,3 +1,6 @@
1
+ /**
2
+ * CategoryCollection — Collection manager for {@link Category} objects.
3
+ */
1
4
  import { SmrtCollection } from '@happyvertical/smrt-core';
2
5
  import { Category } from '../models/Category';
3
6
  export declare class CategoryCollection extends SmrtCollection<Category> {
@@ -1,5 +1,11 @@
1
+ /**
2
+ * MaterialCollection — Collection manager for {@link Material} objects.
3
+ *
4
+ * STI framework auto-filters by `_meta_type` to return only Material rows
5
+ * from the shared `products` table.
6
+ */
1
7
  import { Material } from '../models/Material';
2
- import { MaterialKind } from '../models/types';
8
+ import type { MaterialKind } from '../models/types';
3
9
  import { ProductCollection } from './ProductCollection';
4
10
  export declare class MaterialCollection extends ProductCollection {
5
11
  static readonly _itemClass: typeof Material;
@@ -1,5 +1,6 @@
1
- import { Asset } from '@happyvertical/smrt-assets';
2
- import { SmrtCollectionOptions, SmrtJunction } from '@happyvertical/smrt-core';
1
+ import type { Asset } from '@happyvertical/smrt-assets';
2
+ import type { SmrtCollectionOptions } from '@happyvertical/smrt-core';
3
+ import { SmrtJunction } from '@happyvertical/smrt-core';
3
4
  import { ProductAsset } from '../models/ProductAsset';
4
5
  export interface ProductAssetCollectionOptions extends SmrtCollectionOptions {
5
6
  }
@@ -1,4 +1,4 @@
1
- import { Asset } from '@happyvertical/smrt-assets';
1
+ import type { Asset } from '@happyvertical/smrt-assets';
2
2
  import { SmrtCollection } from '@happyvertical/smrt-core';
3
3
  import { Product } from '../models/Product';
4
4
  export declare class ProductCollection extends SmrtCollection<Product> {
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ProductVariantCollection — read helpers for {@link ProductVariant} rows.
3
+ *
4
+ * {@link ProductVariant} is a standalone model (not a Product STI subtype),
5
+ * so this collection drives its own table (`product_variants`). Helper
6
+ * methods cover the two common query patterns: "what axes does this
7
+ * product vary along?" and "tell me about the size axis specifically."
8
+ */
1
9
  import { SmrtCollection } from '@happyvertical/smrt-core';
2
10
  import { ProductVariant } from '../models/ProductVariant';
3
11
  export declare class ProductVariantCollection extends SmrtCollection<ProductVariant> {
@@ -1,3 +1,8 @@
1
+ /**
2
+ * SkuCollection — query helpers for {@link Sku} rows.
3
+ *
4
+ * @packageDocumentation
5
+ */
1
6
  import { SmrtCollection } from '@happyvertical/smrt-core';
2
7
  import { Sku } from '../models/Sku';
3
8
  export declare class SkuCollection extends SmrtCollection<Sku> {
@@ -1,3 +1,4 @@
1
+ import '../../__smrt-register__.js';
1
2
  export { CategoryCollection } from './CategoryCollection';
2
3
  export { MaterialCollection } from './MaterialCollection';
3
4
  export { ProductAssetCollection } from './ProductAssetCollection';
@@ -1,2 +1,11 @@
1
+ /**
2
+ * Auto-generated SMRT Components
3
+ *
4
+ * This file is automatically generated by the SMRT Vite plugin.
5
+ * It exports UI components that are auto-generated from @smrt() decorated classes.
6
+ *
7
+ * DO NOT EDIT THIS FILE MANUALLY - it will be overwritten.
8
+ */
9
+ import '../../__smrt-register__.js';
1
10
  export declare const autoGeneratedComponents: {};
2
11
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,10 @@
1
- import { ProductData } from './types';
1
+ /**
2
+ * Mock SMRT Client - Temporary implementation for demo purposes
3
+ *
4
+ * This replaces the missing @smrt/client virtual module with a working implementation
5
+ * that demonstrates the intended functionality.
6
+ */
7
+ import type { ProductData } from './types';
2
8
  export type { ProductData } from './types';
3
9
  export interface ApiResponse<T> {
4
10
  data: T;
@@ -1,4 +1,9 @@
1
- import { SmrtObject, SmrtObjectOptions } from '@happyvertical/smrt-core';
1
+ /**
2
+ * Product knowledge base category model
3
+ *
4
+ * SMRT auto-generates REST APIs, MCP tools, and TypeScript clients from this class.
5
+ */
6
+ import { SmrtObject, type SmrtObjectOptions } from '@happyvertical/smrt-core';
2
7
  /**
3
8
  * Options for Category initialization
4
9
  */
@@ -1,6 +1,17 @@
1
- import { Meta } from '@happyvertical/smrt-core';
2
- import { Product, ProductOptions } from './Product';
3
- import { MaterialKind, ProductType } from './types';
1
+ /**
2
+ * Material — STI subtype of Product representing a raw input consumed by
3
+ * manufacturing: fabric, thread, trim, labels, packaging, components.
4
+ *
5
+ * Materials are first-class products in the catalog (the SAP/NetSuite pattern):
6
+ * they have a name, description, vendor, unit cost, and live in inventory just
7
+ * like finished goods. Bills of materials in `@happyvertical/smrt-manufacturing`
8
+ * reference Materials by id.
9
+ *
10
+ * @packageDocumentation
11
+ */
12
+ import { type Meta } from '@happyvertical/smrt-core';
13
+ import { Product, type ProductOptions } from './Product';
14
+ import { type MaterialKind, ProductType } from './types';
4
15
  export interface MaterialOptions extends ProductOptions {
5
16
  materialKind?: MaterialKind;
6
17
  uom?: string;
@@ -1,5 +1,10 @@
1
- import { Asset } from '@happyvertical/smrt-assets';
2
- import { SmrtObject, SmrtObjectOptions } from '@happyvertical/smrt-core';
1
+ /**
2
+ * Product knowledge base model
3
+ *
4
+ * SMRT auto-generates REST APIs, MCP tools, and TypeScript clients from this class.
5
+ */
6
+ import type { Asset } from '@happyvertical/smrt-assets';
7
+ import { SmrtObject, type SmrtObjectOptions } from '@happyvertical/smrt-core';
3
8
  import { ProductType } from './types';
4
9
  /**
5
10
  * Options for Product initialization
@@ -1,4 +1,5 @@
1
- import { SmrtObjectOptions, SmrtObject } from '@happyvertical/smrt-core';
1
+ import type { SmrtObjectOptions } from '@happyvertical/smrt-core';
2
+ import { SmrtObject } from '@happyvertical/smrt-core';
2
3
  export interface ProductAssetOptions extends SmrtObjectOptions {
3
4
  tenantId?: string | null;
4
5
  productId?: string;
@@ -1,4 +1,27 @@
1
- import { SmrtObject, SmrtObjectOptions } from '@happyvertical/smrt-core';
1
+ /**
2
+ * ProductVariant — declarative description of one axis along which a
3
+ * product's SKUs differ.
4
+ *
5
+ * A `ProductVariant` row says "for product X, axis Y has the following
6
+ * allowed values". The actual per-SKU value lives on `Sku.attributes`
7
+ * (also in this package — `Sku` was relocated to `@happyvertical/smrt-products`
8
+ * in Phase 1; inventory only holds stock motion now), keyed by `axisName`.
9
+ * This split keeps the axis catalog (form choices, UI grouping, ordering)
10
+ * separate from the per-unit instances.
11
+ *
12
+ * Deliberately generic. `axisName` is free-form — apparel teams might
13
+ * use `'size'` and `'color'`, automotive teams `'trim'` and `'engine'`,
14
+ * CPG teams `'packSize'` and `'flavor'`. The framework never inspects
15
+ * the axis name.
16
+ *
17
+ * NOT a Product STI subtype — it's its own model with its own table,
18
+ * because the shape (axis declaration) doesn't fit the Product schema
19
+ * (no name, no price, no category — it's metadata about a Product, not
20
+ * a Product itself).
21
+ *
22
+ * @packageDocumentation
23
+ */
24
+ import { SmrtObject, type SmrtObjectOptions } from '@happyvertical/smrt-core';
2
25
  /**
3
26
  * Options accepted by the {@link ProductVariant} constructor.
4
27
  */
@@ -1,4 +1,25 @@
1
- import { SmrtObject, SmrtObjectOptions } from '@happyvertical/smrt-core';
1
+ /**
2
+ * Sku — smallest sellable and countable unit.
3
+ *
4
+ * A SKU is the concrete catalog row that downstream inventory counts.
5
+ * It references a higher-level concept in this same package (a
6
+ * {@link Product} or any of its STI subtypes) via the plain string
7
+ * `productId` field. The same pattern serves apparel (one SKU per
8
+ * size/color), furniture (one SKU per finish), automotive parts,
9
+ * grocery (one SKU per pack size), or any other vertical that needs
10
+ * to count discrete units.
11
+ *
12
+ * Axis values such as `{ size: 'M', color: 'navy' }`, `{ finish: 'walnut' }`,
13
+ * or `{ packSize: '12oz' }` are stored as opaque JSON in `attributes`;
14
+ * the declarative axis catalog lives in {@link ProductVariant} in this
15
+ * same package.
16
+ *
17
+ * Stock balance and movement history for a SKU live in
18
+ * `@happyvertical/smrt-inventory` as `StockLevel` and `StockMovement`.
19
+ *
20
+ * @packageDocumentation
21
+ */
22
+ import { SmrtObject, type SmrtObjectOptions } from '@happyvertical/smrt-core';
2
23
  /**
3
24
  * Options accepted by the {@link Sku} constructor.
4
25
  */
@@ -1,3 +1,14 @@
1
+ /**
2
+ * SMRT Template Models
3
+ *
4
+ * Domain models that demonstrate SMRT auto-generation capabilities.
5
+ * These classes are decorated with @smrt() and automatically generate:
6
+ * - REST APIs
7
+ * - TypeScript clients
8
+ * - MCP tools for AI
9
+ * - UI components
10
+ */
11
+ import '../../__smrt-register__.js';
1
12
  export type { CategoryOptions } from './Category';
2
13
  export { Category } from './Category';
3
14
  export type { MaterialOptions } from './Material';
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-products",
5
- "packageVersion": "0.51.32",
5
+ "packageVersion": "0.51.33",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-products:CategoryCollection": {
8
8
  "name": "categorycollection",
@@ -1,3 +1,3 @@
1
1
  import { a as Product, i as Material, n as ProductVariant, o as ProductType, r as ProductAsset, s as Category, t as Sku } from "./chunks/Sku-Bq9Fr-2f.js";
2
- import "./chunks/models-CIZqZgKA.js";
2
+ import "./chunks/models-DfljuffS.js";
3
3
  export { Category, Material, Product, ProductAsset, ProductType, ProductVariant, Sku };
@@ -3,12 +3,12 @@
3
3
  "sensitiveFieldsExcluded": true,
4
4
  "generatedAt": "1970-01-01T00:00:00.000Z",
5
5
  "packageName": "@happyvertical/smrt-products",
6
- "packageVersion": "0.51.32",
6
+ "packageVersion": "0.51.33",
7
7
  "sourceManifestPath": "dist/lib/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "4548023529322c349ea4e892561facd074bee59a49f8f0256c18452a7722c8c9",
11
- "packageJson": "6185da36b2d35d0efe5956f4527f0ca7b445b5f0fa7daa77811f5cca1885a79b",
10
+ "manifest": "d0f5a22585e5c717f5624b2337d5ca92462f714108059c2ee970ad9e7fddf2db",
11
+ "packageJson": "2419137cc53296034e50b868fdb1aa4dd778e8f981107f9ff0ac228dfc0b1a98",
12
12
  "agents": "4ddde01c48baf13de773cdb57353a148f3fe3b93d21e99d8ac57677cda809e26"
13
13
  },
14
14
  "exports": [
@@ -48,7 +48,7 @@
48
48
  "concurrently": "^10.0.5",
49
49
  "svelte": "^5.57.1",
50
50
  "svelte-check": "^4.7.6",
51
- "typescript": "5.9.3",
51
+ "typescript": "6.0.3",
52
52
  "vite": "8.1.4",
53
53
  "vitest": "4.1.10"
54
54
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-products",
3
- "version": "0.51.32",
3
+ "version": "0.51.33",
4
4
  "smrtJsdoc": "strict",
5
5
  "description": "SMRT products module: triple-purpose microservice template for standalone apps, federated modules, and NPM libraries",
6
6
  "author": "HappyVertical",
@@ -57,13 +57,13 @@
57
57
  "@happyvertical/ai": "^0.94.1",
58
58
  "@happyvertical/files": "^0.94.1",
59
59
  "@happyvertical/logger": "^0.94.1",
60
- "@happyvertical/smrt-assets": "0.51.32",
61
- "@happyvertical/smrt-core": "0.51.32",
62
- "@happyvertical/smrt-scanner": "0.51.32",
63
- "@happyvertical/smrt-svelte": "0.51.32",
64
- "@happyvertical/smrt-tenancy": "0.51.32",
65
- "@happyvertical/smrt-ui": "0.51.32",
66
- "@happyvertical/smrt-web": "0.51.32",
60
+ "@happyvertical/smrt-assets": "0.51.33",
61
+ "@happyvertical/smrt-core": "0.51.33",
62
+ "@happyvertical/smrt-scanner": "0.51.33",
63
+ "@happyvertical/smrt-svelte": "0.51.33",
64
+ "@happyvertical/smrt-tenancy": "0.51.33",
65
+ "@happyvertical/smrt-ui": "0.51.33",
66
+ "@happyvertical/smrt-web": "0.51.33",
67
67
  "@happyvertical/sql": "^0.94.1",
68
68
  "@happyvertical/utils": "^0.94.1",
69
69
  "cors": "^2.8.6",
@@ -84,11 +84,11 @@
84
84
  "@types/cors": "2.8.19",
85
85
  "@types/express": "^5.0.6",
86
86
  "@types/node": "24.13.6",
87
- "@happyvertical/smrt-vitest": "0.51.32",
87
+ "@happyvertical/smrt-vitest": "0.51.33",
88
88
  "concurrently": "^10.0.5",
89
89
  "svelte": "^5.57.1",
90
90
  "svelte-check": "^4.7.6",
91
- "typescript": "5.9.3",
91
+ "typescript": "6.0.3",
92
92
  "vite": "8.1.4",
93
93
  "vitest": "4.1.10"
94
94
  },
@@ -1,2 +0,0 @@
1
- import "./__smrt-register__-BBA7MNne.js";
2
- import "./Sku-Bq9Fr-2f.js";