@happyvertical/smrt-products 0.60.9 → 0.60.10

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.
@@ -1 +1 @@
1
- {"version":3,"file":"collections-C9hgL1qy.js","names":[],"sources":["../../../src/lib/collections/CategoryCollection.ts","../../../src/lib/collections/MaterialCollection.ts","../../../src/lib/collections/ProductVariantCollection.ts","../../../src/lib/collections/SkuCollection.ts"],"sourcesContent":["/**\n * CategoryCollection — Collection manager for {@link Category} objects.\n */\n\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { Category } from '../models/Category';\n\nexport class CategoryCollection extends SmrtCollection<Category> {\n static readonly _itemClass = Category;\n\n /**\n * Return every top-level category. `parentId` on `Category` is typed\n * `string | undefined`; SMRT serializes undefined string fields as `''`\n * rather than `NULL`, so a category created without an explicit\n * `parentId` lands in the DB with `parent_id = ''`, not `parent_id IS NULL`.\n *\n * We accept both shapes — historical data, migrations, and direct DB\n * imports can produce either — so consumers don't have to normalize\n * `parentId` on write to be discoverable as a root. SQL's `IN` operator\n * does NOT match `NULL` (NULL is not equal to anything, including itself\n * inside an IN list), so the empty-string and NULL cases must run as\n * separate queries and merge.\n */\n async getRootCategories(): Promise<Category[]> {\n const [emptyParents, nullParents] = await Promise.all([\n this.list({ where: { parentId: '' } }),\n this.list({ where: { parentId: null } }),\n ]);\n\n if (emptyParents.length === 0) return nullParents;\n if (nullParents.length === 0) return emptyParents;\n\n // De-dupe by id in case a row somehow shows up in both lists.\n const seen = new Set<string>();\n const merged: Category[] = [];\n for (const row of [...emptyParents, ...nullParents]) {\n const id = row.id ?? '';\n if (!id || seen.has(id)) continue;\n seen.add(id);\n merged.push(row);\n }\n return merged;\n }\n}\n","/**\n * MaterialCollection — Collection manager for {@link Material} objects.\n *\n * STI framework auto-filters by `_meta_type` to return only Material rows\n * from the shared `products` table.\n */\n\nimport { Material } from '../models/Material';\nimport type { MaterialKind } from '../models/types';\nimport { ProductCollection } from './ProductCollection';\n\nexport class MaterialCollection extends ProductCollection {\n static override readonly _itemClass = Material;\n\n /**\n * Find every {@link Material} with the given kind.\n *\n * `materialKind` is an `@meta()` field — it lives inside the shared\n * `_meta_data` JSON column on `products`, not as its own SQL column.\n * That means a naive `list({ where: { materialKind } })` would generate\n * a WHERE on a non-existent column. We list every Material STI row and\n * filter the hydrated instances in JS.\n *\n * For very large catalogs, consumers should add a generated column or\n * an expression index over the JSON path and override this helper.\n */\n async findByKind(materialKind: MaterialKind): Promise<Material[]> {\n const items = (await this.list({})) as Material[];\n return items.filter((m) => m.materialKind === materialKind);\n }\n}\n","/**\n * ProductVariantCollection — read helpers for {@link ProductVariant} rows.\n *\n * {@link ProductVariant} is a standalone model (not a Product STI subtype),\n * so this collection drives its own table (`product_variants`). Helper\n * methods cover the two common query patterns: \"what axes does this\n * product vary along?\" and \"tell me about the size axis specifically.\"\n */\n\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { ProductVariant } from '../models/ProductVariant';\n\nexport class ProductVariantCollection extends SmrtCollection<ProductVariant> {\n static readonly _itemClass = ProductVariant;\n\n /** Every axis declaration for a given product, in display order. */\n async findForProduct(productId: string): Promise<ProductVariant[]> {\n return this.list({\n where: { productId },\n orderBy: 'sortOrder ASC',\n });\n }\n\n /** The axis declaration for a `(productId, axisName)` pair, or null. */\n async findAxis(\n productId: string,\n axisName: string,\n ): Promise<ProductVariant | null> {\n const matches = await this.list({\n where: { productId, axisName },\n limit: 1,\n });\n return matches[0] ?? null;\n }\n}\n","/**\n * SkuCollection — query helpers for {@link Sku} rows.\n *\n * @packageDocumentation\n */\n\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { Sku } from '../models/Sku';\n\nexport class SkuCollection extends SmrtCollection<Sku> {\n static readonly _itemClass = Sku;\n\n /**\n * Look up a SKU by its tenant-scoped `code` (UPC, internal part\n * number, etc.). Returns `null` when no row matches.\n */\n async findByCode(code: string): Promise<Sku | null> {\n const matches = await this.list({ where: { code }, limit: 1 });\n return matches[0] ?? null;\n }\n\n /**\n * Look up a SKU by its scannable barcode. Returns `null` when no row\n * matches; pass `''` to skip the query early.\n */\n async findByBarcode(barcode: string): Promise<Sku | null> {\n if (!barcode) return null;\n const matches = await this.list({ where: { barcode }, limit: 1 });\n return matches[0] ?? null;\n }\n\n /**\n * Find every SKU pointing at the given `Product` id (or any Product\n * STI subtype id — `Material` upstream, vertical subtypes defined in\n * templates). Useful for listing the SKUs that back a single product\n * card.\n */\n async findByProduct(productId: string): Promise<Sku[]> {\n return this.list({ where: { productId }, orderBy: 'code ASC' });\n }\n\n /**\n * Find every SKU that is a component of the given parent SKU (for\n * bundles / kits). Returns an empty array when the parent has no\n * children.\n */\n async findByParent(parentSkuId: string): Promise<Sku[]> {\n return this.list({ where: { parentSkuId }, orderBy: 'code ASC' });\n }\n\n /** Find every active SKU, optionally narrowed by parent product id. */\n async findActive(productId?: string): Promise<Sku[]> {\n const where: Record<string, unknown> = { active: true };\n if (productId) where.productId = productId;\n return this.list({ where, orderBy: 'code ASC' });\n }\n}\n"],"mappings":";;;;;;;;;AAOA,IAAa,qBAAb,cAAwC,eAAyB;CAC/D,OAAgB,aAAa;;;;;;;;;;;;;;CAe7B,MAAM,oBAAyC;EAC7C,MAAM,CAAC,cAAc,eAAe,MAAM,QAAQ,IAAI,CACpD,KAAK,KAAK,EAAE,OAAO,EAAE,UAAU,GAAG,EAAE,CAAC,GACrC,KAAK,KAAK,EAAE,OAAO,EAAE,UAAU,KAAK,EAAE,CAAC,CACzC,CAAC;EAED,IAAI,aAAa,WAAW,GAAG,OAAO;EACtC,IAAI,YAAY,WAAW,GAAG,OAAO;EAGrC,MAAM,uBAAO,IAAI,IAAY;EAC7B,MAAM,SAAqB,CAAC;EAC5B,KAAK,MAAM,OAAO,CAAC,GAAG,cAAc,GAAG,WAAW,GAAG;GACnD,MAAM,KAAK,IAAI,MAAM;GACrB,IAAI,CAAC,MAAM,KAAK,IAAI,EAAE,GAAG;GACzB,KAAK,IAAI,EAAE;GACX,OAAO,KAAK,GAAG;EACjB;EACA,OAAO;CACT;AACF;;;;;;;;;AChCA,IAAa,qBAAb,cAAwC,kBAAkB;CACxD,OAAyB,aAAa;;;;;;;;;;;;;CActC,MAAM,WAAW,cAAiD;EAEhE,QAAO,MADc,KAAK,KAAK,CAAC,CAAC,EAAA,CACpB,QAAQ,MAAM,EAAE,iBAAiB,YAAY;CAC5D;AACF;;;;;;;;;;;AClBA,IAAa,2BAAb,cAA8C,eAA+B;CAC3E,OAAgB,aAAa;;CAG7B,MAAM,eAAe,WAA8C;EACjE,OAAO,KAAK,KAAK;GACf,OAAO,EAAE,UAAU;GACnB,SAAS;EACX,CAAC;CACH;;CAGA,MAAM,SACJ,WACA,UACgC;EAKhC,QAAO,MAJe,KAAK,KAAK;GAC9B,OAAO;IAAE;IAAW;GAAS;GAC7B,OAAO;EACT,CAAC,EAAA,CACc,MAAM;CACvB;AACF;;;;;;;;ACzBA,IAAa,gBAAb,cAAmC,eAAoB;CACrD,OAAgB,aAAa;;;;;CAM7B,MAAM,WAAW,MAAmC;EAElD,QAAO,MADe,KAAK,KAAK;GAAE,OAAO,EAAE,KAAK;GAAG,OAAO;EAAE,CAAC,EAAA,CAC9C,MAAM;CACvB;;;;;CAMA,MAAM,cAAc,SAAsC;EACxD,IAAI,CAAC,SAAS,OAAO;EAErB,QAAO,MADe,KAAK,KAAK;GAAE,OAAO,EAAE,QAAQ;GAAG,OAAO;EAAE,CAAC,EAAA,CACjD,MAAM;CACvB;;;;;;;CAQA,MAAM,cAAc,WAAmC;EACrD,OAAO,KAAK,KAAK;GAAE,OAAO,EAAE,UAAU;GAAG,SAAS;EAAW,CAAC;CAChE;;;;;;CAOA,MAAM,aAAa,aAAqC;EACtD,OAAO,KAAK,KAAK;GAAE,OAAO,EAAE,YAAY;GAAG,SAAS;EAAW,CAAC;CAClE;;CAGA,MAAM,WAAW,WAAoC;EACnD,MAAM,QAAiC,EAAE,QAAQ,KAAK;EACtD,IAAI,WAAW,MAAM,YAAY;EACjC,OAAO,KAAK,KAAK;GAAE;GAAO,SAAS;EAAW,CAAC;CACjD;AACF"}
1
+ {"version":3,"file":"collections-CK2V6uto.js","names":[],"sources":["../../../src/lib/collections/CategoryCollection.ts","../../../src/lib/collections/MaterialCollection.ts","../../../src/lib/collections/ProductVariantCollection.ts","../../../src/lib/collections/SkuCollection.ts"],"sourcesContent":["/**\n * CategoryCollection — Collection manager for {@link Category} objects.\n */\n\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { Category } from '../models/Category';\n\nexport class CategoryCollection extends SmrtCollection<Category> {\n static readonly _itemClass = Category;\n\n /**\n * Return every top-level category. `parentId` on `Category` is typed\n * `string | undefined`; SMRT serializes undefined string fields as `''`\n * rather than `NULL`, so a category created without an explicit\n * `parentId` lands in the DB with `parent_id = ''`, not `parent_id IS NULL`.\n *\n * We accept both shapes — historical data, migrations, and direct DB\n * imports can produce either — so consumers don't have to normalize\n * `parentId` on write to be discoverable as a root. SQL's `IN` operator\n * does NOT match `NULL` (NULL is not equal to anything, including itself\n * inside an IN list), so the empty-string and NULL cases must run as\n * separate queries and merge.\n */\n async getRootCategories(): Promise<Category[]> {\n const [emptyParents, nullParents] = await Promise.all([\n this.list({ where: { parentId: '' } }),\n this.list({ where: { parentId: null } }),\n ]);\n\n if (emptyParents.length === 0) return nullParents;\n if (nullParents.length === 0) return emptyParents;\n\n // De-dupe by id in case a row somehow shows up in both lists.\n const seen = new Set<string>();\n const merged: Category[] = [];\n for (const row of [...emptyParents, ...nullParents]) {\n const id = row.id ?? '';\n if (!id || seen.has(id)) continue;\n seen.add(id);\n merged.push(row);\n }\n return merged;\n }\n}\n","/**\n * MaterialCollection — Collection manager for {@link Material} objects.\n *\n * STI framework auto-filters by `_meta_type` to return only Material rows\n * from the shared `products` table.\n */\n\nimport { Material } from '../models/Material';\nimport type { MaterialKind } from '../models/types';\nimport { ProductCollection } from './ProductCollection';\n\nexport class MaterialCollection extends ProductCollection {\n static override readonly _itemClass = Material;\n\n /**\n * Find every {@link Material} with the given kind.\n *\n * `materialKind` is an `@meta()` field — it lives inside the shared\n * `_meta_data` JSON column on `products`, not as its own SQL column.\n * That means a naive `list({ where: { materialKind } })` would generate\n * a WHERE on a non-existent column. We list every Material STI row and\n * filter the hydrated instances in JS.\n *\n * For very large catalogs, consumers should add a generated column or\n * an expression index over the JSON path and override this helper.\n */\n async findByKind(materialKind: MaterialKind): Promise<Material[]> {\n const items = (await this.list({})) as Material[];\n return items.filter((m) => m.materialKind === materialKind);\n }\n}\n","/**\n * ProductVariantCollection — read helpers for {@link ProductVariant} rows.\n *\n * {@link ProductVariant} is a standalone model (not a Product STI subtype),\n * so this collection drives its own table (`product_variants`). Helper\n * methods cover the two common query patterns: \"what axes does this\n * product vary along?\" and \"tell me about the size axis specifically.\"\n */\n\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { ProductVariant } from '../models/ProductVariant';\n\nexport class ProductVariantCollection extends SmrtCollection<ProductVariant> {\n static readonly _itemClass = ProductVariant;\n\n /** Every axis declaration for a given product, in display order. */\n async findForProduct(productId: string): Promise<ProductVariant[]> {\n return this.list({\n where: { productId },\n orderBy: 'sortOrder ASC',\n });\n }\n\n /** The axis declaration for a `(productId, axisName)` pair, or null. */\n async findAxis(\n productId: string,\n axisName: string,\n ): Promise<ProductVariant | null> {\n const matches = await this.list({\n where: { productId, axisName },\n limit: 1,\n });\n return matches[0] ?? null;\n }\n}\n","/**\n * SkuCollection — query helpers for {@link Sku} rows.\n *\n * @packageDocumentation\n */\n\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { Sku } from '../models/Sku';\n\nexport class SkuCollection extends SmrtCollection<Sku> {\n static readonly _itemClass = Sku;\n\n /**\n * Look up a SKU by its tenant-scoped `code` (UPC, internal part\n * number, etc.). Returns `null` when no row matches.\n */\n async findByCode(code: string): Promise<Sku | null> {\n const matches = await this.list({ where: { code }, limit: 1 });\n return matches[0] ?? null;\n }\n\n /**\n * Look up a SKU by its scannable barcode. Returns `null` when no row\n * matches; pass `''` to skip the query early.\n */\n async findByBarcode(barcode: string): Promise<Sku | null> {\n if (!barcode) return null;\n const matches = await this.list({ where: { barcode }, limit: 1 });\n return matches[0] ?? null;\n }\n\n /**\n * Find every SKU pointing at the given `Product` id (or any Product\n * STI subtype id — `Material` upstream, vertical subtypes defined in\n * templates). Useful for listing the SKUs that back a single product\n * card.\n */\n async findByProduct(productId: string): Promise<Sku[]> {\n return this.list({ where: { productId }, orderBy: 'code ASC' });\n }\n\n /**\n * Find every SKU that is a component of the given parent SKU (for\n * bundles / kits). Returns an empty array when the parent has no\n * children.\n */\n async findByParent(parentSkuId: string): Promise<Sku[]> {\n return this.list({ where: { parentSkuId }, orderBy: 'code ASC' });\n }\n\n /** Find every active SKU, optionally narrowed by parent product id. */\n async findActive(productId?: string): Promise<Sku[]> {\n const where: Record<string, unknown> = { active: true };\n if (productId) where.productId = productId;\n return this.list({ where, orderBy: 'code ASC' });\n }\n}\n"],"mappings":";;;;;;;;;AAOA,IAAa,qBAAb,cAAwC,eAAyB;CAC/D,OAAgB,aAAa;;;;;;;;;;;;;;CAe7B,MAAM,oBAAyC;EAC7C,MAAM,CAAC,cAAc,eAAe,MAAM,QAAQ,IAAI,CACpD,KAAK,KAAK,EAAE,OAAO,EAAE,UAAU,GAAG,EAAE,CAAC,GACrC,KAAK,KAAK,EAAE,OAAO,EAAE,UAAU,KAAK,EAAE,CAAC,CACzC,CAAC;EAED,IAAI,aAAa,WAAW,GAAG,OAAO;EACtC,IAAI,YAAY,WAAW,GAAG,OAAO;EAGrC,MAAM,uBAAO,IAAI,IAAY;EAC7B,MAAM,SAAqB,CAAC;EAC5B,KAAK,MAAM,OAAO,CAAC,GAAG,cAAc,GAAG,WAAW,GAAG;GACnD,MAAM,KAAK,IAAI,MAAM;GACrB,IAAI,CAAC,MAAM,KAAK,IAAI,EAAE,GAAG;GACzB,KAAK,IAAI,EAAE;GACX,OAAO,KAAK,GAAG;EACjB;EACA,OAAO;CACT;AACF;;;;;;;;;AChCA,IAAa,qBAAb,cAAwC,kBAAkB;CACxD,OAAyB,aAAa;;;;;;;;;;;;;CActC,MAAM,WAAW,cAAiD;EAEhE,QAAO,MADc,KAAK,KAAK,CAAC,CAAC,EAAA,CACpB,QAAQ,MAAM,EAAE,iBAAiB,YAAY;CAC5D;AACF;;;;;;;;;;;AClBA,IAAa,2BAAb,cAA8C,eAA+B;CAC3E,OAAgB,aAAa;;CAG7B,MAAM,eAAe,WAA8C;EACjE,OAAO,KAAK,KAAK;GACf,OAAO,EAAE,UAAU;GACnB,SAAS;EACX,CAAC;CACH;;CAGA,MAAM,SACJ,WACA,UACgC;EAKhC,QAAO,MAJe,KAAK,KAAK;GAC9B,OAAO;IAAE;IAAW;GAAS;GAC7B,OAAO;EACT,CAAC,EAAA,CACc,MAAM;CACvB;AACF;;;;;;;;ACzBA,IAAa,gBAAb,cAAmC,eAAoB;CACrD,OAAgB,aAAa;;;;;CAM7B,MAAM,WAAW,MAAmC;EAElD,QAAO,MADe,KAAK,KAAK;GAAE,OAAO,EAAE,KAAK;GAAG,OAAO;EAAE,CAAC,EAAA,CAC9C,MAAM;CACvB;;;;;CAMA,MAAM,cAAc,SAAsC;EACxD,IAAI,CAAC,SAAS,OAAO;EAErB,QAAO,MADe,KAAK,KAAK;GAAE,OAAO,EAAE,QAAQ;GAAG,OAAO;EAAE,CAAC,EAAA,CACjD,MAAM;CACvB;;;;;;;CAQA,MAAM,cAAc,WAAmC;EACrD,OAAO,KAAK,KAAK;GAAE,OAAO,EAAE,UAAU;GAAG,SAAS;EAAW,CAAC;CAChE;;;;;;CAOA,MAAM,aAAa,aAAqC;EACtD,OAAO,KAAK,KAAK;GAAE,OAAO,EAAE,YAAY;GAAG,SAAS;EAAW,CAAC;CAClE;;CAGA,MAAM,WAAW,WAAoC;EACnD,MAAM,QAAiC,EAAE,QAAQ,KAAK;EACtD,IAAI,WAAW,MAAM,YAAY;EACjC,OAAO,KAAK,KAAK;GAAE;GAAO,SAAS;EAAW,CAAC;CACjD;AACF"}
@@ -1,7 +1,7 @@
1
- import "./__smrt-register__-uNFLJkVN.js";
1
+ import "./__smrt-register__-DHp9__N3.js";
2
2
  //#region src/lib/generated/index.ts
3
3
  var autoGeneratedComponents = {};
4
4
  //#endregion
5
5
  export { autoGeneratedComponents as t };
6
6
 
7
- //# sourceMappingURL=generated-GLEAXPR6.js.map
7
+ //# sourceMappingURL=generated-Cgcfo0O7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generated-GLEAXPR6.js","names":[],"sources":["../../../src/lib/generated/index.ts"],"sourcesContent":["/**\n * Auto-generated SMRT Components\n *\n * This file is automatically generated by the SMRT Vite plugin.\n * It exports UI components that are auto-generated from @smrt() decorated classes.\n *\n * DO NOT EDIT THIS FILE MANUALLY - it will be overwritten.\n */\n\n// Self-register this package's manifest for consumers that import via this\n// subpath without the main entry. See src/__smrt-register__.ts (issue #1132).\nimport '../../__smrt-register__.js';\n\n// Auto-generated components will be exported here by the SMRT Vite plugin\n// Examples:\n// export { default as SmrtProductForm } from './SmrtProductForm.svelte';\n// export { default as SmrtProductTable } from './SmrtProductTable.svelte';\n// export { default as SmrtCategoryForm } from './SmrtCategoryForm.svelte';\n\n// For now, export an empty object to prevent import errors\nexport const autoGeneratedComponents = {};\n"],"mappings":";;AAoBA,IAAa,0BAA0B,CAAC"}
1
+ {"version":3,"file":"generated-Cgcfo0O7.js","names":[],"sources":["../../../src/lib/generated/index.ts"],"sourcesContent":["/**\n * Auto-generated SMRT Components\n *\n * This file is automatically generated by the SMRT Vite plugin.\n * It exports UI components that are auto-generated from @smrt() decorated classes.\n *\n * DO NOT EDIT THIS FILE MANUALLY - it will be overwritten.\n */\n\n// Self-register this package's manifest for consumers that import via this\n// subpath without the main entry. See src/__smrt-register__.ts (issue #1132).\nimport '../../__smrt-register__.js';\n\n// Auto-generated components will be exported here by the SMRT Vite plugin\n// Examples:\n// export { default as SmrtProductForm } from './SmrtProductForm.svelte';\n// export { default as SmrtProductTable } from './SmrtProductTable.svelte';\n// export { default as SmrtCategoryForm } from './SmrtCategoryForm.svelte';\n\n// For now, export an empty object to prevent import errors\nexport const autoGeneratedComponents = {};\n"],"mappings":";;AAoBA,IAAa,0BAA0B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import "./__smrt-register__-DHp9__N3.js";
2
+ import "./Sku-D9O8I6NV.js";
@@ -1,4 +1,4 @@
1
- import { i as CategoryCollection, n as ProductVariantCollection, r as MaterialCollection, t as SkuCollection } from "./chunks/collections-C9hgL1qy.js";
1
+ import { i as CategoryCollection, n as ProductVariantCollection, r as MaterialCollection, t as SkuCollection } from "./chunks/collections-CK2V6uto.js";
2
2
  import { t as ProductCollection } from "./chunks/ProductCollection-bcMIqMpy.js";
3
3
  import { t as ProductAssetCollection } from "./chunks/ProductAssetCollection-CDwWlUxj.js";
4
4
  export { CategoryCollection, MaterialCollection, ProductAssetCollection, ProductCollection, ProductVariantCollection, SkuCollection };
@@ -1,2 +1,2 @@
1
- import { t as autoGeneratedComponents } from "./chunks/generated-GLEAXPR6.js";
1
+ import { t as autoGeneratedComponents } from "./chunks/generated-Cgcfo0O7.js";
2
2
  export { autoGeneratedComponents };
package/dist/lib/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { t as __exportAll } from "./chunks/rolldown-runtime-D7D4PA-g.js";
2
- import "./chunks/__smrt-register__-uNFLJkVN.js";
2
+ import "./chunks/__smrt-register__-DHp9__N3.js";
3
3
  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-D9O8I6NV.js";
4
- import { i as CategoryCollection, n as ProductVariantCollection, r as MaterialCollection, t as SkuCollection } from "./chunks/collections-C9hgL1qy.js";
4
+ import { i as CategoryCollection, n as ProductVariantCollection, r as MaterialCollection, t as SkuCollection } from "./chunks/collections-CK2V6uto.js";
5
5
  import { t as ProductCollection } from "./chunks/ProductCollection-bcMIqMpy.js";
6
6
  import { t as ProductAssetCollection } from "./chunks/ProductAssetCollection-CDwWlUxj.js";
7
7
  import { n as ProductCard, t as ProductForm } from "./chunks/components-DMJz1geh.js";
8
- import { t as autoGeneratedComponents } from "./chunks/generated-GLEAXPR6.js";
9
- import "./chunks/models-DFxzfOzJ.js";
8
+ import { t as autoGeneratedComponents } from "./chunks/generated-Cgcfo0O7.js";
9
+ import "./chunks/models-Bp4MS6Nw.js";
10
10
  import { n as productStore, t as ProductStoreClass } from "./chunks/stores-CB0SI1c5.js";
11
11
  import { i as slugify, n as formatPrice, r as generateId, t as formatDate } from "./chunks/utils-BgTqlQoH.js";
12
12
  import { SmrtRecipe, startRestServer } from "@happyvertical/smrt-core";
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-products",
5
- "packageVersion": "0.60.9",
5
+ "packageVersion": "0.60.10",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-products:CategoryCollection": {
8
8
  "name": "categorycollection",
@@ -49,8 +49,14 @@
49
49
  ],
50
50
  "schema": {
51
51
  "tableName": "categories",
52
- "ddl": "CREATE TABLE IF NOT EXISTS \"categories\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"description\" TEXT,\n \"parent_id\" UUID,\n \"level\" INTEGER DEFAULT 0,\n \"product_count\" INTEGER DEFAULT 0,\n \"active\" BOOLEAN DEFAULT TRUE\n);",
52
+ "ddl": "CREATE TABLE IF NOT EXISTS \"categories\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"description\" TEXT,\n \"parent_id\" UUID,\n \"level\" INTEGER DEFAULT 0,\n \"product_count\" INTEGER DEFAULT 0,\n \"active\" BOOLEAN DEFAULT TRUE\n);",
53
53
  "columns": {
54
+ "_sync_origin_device_id": {
55
+ "type": "TEXT"
56
+ },
57
+ "_sync_revision": {
58
+ "type": "INTEGER"
59
+ },
54
60
  "id": {
55
61
  "type": "UUID",
56
62
  "primaryKey": true,
@@ -156,7 +162,7 @@
156
162
  ]
157
163
  }
158
164
  ],
159
- "version": "78838be9"
165
+ "version": "9c8e227d"
160
166
  },
161
167
  "importPath": "@happyvertical/smrt-products/collections"
162
168
  },
@@ -306,8 +312,14 @@
306
312
  ],
307
313
  "schema": {
308
314
  "tableName": "products",
309
- "ddl": "CREATE TABLE IF NOT EXISTS \"products\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_type\" TEXT,\n \"name\" TEXT,\n \"description\" TEXT,\n \"category\" TEXT,\n \"manufacturer\" TEXT,\n \"model\" TEXT,\n \"price\" INTEGER DEFAULT 0,\n \"default_sales_tax_code_id\" UUID,\n \"default_purchase_tax_code_id\" UUID,\n \"in_stock\" BOOLEAN DEFAULT TRUE,\n \"specifications\" JSON DEFAULT '{}',\n \"tags\" JSON DEFAULT '[]'\n);",
315
+ "ddl": "CREATE TABLE IF NOT EXISTS \"products\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_type\" TEXT,\n \"name\" TEXT,\n \"description\" TEXT,\n \"category\" TEXT,\n \"manufacturer\" TEXT,\n \"model\" TEXT,\n \"price\" INTEGER DEFAULT 0,\n \"default_sales_tax_code_id\" UUID,\n \"default_purchase_tax_code_id\" UUID,\n \"in_stock\" BOOLEAN DEFAULT TRUE,\n \"specifications\" JSON DEFAULT '{}',\n \"tags\" JSON DEFAULT '[]'\n);",
310
316
  "columns": {
317
+ "_sync_origin_device_id": {
318
+ "type": "TEXT"
319
+ },
320
+ "_sync_revision": {
321
+ "type": "INTEGER"
322
+ },
311
323
  "id": {
312
324
  "type": "UUID",
313
325
  "primaryKey": true,
@@ -439,7 +451,7 @@
439
451
  ]
440
452
  }
441
453
  ],
442
- "version": "d8402a81"
454
+ "version": "fd960e41"
443
455
  },
444
456
  "importPath": "@happyvertical/smrt-products/collections"
445
457
  },
@@ -651,8 +663,14 @@
651
663
  "collectionOf": "@happyvertical/smrt-products:ProductAsset",
652
664
  "schema": {
653
665
  "tableName": "product_assets",
654
- "ddl": "CREATE TABLE IF NOT EXISTS \"product_assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_id\" UUID NOT NULL,\n \"asset_id\" UUID NOT NULL,\n \"relationship\" TEXT NOT NULL,\n \"sort_order\" INTEGER NOT NULL DEFAULT 0\n);",
666
+ "ddl": "CREATE TABLE IF NOT EXISTS \"product_assets\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_id\" UUID NOT NULL,\n \"asset_id\" UUID NOT NULL,\n \"relationship\" TEXT NOT NULL,\n \"sort_order\" INTEGER NOT NULL DEFAULT 0\n);",
655
667
  "columns": {
668
+ "_sync_origin_device_id": {
669
+ "type": "TEXT"
670
+ },
671
+ "_sync_revision": {
672
+ "type": "INTEGER"
673
+ },
656
674
  "id": {
657
675
  "type": "UUID",
658
676
  "primaryKey": true,
@@ -747,7 +765,7 @@
747
765
  ]
748
766
  }
749
767
  ],
750
- "version": "9d67ec65"
768
+ "version": "70cd2fa0"
751
769
  },
752
770
  "importPath": "@happyvertical/smrt-products/collections"
753
771
  },
@@ -883,8 +901,14 @@
883
901
  ],
884
902
  "schema": {
885
903
  "tableName": "products",
886
- "ddl": "CREATE TABLE IF NOT EXISTS \"products\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_type\" TEXT,\n \"name\" TEXT,\n \"description\" TEXT,\n \"category\" TEXT,\n \"manufacturer\" TEXT,\n \"model\" TEXT,\n \"price\" INTEGER DEFAULT 0,\n \"default_sales_tax_code_id\" UUID,\n \"default_purchase_tax_code_id\" UUID,\n \"in_stock\" BOOLEAN DEFAULT TRUE,\n \"specifications\" JSON DEFAULT '{}',\n \"tags\" JSON DEFAULT '[]'\n);",
904
+ "ddl": "CREATE TABLE IF NOT EXISTS \"products\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_type\" TEXT,\n \"name\" TEXT,\n \"description\" TEXT,\n \"category\" TEXT,\n \"manufacturer\" TEXT,\n \"model\" TEXT,\n \"price\" INTEGER DEFAULT 0,\n \"default_sales_tax_code_id\" UUID,\n \"default_purchase_tax_code_id\" UUID,\n \"in_stock\" BOOLEAN DEFAULT TRUE,\n \"specifications\" JSON DEFAULT '{}',\n \"tags\" JSON DEFAULT '[]'\n);",
887
905
  "columns": {
906
+ "_sync_origin_device_id": {
907
+ "type": "TEXT"
908
+ },
909
+ "_sync_revision": {
910
+ "type": "INTEGER"
911
+ },
888
912
  "id": {
889
913
  "type": "UUID",
890
914
  "primaryKey": true,
@@ -1016,7 +1040,7 @@
1016
1040
  ]
1017
1041
  }
1018
1042
  ],
1019
- "version": "d8402a81"
1043
+ "version": "fd960e41"
1020
1044
  },
1021
1045
  "importPath": "@happyvertical/smrt-products/collections"
1022
1046
  },
@@ -1091,8 +1115,14 @@
1091
1115
  ],
1092
1116
  "schema": {
1093
1117
  "tableName": "product_variants",
1094
- "ddl": "CREATE TABLE IF NOT EXISTS \"product_variants\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_id\" TEXT NOT NULL DEFAULT '',\n \"axis_name\" TEXT NOT NULL DEFAULT '',\n \"label\" TEXT DEFAULT '',\n \"allowed_values\" TEXT DEFAULT '[]',\n \"sort_order\" INTEGER DEFAULT 0\n);",
1118
+ "ddl": "CREATE TABLE IF NOT EXISTS \"product_variants\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_id\" TEXT NOT NULL DEFAULT '',\n \"axis_name\" TEXT NOT NULL DEFAULT '',\n \"label\" TEXT DEFAULT '',\n \"allowed_values\" TEXT DEFAULT '[]',\n \"sort_order\" INTEGER DEFAULT 0\n);",
1095
1119
  "columns": {
1120
+ "_sync_origin_device_id": {
1121
+ "type": "TEXT"
1122
+ },
1123
+ "_sync_revision": {
1124
+ "type": "INTEGER"
1125
+ },
1096
1126
  "id": {
1097
1127
  "type": "UUID",
1098
1128
  "primaryKey": true,
@@ -1181,7 +1211,7 @@
1181
1211
  ]
1182
1212
  }
1183
1213
  ],
1184
- "version": "2891ff02"
1214
+ "version": "b0cf868a"
1185
1215
  },
1186
1216
  "importPath": "@happyvertical/smrt-products/collections"
1187
1217
  },
@@ -1293,8 +1323,14 @@
1293
1323
  ],
1294
1324
  "schema": {
1295
1325
  "tableName": "product_skus",
1296
- "ddl": "CREATE TABLE IF NOT EXISTS \"product_skus\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_id\" TEXT NOT NULL DEFAULT '',\n \"code\" TEXT NOT NULL DEFAULT '',\n \"barcode\" TEXT DEFAULT '',\n \"name\" TEXT DEFAULT '',\n \"attributes\" TEXT DEFAULT '{}',\n \"weight_grams\" REAL,\n \"parent_sku_id\" TEXT DEFAULT '',\n \"active\" BOOLEAN DEFAULT TRUE\n);",
1326
+ "ddl": "CREATE TABLE IF NOT EXISTS \"product_skus\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_id\" TEXT NOT NULL DEFAULT '',\n \"code\" TEXT NOT NULL DEFAULT '',\n \"barcode\" TEXT DEFAULT '',\n \"name\" TEXT DEFAULT '',\n \"attributes\" TEXT DEFAULT '{}',\n \"weight_grams\" REAL,\n \"parent_sku_id\" TEXT DEFAULT '',\n \"active\" BOOLEAN DEFAULT TRUE\n);",
1297
1327
  "columns": {
1328
+ "_sync_origin_device_id": {
1329
+ "type": "TEXT"
1330
+ },
1331
+ "_sync_revision": {
1332
+ "type": "INTEGER"
1333
+ },
1298
1334
  "id": {
1299
1335
  "type": "UUID",
1300
1336
  "primaryKey": true,
@@ -1399,7 +1435,7 @@
1399
1435
  ]
1400
1436
  }
1401
1437
  ],
1402
- "version": "89d5a311"
1438
+ "version": "699e3cc1"
1403
1439
  },
1404
1440
  "importPath": "@happyvertical/smrt-products/collections"
1405
1441
  },
@@ -1518,8 +1554,14 @@
1518
1554
  ],
1519
1555
  "schema": {
1520
1556
  "tableName": "categories",
1521
- "ddl": "CREATE TABLE IF NOT EXISTS \"categories\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"description\" TEXT,\n \"parent_id\" UUID,\n \"level\" INTEGER DEFAULT 0,\n \"product_count\" INTEGER DEFAULT 0,\n \"active\" BOOLEAN DEFAULT TRUE\n);",
1557
+ "ddl": "CREATE TABLE IF NOT EXISTS \"categories\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"description\" TEXT,\n \"parent_id\" UUID,\n \"level\" INTEGER DEFAULT 0,\n \"product_count\" INTEGER DEFAULT 0,\n \"active\" BOOLEAN DEFAULT TRUE\n);",
1522
1558
  "columns": {
1559
+ "_sync_origin_device_id": {
1560
+ "type": "TEXT"
1561
+ },
1562
+ "_sync_revision": {
1563
+ "type": "INTEGER"
1564
+ },
1523
1565
  "id": {
1524
1566
  "type": "UUID",
1525
1567
  "primaryKey": true,
@@ -1625,7 +1667,7 @@
1625
1667
  ]
1626
1668
  }
1627
1669
  ],
1628
- "version": "78838be9"
1670
+ "version": "9c8e227d"
1629
1671
  },
1630
1672
  "importPath": "@happyvertical/smrt-products/models"
1631
1673
  },
@@ -1900,8 +1942,14 @@
1900
1942
  ],
1901
1943
  "schema": {
1902
1944
  "tableName": "products",
1903
- "ddl": "CREATE TABLE IF NOT EXISTS \"products\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_type\" TEXT,\n \"name\" TEXT,\n \"description\" TEXT,\n \"category\" TEXT,\n \"manufacturer\" TEXT,\n \"model\" TEXT,\n \"price\" INTEGER DEFAULT 0,\n \"default_sales_tax_code_id\" UUID,\n \"default_purchase_tax_code_id\" UUID,\n \"in_stock\" BOOLEAN DEFAULT TRUE,\n \"specifications\" JSON DEFAULT '{}',\n \"tags\" JSON DEFAULT '[]'\n);",
1945
+ "ddl": "CREATE TABLE IF NOT EXISTS \"products\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_type\" TEXT,\n \"name\" TEXT,\n \"description\" TEXT,\n \"category\" TEXT,\n \"manufacturer\" TEXT,\n \"model\" TEXT,\n \"price\" INTEGER DEFAULT 0,\n \"default_sales_tax_code_id\" UUID,\n \"default_purchase_tax_code_id\" UUID,\n \"in_stock\" BOOLEAN DEFAULT TRUE,\n \"specifications\" JSON DEFAULT '{}',\n \"tags\" JSON DEFAULT '[]'\n);",
1904
1946
  "columns": {
1947
+ "_sync_origin_device_id": {
1948
+ "type": "TEXT"
1949
+ },
1950
+ "_sync_revision": {
1951
+ "type": "INTEGER"
1952
+ },
1905
1953
  "id": {
1906
1954
  "type": "UUID",
1907
1955
  "primaryKey": true,
@@ -2033,7 +2081,7 @@
2033
2081
  ]
2034
2082
  }
2035
2083
  ],
2036
- "version": "d8402a81"
2084
+ "version": "fd960e41"
2037
2085
  },
2038
2086
  "importPath": "@happyvertical/smrt-products/models"
2039
2087
  },
@@ -2290,8 +2338,14 @@
2290
2338
  ],
2291
2339
  "schema": {
2292
2340
  "tableName": "products",
2293
- "ddl": "CREATE TABLE IF NOT EXISTS \"products\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_type\" TEXT,\n \"name\" TEXT,\n \"description\" TEXT,\n \"category\" TEXT,\n \"manufacturer\" TEXT,\n \"model\" TEXT,\n \"price\" INTEGER DEFAULT 0,\n \"default_sales_tax_code_id\" UUID,\n \"default_purchase_tax_code_id\" UUID,\n \"in_stock\" BOOLEAN DEFAULT TRUE,\n \"specifications\" JSON DEFAULT '{}',\n \"tags\" JSON DEFAULT '[]'\n);",
2341
+ "ddl": "CREATE TABLE IF NOT EXISTS \"products\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_type\" TEXT,\n \"name\" TEXT,\n \"description\" TEXT,\n \"category\" TEXT,\n \"manufacturer\" TEXT,\n \"model\" TEXT,\n \"price\" INTEGER DEFAULT 0,\n \"default_sales_tax_code_id\" UUID,\n \"default_purchase_tax_code_id\" UUID,\n \"in_stock\" BOOLEAN DEFAULT TRUE,\n \"specifications\" JSON DEFAULT '{}',\n \"tags\" JSON DEFAULT '[]'\n);",
2294
2342
  "columns": {
2343
+ "_sync_origin_device_id": {
2344
+ "type": "TEXT"
2345
+ },
2346
+ "_sync_revision": {
2347
+ "type": "INTEGER"
2348
+ },
2295
2349
  "id": {
2296
2350
  "type": "UUID",
2297
2351
  "primaryKey": true,
@@ -2423,7 +2477,7 @@
2423
2477
  ]
2424
2478
  }
2425
2479
  ],
2426
- "version": "d8402a81"
2480
+ "version": "fd960e41"
2427
2481
  },
2428
2482
  "importPath": "@happyvertical/smrt-products/models"
2429
2483
  },
@@ -2522,8 +2576,14 @@
2522
2576
  ],
2523
2577
  "schema": {
2524
2578
  "tableName": "product_assets",
2525
- "ddl": "CREATE TABLE IF NOT EXISTS \"product_assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_id\" UUID NOT NULL,\n \"asset_id\" UUID NOT NULL,\n \"relationship\" TEXT NOT NULL,\n \"sort_order\" INTEGER NOT NULL DEFAULT 0\n);",
2579
+ "ddl": "CREATE TABLE IF NOT EXISTS \"product_assets\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_id\" UUID NOT NULL,\n \"asset_id\" UUID NOT NULL,\n \"relationship\" TEXT NOT NULL,\n \"sort_order\" INTEGER NOT NULL DEFAULT 0\n);",
2526
2580
  "columns": {
2581
+ "_sync_origin_device_id": {
2582
+ "type": "TEXT"
2583
+ },
2584
+ "_sync_revision": {
2585
+ "type": "INTEGER"
2586
+ },
2527
2587
  "id": {
2528
2588
  "type": "UUID",
2529
2589
  "primaryKey": true,
@@ -2618,7 +2678,7 @@
2618
2678
  ]
2619
2679
  }
2620
2680
  ],
2621
- "version": "9d67ec65"
2681
+ "version": "70cd2fa0"
2622
2682
  },
2623
2683
  "importPath": "@happyvertical/smrt-products/models"
2624
2684
  },
@@ -2766,8 +2826,14 @@
2766
2826
  ],
2767
2827
  "schema": {
2768
2828
  "tableName": "product_variants",
2769
- "ddl": "CREATE TABLE IF NOT EXISTS \"product_variants\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_id\" TEXT NOT NULL DEFAULT '',\n \"axis_name\" TEXT NOT NULL DEFAULT '',\n \"label\" TEXT DEFAULT '',\n \"allowed_values\" TEXT DEFAULT '[]',\n \"sort_order\" INTEGER DEFAULT 0\n);",
2829
+ "ddl": "CREATE TABLE IF NOT EXISTS \"product_variants\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_id\" TEXT NOT NULL DEFAULT '',\n \"axis_name\" TEXT NOT NULL DEFAULT '',\n \"label\" TEXT DEFAULT '',\n \"allowed_values\" TEXT DEFAULT '[]',\n \"sort_order\" INTEGER DEFAULT 0\n);",
2770
2830
  "columns": {
2831
+ "_sync_origin_device_id": {
2832
+ "type": "TEXT"
2833
+ },
2834
+ "_sync_revision": {
2835
+ "type": "INTEGER"
2836
+ },
2771
2837
  "id": {
2772
2838
  "type": "UUID",
2773
2839
  "primaryKey": true,
@@ -2856,7 +2922,7 @@
2856
2922
  ]
2857
2923
  }
2858
2924
  ],
2859
- "version": "2891ff02"
2925
+ "version": "b0cf868a"
2860
2926
  },
2861
2927
  "importPath": "@happyvertical/smrt-products/models"
2862
2928
  },
@@ -3018,8 +3084,14 @@
3018
3084
  ],
3019
3085
  "schema": {
3020
3086
  "tableName": "product_skus",
3021
- "ddl": "CREATE TABLE IF NOT EXISTS \"product_skus\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_id\" TEXT NOT NULL DEFAULT '',\n \"code\" TEXT NOT NULL DEFAULT '',\n \"barcode\" TEXT DEFAULT '',\n \"name\" TEXT DEFAULT '',\n \"attributes\" TEXT DEFAULT '{}',\n \"weight_grams\" REAL,\n \"parent_sku_id\" TEXT DEFAULT '',\n \"active\" BOOLEAN DEFAULT TRUE\n);",
3087
+ "ddl": "CREATE TABLE IF NOT EXISTS \"product_skus\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"product_id\" TEXT NOT NULL DEFAULT '',\n \"code\" TEXT NOT NULL DEFAULT '',\n \"barcode\" TEXT DEFAULT '',\n \"name\" TEXT DEFAULT '',\n \"attributes\" TEXT DEFAULT '{}',\n \"weight_grams\" REAL,\n \"parent_sku_id\" TEXT DEFAULT '',\n \"active\" BOOLEAN DEFAULT TRUE\n);",
3022
3088
  "columns": {
3089
+ "_sync_origin_device_id": {
3090
+ "type": "TEXT"
3091
+ },
3092
+ "_sync_revision": {
3093
+ "type": "INTEGER"
3094
+ },
3023
3095
  "id": {
3024
3096
  "type": "UUID",
3025
3097
  "primaryKey": true,
@@ -3124,7 +3196,7 @@
3124
3196
  ]
3125
3197
  }
3126
3198
  ],
3127
- "version": "89d5a311"
3199
+ "version": "699e3cc1"
3128
3200
  },
3129
3201
  "importPath": "@happyvertical/smrt-products/models"
3130
3202
  }
@@ -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-D9O8I6NV.js";
2
- import "./chunks/models-DFxzfOzJ.js";
2
+ import "./chunks/models-Bp4MS6Nw.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.60.9",
6
+ "packageVersion": "0.60.10",
7
7
  "sourceManifestPath": "dist/lib/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "a61a243d63b1deff0991389e8d934d517149f3b9f8df9033c5b963487b1a39c9",
11
- "packageJson": "b3a1e928af5c880108c2acb04a100632400d808a7d0b6716de3ce94bea30bcff",
10
+ "manifest": "9830bc17c27f6cae08d6caa611d17b4d06da840dcd26810e8696c1f515cb925f",
11
+ "packageJson": "7efcd18091be2ff3fa47a1c69ea55fede0a821cdcdd7e23f3031dc080966ce12",
12
12
  "agents": "39bae43f14d7f80933a11fc1087d5bf376d8e0d6f4eae3a9a658185bf54508cf",
13
13
  "moduleDoc:agents/install-lifecycle.md": "0b9b63732ff27f7435e68a04f481d4d4f03974065a39e46f0960964d4fac49df"
14
14
  },
@@ -0,0 +1,96 @@
1
+ ---
2
+ type: "Component"
3
+ title: "@happyvertical/smrt-products"
4
+ description: "SMRT products module: triple-purpose microservice template for standalone apps, federated modules, and NPM libraries"
5
+ status: "stable"
6
+ generated:
7
+ by: "smrt/scripts/generate-knowledge-okf.ts"
8
+ at: "2026-11-05T15:48:19Z"
9
+ audience: "internal"
10
+ evidence_level: "source-inspected"
11
+ source_revision: "sha256:9b43bb99d225c8b957b59a12fc67e8d9d7bc307ea1b26d3d5506d1895eb3c423"
12
+ sources:
13
+ - id: "manifest"
14
+ resource: "https://github.com/happyvertical/smrt/blob/main/packages/products/package.json"
15
+ title: "@happyvertical/smrt-products package manifest"
16
+ - id: "agents"
17
+ resource: "https://github.com/happyvertical/smrt/blob/main/packages/products/AGENTS.md"
18
+ title: "@happyvertical/smrt-products packages/products/AGENTS.md"
19
+ - id: "agents-2"
20
+ resource: "https://github.com/happyvertical/smrt/blob/main/packages/products/agents/install-lifecycle.md"
21
+ title: "@happyvertical/smrt-products packages/products/agents/install-lifecycle.md"
22
+ ---
23
+
24
+ # @happyvertical/smrt-products
25
+
26
+ ## Package
27
+
28
+ - Directory: `packages/products`
29
+ - Private: no
30
+ - Object source: `domain-artifact`
31
+ - Evidence level: `source-inspected`
32
+
33
+ ## Documentation
34
+
35
+ - `packages/products/AGENTS.md`
36
+ - `packages/products/agents/install-lifecycle.md`
37
+
38
+ ## Framework dependencies
39
+
40
+ - [smrt-assets](/components/smrt-assets.md)
41
+ - [smrt-core](/components/smrt-core.md)
42
+ - [smrt-scanner](/components/smrt-scanner.md)
43
+ - [smrt-svelte](/components/smrt-svelte.md)
44
+ - [smrt-tenancy](/components/smrt-tenancy.md)
45
+ - [smrt-ui](/components/smrt-ui.md)
46
+ - [smrt-vitest](/components/smrt-vitest.md)
47
+ - [smrt-web](/components/smrt-web.md)
48
+
49
+ ## SDK dependencies
50
+
51
+ - `@happyvertical/ai`
52
+ - `@happyvertical/files`
53
+ - `@happyvertical/logger`
54
+ - `@happyvertical/sql`
55
+ - `@happyvertical/utils`
56
+
57
+ ## Exports
58
+
59
+ - `.`
60
+ - `./collections`
61
+ - `./components`
62
+ - `./generated`
63
+ - `./manifest`
64
+ - `./manifest.json`
65
+ - `./models`
66
+ - `./stores`
67
+ - `./stores/product-collection`
68
+ - `./utils`
69
+
70
+ ## Models
71
+
72
+ - `Category` (collection `categories`, extends `SmrtObject`, STI table)
73
+ - `CategoryCollection` (collection `categories`, extends `SmrtCollection`)
74
+ - `Material` (collection `products`, extends `Product`, STI table)
75
+ - `MaterialCollection` (collection `products`, extends `ProductCollection`)
76
+ - `Product` (collection `products`, extends `SmrtObject`, STI table)
77
+ - `ProductAsset` (collection `productassets`, extends `SmrtObject`)
78
+ - `ProductAssetCollection` (collection `productassets`, extends `SmrtJunction`)
79
+ - `ProductCollection` (collection `products`, extends `SmrtCollection`)
80
+ - `ProductVariant` (collection `productvariants`, extends `SmrtObject`)
81
+ - `ProductVariantCollection` (collection `productvariants`, extends `SmrtCollection`)
82
+ - `Sku` (collection `skus`, extends `SmrtObject`)
83
+ - `SkuCollection` (collection `skus`, extends `SmrtCollection`)
84
+
85
+ ## MCP tools
86
+
87
+ - `category_get`: get on `@happyvertical/smrt-products:Category`
88
+ - `category_list`: list on `@happyvertical/smrt-products:Category`
89
+ - `material_get`: get on `@happyvertical/smrt-products:Material`
90
+ - `material_list`: list on `@happyvertical/smrt-products:Material`
91
+ - `product_get`: get on `@happyvertical/smrt-products:Product`
92
+ - `product_list`: list on `@happyvertical/smrt-products:Product`
93
+ - `productvariant_get`: get on `@happyvertical/smrt-products:ProductVariant`
94
+ - `productvariant_list`: list on `@happyvertical/smrt-products:ProductVariant`
95
+ - `sku_get`: get on `@happyvertical/smrt-products:Sku`
96
+ - `sku_list`: list on `@happyvertical/smrt-products:Sku`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-products",
3
- "version": "0.60.9",
3
+ "version": "0.60.10",
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",
@@ -15,7 +15,8 @@
15
15
  "dist/lib",
16
16
  "AGENTS.md",
17
17
  "agents",
18
- "scripts/prepare.mjs"
18
+ "scripts/prepare.mjs",
19
+ "dist/smrt-knowledge.okf.md"
19
20
  ],
20
21
  "exports": {
21
22
  ".": {
@@ -58,18 +59,18 @@
58
59
  "./manifest.json": "./dist/lib/manifest.json"
59
60
  },
60
61
  "dependencies": {
61
- "@happyvertical/ai": "^0.111.3",
62
- "@happyvertical/files": "^0.111.3",
63
- "@happyvertical/logger": "^0.111.3",
64
- "@happyvertical/smrt-assets": "0.60.9",
65
- "@happyvertical/smrt-core": "0.60.9",
66
- "@happyvertical/smrt-scanner": "0.60.9",
67
- "@happyvertical/smrt-svelte": "0.60.9",
68
- "@happyvertical/smrt-tenancy": "0.60.9",
69
- "@happyvertical/smrt-ui": "0.60.9",
70
- "@happyvertical/smrt-web": "0.60.9",
71
- "@happyvertical/sql": "^0.111.3",
72
- "@happyvertical/utils": "^0.111.3",
62
+ "@happyvertical/ai": "^0.111.5",
63
+ "@happyvertical/files": "^0.111.5",
64
+ "@happyvertical/logger": "^0.111.5",
65
+ "@happyvertical/smrt-assets": "0.60.10",
66
+ "@happyvertical/smrt-core": "0.60.10",
67
+ "@happyvertical/smrt-scanner": "0.60.10",
68
+ "@happyvertical/smrt-svelte": "0.60.10",
69
+ "@happyvertical/smrt-tenancy": "0.60.10",
70
+ "@happyvertical/smrt-ui": "0.60.10",
71
+ "@happyvertical/smrt-web": "0.60.10",
72
+ "@happyvertical/sql": "^0.111.5",
73
+ "@happyvertical/utils": "^0.111.5",
73
74
  "cors": "^2.8.6",
74
75
  "express": "^5.2.1"
75
76
  },
@@ -88,7 +89,7 @@
88
89
  "@types/cors": "2.8.19",
89
90
  "@types/express": "^5.0.6",
90
91
  "@types/node": "24.13.6",
91
- "@happyvertical/smrt-vitest": "0.60.9",
92
+ "@happyvertical/smrt-vitest": "0.60.10",
92
93
  "concurrently": "^10.0.5",
93
94
  "svelte": "^5.57.1",
94
95
  "svelte-check": "^4.7.6",