@happyvertical/smrt-products 0.38.2 → 0.38.4
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.
- package/dist/lib/chunks/{ProductAssetCollection-TbeaVxzc.js → ProductAssetCollection-BLfdEtYT.js} +4 -4
- package/dist/lib/chunks/{ProductAssetCollection-TbeaVxzc.js.map → ProductAssetCollection-BLfdEtYT.js.map} +1 -1
- package/dist/lib/chunks/{ProductCollection-8QlfZ9ez.js → ProductCollection-BDcBK9RN.js} +2 -2
- package/dist/lib/chunks/{ProductCollection-8QlfZ9ez.js.map → ProductCollection-BDcBK9RN.js.map} +1 -1
- package/dist/lib/chunks/{Sku-B0w2dfHb.js → Sku-C181XteX.js} +3 -3
- package/dist/lib/chunks/{Sku-B0w2dfHb.js.map → Sku-C181XteX.js.map} +1 -1
- package/dist/lib/chunks/__smrt-register__-GwcyNfFl.js +6 -0
- package/dist/lib/chunks/{__smrt-register__-Uiu0ODFT.js.map → __smrt-register__-GwcyNfFl.js.map} +1 -1
- package/dist/lib/chunks/{collections-DrIRgYyG.js → collections-QAzLxrPY.js} +5 -5
- package/dist/lib/chunks/{collections-DrIRgYyG.js.map → collections-QAzLxrPY.js.map} +1 -1
- package/dist/lib/chunks/{decorate-C25O10I-.js → decorate-DcF3lt7P.js} +1 -1
- package/dist/lib/chunks/{generated-BWhQOQH0.js → generated-D3OAqEL7.js} +2 -2
- package/dist/lib/chunks/{generated-BWhQOQH0.js.map → generated-D3OAqEL7.js.map} +1 -1
- package/dist/lib/chunks/models-DF-egB6k.js +2 -0
- package/dist/lib/collections.js +3 -3
- package/dist/lib/generated.js +1 -1
- package/dist/lib/index.js +7 -7
- package/dist/lib/manifest.json +23 -5
- package/dist/lib/models.js +2 -2
- package/dist/lib/smrt-knowledge.json +5 -5
- package/package.json +15 -15
- package/dist/lib/chunks/__smrt-register__-Uiu0ODFT.js +0 -6
- package/dist/lib/chunks/models-wMzr21aG.js +0 -2
package/dist/lib/chunks/{ProductAssetCollection-TbeaVxzc.js → ProductAssetCollection-BLfdEtYT.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { t as __decorate } from "./decorate-
|
|
3
|
-
import { r as ProductAsset } from "./Sku-
|
|
2
|
+
import { t as __decorate } from "./decorate-DcF3lt7P.js";
|
|
3
|
+
import { r as ProductAsset } from "./Sku-C181XteX.js";
|
|
4
4
|
import { SmrtJunction, smrt } from "@happyvertical/smrt-core";
|
|
5
5
|
import { addOwnedAssetFromCollection, getOwnedAssetsFromCollection, removeOwnedAssetFromCollection } from "@happyvertical/smrt-assets";
|
|
6
6
|
//#region src/lib/collections/ProductAssetCollection.ts
|
|
@@ -12,7 +12,7 @@ var ProductAssetCollection = class ProductAssetCollection extends SmrtJunction {
|
|
|
12
12
|
productCollectionPromise = null;
|
|
13
13
|
async getProductCollection() {
|
|
14
14
|
if (!this.productCollectionPromise) {
|
|
15
|
-
const { ProductCollection } = await import("./ProductCollection-
|
|
15
|
+
const { ProductCollection } = await import("./ProductCollection-BDcBK9RN.js").then((n) => n.n);
|
|
16
16
|
this.productCollectionPromise = ProductCollection.create({ db: this.db });
|
|
17
17
|
}
|
|
18
18
|
return this.productCollectionPromise;
|
|
@@ -35,4 +35,4 @@ ProductAssetCollection = __decorate([smrt({
|
|
|
35
35
|
//#endregion
|
|
36
36
|
export { ProductAssetCollection_exports as n, ProductAssetCollection as t };
|
|
37
37
|
|
|
38
|
-
//# sourceMappingURL=ProductAssetCollection-
|
|
38
|
+
//# sourceMappingURL=ProductAssetCollection-BLfdEtYT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductAssetCollection-
|
|
1
|
+
{"version":3,"file":"ProductAssetCollection-BLfdEtYT.js","names":[],"sources":["../../../src/lib/collections/ProductAssetCollection.ts"],"sourcesContent":["import type { Asset } from '@happyvertical/smrt-assets';\nimport {\n addOwnedAssetFromCollection,\n getOwnedAssetsFromCollection,\n removeOwnedAssetFromCollection,\n} from '@happyvertical/smrt-assets';\nimport type { SmrtCollectionOptions } from '@happyvertical/smrt-core';\nimport { SmrtJunction, smrt } from '@happyvertical/smrt-core';\nimport { ProductAsset } from '../models/ProductAsset';\nimport type { ProductCollection } from './ProductCollection';\n\nexport interface ProductAssetCollectionOptions extends SmrtCollectionOptions {}\n\n@smrt({\n api: false,\n mcp: false,\n cli: false,\n})\nexport class ProductAssetCollection extends SmrtJunction<ProductAsset> {\n static readonly _itemClass = ProductAsset;\n protected leftField = 'productId';\n protected rightField = 'assetId';\n\n private productCollectionPromise: Promise<ProductCollection> | null = null;\n\n private async getProductCollection(): Promise<ProductCollection> {\n if (!this.productCollectionPromise) {\n const { ProductCollection } = await import('./ProductCollection');\n this.productCollectionPromise = ProductCollection.create({ db: this.db });\n }\n\n return this.productCollectionPromise;\n }\n\n async getAssets(productId: string, relationship?: string): Promise<Asset[]> {\n return getOwnedAssetsFromCollection(\n await this.getProductCollection(),\n productId,\n relationship,\n );\n }\n\n async addAsset(\n productId: string,\n asset: Asset,\n relationship = 'attachment',\n sortOrder = 0,\n ): Promise<void> {\n await addOwnedAssetFromCollection(\n await this.getProductCollection(),\n 'Product',\n productId,\n asset,\n relationship,\n sortOrder,\n );\n }\n\n async removeAsset(\n productId: string,\n assetId: string,\n relationship?: string,\n ): Promise<void> {\n await removeOwnedAssetFromCollection(\n await this.getProductCollection(),\n 'Product',\n productId,\n assetId,\n relationship,\n );\n }\n}\n"],"mappings":";;;;;;;AAkBO,IAAA,yBAAA,MAAM,+BAA+B,aAA2B;CACrE,OAAgB,aAAa;CAC7B,YAAsB;CACtB,aAAuB;CAEvB,2BAAsE;CAEtE,MAAc,uBAAmD;EAC/D,IAAI,CAAC,KAAK,0BAA0B;GAClC,MAAM,EAAE,sBAAsB,MAAM,OAAO,kCAAA,CAAA,MAAA,MAAA,EAAA,CAAA;GAC3C,KAAK,2BAA2B,kBAAkB,OAAO,EAAE,IAAI,KAAK,GAAG,CAAC;EAC1E;EAEA,OAAO,KAAK;CACd;CAEA,MAAM,UAAU,WAAmB,cAAyC;EAC1E,OAAO,6BACL,MAAM,KAAK,qBAAqB,GAChC,WACA,YACF;CACF;CAEA,MAAM,SACJ,WACA,OACA,eAAe,cACf,YAAY,GACG;EACf,MAAM,4BACJ,MAAM,KAAK,qBAAqB,GAChC,WACA,WACA,OACA,cACA,SACF;CACF;CAEA,MAAM,YACJ,WACA,SACA,cACe;EACf,MAAM,+BACJ,MAAM,KAAK,qBAAqB,GAChC,WACA,WACA,SACA,YACF;CACF;AACF;qCA1DC,KAAK;CACJ,KAAK;CACL,KAAK;CACL,KAAK;AACP,CAAC,CAAA,GAAA,sBAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { a as Product } from "./Sku-
|
|
2
|
+
import { a as Product } from "./Sku-C181XteX.js";
|
|
3
3
|
import { SmrtCollection } from "@happyvertical/smrt-core";
|
|
4
4
|
import { addOwnedAssetFromCollection, getOwnedAssetsFromCollection, removeOwnedAssetFromCollection } from "@happyvertical/smrt-assets";
|
|
5
5
|
//#region src/lib/collections/ProductCollection.ts
|
|
@@ -25,4 +25,4 @@ var ProductCollection = class extends SmrtCollection {
|
|
|
25
25
|
//#endregion
|
|
26
26
|
export { ProductCollection_exports as n, ProductCollection as t };
|
|
27
27
|
|
|
28
|
-
//# sourceMappingURL=ProductCollection-
|
|
28
|
+
//# sourceMappingURL=ProductCollection-BDcBK9RN.js.map
|
package/dist/lib/chunks/{ProductCollection-8QlfZ9ez.js.map → ProductCollection-BDcBK9RN.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductCollection-
|
|
1
|
+
{"version":3,"file":"ProductCollection-BDcBK9RN.js","names":[],"sources":["../../../src/lib/collections/ProductCollection.ts"],"sourcesContent":["import type { Asset } from '@happyvertical/smrt-assets';\nimport {\n addOwnedAssetFromCollection,\n getOwnedAssetsFromCollection,\n removeOwnedAssetFromCollection,\n} from '@happyvertical/smrt-assets';\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { Product } from '../models/Product';\n\nexport class ProductCollection extends SmrtCollection<Product> {\n static readonly _itemClass = Product;\n\n async findByManufacturer(manufacturer: string): Promise<Product[]> {\n return this.list({ where: { manufacturer } });\n }\n\n async findInStock(): Promise<Product[]> {\n return this.list({ where: { inStock: true } });\n }\n\n async getAssets(productId: string, relationship?: string): Promise<Asset[]> {\n return getOwnedAssetsFromCollection(this, productId, relationship);\n }\n\n async addAsset(\n productId: string,\n asset: Asset,\n relationship = 'attachment',\n sortOrder = 0,\n ): Promise<void> {\n await addOwnedAssetFromCollection(\n this,\n 'Product',\n productId,\n asset,\n relationship,\n sortOrder,\n );\n }\n\n async removeAsset(\n productId: string,\n assetId: string,\n relationship?: string,\n ): Promise<void> {\n await removeOwnedAssetFromCollection(\n this,\n 'Product',\n productId,\n assetId,\n relationship,\n );\n }\n}\n"],"mappings":";;;;;;AASA,IAAa,oBAAb,cAAuC,eAAwB;CAC7D,OAAgB,aAAa;CAE7B,MAAM,mBAAmB,cAA0C;EACjE,OAAO,KAAK,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;CAC9C;CAEA,MAAM,cAAkC;EACtC,OAAO,KAAK,KAAK,EAAE,OAAO,EAAE,SAAS,KAAK,EAAE,CAAC;CAC/C;CAEA,MAAM,UAAU,WAAmB,cAAyC;EAC1E,OAAO,6BAA6B,MAAM,WAAW,YAAY;CACnE;CAEA,MAAM,SACJ,WACA,OACA,eAAe,cACf,YAAY,GACG;EACf,MAAM,4BACJ,MACA,WACA,WACA,OACA,cACA,SACF;CACF;CAEA,MAAM,YACJ,WACA,SACA,cACe;EACf,MAAM,+BACJ,MACA,WACA,WACA,SACA,YACF;CACF;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __decorate } from "./decorate-
|
|
1
|
+
import { t as __decorate } from "./decorate-DcF3lt7P.js";
|
|
2
2
|
import { SmrtObject, crossPackageRef, field, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
3
3
|
import { TenantScoped, getCurrentTenant, tenantId } from "@happyvertical/smrt-tenancy";
|
|
4
4
|
import { assertValidOwnedAssetRelationship, assertValidOwnedAssetSortOrder, resolveOwnedAssetsById } from "@happyvertical/smrt-assets";
|
|
@@ -119,7 +119,7 @@ var Product = class Product extends SmrtObject {
|
|
|
119
119
|
this.specifications[key] = value;
|
|
120
120
|
}
|
|
121
121
|
async getProductAssetCollection() {
|
|
122
|
-
const { ProductAssetCollection } = await import("./ProductAssetCollection-
|
|
122
|
+
const { ProductAssetCollection } = await import("./ProductAssetCollection-BLfdEtYT.js").then((n) => n.n);
|
|
123
123
|
return ProductAssetCollection.create({ db: this.db });
|
|
124
124
|
}
|
|
125
125
|
async getAssets(relationship) {
|
|
@@ -464,4 +464,4 @@ Sku = __decorate([TenantScoped({ mode: "optional" }), smrt({
|
|
|
464
464
|
//#endregion
|
|
465
465
|
export { Product as a, Material as i, ProductVariant as n, ProductType as o, ProductAsset as r, Category as s, Sku as t };
|
|
466
466
|
|
|
467
|
-
//# sourceMappingURL=Sku-
|
|
467
|
+
//# sourceMappingURL=Sku-C181XteX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sku-B0w2dfHb.js","names":[],"sources":["../../../src/lib/models/Category.ts","../../../src/lib/models/types.ts","../../../src/lib/models/Product.ts","../../../src/lib/models/Material.ts","../../../src/lib/models/ProductAsset.ts","../../../src/lib/models/ProductVariant.ts","../../../src/lib/models/Sku.ts"],"sourcesContent":["/**\n * Product knowledge base category model\n *\n * SMRT auto-generates REST APIs, MCP tools, and TypeScript clients from this class.\n */\n\nimport {\n foreignKey,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\n\n/**\n * Options for Category initialization\n */\nexport interface CategoryOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n name?: string;\n description?: string;\n parentId?: string;\n level?: number;\n productCount?: number;\n active?: boolean;\n}\n\n/**\n * Product knowledge base category for organizing product information.\n *\n * Optional tenancy — categories may be shared globally (tenantId=null) or\n * scoped to a tenant. Hierarchical via parentId.\n */\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n // See the matching note on `Product` — overriding `conflictColumns`\n // to include `tenant_id` causes a SQLite `ON CONFLICT clause does not\n // match any … UNIQUE constraint` error because the core schema\n // generator's hardcoded STI unique index is `(slug, context,\n // _meta_type)` and does not include the tenant column. Until the\n // upstream framework fix lands, two tenants cannot share a category\n // slug at the schema level.\n api: {\n include: ['list', 'get', 'create', 'update'], // Standard CRUD except delete\n },\n mcp: {\n include: ['list', 'get'], // AI tools for category discovery\n },\n cli: true, // Enable CLI commands for admin\n})\nexport class Category extends SmrtObject {\n /**\n * Tenant ID for multi-tenant isolation.\n * Nullable to support both tenant-scoped and global categories.\n */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n name = '';\n description = '';\n @foreignKey('Category')\n parentId?: string; // For hierarchical categories\n level = 0; // Category depth in hierarchy\n productCount = 0; // Number of products in this category\n active = true;\n\n constructor(options: CategoryOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n this.name = options.name || '';\n this.description = options.description || '';\n this.parentId = options.parentId;\n this.level = options.level || 0;\n this.productCount = options.productCount || 0;\n this.active = options.active !== undefined ? options.active : true;\n }\n}\n","/**\n * Shared types for the products package.\n *\n * @packageDocumentation\n */\n\n/**\n * Discriminator for Product STI subtypes.\n *\n * Industry-vertical templates extend `Product` with their own STI subtypes\n * (apparel uses `Style`/`Makeup`; furniture might use `Design`/`Finish`;\n * automotive `Model`/`Trim`) — the upstream package only ships the truly\n * generic primitives:\n *\n * - {@link ProductType.PRODUCT} — plain catalog item (base)\n * - {@link ProductType.MATERIAL} — raw input consumed by manufacturing\n *\n * The axis-declaration concept (\"this product varies along `size` with\n * values `[XS, S, M, L, XL]`\") is NOT a Product STI subtype — it lives in\n * its own model, {@link ProductVariant}, with a separate table. Per-SKU\n * value pins live on `Sku.attributes` (also in this package — `Sku` was\n * relocated from `@happyvertical/smrt-inventory` to here in Phase 1 so\n * every catalog primitive lives under one roof; inventory only holds\n * stock levels and movements now).\n */\nexport enum ProductType {\n /** Generic catalog item (default). */\n PRODUCT = 'product',\n /** A raw input — fabric, trim, packaging, etc. — consumed by manufacturing. */\n MATERIAL = 'material',\n}\n\n/**\n * High-level classification of a {@link ProductType.MATERIAL} item.\n *\n * Open string so consumers can extend with vertical-specific kinds without\n * an enum change. The `(string & {})` branch preserves the literal-string\n * autocomplete suggestions in IDEs — a bare `| string` would collapse the\n * whole union to `string` and erase the named hints (same pattern as\n * `StockMovementReason` in `@happyvertical/smrt-inventory`).\n */\nexport type MaterialKind =\n | 'fabric'\n | 'trim'\n | 'thread'\n | 'label'\n | 'packaging'\n | 'component'\n | (string & {});\n","/**\n * Product knowledge base model\n *\n * SMRT auto-generates REST APIs, MCP tools, and TypeScript clients from this class.\n */\n\nimport type { Asset } from '@happyvertical/smrt-assets';\nimport {\n assertValidOwnedAssetRelationship,\n assertValidOwnedAssetSortOrder,\n resolveOwnedAssetsById,\n} from '@happyvertical/smrt-assets';\nimport {\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport {\n getCurrentTenant,\n TenantScoped,\n tenantId,\n} from '@happyvertical/smrt-tenancy';\nimport { ProductType } from './types';\n\n/**\n * Options for Product initialization\n */\nexport interface ProductOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n productType?: ProductType;\n name?: string;\n description?: string;\n category?: string;\n manufacturer?: string;\n model?: string;\n price?: number;\n inStock?: boolean;\n specifications?: Record<string, unknown>;\n tags?: string[];\n}\n\n/**\n * Product information for knowledge base queries.\n *\n * STI base — subclasses (e.g. `Material` upstream, `Style`/`Makeup` in the\n * apparel template) share this table via the `_meta_type` discriminator\n * and `productType` field. Optional tenancy lets the same package serve\n * shared global catalogs OR per-merchant catalogs.\n */\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n // KNOWN LIMITATION (tracked for framework follow-up): the core schema\n // generator hardcodes the STI unique index as\n // `(slug, context, _meta_type)` and does not include `tenant_id`\n // even when the class is `@TenantScoped`. As a result two tenants\n // cannot save a row with the same slug+context+type — the UNIQUE\n // constraint at the SQL layer rejects the second insert.\n //\n // We deliberately do NOT override `conflictColumns` here to add\n // `tenant_id`: doing so would put the runtime upsert path\n // (`ON CONFLICT ('slug','context','_meta_type','tenant_id')`) out of\n // step with the actual unique index, producing `SQLITE_ERROR: ON\n // CONFLICT clause does not match any … UNIQUE constraint` on every\n // save. Production callers should either (a) namespace their slugs\n // per tenant on the application side (e.g. `${tenantId}-widget`), or\n // (b) wait for the upstream framework fix that extends the STI\n // unique index with `tenant_id` for tenant-scoped tables.\n api: {\n include: ['list', 'get', 'create', 'update'], // Standard CRUD except delete\n },\n mcp: {\n include: ['list', 'get'], // AI tools for product discovery\n },\n cli: true, // Enable CLI commands for admin\n})\nexport class Product extends SmrtObject {\n /**\n * Tenant ID for multi-tenant isolation.\n * Nullable to support both tenant-scoped and global catalogs.\n */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n /**\n * STI discriminator. Subclasses override this with their type.\n */\n productType: ProductType = ProductType.PRODUCT;\n\n name = '';\n description = '';\n category = ''; // Reference to category\n manufacturer = '';\n model = '';\n price = 0;\n inStock = true;\n specifications: Record<string, unknown> = {};\n tags: string[] = [];\n\n constructor(options: ProductOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n // Treat `null` like `undefined`: existing product rows written\n // before the `product_type` column existed hydrate with the field\n // as SQL `NULL`, and without this guard the SmrtObject loader would\n // overwrite the `ProductType.PRODUCT` initializer with `null`. The\n // STI discriminator `_meta_type` still identifies the row's\n // subtype; `productType` is the secondary human-readable label and\n // should fall back to the base default for legacy rows.\n if (options.productType !== undefined && options.productType !== null) {\n this.productType = options.productType;\n }\n this.name = options.name || '';\n this.description = options.description || '';\n this.category = options.category || '';\n this.manufacturer = options.manufacturer || '';\n this.model = options.model || '';\n this.price = options.price || 0;\n this.inStock = options.inStock !== undefined ? options.inStock : true;\n this.specifications = options.specifications || {};\n this.tags = options.tags || [];\n }\n\n async getSpecification(key: string): Promise<unknown> {\n return this.specifications[key];\n }\n\n async updateSpecification(key: string, value: unknown): Promise<void> {\n this.specifications[key] = value;\n }\n\n private async getProductAssetCollection() {\n const { ProductAssetCollection } = await import(\n '../collections/ProductAssetCollection'\n );\n return ProductAssetCollection.create({ db: this.db });\n }\n async getAssets(relationship?: string): Promise<Asset[]> {\n if (!this.id) {\n return [];\n }\n\n const productAssets = await this.getProductAssetCollection();\n // Don't pass `this.tenantId` here. ProductAsset is @TenantScoped, so the\n // tenancy interceptor auto-filters the underlying list() by the active\n // context. Passing `this.tenantId` would apply a second explicit filter on\n // TOP of the interceptor's — and when this Product is a global/shared row\n // (`tenantId === null`), that second filter would drop every per-tenant\n // link to it. The interceptor is the right boundary: in a tenant scope it\n // returns that tenant's links; outside any scope it returns everything. See\n // the `ProductAsset` model comment about cross-tenant linking.\n const linkedAssets = await productAssets.byLeft(\n this.id,\n relationship ? { relationship } : {},\n );\n\n // Use the ACTIVE tenant context's tenantId, not `this.tenantId`,\n // when resolving the underlying assets. `resolveOwnedAssetsById`\n // treats its `tenantId` arg as the caller's identity: when set, it\n // enters `withSystemContext` to bypass the interceptor and then\n // includes both that-tenant-owned AND global (tenantId === null)\n // assets in the visible set. Passing `this.tenantId` would force\n // a global Product (`tenantId === null`) running inside a tenant\n // request into the \"no caller tenant\" branch — the interceptor\n // would then filter to only the tenant's own assets and drop\n // every global asset linked to the shared product. Reading the\n // active context fixes both directions: tenant requests see\n // tenant + global assets; system requests see everything.\n const ctxTenantId = getCurrentTenant()?.tenantId ?? null;\n return resolveOwnedAssetsById(\n this.db,\n linkedAssets.map((link) => link.assetId),\n ctxTenantId,\n );\n }\n\n async addAsset(\n asset: Asset,\n relationship = 'attachment',\n sortOrder = 0,\n ): Promise<void> {\n if (!this.id || !asset.id) {\n throw new Error('Cannot associate unsaved product or asset');\n }\n\n assertValidOwnedAssetRelationship(relationship);\n assertValidOwnedAssetSortOrder(sortOrder);\n\n const productAssets = await this.getProductAssetCollection();\n // Same rationale as `getAssets` — the interceptor's auto-populate sets the\n // new row's `tenantId` from the active context, so we don't hard-wire\n // `this.tenantId`. When this Product is global (`tenantId === null`) but a\n // tenant is linking it, the link should land under that tenant, not under\n // the global namespace.\n await productAssets.attach(this.id, asset.id, {\n relationship,\n sortOrder,\n });\n }\n\n async removeAsset(assetId: string, relationship?: string): Promise<void> {\n if (!this.id) {\n return;\n }\n\n const productAssets = await this.getProductAssetCollection();\n // Tenant-scoped delete: pass only the relationship filter and let the\n // interceptor scope the underlying list() to the active tenant, rather\n // than constraining to `this.tenantId` (which on a global product would\n // never match a tenant-owned link). System-style callers without a tenant\n // context sweep every matching row — the existing `detach` semantics.\n await productAssets.detach(\n this.id,\n assetId,\n relationship ? { relationship } : {},\n );\n }\n}\n","/**\n * Material — STI subtype of Product representing a raw input consumed by\n * manufacturing: fabric, thread, trim, labels, packaging, components.\n *\n * Materials are first-class products in the catalog (the SAP/NetSuite pattern):\n * they have a name, description, vendor, unit cost, and live in inventory just\n * like finished goods. Bills of materials in `@happyvertical/smrt-manufacturing`\n * reference Materials by id.\n *\n * @packageDocumentation\n */\n\nimport { type Meta, smrt } from '@happyvertical/smrt-core';\nimport { TenantScoped } from '@happyvertical/smrt-tenancy';\nimport { Product, type ProductOptions } from './Product';\nimport { type MaterialKind, ProductType } from './types';\n\nexport interface MaterialOptions extends ProductOptions {\n materialKind?: MaterialKind;\n uom?: string;\n costPerUnit?: number;\n}\n\n// @TenantScoped is registered per concrete class, so inheriting from\n// Product is NOT enough — `MaterialCollection.list()` passes 'Material'\n// (not 'Product') to the interceptor, which then fails its\n// `isTenantScopedClass(className)` lookup and skips tenant auto-filter\n// + auto-populate. Repeat the decorator here so material rows\n// participate in the same tenant isolation as their Product parent.\n@TenantScoped({ mode: 'optional' })\n// SECURITY (S5 #1406): @smrt() generation config is ALSO registered per\n// concrete class and is NOT inherited from the STI parent. An empty\n// `@smrt()` here would resolve `getConfig('Material').api/.mcp` to\n// `undefined`, which the REST + MCP generators treat as \"expose\n// EVERYTHING\" — including `delete`, `create`, and `update` MCP tools —\n// even though the `Product` base deliberately restricts itself to CRUD\n// (no delete) over REST and read-only (`list`/`get`) over MCP. The\n// products `mcp.ts` generator enumerates the whole registry, so a\n// silently-wide-open Material surface ships the moment the package's own\n// server is generated. Re-declare the parent's restricted posture so the\n// STI child matches its base — and so consumers copying this canonical\n// subtype example (apparel `Style`/`Makeup`, automotive `Model`/`Trim`,\n// …) inherit the secure pattern instead of an accidental open surface.\n@smrt({\n api: {\n include: ['list', 'get', 'create', 'update'], // no delete, matches Product\n },\n mcp: {\n include: ['list', 'get'], // read-only AI tools, matches Product\n },\n cli: true,\n})\nexport class Material extends Product {\n override productType: ProductType = ProductType.MATERIAL;\n\n // STI child-specific fields use the `Meta<T>` type wrapper rather than\n // the runtime `@meta()` decorator. The scanner detects the wrapper at\n // build time (via the type annotation) and emits the field with\n // `type: 'meta'` in the manifest, which routes it through `_meta_data`\n // JSON storage at schema-generation time. The runtime decorator path\n // doesn't reach the manifest, so STI children that only use `@meta()`\n // get materialized as ordinary columns on the parent's table.\n\n /** Classification — fabric, trim, thread, label, packaging, component, ... */\n materialKind: Meta<MaterialKind> = 'component';\n\n /** Unit of measure — \"yards\", \"meters\", \"each\", \"grams\", \"lbs\". */\n uom: Meta<string> = 'each';\n\n /**\n * Latest known cost per UOM. For sophisticated cost rollup, manufacturing\n * may pull from purchase-order history instead of this denormalised value.\n */\n costPerUnit: Meta<number> = 0.0;\n\n constructor(options: MaterialOptions = {}) {\n super(options);\n if (options.materialKind !== undefined)\n this.materialKind = options.materialKind;\n if (options.uom !== undefined) this.uom = options.uom;\n if (options.costPerUnit !== undefined)\n this.costPerUnit = options.costPerUnit;\n }\n}\n","import type { SmrtObjectOptions } from '@happyvertical/smrt-core';\nimport {\n crossPackageRef,\n field,\n foreignKey,\n SmrtObject,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\n\nexport interface ProductAssetOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n productId?: string;\n assetId?: string;\n relationship?: string;\n sortOrder?: number;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableName: 'product_assets',\n // tenant_id is included so two tenants can independently link the same\n // shared product/asset under the same relationship without their rows\n // colliding (or worse, one tenant silently overwriting another's link\n // via UPSERT).\n conflictColumns: ['product_id', 'asset_id', 'relationship', 'tenant_id'],\n api: false,\n mcp: false,\n cli: false,\n})\nexport class ProductAsset extends SmrtObject {\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n @foreignKey('Product', { required: true })\n productId = '';\n\n @crossPackageRef('@happyvertical/smrt-assets:Asset', { required: true })\n assetId = '';\n\n @field({ required: true })\n relationship = 'attachment';\n\n @field()\n sortOrder = 0;\n\n constructor(options: ProductAssetOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.productId) this.productId = options.productId;\n if (options.assetId) this.assetId = options.assetId;\n if (options.relationship) this.relationship = options.relationship;\n if (options.sortOrder !== undefined) this.sortOrder = options.sortOrder;\n }\n}\n","/**\n * ProductVariant — declarative description of one axis along which a\n * product's SKUs differ.\n *\n * A `ProductVariant` row says \"for product X, axis Y has the following\n * allowed values\". The actual per-SKU value lives on `Sku.attributes`\n * (also in this package — `Sku` was relocated to `@happyvertical/smrt-products`\n * in Phase 1; inventory only holds stock motion now), keyed by `axisName`.\n * This split keeps the axis catalog (form choices, UI grouping, ordering)\n * separate from the per-unit instances.\n *\n * Deliberately generic. `axisName` is free-form — apparel teams might\n * use `'size'` and `'color'`, automotive teams `'trim'` and `'engine'`,\n * CPG teams `'packSize'` and `'flavor'`. The framework never inspects\n * the axis name.\n *\n * NOT a Product STI subtype — it's its own model with its own table,\n * because the shape (axis declaration) doesn't fit the Product schema\n * (no name, no price, no category — it's metadata about a Product, not\n * a Product itself).\n *\n * @packageDocumentation\n */\n\nimport {\n field,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\n\n/**\n * Options accepted by the {@link ProductVariant} constructor.\n */\nexport interface ProductVariantOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n productId?: string;\n axisName?: string;\n label?: string;\n allowedValues?: string[] | string;\n sortOrder?: number;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableName: 'product_variants',\n conflictColumns: ['product_id', 'axis_name', 'tenant_id'],\n api: { include: ['list', 'get', 'create', 'update'] },\n mcp: { include: ['list', 'get'] },\n cli: true,\n})\nexport class ProductVariant extends SmrtObject {\n /** Tenant scope. `null` means the variant axis is global. */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n /**\n * Plain string reference to the {@link Product} this axis belongs to\n * (or any Product STI subtype — `Material`, or vertical subtypes\n * defined in templates such as the apparel `Style` / `Makeup`).\n */\n @field({ required: true })\n productId: string = '';\n\n /**\n * The name of the axis (`'size'`, `'color'`, `'finish'`, `'voltage'`,\n * `'packSize'`, …). Free-form — the framework treats this as opaque.\n */\n @field({ required: true })\n axisName: string = '';\n\n /** Optional human-friendly label for forms / UIs (defaults to `axisName`). */\n label: string = '';\n\n /**\n * Allowed values for this axis, stored as a JSON string. Named\n * `allowedValues` (rather than `values`) because the unprefixed name\n * collides with the SQL `VALUES` keyword on several engines. Use\n * {@link getValues} / {@link setValues} to round-trip the array form.\n */\n allowedValues: string = '[]';\n\n /** Sort order for displaying multiple axes in a consistent column order. */\n sortOrder: number = 0;\n\n constructor(options: ProductVariantOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.productId !== undefined) this.productId = options.productId;\n if (options.axisName !== undefined) this.axisName = options.axisName;\n if (options.label !== undefined) this.label = options.label;\n if (options.allowedValues !== undefined)\n this.setValues(options.allowedValues);\n if (options.sortOrder !== undefined) this.sortOrder = options.sortOrder;\n\n // Default the label to axisName when no explicit label was supplied.\n // The field docstring promises this behavior and admin UIs render\n // `variant.label` directly; without this fallback an axis declared\n // as `{ axisName: 'size' }` would render with a blank label.\n if (!this.label && this.axisName) {\n this.label = this.axisName;\n }\n }\n\n /**\n * Parse and return the {@link allowedValues} JSON array. Returns an\n * empty array if the stored value cannot be parsed as an array.\n */\n getValues(): string[] {\n if (!this.allowedValues) return [];\n try {\n const parsed = JSON.parse(this.allowedValues);\n return Array.isArray(parsed) ? parsed.map((value) => String(value)) : [];\n } catch {\n return [];\n }\n }\n\n /**\n * Serialize the allowed values back into the stored\n * {@link allowedValues} string. Accepts either an array or a\n * pre-serialized JSON string.\n */\n setValues(value: string[] | string): void {\n if (typeof value === 'string') {\n this.allowedValues = value;\n return;\n }\n this.allowedValues = JSON.stringify(Array.isArray(value) ? value : []);\n }\n}\n","/**\n * Sku — smallest sellable and countable unit.\n *\n * A SKU is the concrete catalog row that downstream inventory counts.\n * It references a higher-level concept in this same package (a\n * {@link Product} or any of its STI subtypes) via the plain string\n * `productId` field. The same pattern serves apparel (one SKU per\n * size/color), furniture (one SKU per finish), automotive parts,\n * grocery (one SKU per pack size), or any other vertical that needs\n * to count discrete units.\n *\n * Axis values such as `{ size: 'M', color: 'navy' }`, `{ finish: 'walnut' }`,\n * or `{ packSize: '12oz' }` are stored as opaque JSON in `attributes`;\n * the declarative axis catalog lives in {@link ProductVariant} in this\n * same package.\n *\n * Stock balance and movement history for a SKU live in\n * `@happyvertical/smrt-inventory` as `StockLevel` and `StockMovement`.\n *\n * @packageDocumentation\n */\n\nimport {\n field,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\n\n/**\n * Options accepted by the {@link Sku} constructor.\n */\nexport interface SkuOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n productId?: string;\n code?: string;\n barcode?: string;\n name?: string;\n attributes?: Record<string, unknown> | string;\n weightGrams?: number;\n parentSkuId?: string;\n active?: boolean;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableName: 'product_skus',\n conflictColumns: ['code', 'tenant_id'],\n api: { include: ['list', 'get', 'create', 'update'] },\n mcp: { include: ['list', 'get'] },\n cli: true,\n})\nexport class Sku extends SmrtObject {\n /** Tenant scope. `null` means the SKU is a global record. */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n /**\n * Plain string reference to a row in this package — typically a\n * `Product` id (or any of its STI subtypes, such as `Material`\n * upstream or `Style` / `Makeup` in the apparel template).\n *\n * Marked required so the framework rejects a save with `productId`\n * empty or unset. Without this, downstream consumers (inventory\n * stock motion, manufacturing BOM resolution) would have to filter\n * out orphan SKU rows that point at no product — a sharp footgun\n * the moment one slips through. The `@field({ required: true })`\n * decorator also surfaces the constraint in generated REST/MCP\n * schemas.\n */\n @field({ required: true })\n productId: string = '';\n\n /**\n * Stable, human-meaningful identifier such as a UPC, internal SKU\n * code, or part number. Together with `tenantId` this is the natural\n * key (`conflictColumns: ['code', 'tenant_id']`), so re-saving an\n * identical row is an upsert rather than a UNIQUE violation.\n */\n @field({ required: true })\n code: string = '';\n\n /** Optional scannable barcode (EAN/UPC/Code-128/etc.). */\n barcode: string = '';\n\n /** Display name for UIs. Optional — `code` is enough for machines. */\n name: string = '';\n\n /**\n * Axis values for this SKU expressed as JSON, e.g. `{ size: 'M' }`,\n * `{ finish: 'walnut' }`, or `{ voltage: '230V' }`.\n *\n * The persisted column type is text; use {@link getAttributes} and\n * {@link setAttributes} to round-trip parsed values without worrying\n * about parse errors.\n */\n attributes: string = '{}';\n\n /** Optional physical weight in grams for shipping / cost calculations. */\n @field({ type: 'decimal' })\n weightGrams: number = 0.0;\n\n /**\n * Optional self-reference for bundles / kits — set to the id of the\n * \"parent\" SKU that this SKU is a component of.\n */\n parentSkuId: string = '';\n\n /**\n * Soft-active flag. Inactive SKUs stay queryable for history but\n * should not be offered for sale or production planning.\n */\n active: boolean = true;\n\n constructor(options: SkuOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.productId !== undefined) this.productId = options.productId;\n if (options.code !== undefined) this.code = options.code;\n if (options.barcode !== undefined) this.barcode = options.barcode;\n if (options.name !== undefined) this.name = options.name;\n if (options.attributes !== undefined)\n this.setAttributes(options.attributes);\n if (options.weightGrams !== undefined)\n this.weightGrams = options.weightGrams;\n if (options.parentSkuId !== undefined)\n this.parentSkuId = options.parentSkuId;\n if (options.active !== undefined) this.active = options.active;\n }\n\n /**\n * Parse and return the {@link attributes} JSON. Returns an empty\n * object if the stored value is invalid JSON so callers don't have\n * to wrap every read in a try/catch.\n */\n getAttributes(): Record<string, unknown> {\n if (!this.attributes) return {};\n try {\n const parsed = JSON.parse(this.attributes);\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed)\n ? (parsed as Record<string, unknown>)\n : {};\n } catch {\n return {};\n }\n }\n\n /**\n * Serialize axis values back into the stored {@link attributes}\n * string. Accepts either an object (will be `JSON.stringify`'d) or a\n * raw JSON string that the caller has already serialized.\n */\n setAttributes(value: Record<string, unknown> | string): void {\n if (typeof value === 'string') {\n this.attributes = value;\n return;\n }\n this.attributes = JSON.stringify(value ?? {});\n }\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Sku-C181XteX.js","names":[],"sources":["../../../src/lib/models/Category.ts","../../../src/lib/models/types.ts","../../../src/lib/models/Product.ts","../../../src/lib/models/Material.ts","../../../src/lib/models/ProductAsset.ts","../../../src/lib/models/ProductVariant.ts","../../../src/lib/models/Sku.ts"],"sourcesContent":["/**\n * Product knowledge base category model\n *\n * SMRT auto-generates REST APIs, MCP tools, and TypeScript clients from this class.\n */\n\nimport {\n foreignKey,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\n\n/**\n * Options for Category initialization\n */\nexport interface CategoryOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n name?: string;\n description?: string;\n parentId?: string;\n level?: number;\n productCount?: number;\n active?: boolean;\n}\n\n/**\n * Product knowledge base category for organizing product information.\n *\n * Optional tenancy — categories may be shared globally (tenantId=null) or\n * scoped to a tenant. Hierarchical via parentId.\n */\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n // See the matching note on `Product` — overriding `conflictColumns`\n // to include `tenant_id` causes a SQLite `ON CONFLICT clause does not\n // match any … UNIQUE constraint` error because the core schema\n // generator's hardcoded STI unique index is `(slug, context,\n // _meta_type)` and does not include the tenant column. Until the\n // upstream framework fix lands, two tenants cannot share a category\n // slug at the schema level.\n api: {\n include: ['list', 'get', 'create', 'update'], // Standard CRUD except delete\n },\n mcp: {\n include: ['list', 'get'], // AI tools for category discovery\n },\n cli: true, // Enable CLI commands for admin\n})\nexport class Category extends SmrtObject {\n /**\n * Tenant ID for multi-tenant isolation.\n * Nullable to support both tenant-scoped and global categories.\n */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n name = '';\n description = '';\n @foreignKey('Category')\n parentId?: string; // For hierarchical categories\n level = 0; // Category depth in hierarchy\n productCount = 0; // Number of products in this category\n active = true;\n\n constructor(options: CategoryOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n this.name = options.name || '';\n this.description = options.description || '';\n this.parentId = options.parentId;\n this.level = options.level || 0;\n this.productCount = options.productCount || 0;\n this.active = options.active !== undefined ? options.active : true;\n }\n}\n","/**\n * Shared types for the products package.\n *\n * @packageDocumentation\n */\n\n/**\n * Discriminator for Product STI subtypes.\n *\n * Industry-vertical templates extend `Product` with their own STI subtypes\n * (apparel uses `Style`/`Makeup`; furniture might use `Design`/`Finish`;\n * automotive `Model`/`Trim`) — the upstream package only ships the truly\n * generic primitives:\n *\n * - {@link ProductType.PRODUCT} — plain catalog item (base)\n * - {@link ProductType.MATERIAL} — raw input consumed by manufacturing\n *\n * The axis-declaration concept (\"this product varies along `size` with\n * values `[XS, S, M, L, XL]`\") is NOT a Product STI subtype — it lives in\n * its own model, {@link ProductVariant}, with a separate table. Per-SKU\n * value pins live on `Sku.attributes` (also in this package — `Sku` was\n * relocated from `@happyvertical/smrt-inventory` to here in Phase 1 so\n * every catalog primitive lives under one roof; inventory only holds\n * stock levels and movements now).\n */\nexport enum ProductType {\n /** Generic catalog item (default). */\n PRODUCT = 'product',\n /** A raw input — fabric, trim, packaging, etc. — consumed by manufacturing. */\n MATERIAL = 'material',\n}\n\n/**\n * High-level classification of a {@link ProductType.MATERIAL} item.\n *\n * Open string so consumers can extend with vertical-specific kinds without\n * an enum change. The `(string & {})` branch preserves the literal-string\n * autocomplete suggestions in IDEs — a bare `| string` would collapse the\n * whole union to `string` and erase the named hints (same pattern as\n * `StockMovementReason` in `@happyvertical/smrt-inventory`).\n */\nexport type MaterialKind =\n | 'fabric'\n | 'trim'\n | 'thread'\n | 'label'\n | 'packaging'\n | 'component'\n | (string & {});\n","/**\n * Product knowledge base model\n *\n * SMRT auto-generates REST APIs, MCP tools, and TypeScript clients from this class.\n */\n\nimport type { Asset } from '@happyvertical/smrt-assets';\nimport {\n assertValidOwnedAssetRelationship,\n assertValidOwnedAssetSortOrder,\n resolveOwnedAssetsById,\n} from '@happyvertical/smrt-assets';\nimport {\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport {\n getCurrentTenant,\n TenantScoped,\n tenantId,\n} from '@happyvertical/smrt-tenancy';\nimport { ProductType } from './types';\n\n/**\n * Options for Product initialization\n */\nexport interface ProductOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n productType?: ProductType;\n name?: string;\n description?: string;\n category?: string;\n manufacturer?: string;\n model?: string;\n price?: number;\n inStock?: boolean;\n specifications?: Record<string, unknown>;\n tags?: string[];\n}\n\n/**\n * Product information for knowledge base queries.\n *\n * STI base — subclasses (e.g. `Material` upstream, `Style`/`Makeup` in the\n * apparel template) share this table via the `_meta_type` discriminator\n * and `productType` field. Optional tenancy lets the same package serve\n * shared global catalogs OR per-merchant catalogs.\n */\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n // KNOWN LIMITATION (tracked for framework follow-up): the core schema\n // generator hardcodes the STI unique index as\n // `(slug, context, _meta_type)` and does not include `tenant_id`\n // even when the class is `@TenantScoped`. As a result two tenants\n // cannot save a row with the same slug+context+type — the UNIQUE\n // constraint at the SQL layer rejects the second insert.\n //\n // We deliberately do NOT override `conflictColumns` here to add\n // `tenant_id`: doing so would put the runtime upsert path\n // (`ON CONFLICT ('slug','context','_meta_type','tenant_id')`) out of\n // step with the actual unique index, producing `SQLITE_ERROR: ON\n // CONFLICT clause does not match any … UNIQUE constraint` on every\n // save. Production callers should either (a) namespace their slugs\n // per tenant on the application side (e.g. `${tenantId}-widget`), or\n // (b) wait for the upstream framework fix that extends the STI\n // unique index with `tenant_id` for tenant-scoped tables.\n api: {\n include: ['list', 'get', 'create', 'update'], // Standard CRUD except delete\n },\n mcp: {\n include: ['list', 'get'], // AI tools for product discovery\n },\n cli: true, // Enable CLI commands for admin\n})\nexport class Product extends SmrtObject {\n /**\n * Tenant ID for multi-tenant isolation.\n * Nullable to support both tenant-scoped and global catalogs.\n */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n /**\n * STI discriminator. Subclasses override this with their type.\n */\n productType: ProductType = ProductType.PRODUCT;\n\n name = '';\n description = '';\n category = ''; // Reference to category\n manufacturer = '';\n model = '';\n price = 0;\n inStock = true;\n specifications: Record<string, unknown> = {};\n tags: string[] = [];\n\n constructor(options: ProductOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n // Treat `null` like `undefined`: existing product rows written\n // before the `product_type` column existed hydrate with the field\n // as SQL `NULL`, and without this guard the SmrtObject loader would\n // overwrite the `ProductType.PRODUCT` initializer with `null`. The\n // STI discriminator `_meta_type` still identifies the row's\n // subtype; `productType` is the secondary human-readable label and\n // should fall back to the base default for legacy rows.\n if (options.productType !== undefined && options.productType !== null) {\n this.productType = options.productType;\n }\n this.name = options.name || '';\n this.description = options.description || '';\n this.category = options.category || '';\n this.manufacturer = options.manufacturer || '';\n this.model = options.model || '';\n this.price = options.price || 0;\n this.inStock = options.inStock !== undefined ? options.inStock : true;\n this.specifications = options.specifications || {};\n this.tags = options.tags || [];\n }\n\n async getSpecification(key: string): Promise<unknown> {\n return this.specifications[key];\n }\n\n async updateSpecification(key: string, value: unknown): Promise<void> {\n this.specifications[key] = value;\n }\n\n private async getProductAssetCollection() {\n const { ProductAssetCollection } = await import(\n '../collections/ProductAssetCollection'\n );\n return ProductAssetCollection.create({ db: this.db });\n }\n async getAssets(relationship?: string): Promise<Asset[]> {\n if (!this.id) {\n return [];\n }\n\n const productAssets = await this.getProductAssetCollection();\n // Don't pass `this.tenantId` here. ProductAsset is @TenantScoped, so the\n // tenancy interceptor auto-filters the underlying list() by the active\n // context. Passing `this.tenantId` would apply a second explicit filter on\n // TOP of the interceptor's — and when this Product is a global/shared row\n // (`tenantId === null`), that second filter would drop every per-tenant\n // link to it. The interceptor is the right boundary: in a tenant scope it\n // returns that tenant's links; outside any scope it returns everything. See\n // the `ProductAsset` model comment about cross-tenant linking.\n const linkedAssets = await productAssets.byLeft(\n this.id,\n relationship ? { relationship } : {},\n );\n\n // Use the ACTIVE tenant context's tenantId, not `this.tenantId`,\n // when resolving the underlying assets. `resolveOwnedAssetsById`\n // treats its `tenantId` arg as the caller's identity: when set, it\n // enters `withSystemContext` to bypass the interceptor and then\n // includes both that-tenant-owned AND global (tenantId === null)\n // assets in the visible set. Passing `this.tenantId` would force\n // a global Product (`tenantId === null`) running inside a tenant\n // request into the \"no caller tenant\" branch — the interceptor\n // would then filter to only the tenant's own assets and drop\n // every global asset linked to the shared product. Reading the\n // active context fixes both directions: tenant requests see\n // tenant + global assets; system requests see everything.\n const ctxTenantId = getCurrentTenant()?.tenantId ?? null;\n return resolveOwnedAssetsById(\n this.db,\n linkedAssets.map((link) => link.assetId),\n ctxTenantId,\n );\n }\n\n async addAsset(\n asset: Asset,\n relationship = 'attachment',\n sortOrder = 0,\n ): Promise<void> {\n if (!this.id || !asset.id) {\n throw new Error('Cannot associate unsaved product or asset');\n }\n\n assertValidOwnedAssetRelationship(relationship);\n assertValidOwnedAssetSortOrder(sortOrder);\n\n const productAssets = await this.getProductAssetCollection();\n // Same rationale as `getAssets` — the interceptor's auto-populate sets the\n // new row's `tenantId` from the active context, so we don't hard-wire\n // `this.tenantId`. When this Product is global (`tenantId === null`) but a\n // tenant is linking it, the link should land under that tenant, not under\n // the global namespace.\n await productAssets.attach(this.id, asset.id, {\n relationship,\n sortOrder,\n });\n }\n\n async removeAsset(assetId: string, relationship?: string): Promise<void> {\n if (!this.id) {\n return;\n }\n\n const productAssets = await this.getProductAssetCollection();\n // Tenant-scoped delete: pass only the relationship filter and let the\n // interceptor scope the underlying list() to the active tenant, rather\n // than constraining to `this.tenantId` (which on a global product would\n // never match a tenant-owned link). System-style callers without a tenant\n // context sweep every matching row — the existing `detach` semantics.\n await productAssets.detach(\n this.id,\n assetId,\n relationship ? { relationship } : {},\n );\n }\n}\n","/**\n * Material — STI subtype of Product representing a raw input consumed by\n * manufacturing: fabric, thread, trim, labels, packaging, components.\n *\n * Materials are first-class products in the catalog (the SAP/NetSuite pattern):\n * they have a name, description, vendor, unit cost, and live in inventory just\n * like finished goods. Bills of materials in `@happyvertical/smrt-manufacturing`\n * reference Materials by id.\n *\n * @packageDocumentation\n */\n\nimport { type Meta, smrt } from '@happyvertical/smrt-core';\nimport { TenantScoped } from '@happyvertical/smrt-tenancy';\nimport { Product, type ProductOptions } from './Product';\nimport { type MaterialKind, ProductType } from './types';\n\nexport interface MaterialOptions extends ProductOptions {\n materialKind?: MaterialKind;\n uom?: string;\n costPerUnit?: number;\n}\n\n// @TenantScoped is registered per concrete class, so inheriting from\n// Product is NOT enough — `MaterialCollection.list()` passes 'Material'\n// (not 'Product') to the interceptor, which then fails its\n// `isTenantScopedClass(className)` lookup and skips tenant auto-filter\n// + auto-populate. Repeat the decorator here so material rows\n// participate in the same tenant isolation as their Product parent.\n@TenantScoped({ mode: 'optional' })\n// SECURITY (S5 #1406): @smrt() generation config is ALSO registered per\n// concrete class and is NOT inherited from the STI parent. An empty\n// `@smrt()` here would resolve `getConfig('Material').api/.mcp` to\n// `undefined`, which the REST + MCP generators treat as \"expose\n// EVERYTHING\" — including `delete`, `create`, and `update` MCP tools —\n// even though the `Product` base deliberately restricts itself to CRUD\n// (no delete) over REST and read-only (`list`/`get`) over MCP. The\n// products `mcp.ts` generator enumerates the whole registry, so a\n// silently-wide-open Material surface ships the moment the package's own\n// server is generated. Re-declare the parent's restricted posture so the\n// STI child matches its base — and so consumers copying this canonical\n// subtype example (apparel `Style`/`Makeup`, automotive `Model`/`Trim`,\n// …) inherit the secure pattern instead of an accidental open surface.\n@smrt({\n api: {\n include: ['list', 'get', 'create', 'update'], // no delete, matches Product\n },\n mcp: {\n include: ['list', 'get'], // read-only AI tools, matches Product\n },\n cli: true,\n})\nexport class Material extends Product {\n override productType: ProductType = ProductType.MATERIAL;\n\n // STI child-specific fields use the `Meta<T>` type wrapper rather than\n // the runtime `@meta()` decorator. The scanner detects the wrapper at\n // build time (via the type annotation) and emits the field with\n // `type: 'meta'` in the manifest, which routes it through `_meta_data`\n // JSON storage at schema-generation time. The runtime decorator path\n // doesn't reach the manifest, so STI children that only use `@meta()`\n // get materialized as ordinary columns on the parent's table.\n\n /** Classification — fabric, trim, thread, label, packaging, component, ... */\n materialKind: Meta<MaterialKind> = 'component';\n\n /** Unit of measure — \"yards\", \"meters\", \"each\", \"grams\", \"lbs\". */\n uom: Meta<string> = 'each';\n\n /**\n * Latest known cost per UOM. For sophisticated cost rollup, manufacturing\n * may pull from purchase-order history instead of this denormalised value.\n */\n costPerUnit: Meta<number> = 0.0;\n\n constructor(options: MaterialOptions = {}) {\n super(options);\n if (options.materialKind !== undefined)\n this.materialKind = options.materialKind;\n if (options.uom !== undefined) this.uom = options.uom;\n if (options.costPerUnit !== undefined)\n this.costPerUnit = options.costPerUnit;\n }\n}\n","import type { SmrtObjectOptions } from '@happyvertical/smrt-core';\nimport {\n crossPackageRef,\n field,\n foreignKey,\n SmrtObject,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\n\nexport interface ProductAssetOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n productId?: string;\n assetId?: string;\n relationship?: string;\n sortOrder?: number;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableName: 'product_assets',\n // tenant_id is included so two tenants can independently link the same\n // shared product/asset under the same relationship without their rows\n // colliding (or worse, one tenant silently overwriting another's link\n // via UPSERT).\n conflictColumns: ['product_id', 'asset_id', 'relationship', 'tenant_id'],\n api: false,\n mcp: false,\n cli: false,\n})\nexport class ProductAsset extends SmrtObject {\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n @foreignKey('Product', { required: true })\n productId = '';\n\n @crossPackageRef('@happyvertical/smrt-assets:Asset', { required: true })\n assetId = '';\n\n @field({ required: true })\n relationship = 'attachment';\n\n @field()\n sortOrder = 0;\n\n constructor(options: ProductAssetOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.productId) this.productId = options.productId;\n if (options.assetId) this.assetId = options.assetId;\n if (options.relationship) this.relationship = options.relationship;\n if (options.sortOrder !== undefined) this.sortOrder = options.sortOrder;\n }\n}\n","/**\n * ProductVariant — declarative description of one axis along which a\n * product's SKUs differ.\n *\n * A `ProductVariant` row says \"for product X, axis Y has the following\n * allowed values\". The actual per-SKU value lives on `Sku.attributes`\n * (also in this package — `Sku` was relocated to `@happyvertical/smrt-products`\n * in Phase 1; inventory only holds stock motion now), keyed by `axisName`.\n * This split keeps the axis catalog (form choices, UI grouping, ordering)\n * separate from the per-unit instances.\n *\n * Deliberately generic. `axisName` is free-form — apparel teams might\n * use `'size'` and `'color'`, automotive teams `'trim'` and `'engine'`,\n * CPG teams `'packSize'` and `'flavor'`. The framework never inspects\n * the axis name.\n *\n * NOT a Product STI subtype — it's its own model with its own table,\n * because the shape (axis declaration) doesn't fit the Product schema\n * (no name, no price, no category — it's metadata about a Product, not\n * a Product itself).\n *\n * @packageDocumentation\n */\n\nimport {\n field,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\n\n/**\n * Options accepted by the {@link ProductVariant} constructor.\n */\nexport interface ProductVariantOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n productId?: string;\n axisName?: string;\n label?: string;\n allowedValues?: string[] | string;\n sortOrder?: number;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableName: 'product_variants',\n conflictColumns: ['product_id', 'axis_name', 'tenant_id'],\n api: { include: ['list', 'get', 'create', 'update'] },\n mcp: { include: ['list', 'get'] },\n cli: true,\n})\nexport class ProductVariant extends SmrtObject {\n /** Tenant scope. `null` means the variant axis is global. */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n /**\n * Plain string reference to the {@link Product} this axis belongs to\n * (or any Product STI subtype — `Material`, or vertical subtypes\n * defined in templates such as the apparel `Style` / `Makeup`).\n */\n @field({ required: true })\n productId: string = '';\n\n /**\n * The name of the axis (`'size'`, `'color'`, `'finish'`, `'voltage'`,\n * `'packSize'`, …). Free-form — the framework treats this as opaque.\n */\n @field({ required: true })\n axisName: string = '';\n\n /** Optional human-friendly label for forms / UIs (defaults to `axisName`). */\n label: string = '';\n\n /**\n * Allowed values for this axis, stored as a JSON string. Named\n * `allowedValues` (rather than `values`) because the unprefixed name\n * collides with the SQL `VALUES` keyword on several engines. Use\n * {@link getValues} / {@link setValues} to round-trip the array form.\n */\n allowedValues: string = '[]';\n\n /** Sort order for displaying multiple axes in a consistent column order. */\n sortOrder: number = 0;\n\n constructor(options: ProductVariantOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.productId !== undefined) this.productId = options.productId;\n if (options.axisName !== undefined) this.axisName = options.axisName;\n if (options.label !== undefined) this.label = options.label;\n if (options.allowedValues !== undefined)\n this.setValues(options.allowedValues);\n if (options.sortOrder !== undefined) this.sortOrder = options.sortOrder;\n\n // Default the label to axisName when no explicit label was supplied.\n // The field docstring promises this behavior and admin UIs render\n // `variant.label` directly; without this fallback an axis declared\n // as `{ axisName: 'size' }` would render with a blank label.\n if (!this.label && this.axisName) {\n this.label = this.axisName;\n }\n }\n\n /**\n * Parse and return the {@link allowedValues} JSON array. Returns an\n * empty array if the stored value cannot be parsed as an array.\n */\n getValues(): string[] {\n if (!this.allowedValues) return [];\n try {\n const parsed = JSON.parse(this.allowedValues);\n return Array.isArray(parsed) ? parsed.map((value) => String(value)) : [];\n } catch {\n return [];\n }\n }\n\n /**\n * Serialize the allowed values back into the stored\n * {@link allowedValues} string. Accepts either an array or a\n * pre-serialized JSON string.\n */\n setValues(value: string[] | string): void {\n if (typeof value === 'string') {\n this.allowedValues = value;\n return;\n }\n this.allowedValues = JSON.stringify(Array.isArray(value) ? value : []);\n }\n}\n","/**\n * Sku — smallest sellable and countable unit.\n *\n * A SKU is the concrete catalog row that downstream inventory counts.\n * It references a higher-level concept in this same package (a\n * {@link Product} or any of its STI subtypes) via the plain string\n * `productId` field. The same pattern serves apparel (one SKU per\n * size/color), furniture (one SKU per finish), automotive parts,\n * grocery (one SKU per pack size), or any other vertical that needs\n * to count discrete units.\n *\n * Axis values such as `{ size: 'M', color: 'navy' }`, `{ finish: 'walnut' }`,\n * or `{ packSize: '12oz' }` are stored as opaque JSON in `attributes`;\n * the declarative axis catalog lives in {@link ProductVariant} in this\n * same package.\n *\n * Stock balance and movement history for a SKU live in\n * `@happyvertical/smrt-inventory` as `StockLevel` and `StockMovement`.\n *\n * @packageDocumentation\n */\n\nimport {\n field,\n SmrtObject,\n type SmrtObjectOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\n\n/**\n * Options accepted by the {@link Sku} constructor.\n */\nexport interface SkuOptions extends SmrtObjectOptions {\n tenantId?: string | null;\n productId?: string;\n code?: string;\n barcode?: string;\n name?: string;\n attributes?: Record<string, unknown> | string;\n weightGrams?: number;\n parentSkuId?: string;\n active?: boolean;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableName: 'product_skus',\n conflictColumns: ['code', 'tenant_id'],\n api: { include: ['list', 'get', 'create', 'update'] },\n mcp: { include: ['list', 'get'] },\n cli: true,\n})\nexport class Sku extends SmrtObject {\n /** Tenant scope. `null` means the SKU is a global record. */\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n /**\n * Plain string reference to a row in this package — typically a\n * `Product` id (or any of its STI subtypes, such as `Material`\n * upstream or `Style` / `Makeup` in the apparel template).\n *\n * Marked required so the framework rejects a save with `productId`\n * empty or unset. Without this, downstream consumers (inventory\n * stock motion, manufacturing BOM resolution) would have to filter\n * out orphan SKU rows that point at no product — a sharp footgun\n * the moment one slips through. The `@field({ required: true })`\n * decorator also surfaces the constraint in generated REST/MCP\n * schemas.\n */\n @field({ required: true })\n productId: string = '';\n\n /**\n * Stable, human-meaningful identifier such as a UPC, internal SKU\n * code, or part number. Together with `tenantId` this is the natural\n * key (`conflictColumns: ['code', 'tenant_id']`), so re-saving an\n * identical row is an upsert rather than a UNIQUE violation.\n */\n @field({ required: true })\n code: string = '';\n\n /** Optional scannable barcode (EAN/UPC/Code-128/etc.). */\n barcode: string = '';\n\n /** Display name for UIs. Optional — `code` is enough for machines. */\n name: string = '';\n\n /**\n * Axis values for this SKU expressed as JSON, e.g. `{ size: 'M' }`,\n * `{ finish: 'walnut' }`, or `{ voltage: '230V' }`.\n *\n * The persisted column type is text; use {@link getAttributes} and\n * {@link setAttributes} to round-trip parsed values without worrying\n * about parse errors.\n */\n attributes: string = '{}';\n\n /** Optional physical weight in grams for shipping / cost calculations. */\n @field({ type: 'decimal' })\n weightGrams: number = 0.0;\n\n /**\n * Optional self-reference for bundles / kits — set to the id of the\n * \"parent\" SKU that this SKU is a component of.\n */\n parentSkuId: string = '';\n\n /**\n * Soft-active flag. Inactive SKUs stay queryable for history but\n * should not be offered for sale or production planning.\n */\n active: boolean = true;\n\n constructor(options: SkuOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.productId !== undefined) this.productId = options.productId;\n if (options.code !== undefined) this.code = options.code;\n if (options.barcode !== undefined) this.barcode = options.barcode;\n if (options.name !== undefined) this.name = options.name;\n if (options.attributes !== undefined)\n this.setAttributes(options.attributes);\n if (options.weightGrams !== undefined)\n this.weightGrams = options.weightGrams;\n if (options.parentSkuId !== undefined)\n this.parentSkuId = options.parentSkuId;\n if (options.active !== undefined) this.active = options.active;\n }\n\n /**\n * Parse and return the {@link attributes} JSON. Returns an empty\n * object if the stored value is invalid JSON so callers don't have\n * to wrap every read in a try/catch.\n */\n getAttributes(): Record<string, unknown> {\n if (!this.attributes) return {};\n try {\n const parsed = JSON.parse(this.attributes);\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed)\n ? (parsed as Record<string, unknown>)\n : {};\n } catch {\n return {};\n }\n }\n\n /**\n * Serialize axis values back into the stored {@link attributes}\n * string. Accepts either an object (will be `JSON.stringify`'d) or a\n * raw JSON string that the caller has already serialized.\n */\n setAttributes(value: Record<string, unknown> | string): void {\n if (typeof value === 'string') {\n this.attributes = value;\n return;\n }\n this.attributes = JSON.stringify(value ?? {});\n }\n}\n"],"mappings":";;;;;;;;;;AAmDO,IAAA,WAAA,MAAM,iBAAiB,WAAW;;;;;CAKvC,WAC0B;CAE1B,OAAO;CACP,cAAc;CACd;CAEA,QAAQ;CACR,eAAe;CACf,SAAS;CAET,YAAY,UAA2B,CAAC,GAAG;EACzC,MAAM,OAAO;EACb,IAAI,QAAQ,aAAa,KAAA,GAAW,KAAK,WAAW,QAAQ;EAC5D,KAAK,OAAO,QAAQ,QAAQ;EAC5B,KAAK,cAAc,QAAQ,eAAe;EAC1C,KAAK,WAAW,QAAQ;EACxB,KAAK,QAAQ,QAAQ,SAAS;EAC9B,KAAK,eAAe,QAAQ,gBAAgB;EAC5C,KAAK,SAAS,QAAQ,WAAW,KAAA,IAAY,QAAQ,SAAS;CAChE;AACF;YArBG,SAAS,EAAE,UAAU,KAAK,CAAC,CAAA,GAAA,SAAA,WAAA,YAAA,KAAA,CAAA;YAK3B,WAAW,UAAU,CAAA,GAAA,SAAA,WAAA,YAAA,KAAA,CAAA;uBA5BvB,aAAa,EAAE,MAAM,WAAW,CAAC,GACjC,KAAK;CACJ,eAAe;CAQf,KAAK,EACH,SAAS;EAAC;EAAQ;EAAO;EAAU;CAAQ,EAC7C;CACA,KAAK,EACH,SAAS,CAAC,QAAQ,KAAK,EACzB;CACA,KAAK;AACP,CAAC,CAAA,GAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACzBD,IAAY,cAAL,yBAAA,aAAA;;CAEL,YAAA,aAAA;;CAEA,YAAA,cAAA;;AACF,EAAA,CAAA,CAAA;;;AC8CO,IAAA,UAAA,MAAM,gBAAgB,WAAW;;;;;CAKtC,WAC0B;;;;CAK1B,cAA2B,YAAY;CAEvC,OAAO;CACP,cAAc;CACd,WAAW;CACX,eAAe;CACf,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,iBAA0C,CAAC;CAC3C,OAAiB,CAAC;CAElB,YAAY,UAA0B,CAAC,GAAG;EACxC,MAAM,OAAO;EACb,IAAI,QAAQ,aAAa,KAAA,GAAW,KAAK,WAAW,QAAQ;EAQ5D,IAAI,QAAQ,gBAAgB,KAAA,KAAa,QAAQ,gBAAgB,MAC/D,KAAK,cAAc,QAAQ;EAE7B,KAAK,OAAO,QAAQ,QAAQ;EAC5B,KAAK,cAAc,QAAQ,eAAe;EAC1C,KAAK,WAAW,QAAQ,YAAY;EACpC,KAAK,eAAe,QAAQ,gBAAgB;EAC5C,KAAK,QAAQ,QAAQ,SAAS;EAC9B,KAAK,QAAQ,QAAQ,SAAS;EAC9B,KAAK,UAAU,QAAQ,YAAY,KAAA,IAAY,QAAQ,UAAU;EACjE,KAAK,iBAAiB,QAAQ,kBAAkB,CAAC;EACjD,KAAK,OAAO,QAAQ,QAAQ,CAAC;CAC/B;CAEA,MAAM,iBAAiB,KAA+B;EACpD,OAAO,KAAK,eAAe;CAC7B;CAEA,MAAM,oBAAoB,KAAa,OAA+B;EACpE,KAAK,eAAe,OAAO;CAC7B;CAEA,MAAc,4BAA4B;EACxC,MAAM,EAAE,2BAA2B,MAAM,OACvC,uCAAA,CAAA,MAAA,MAAA,EAAA,CAAA;EAEF,OAAO,uBAAuB,OAAO,EAAE,IAAI,KAAK,GAAG,CAAC;CACtD;CACA,MAAM,UAAU,cAAyC;EACvD,IAAI,CAAC,KAAK,IACR,OAAO,CAAC;EAYV,MAAM,eAAe,OAAM,MATC,KAAK,0BAA0B,EAAA,CASlB,OACvC,KAAK,IACL,eAAe,EAAE,aAAa,IAAI,CAAC,CACrC;EAcA,MAAM,cAAc,iBAAiB,CAAC,EAAE,YAAY;EACpD,OAAO,uBACL,KAAK,IACL,aAAa,KAAK,SAAS,KAAK,OAAO,GACvC,WACF;CACF;CAEA,MAAM,SACJ,OACA,eAAe,cACf,YAAY,GACG;EACf,IAAI,CAAC,KAAK,MAAM,CAAC,MAAM,IACrB,MAAM,IAAI,MAAM,2CAA2C;EAG7D,kCAAkC,YAAY;EAC9C,+BAA+B,SAAS;EAQxC,OAAM,MANsB,KAAK,0BAA0B,EAAA,CAMvC,OAAO,KAAK,IAAI,MAAM,IAAI;GAC5C;GACA;EACF,CAAC;CACH;CAEA,MAAM,YAAY,SAAiB,cAAsC;EACvE,IAAI,CAAC,KAAK,IACR;EASF,OAAM,MANsB,KAAK,0BAA0B,EAAA,CAMvC,OAClB,KAAK,IACL,SACA,eAAe,EAAE,aAAa,IAAI,CAAC,CACrC;CACF;AACF;YAxIG,SAAS,EAAE,UAAU,KAAK,CAAC,CAAA,GAAA,QAAA,WAAA,YAAA,KAAA,CAAA;sBAhC7B,aAAa,EAAE,MAAM,WAAW,CAAC,GACjC,KAAK;CACJ,eAAe;CAiBf,KAAK,EACH,SAAS;EAAC;EAAQ;EAAO;EAAU;CAAQ,EAC7C;CACA,KAAK,EACH,SAAS,CAAC,QAAQ,KAAK,EACzB;CACA,KAAK;AACP,CAAC,CAAA,GAAA,OAAA;;;;;;;;;;;;;;ACvBM,IAAA,WAAA,MAAM,iBAAiB,QAAQ;CACpC,cAAoC,YAAY;;CAWhD,eAAmC;;CAGnC,MAAoB;;;;;CAMpB,cAA4B;CAE5B,YAAY,UAA2B,CAAC,GAAG;EACzC,MAAM,OAAO;EACb,IAAI,QAAQ,iBAAiB,KAAA,GAC3B,KAAK,eAAe,QAAQ;EAC9B,IAAI,QAAQ,QAAQ,KAAA,GAAW,KAAK,MAAM,QAAQ;EAClD,IAAI,QAAQ,gBAAgB,KAAA,GAC1B,KAAK,cAAc,QAAQ;CAC/B;AACF;uBAtDC,aAAa,EAAE,MAAM,WAAW,CAAC,GAcjC,KAAK;CACJ,KAAK,EACH,SAAS;EAAC;EAAQ;EAAO;EAAU;CAAQ,EAC7C;CACA,KAAK,EACH,SAAS,CAAC,QAAQ,KAAK,EACzB;CACA,KAAK;AACP,CAAC,CAAA,GAAA,QAAA;;;ACrBM,IAAA,eAAA,MAAM,qBAAqB,WAAW;CAC3C,WAC0B;CAE1B,YACY;CAEZ,UACU;CAEV,eACe;CAEf,YACY;CAEZ,YAAY,UAA+B,CAAC,GAAG;EAC7C,MAAM,OAAO;EACb,IAAI,QAAQ,aAAa,KAAA,GAAW,KAAK,WAAW,QAAQ;EAC5D,IAAI,QAAQ,WAAW,KAAK,YAAY,QAAQ;EAChD,IAAI,QAAQ,SAAS,KAAK,UAAU,QAAQ;EAC5C,IAAI,QAAQ,cAAc,KAAK,eAAe,QAAQ;EACtD,IAAI,QAAQ,cAAc,KAAA,GAAW,KAAK,YAAY,QAAQ;CAChE;AACF;YAvBG,SAAS,EAAE,UAAU,KAAK,CAAC,CAAA,GAAA,aAAA,WAAA,YAAA,KAAA,CAAA;YAG3B,WAAW,WAAW,EAAE,UAAU,KAAK,CAAC,CAAA,GAAA,aAAA,WAAA,aAAA,KAAA,CAAA;YAGxC,gBAAgB,oCAAoC,EAAE,UAAU,KAAK,CAAC,CAAA,GAAA,aAAA,WAAA,WAAA,KAAA,CAAA;YAGtE,MAAM,EAAE,UAAU,KAAK,CAAC,CAAA,GAAA,aAAA,WAAA,gBAAA,KAAA,CAAA;YAGxB,MAAM,CAAA,GAAA,aAAA,WAAA,aAAA,KAAA,CAAA;2BAzBR,aAAa,EAAE,MAAM,WAAW,CAAC,GACjC,KAAK;CACJ,WAAW;CAKX,iBAAiB;EAAC;EAAc;EAAY;EAAgB;CAAW;CACvE,KAAK;CACL,KAAK;CACL,KAAK;AACP,CAAC,CAAA,GAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;ACuBM,IAAA,iBAAA,MAAM,uBAAuB,WAAW;;CAE7C,WAC0B;;;;;;CAO1B,YACoB;;;;;CAMpB,WACmB;;CAGnB,QAAgB;;;;;;;CAQhB,gBAAwB;;CAGxB,YAAoB;CAEpB,YAAY,UAAiC,CAAC,GAAG;EAC/C,MAAM,OAAO;EACb,IAAI,QAAQ,aAAa,KAAA,GAAW,KAAK,WAAW,QAAQ;EAC5D,IAAI,QAAQ,cAAc,KAAA,GAAW,KAAK,YAAY,QAAQ;EAC9D,IAAI,QAAQ,aAAa,KAAA,GAAW,KAAK,WAAW,QAAQ;EAC5D,IAAI,QAAQ,UAAU,KAAA,GAAW,KAAK,QAAQ,QAAQ;EACtD,IAAI,QAAQ,kBAAkB,KAAA,GAC5B,KAAK,UAAU,QAAQ,aAAa;EACtC,IAAI,QAAQ,cAAc,KAAA,GAAW,KAAK,YAAY,QAAQ;EAM9D,IAAI,CAAC,KAAK,SAAS,KAAK,UACtB,KAAK,QAAQ,KAAK;CAEtB;;;;;CAMA,YAAsB;EACpB,IAAI,CAAC,KAAK,eAAe,OAAO,CAAC;EACjC,IAAI;GACF,MAAM,SAAS,KAAK,MAAM,KAAK,aAAa;GAC5C,OAAO,MAAM,QAAQ,MAAM,IAAI,OAAO,KAAK,UAAU,OAAO,KAAK,CAAC,IAAI,CAAC;EACzE,QAAQ;GACN,OAAO,CAAC;EACV;CACF;;;;;;CAOA,UAAU,OAAgC;EACxC,IAAI,OAAO,UAAU,UAAU;GAC7B,KAAK,gBAAgB;GACrB;EACF;EACA,KAAK,gBAAgB,KAAK,UAAU,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,CAAC;CACvE;AACF;YA7EG,SAAS,EAAE,UAAU,KAAK,CAAC,CAAA,GAAA,eAAA,WAAA,YAAA,KAAA,CAAA;YAQ3B,MAAM,EAAE,UAAU,KAAK,CAAC,CAAA,GAAA,eAAA,WAAA,aAAA,KAAA,CAAA;YAOxB,MAAM,EAAE,UAAU,KAAK,CAAC,CAAA,GAAA,eAAA,WAAA,YAAA,KAAA,CAAA;6BAzB1B,aAAa,EAAE,MAAM,WAAW,CAAC,GACjC,KAAK;CACJ,WAAW;CACX,iBAAiB;EAAC;EAAc;EAAa;CAAW;CACxD,KAAK,EAAE,SAAS;EAAC;EAAQ;EAAO;EAAU;CAAQ,EAAE;CACpD,KAAK,EAAE,SAAS,CAAC,QAAQ,KAAK,EAAE;CAChC,KAAK;AACP,CAAC,CAAA,GAAA,cAAA;;;;;;;;;;;;;;;;;;;;;;;;ACEM,IAAA,MAAA,MAAM,YAAY,WAAW;;CAElC,WAC0B;;;;;;;;;;;;;;CAe1B,YACoB;;;;;;;CAQpB,OACe;;CAGf,UAAkB;;CAGlB,OAAe;;;;;;;;;CAUf,aAAqB;;CAGrB,cACsB;;;;;CAMtB,cAAsB;;;;;CAMtB,SAAkB;CAElB,YAAY,UAAsB,CAAC,GAAG;EACpC,MAAM,OAAO;EACb,IAAI,QAAQ,aAAa,KAAA,GAAW,KAAK,WAAW,QAAQ;EAC5D,IAAI,QAAQ,cAAc,KAAA,GAAW,KAAK,YAAY,QAAQ;EAC9D,IAAI,QAAQ,SAAS,KAAA,GAAW,KAAK,OAAO,QAAQ;EACpD,IAAI,QAAQ,YAAY,KAAA,GAAW,KAAK,UAAU,QAAQ;EAC1D,IAAI,QAAQ,SAAS,KAAA,GAAW,KAAK,OAAO,QAAQ;EACpD,IAAI,QAAQ,eAAe,KAAA,GACzB,KAAK,cAAc,QAAQ,UAAU;EACvC,IAAI,QAAQ,gBAAgB,KAAA,GAC1B,KAAK,cAAc,QAAQ;EAC7B,IAAI,QAAQ,gBAAgB,KAAA,GAC1B,KAAK,cAAc,QAAQ;EAC7B,IAAI,QAAQ,WAAW,KAAA,GAAW,KAAK,SAAS,QAAQ;CAC1D;;;;;;CAOA,gBAAyC;EACvC,IAAI,CAAC,KAAK,YAAY,OAAO,CAAC;EAC9B,IAAI;GACF,MAAM,SAAS,KAAK,MAAM,KAAK,UAAU;GACzC,OAAO,UAAU,OAAO,WAAW,YAAY,CAAC,MAAM,QAAQ,MAAM,IAC/D,SACD,CAAC;EACP,QAAQ;GACN,OAAO,CAAC;EACV;CACF;;;;;;CAOA,cAAc,OAA+C;EAC3D,IAAI,OAAO,UAAU,UAAU;GAC7B,KAAK,aAAa;GAClB;EACF;EACA,KAAK,aAAa,KAAK,UAAU,SAAS,CAAC,CAAC;CAC9C;AACF;YAzGG,SAAS,EAAE,UAAU,KAAK,CAAC,CAAA,GAAA,IAAA,WAAA,YAAA,KAAA,CAAA;YAgB3B,MAAM,EAAE,UAAU,KAAK,CAAC,CAAA,GAAA,IAAA,WAAA,aAAA,KAAA,CAAA;YASxB,MAAM,EAAE,UAAU,KAAK,CAAC,CAAA,GAAA,IAAA,WAAA,QAAA,KAAA,CAAA;YAoBxB,MAAM,EAAE,MAAM,UAAU,CAAC,CAAA,GAAA,IAAA,WAAA,eAAA,KAAA,CAAA;kBAvD3B,aAAa,EAAE,MAAM,WAAW,CAAC,GACjC,KAAK;CACJ,WAAW;CACX,iBAAiB,CAAC,QAAQ,WAAW;CACrC,KAAK,EAAE,SAAS;EAAC;EAAQ;EAAO;EAAU;CAAQ,EAAE;CACpD,KAAK,EAAE,SAAS,CAAC,QAAQ,KAAK,EAAE;CAChC,KAAK;AACP,CAAC,CAAA,GAAA,GAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ObjectRegistry } from "@happyvertical/smrt-core";
|
|
2
|
+
//#region src/__smrt-register__.ts
|
|
3
|
+
ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":1783263156948,\"packageName\":\"@happyvertical/smrt-products\",\"packageVersion\":\"0.38.4\",\"objects\":{\"@happyvertical/smrt-products:CategoryCollection\":{\"name\":\"categorycollection\",\"className\":\"CategoryCollection\",\"qualifiedName\":\"@happyvertical/smrt-products:CategoryCollection\",\"collection\":\"categories\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/collections/CategoryCollection.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{},\"methods\":{\"getRootCategories\":{\"name\":\"getRootCategories\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Category[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"Category\",\"exportName\":\"CategoryCollection\",\"collectionExportName\":\"CategoryCollectionCollection\",\"schema\":{\"tableName\":\"category_collections\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"category_collections\\\" (\\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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"category_collections_id_idx\",\"columns\":[\"id\"]},{\"name\":\"category_collections_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"f2f42d47\"}},\"@happyvertical/smrt-products:MaterialCollection\":{\"name\":\"materialcollection\",\"className\":\"MaterialCollection\",\"qualifiedName\":\"@happyvertical/smrt-products:MaterialCollection\",\"collection\":\"products\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/collections/MaterialCollection.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{},\"methods\":{\"findByKind\":{\"name\":\"findByKind\",\"async\":true,\"parameters\":[{\"name\":\"materialKind\",\"type\":\"MaterialKind\",\"optional\":false}],\"returnType\":\"Promise<Material[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"products\"},\"extends\":\"ProductCollection\",\"exportName\":\"MaterialCollection\",\"collectionExportName\":\"MaterialCollectionCollection\",\"schema\":{\"tableName\":\"products\",\"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 \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"products_id_idx\",\"columns\":[\"id\"]},{\"name\":\"products_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"d7d2c125\"}},\"@happyvertical/smrt-products:ProductAssetCollection\":{\"name\":\"productassetcollection\",\"className\":\"ProductAssetCollection\",\"qualifiedName\":\"@happyvertical/smrt-products:ProductAssetCollection\",\"collection\":\"productassets\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/collections/ProductAssetCollection.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{},\"methods\":{\"byLeft\":{\"name\":\"byLeft\",\"async\":true,\"parameters\":[{\"name\":\"leftId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionFilterOptions\",\"optional\":true}],\"returnType\":\"Promise<TItem[]>\",\"isStatic\":false,\"isPublic\":true},\"byRight\":{\"name\":\"byRight\",\"async\":true,\"parameters\":[{\"name\":\"rightId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionFilterOptions\",\"optional\":true}],\"returnType\":\"Promise<TItem[]>\",\"isStatic\":false,\"isPublic\":true},\"attach\":{\"name\":\"attach\",\"async\":true,\"parameters\":[{\"name\":\"leftId\",\"type\":\"string\",\"optional\":false},{\"name\":\"rightId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionAttachOptions\",\"optional\":true}],\"returnType\":\"Promise<TItem>\",\"isStatic\":false,\"isPublic\":true},\"detach\":{\"name\":\"detach\",\"async\":true,\"parameters\":[{\"name\":\"leftId\",\"type\":\"string\",\"optional\":false},{\"name\":\"rightId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionFilterOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"setLinks\":{\"name\":\"setLinks\",\"async\":true,\"parameters\":[{\"name\":\"leftId\",\"type\":\"string\",\"optional\":false},{\"name\":\"rightIds\",\"type\":\"string[]\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionAttachOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getAssets\":{\"name\":\"getAssets\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"addAsset\":{\"name\":\"addAsset\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false},{\"name\":\"asset\",\"type\":\"Asset\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"any\",\"optional\":true,\"default\":\"attachment\"},{\"name\":\"sortOrder\",\"type\":\"any\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"removeAsset\":{\"name\":\"removeAsset\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false},{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"api\":false,\"mcp\":false,\"cli\":false,\"tableName\":\"product_assets\"},\"extends\":\"SmrtJunction\",\"extendsTypeArg\":\"ProductAsset\",\"exportName\":\"ProductAssetCollection\",\"collectionExportName\":\"ProductAssetCollectionCollection\",\"schema\":{\"tableName\":\"product_assets\",\"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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"product_assets_id_idx\",\"columns\":[\"id\"]},{\"name\":\"product_assets_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"ffb1b593\"}},\"@happyvertical/smrt-products:ProductCollection\":{\"name\":\"productcollection\",\"className\":\"ProductCollection\",\"qualifiedName\":\"@happyvertical/smrt-products:ProductCollection\",\"collection\":\"products\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/collections/ProductCollection.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{},\"methods\":{\"findByManufacturer\":{\"name\":\"findByManufacturer\",\"async\":true,\"parameters\":[{\"name\":\"manufacturer\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Product[]>\",\"isStatic\":false,\"isPublic\":true},\"findInStock\":{\"name\":\"findInStock\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Product[]>\",\"isStatic\":false,\"isPublic\":true},\"getAssets\":{\"name\":\"getAssets\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"addAsset\":{\"name\":\"addAsset\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false},{\"name\":\"asset\",\"type\":\"Asset\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"any\",\"optional\":true,\"default\":\"attachment\"},{\"name\":\"sortOrder\",\"type\":\"any\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"removeAsset\":{\"name\":\"removeAsset\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false},{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"Product\",\"exportName\":\"ProductCollection\",\"collectionExportName\":\"ProductCollectionCollection\",\"schema\":{\"tableName\":\"product_collections\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"product_collections\\\" (\\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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"product_collections_id_idx\",\"columns\":[\"id\"]},{\"name\":\"product_collections_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"51a90ef1\"}},\"@happyvertical/smrt-products:ProductVariantCollection\":{\"name\":\"productvariantcollection\",\"className\":\"ProductVariantCollection\",\"qualifiedName\":\"@happyvertical/smrt-products:ProductVariantCollection\",\"collection\":\"productvariants\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/collections/ProductVariantCollection.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{},\"methods\":{\"findForProduct\":{\"name\":\"findForProduct\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<ProductVariant[]>\",\"isStatic\":false,\"isPublic\":true},\"findAxis\":{\"name\":\"findAxis\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false},{\"name\":\"axisName\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<ProductVariant | null>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"product_variants\"},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"ProductVariant\",\"exportName\":\"ProductVariantCollection\",\"collectionExportName\":\"ProductVariantCollectionCollection\",\"schema\":{\"tableName\":\"product_variants\",\"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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"product_variants_id_idx\",\"columns\":[\"id\"]},{\"name\":\"product_variants_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"7e192164\"}},\"@happyvertical/smrt-products:SkuCollection\":{\"name\":\"skucollection\",\"className\":\"SkuCollection\",\"qualifiedName\":\"@happyvertical/smrt-products:SkuCollection\",\"collection\":\"skus\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/collections/SkuCollection.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{},\"methods\":{\"findByCode\":{\"name\":\"findByCode\",\"async\":true,\"parameters\":[{\"name\":\"code\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Sku | null>\",\"isStatic\":false,\"isPublic\":true},\"findByBarcode\":{\"name\":\"findByBarcode\",\"async\":true,\"parameters\":[{\"name\":\"barcode\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Sku | null>\",\"isStatic\":false,\"isPublic\":true},\"findByProduct\":{\"name\":\"findByProduct\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Sku[]>\",\"isStatic\":false,\"isPublic\":true},\"findByParent\":{\"name\":\"findByParent\",\"async\":true,\"parameters\":[{\"name\":\"parentSkuId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Sku[]>\",\"isStatic\":false,\"isPublic\":true},\"findActive\":{\"name\":\"findActive\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Sku[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"product_skus\"},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"Sku\",\"exportName\":\"SkuCollection\",\"collectionExportName\":\"SkuCollectionCollection\",\"schema\":{\"tableName\":\"product_skus\",\"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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"product_skus_id_idx\",\"columns\":[\"id\"]},{\"name\":\"product_skus_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"f3e8dedc\"}},\"@happyvertical/smrt-products:Category\":{\"name\":\"category\",\"className\":\"Category\",\"qualifiedName\":\"@happyvertical/smrt-products:Category\",\"collection\":\"categories\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/models/Category.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{\"created_at\":{\"type\":\"datetime\",\"required\":false},\"updated_at\":{\"type\":\"datetime\",\"required\":false},\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"name\":{\"type\":\"text\",\"required\":false},\"description\":{\"type\":\"text\",\"required\":false},\"parentId\":{\"type\":\"foreignKey\",\"required\":false,\"related\":\"Category\"},\"level\":{\"type\":\"integer\",\"required\":true,\"default\":0},\"productCount\":{\"type\":\"integer\",\"required\":true,\"default\":0},\"active\":{\"type\":\"boolean\",\"required\":true,\"default\":true}},\"methods\":{\"getAiUsageSnapshot\":{\"name\":\"getAiUsageSnapshot\",\"async\":false,\"parameters\":[],\"returnType\":\"AiUsageSnapshot | undefined\",\"isStatic\":false,\"isPublic\":true},\"resetAiUsage\":{\"name\":\"resetAiUsage\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"listAiUsage\":{\"name\":\"listAiUsage\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiUsageListOptions\",\"optional\":true}],\"returnType\":\"Promise<SmrtAiUsageRecord[]>\",\"isStatic\":false,\"isPublic\":true},\"summarizeAiUsage\":{\"name\":\"summarizeAiUsage\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiUsageSummaryOptions\",\"optional\":true}],\"returnType\":\"Promise<Record<string, AiUsageStats>>\",\"isStatic\":false,\"isPublic\":true},\"destroy\":{\"name\":\"destroy\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"markAsPersisted\":{\"name\":\"markAsPersisted\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"requireInsertOnSave\":{\"name\":\"requireInsertOnSave\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"initialize\":{\"name\":\"initialize\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise\",\"isStatic\":false,\"isPublic\":true},\"loadDataFromDb\":{\"name\":\"loadDataFromDb\",\"async\":true,\"parameters\":[{\"name\":\"data\",\"type\":\"Record<string>\",\"optional\":false}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getFields\":{\"name\":\"getFields\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"toJSON\":{\"name\":\"toJSON\",\"async\":false,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"toPlainObject\":{\"name\":\"toPlainObject\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string>\",\"isStatic\":false,\"isPublic\":true},\"toPublicJSON\":{\"name\":\"toPublicJSON\",\"async\":false,\"parameters\":[{\"name\":\"options\",\"type\":\"PublicJsonOptions\",\"optional\":true}],\"returnType\":\"Record<string>\",\"isStatic\":false,\"isPublic\":true},\"getId\":{\"name\":\"getId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getSlug\":{\"name\":\"getSlug\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getSavedId\":{\"name\":\"getSavedId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"isSaved\":{\"name\":\"isSaved\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"save\":{\"name\":\"save\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"classifyConstraintError\":{\"name\":\"classifyConstraintError\",\"async\":false,\"parameters\":[{\"name\":\"message\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"'unique' | 'not_null' | null\",\"isStatic\":true,\"isPublic\":true},\"loadFromId\":{\"name\":\"loadFromId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"loadFromSlug\":{\"name\":\"loadFromSlug\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"is\":{\"name\":\"is\",\"async\":true,\"parameters\":[{\"name\":\"criteria\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"do\":{\"name\":\"do\",\"async\":true,\"parameters\":[{\"name\":\"instructions\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"describe\":{\"name\":\"describe\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"delete\":{\"name\":\"delete\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"isRelatedLoaded\":{\"name\":\"isRelatedLoaded\",\"async\":false,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"boolean\",\"isStatic\":false,\"isPublic\":true},\"_setLoadedRelationship\":{\"name\":\"_setLoadedRelationship\",\"async\":false,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"value\",\"type\":\"any\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"loadRelated\":{\"name\":\"loadRelated\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"loadRelatedMany\":{\"name\":\"loadRelatedMany\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any[]>\",\"isStatic\":false,\"isPublic\":true},\"getRelated\":{\"name\":\"getRelated\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"getAvailableTools\":{\"name\":\"getAvailableTools\",\"async\":false,\"parameters\":[],\"returnType\":\"AITool[]\",\"isStatic\":false,\"isPublic\":true},\"executeToolCall\":{\"name\":\"executeToolCall\",\"async\":true,\"parameters\":[{\"name\":\"toolCall\",\"type\":\"ToolCall\",\"optional\":false}],\"returnType\":\"Promise<ToolCallResult>\",\"isStatic\":false,\"isPublic\":true},\"remember\":{\"name\":\"remember\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"recall\":{\"name\":\"recall\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise\",\"isStatic\":false,\"isPublic\":true},\"recallAll\":{\"name\":\"recallAll\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":true}],\"returnType\":\"Promise<Map<string>>\",\"isStatic\":false,\"isPublic\":true},\"forget\":{\"name\":\"forget\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"forgetScope\":{\"name\":\"forgetScope\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<number>\",\"isStatic\":false,\"isPublic\":true},\"generateEmbeddings\":{\"name\":\"generateEmbeddings\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"GenerateEmbeddingsOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getEmbedding\":{\"name\":\"getEmbedding\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"model\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<number[] | null>\",\"isStatic\":false,\"isPublic\":true},\"hasStaleEmbeddings\":{\"name\":\"hasStaleEmbeddings\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<boolean>\",\"isStatic\":false,\"isPublic\":true},\"clearEmbeddings\":{\"name\":\"clearEmbeddings\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":true,\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"Category\",\"collectionExportName\":\"CategoryCollection\",\"validationRules\":[{\"field\":\"level\",\"rule\":\"required\",\"fieldType\":\"integer\"},{\"field\":\"productCount\",\"rule\":\"required\",\"fieldType\":\"integer\"},{\"field\":\"active\",\"rule\":\"required\",\"fieldType\":\"boolean\"}],\"schema\":{\"tableName\":\"categories\",\"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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false},\"parent_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false},\"level\":{\"type\":\"INTEGER\",\"notNull\":false,\"default\":0},\"product_count\":{\"type\":\"INTEGER\",\"notNull\":false,\"default\":0},\"active\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"default\":true}},\"indexes\":[{\"name\":\"categories_id_idx\",\"columns\":[\"id\"]},{\"name\":\"categories_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"categories_meta_type_idx\",\"columns\":[\"_meta_type\"]}],\"version\":\"9b7d356d\"}},\"@happyvertical/smrt-products:Material\":{\"name\":\"material\",\"className\":\"Material\",\"qualifiedName\":\"@happyvertical/smrt-products:Material\",\"collection\":\"products\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/models/Material.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{\"created_at\":{\"type\":\"datetime\",\"required\":false},\"updated_at\":{\"type\":\"datetime\",\"required\":false},\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"productType\":{\"type\":\"text\",\"required\":false},\"name\":{\"type\":\"text\",\"required\":false},\"description\":{\"type\":\"text\",\"required\":false},\"category\":{\"type\":\"text\",\"required\":false},\"manufacturer\":{\"type\":\"text\",\"required\":false},\"model\":{\"type\":\"text\",\"required\":false},\"price\":{\"type\":\"integer\",\"required\":true,\"default\":0},\"inStock\":{\"type\":\"boolean\",\"required\":true,\"default\":true},\"specifications\":{\"type\":\"json\",\"required\":false,\"default\":{}},\"tags\":{\"type\":\"json\",\"required\":false,\"default\":[]},\"materialKind\":{\"type\":\"meta\",\"required\":false,\"default\":\"component\",\"_meta\":{\"underlyingType\":\"text\"}},\"uom\":{\"type\":\"meta\",\"required\":false,\"default\":\"each\",\"_meta\":{\"underlyingType\":\"text\"}},\"costPerUnit\":{\"type\":\"meta\",\"required\":false,\"default\":0,\"_meta\":{\"underlyingType\":\"decimal\"}}},\"methods\":{\"getAiUsageSnapshot\":{\"name\":\"getAiUsageSnapshot\",\"async\":false,\"parameters\":[],\"returnType\":\"AiUsageSnapshot | undefined\",\"isStatic\":false,\"isPublic\":true},\"resetAiUsage\":{\"name\":\"resetAiUsage\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"listAiUsage\":{\"name\":\"listAiUsage\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiUsageListOptions\",\"optional\":true}],\"returnType\":\"Promise<SmrtAiUsageRecord[]>\",\"isStatic\":false,\"isPublic\":true},\"summarizeAiUsage\":{\"name\":\"summarizeAiUsage\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiUsageSummaryOptions\",\"optional\":true}],\"returnType\":\"Promise<Record<string, AiUsageStats>>\",\"isStatic\":false,\"isPublic\":true},\"destroy\":{\"name\":\"destroy\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"markAsPersisted\":{\"name\":\"markAsPersisted\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"requireInsertOnSave\":{\"name\":\"requireInsertOnSave\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"initialize\":{\"name\":\"initialize\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise\",\"isStatic\":false,\"isPublic\":true},\"loadDataFromDb\":{\"name\":\"loadDataFromDb\",\"async\":true,\"parameters\":[{\"name\":\"data\",\"type\":\"Record<string>\",\"optional\":false}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getFields\":{\"name\":\"getFields\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"toJSON\":{\"name\":\"toJSON\",\"async\":false,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"toPlainObject\":{\"name\":\"toPlainObject\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string>\",\"isStatic\":false,\"isPublic\":true},\"toPublicJSON\":{\"name\":\"toPublicJSON\",\"async\":false,\"parameters\":[{\"name\":\"options\",\"type\":\"PublicJsonOptions\",\"optional\":true}],\"returnType\":\"Record<string>\",\"isStatic\":false,\"isPublic\":true},\"getId\":{\"name\":\"getId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getSlug\":{\"name\":\"getSlug\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getSavedId\":{\"name\":\"getSavedId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"isSaved\":{\"name\":\"isSaved\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"save\":{\"name\":\"save\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"classifyConstraintError\":{\"name\":\"classifyConstraintError\",\"async\":false,\"parameters\":[{\"name\":\"message\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"'unique' | 'not_null' | null\",\"isStatic\":true,\"isPublic\":true},\"loadFromId\":{\"name\":\"loadFromId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"loadFromSlug\":{\"name\":\"loadFromSlug\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"is\":{\"name\":\"is\",\"async\":true,\"parameters\":[{\"name\":\"criteria\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"do\":{\"name\":\"do\",\"async\":true,\"parameters\":[{\"name\":\"instructions\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"describe\":{\"name\":\"describe\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"delete\":{\"name\":\"delete\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"isRelatedLoaded\":{\"name\":\"isRelatedLoaded\",\"async\":false,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"boolean\",\"isStatic\":false,\"isPublic\":true},\"_setLoadedRelationship\":{\"name\":\"_setLoadedRelationship\",\"async\":false,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"value\",\"type\":\"any\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"loadRelated\":{\"name\":\"loadRelated\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"loadRelatedMany\":{\"name\":\"loadRelatedMany\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any[]>\",\"isStatic\":false,\"isPublic\":true},\"getRelated\":{\"name\":\"getRelated\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"getAvailableTools\":{\"name\":\"getAvailableTools\",\"async\":false,\"parameters\":[],\"returnType\":\"AITool[]\",\"isStatic\":false,\"isPublic\":true},\"executeToolCall\":{\"name\":\"executeToolCall\",\"async\":true,\"parameters\":[{\"name\":\"toolCall\",\"type\":\"ToolCall\",\"optional\":false}],\"returnType\":\"Promise<ToolCallResult>\",\"isStatic\":false,\"isPublic\":true},\"remember\":{\"name\":\"remember\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"recall\":{\"name\":\"recall\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise\",\"isStatic\":false,\"isPublic\":true},\"recallAll\":{\"name\":\"recallAll\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":true}],\"returnType\":\"Promise<Map<string>>\",\"isStatic\":false,\"isPublic\":true},\"forget\":{\"name\":\"forget\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"forgetScope\":{\"name\":\"forgetScope\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<number>\",\"isStatic\":false,\"isPublic\":true},\"generateEmbeddings\":{\"name\":\"generateEmbeddings\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"GenerateEmbeddingsOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getEmbedding\":{\"name\":\"getEmbedding\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"model\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<number[] | null>\",\"isStatic\":false,\"isPublic\":true},\"hasStaleEmbeddings\":{\"name\":\"hasStaleEmbeddings\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<boolean>\",\"isStatic\":false,\"isPublic\":true},\"clearEmbeddings\":{\"name\":\"clearEmbeddings\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getSpecification\":{\"name\":\"getSpecification\",\"async\":true,\"parameters\":[{\"name\":\"key\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise\",\"isStatic\":false,\"isPublic\":true},\"updateSpecification\":{\"name\":\"updateSpecification\",\"async\":true,\"parameters\":[{\"name\":\"key\",\"type\":\"string\",\"optional\":false},{\"name\":\"value\",\"type\":\"any\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getAssets\":{\"name\":\"getAssets\",\"async\":true,\"parameters\":[{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"addAsset\":{\"name\":\"addAsset\",\"async\":true,\"parameters\":[{\"name\":\"asset\",\"type\":\"Asset\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"any\",\"optional\":true,\"default\":\"attachment\"},{\"name\":\"sortOrder\",\"type\":\"any\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"removeAsset\":{\"name\":\"removeAsset\",\"async\":true,\"parameters\":[{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":true,\"tenantScoped\":{\"mode\":\"optional\"},\"tableName\":\"products\",\"tableStrategy\":\"sti\"},\"extends\":\"Product\",\"exportName\":\"Material\",\"collectionExportName\":\"MaterialCollection\",\"validationRules\":[{\"field\":\"price\",\"rule\":\"required\",\"fieldType\":\"integer\"},{\"field\":\"inStock\",\"rule\":\"required\",\"fieldType\":\"boolean\"}],\"schema\":{\"tableName\":\"products\",\"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 \\\"in_stock\\\" BOOLEAN DEFAULT TRUE,\\n \\\"specifications\\\" JSON DEFAULT '{}',\\n \\\"tags\\\" JSON DEFAULT '[]'\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"product_type\":{\"type\":\"TEXT\",\"notNull\":false},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false},\"category\":{\"type\":\"TEXT\",\"notNull\":false},\"manufacturer\":{\"type\":\"TEXT\",\"notNull\":false},\"model\":{\"type\":\"TEXT\",\"notNull\":false},\"price\":{\"type\":\"INTEGER\",\"notNull\":false,\"default\":0},\"in_stock\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"default\":true},\"specifications\":{\"type\":\"JSON\",\"notNull\":false,\"default\":{}},\"tags\":{\"type\":\"JSON\",\"notNull\":false,\"default\":[]}},\"indexes\":[{\"name\":\"products_id_idx\",\"columns\":[\"id\"]},{\"name\":\"products_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"products_meta_type_idx\",\"columns\":[\"_meta_type\"]}],\"version\":\"4a33c96d\"}},\"@happyvertical/smrt-products:Product\":{\"name\":\"product\",\"className\":\"Product\",\"qualifiedName\":\"@happyvertical/smrt-products:Product\",\"collection\":\"products\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/models/Product.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{\"created_at\":{\"type\":\"datetime\",\"required\":false},\"updated_at\":{\"type\":\"datetime\",\"required\":false},\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"productType\":{\"type\":\"text\",\"required\":false},\"name\":{\"type\":\"text\",\"required\":false},\"description\":{\"type\":\"text\",\"required\":false},\"category\":{\"type\":\"text\",\"required\":false},\"manufacturer\":{\"type\":\"text\",\"required\":false},\"model\":{\"type\":\"text\",\"required\":false},\"price\":{\"type\":\"integer\",\"required\":true,\"default\":0},\"inStock\":{\"type\":\"boolean\",\"required\":true,\"default\":true},\"specifications\":{\"type\":\"json\",\"required\":false,\"default\":{}},\"tags\":{\"type\":\"json\",\"required\":false,\"default\":[]}},\"methods\":{\"getAiUsageSnapshot\":{\"name\":\"getAiUsageSnapshot\",\"async\":false,\"parameters\":[],\"returnType\":\"AiUsageSnapshot | undefined\",\"isStatic\":false,\"isPublic\":true},\"resetAiUsage\":{\"name\":\"resetAiUsage\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"listAiUsage\":{\"name\":\"listAiUsage\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiUsageListOptions\",\"optional\":true}],\"returnType\":\"Promise<SmrtAiUsageRecord[]>\",\"isStatic\":false,\"isPublic\":true},\"summarizeAiUsage\":{\"name\":\"summarizeAiUsage\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiUsageSummaryOptions\",\"optional\":true}],\"returnType\":\"Promise<Record<string, AiUsageStats>>\",\"isStatic\":false,\"isPublic\":true},\"destroy\":{\"name\":\"destroy\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"markAsPersisted\":{\"name\":\"markAsPersisted\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"requireInsertOnSave\":{\"name\":\"requireInsertOnSave\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"initialize\":{\"name\":\"initialize\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise\",\"isStatic\":false,\"isPublic\":true},\"loadDataFromDb\":{\"name\":\"loadDataFromDb\",\"async\":true,\"parameters\":[{\"name\":\"data\",\"type\":\"Record<string>\",\"optional\":false}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getFields\":{\"name\":\"getFields\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"toJSON\":{\"name\":\"toJSON\",\"async\":false,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"toPlainObject\":{\"name\":\"toPlainObject\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string>\",\"isStatic\":false,\"isPublic\":true},\"toPublicJSON\":{\"name\":\"toPublicJSON\",\"async\":false,\"parameters\":[{\"name\":\"options\",\"type\":\"PublicJsonOptions\",\"optional\":true}],\"returnType\":\"Record<string>\",\"isStatic\":false,\"isPublic\":true},\"getId\":{\"name\":\"getId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getSlug\":{\"name\":\"getSlug\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getSavedId\":{\"name\":\"getSavedId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"isSaved\":{\"name\":\"isSaved\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"save\":{\"name\":\"save\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"classifyConstraintError\":{\"name\":\"classifyConstraintError\",\"async\":false,\"parameters\":[{\"name\":\"message\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"'unique' | 'not_null' | null\",\"isStatic\":true,\"isPublic\":true},\"loadFromId\":{\"name\":\"loadFromId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"loadFromSlug\":{\"name\":\"loadFromSlug\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"is\":{\"name\":\"is\",\"async\":true,\"parameters\":[{\"name\":\"criteria\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"do\":{\"name\":\"do\",\"async\":true,\"parameters\":[{\"name\":\"instructions\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"describe\":{\"name\":\"describe\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"delete\":{\"name\":\"delete\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"isRelatedLoaded\":{\"name\":\"isRelatedLoaded\",\"async\":false,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"boolean\",\"isStatic\":false,\"isPublic\":true},\"_setLoadedRelationship\":{\"name\":\"_setLoadedRelationship\",\"async\":false,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"value\",\"type\":\"any\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"loadRelated\":{\"name\":\"loadRelated\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"loadRelatedMany\":{\"name\":\"loadRelatedMany\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any[]>\",\"isStatic\":false,\"isPublic\":true},\"getRelated\":{\"name\":\"getRelated\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"getAvailableTools\":{\"name\":\"getAvailableTools\",\"async\":false,\"parameters\":[],\"returnType\":\"AITool[]\",\"isStatic\":false,\"isPublic\":true},\"executeToolCall\":{\"name\":\"executeToolCall\",\"async\":true,\"parameters\":[{\"name\":\"toolCall\",\"type\":\"ToolCall\",\"optional\":false}],\"returnType\":\"Promise<ToolCallResult>\",\"isStatic\":false,\"isPublic\":true},\"remember\":{\"name\":\"remember\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"recall\":{\"name\":\"recall\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise\",\"isStatic\":false,\"isPublic\":true},\"recallAll\":{\"name\":\"recallAll\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":true}],\"returnType\":\"Promise<Map<string>>\",\"isStatic\":false,\"isPublic\":true},\"forget\":{\"name\":\"forget\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"forgetScope\":{\"name\":\"forgetScope\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<number>\",\"isStatic\":false,\"isPublic\":true},\"generateEmbeddings\":{\"name\":\"generateEmbeddings\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"GenerateEmbeddingsOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getEmbedding\":{\"name\":\"getEmbedding\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"model\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<number[] | null>\",\"isStatic\":false,\"isPublic\":true},\"hasStaleEmbeddings\":{\"name\":\"hasStaleEmbeddings\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<boolean>\",\"isStatic\":false,\"isPublic\":true},\"clearEmbeddings\":{\"name\":\"clearEmbeddings\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getSpecification\":{\"name\":\"getSpecification\",\"async\":true,\"parameters\":[{\"name\":\"key\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise\",\"isStatic\":false,\"isPublic\":true},\"updateSpecification\":{\"name\":\"updateSpecification\",\"async\":true,\"parameters\":[{\"name\":\"key\",\"type\":\"string\",\"optional\":false},{\"name\":\"value\",\"type\":\"any\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getAssets\":{\"name\":\"getAssets\",\"async\":true,\"parameters\":[{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"addAsset\":{\"name\":\"addAsset\",\"async\":true,\"parameters\":[{\"name\":\"asset\",\"type\":\"Asset\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"any\",\"optional\":true,\"default\":\"attachment\"},{\"name\":\"sortOrder\",\"type\":\"any\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"removeAsset\":{\"name\":\"removeAsset\",\"async\":true,\"parameters\":[{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":true,\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"Product\",\"collectionExportName\":\"ProductCollection\",\"validationRules\":[{\"field\":\"price\",\"rule\":\"required\",\"fieldType\":\"integer\"},{\"field\":\"inStock\",\"rule\":\"required\",\"fieldType\":\"boolean\"}],\"schema\":{\"tableName\":\"products\",\"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 \\\"in_stock\\\" BOOLEAN DEFAULT TRUE,\\n \\\"specifications\\\" JSON DEFAULT '{}',\\n \\\"tags\\\" JSON DEFAULT '[]'\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"product_type\":{\"type\":\"TEXT\",\"notNull\":false},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false},\"category\":{\"type\":\"TEXT\",\"notNull\":false},\"manufacturer\":{\"type\":\"TEXT\",\"notNull\":false},\"model\":{\"type\":\"TEXT\",\"notNull\":false},\"price\":{\"type\":\"INTEGER\",\"notNull\":false,\"default\":0},\"in_stock\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"default\":true},\"specifications\":{\"type\":\"JSON\",\"notNull\":false,\"default\":{}},\"tags\":{\"type\":\"JSON\",\"notNull\":false,\"default\":[]}},\"indexes\":[{\"name\":\"products_id_idx\",\"columns\":[\"id\"]},{\"name\":\"products_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"products_meta_type_idx\",\"columns\":[\"_meta_type\"]}],\"version\":\"a7b4d592\"}},\"@happyvertical/smrt-products:ProductAsset\":{\"name\":\"productasset\",\"className\":\"ProductAsset\",\"qualifiedName\":\"@happyvertical/smrt-products:ProductAsset\",\"collection\":\"productassets\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/models/ProductAsset.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"productId\":{\"type\":\"foreignKey\",\"required\":true,\"related\":\"Product\",\"_meta\":{\"required\":true}},\"assetId\":{\"type\":\"crossPackageRef\",\"required\":true,\"related\":\"@happyvertical/smrt-assets:Asset\"},\"relationship\":{\"type\":\"text\",\"required\":true,\"_meta\":{\"required\":true}},\"sortOrder\":{\"type\":\"integer\",\"required\":true,\"default\":0}},\"methods\":{},\"decoratorConfig\":{\"tableName\":\"product_assets\",\"conflictColumns\":[\"product_id\",\"asset_id\",\"relationship\",\"tenant_id\"],\"api\":false,\"mcp\":false,\"cli\":false,\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"ProductAsset\",\"collectionExportName\":\"ProductAssetCollection\",\"validationRules\":[{\"field\":\"productId\",\"rule\":\"required\",\"fieldType\":\"foreignKey\"},{\"field\":\"assetId\",\"rule\":\"required\",\"fieldType\":\"crossPackageRef\"},{\"field\":\"relationship\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"sortOrder\",\"rule\":\"required\",\"fieldType\":\"integer\"}],\"schema\":{\"tableName\":\"product_assets\",\"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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"product_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":true,\"unique\":false},\"asset_id\":{\"type\":\"UUID\",\"referenceKind\":\"crossPackageRef\",\"notNull\":true,\"unique\":false},\"relationship\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false},\"sort_order\":{\"type\":\"INTEGER\",\"notNull\":true,\"unique\":false,\"default\":0}},\"indexes\":[{\"name\":\"product_assets_id_idx\",\"columns\":[\"id\"]},{\"name\":\"product_assets_product_id_asset_id_idx\",\"columns\":[\"product_id\",\"asset_id\",\"relationship\",\"tenant_id\"],\"unique\":true}],\"version\":\"320e1554\"}},\"@happyvertical/smrt-products:ProductVariant\":{\"name\":\"productvariant\",\"className\":\"ProductVariant\",\"qualifiedName\":\"@happyvertical/smrt-products:ProductVariant\",\"collection\":\"productvariants\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/models/ProductVariant.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"productId\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"axisName\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"label\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"allowedValues\":{\"type\":\"text\",\"required\":false,\"default\":\"[]\"},\"sortOrder\":{\"type\":\"integer\",\"required\":false,\"default\":0}},\"methods\":{\"getValues\":{\"name\":\"getValues\",\"async\":false,\"parameters\":[],\"returnType\":\"string[]\",\"isStatic\":false,\"isPublic\":true},\"setValues\":{\"name\":\"setValues\",\"async\":false,\"parameters\":[{\"name\":\"value\",\"type\":\"string[] | string\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"product_variants\",\"conflictColumns\":[\"product_id\",\"axis_name\",\"tenant_id\"],\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":true,\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"ProductVariant\",\"collectionExportName\":\"ProductVariantCollection\",\"validationRules\":[{\"field\":\"productId\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"axisName\",\"rule\":\"required\",\"fieldType\":\"text\"}],\"schema\":{\"tableName\":\"product_variants\",\"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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"product_id\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"axis_name\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"label\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"allowed_values\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"[]\"},\"sort_order\":{\"type\":\"INTEGER\",\"notNull\":false,\"unique\":false,\"default\":0}},\"indexes\":[{\"name\":\"product_variants_id_idx\",\"columns\":[\"id\"]},{\"name\":\"product_variants_product_id_axis_name_idx\",\"columns\":[\"product_id\",\"axis_name\",\"tenant_id\"],\"unique\":true}],\"version\":\"2891ff02\"}},\"@happyvertical/smrt-products:Sku\":{\"name\":\"sku\",\"className\":\"Sku\",\"qualifiedName\":\"@happyvertical/smrt-products:Sku\",\"collection\":\"skus\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/models/Sku.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"productId\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"code\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"barcode\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"name\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"attributes\":{\"type\":\"text\",\"required\":false,\"default\":\"{}\"},\"weightGrams\":{\"type\":\"decimal\",\"required\":false,\"_meta\":{}},\"parentSkuId\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"active\":{\"type\":\"boolean\",\"required\":false,\"default\":true}},\"methods\":{\"getAttributes\":{\"name\":\"getAttributes\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string>\",\"isStatic\":false,\"isPublic\":true},\"setAttributes\":{\"name\":\"setAttributes\",\"async\":false,\"parameters\":[{\"name\":\"value\",\"type\":\"Record<string> | string\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"product_skus\",\"conflictColumns\":[\"code\",\"tenant_id\"],\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":true,\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"Sku\",\"collectionExportName\":\"SkuCollection\",\"validationRules\":[{\"field\":\"productId\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"code\",\"rule\":\"required\",\"fieldType\":\"text\"}],\"schema\":{\"tableName\":\"product_skus\",\"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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"product_id\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"code\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"barcode\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"name\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"attributes\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"{}\"},\"weight_grams\":{\"type\":\"REAL\",\"notNull\":false,\"unique\":false},\"parent_sku_id\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"active\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"unique\":false,\"default\":true}},\"indexes\":[{\"name\":\"product_skus_id_idx\",\"columns\":[\"id\"]},{\"name\":\"product_skus_code_tenant_id_idx\",\"columns\":[\"code\",\"tenant_id\"],\"unique\":true}],\"version\":\"89d5a311\"}}},\"moduleType\":\"smrt\",\"smrtDependencies\":[\"@happyvertical/smrt-assets\",\"@happyvertical/smrt-core\",\"@happyvertical/smrt-tenancy\"]}"));
|
|
4
|
+
//#endregion
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=__smrt-register__-GwcyNfFl.js.map
|
package/dist/lib/chunks/{__smrt-register__-Uiu0ODFT.js.map → __smrt-register__-GwcyNfFl.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__smrt-register__-
|
|
1
|
+
{"version":3,"file":"__smrt-register__-GwcyNfFl.js","names":[],"sources":["../../../src/__smrt-register__.ts"],"sourcesContent":["/**\n * Self-registers this package's build-time manifest before any @smrt() decorator\n * in the package fires. Fixes issue #1132: in consumer runtimes (tsx, SvelteKit\n * SSR, plain `vite dev`) the decorator's synchronous manifest lookup previously\n * missed because no step populated the global manifest cache — classes got\n * registered with zero fields and `save()` / `toJSON()` silently dropped every\n * declared property.\n *\n * Import this module as the first statement in `src/index.ts` so its top-level\n * side effect runs ahead of any class module's @smrt() decorator.\n *\n * Silent no-op in dev/test, where the vitest plugin already populates manifests\n * via a different path. Only needs to succeed in the published dist output.\n *\n * @see https://github.com/happyvertical/smrt/issues/1132\n */\nimport { ObjectRegistry } from '@happyvertical/smrt-core';\n\n// During library builds, smrtPlugin replaces this entire module with generated\n// code that embeds the scanned manifest inline (#1506/#1507) — published dists\n// never resolve this URL, so downstream bundlers cannot break registration by\n// relocating the compiled module away from dist/manifest.json. The runtime\n// lookup below is the fallback for source-mode runs without that transform.\nObjectRegistry.registerPackageManifest(\n new URL('./manifest.json', import.meta.url),\n);\n"],"mappings":""}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./__smrt-register__-
|
|
2
|
-
import { i as Material, n as ProductVariant, s as Category, t as Sku } from "./Sku-
|
|
3
|
-
import { t as ProductCollection } from "./ProductCollection-
|
|
4
|
-
import "./ProductAssetCollection-
|
|
1
|
+
import "./__smrt-register__-GwcyNfFl.js";
|
|
2
|
+
import { i as Material, n as ProductVariant, s as Category, t as Sku } from "./Sku-C181XteX.js";
|
|
3
|
+
import { t as ProductCollection } from "./ProductCollection-BDcBK9RN.js";
|
|
4
|
+
import "./ProductAssetCollection-BLfdEtYT.js";
|
|
5
5
|
import { SmrtCollection } from "@happyvertical/smrt-core";
|
|
6
6
|
//#region src/lib/collections/CategoryCollection.ts
|
|
7
7
|
/**
|
|
@@ -159,4 +159,4 @@ var SkuCollection = class extends SmrtCollection {
|
|
|
159
159
|
//#endregion
|
|
160
160
|
export { CategoryCollection as i, ProductVariantCollection as n, MaterialCollection as r, SkuCollection as t };
|
|
161
161
|
|
|
162
|
-
//# sourceMappingURL=collections-
|
|
162
|
+
//# sourceMappingURL=collections-QAzLxrPY.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collections-
|
|
1
|
+
{"version":3,"file":"collections-QAzLxrPY.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,4 +1,4 @@
|
|
|
1
|
-
//#region \0@oxc-project+runtime@0.
|
|
1
|
+
//#region \0@oxc-project+runtime@0.138.0/helpers/esm/decorate.js
|
|
2
2
|
function __decorate(decorators, target, key, desc) {
|
|
3
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./__smrt-register__-
|
|
1
|
+
import "./__smrt-register__-GwcyNfFl.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-
|
|
7
|
+
//# sourceMappingURL=generated-D3OAqEL7.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generated-
|
|
1
|
+
{"version":3,"file":"generated-D3OAqEL7.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"}
|
package/dist/lib/collections.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as CategoryCollection, n as ProductVariantCollection, r as MaterialCollection, t as SkuCollection } from "./chunks/collections-
|
|
2
|
-
import { t as ProductCollection } from "./chunks/ProductCollection-
|
|
3
|
-
import { t as ProductAssetCollection } from "./chunks/ProductAssetCollection-
|
|
1
|
+
import { i as CategoryCollection, n as ProductVariantCollection, r as MaterialCollection, t as SkuCollection } from "./chunks/collections-QAzLxrPY.js";
|
|
2
|
+
import { t as ProductCollection } from "./chunks/ProductCollection-BDcBK9RN.js";
|
|
3
|
+
import { t as ProductAssetCollection } from "./chunks/ProductAssetCollection-BLfdEtYT.js";
|
|
4
4
|
export { CategoryCollection, MaterialCollection, ProductAssetCollection, ProductCollection, ProductVariantCollection, SkuCollection };
|
package/dist/lib/generated.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as autoGeneratedComponents } from "./chunks/generated-
|
|
1
|
+
import { t as autoGeneratedComponents } from "./chunks/generated-D3OAqEL7.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__-
|
|
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-
|
|
4
|
-
import { i as CategoryCollection, n as ProductVariantCollection, r as MaterialCollection, t as SkuCollection } from "./chunks/collections-
|
|
5
|
-
import { t as ProductCollection } from "./chunks/ProductCollection-
|
|
6
|
-
import { t as ProductAssetCollection } from "./chunks/ProductAssetCollection-
|
|
2
|
+
import "./chunks/__smrt-register__-GwcyNfFl.js";
|
|
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-C181XteX.js";
|
|
4
|
+
import { i as CategoryCollection, n as ProductVariantCollection, r as MaterialCollection, t as SkuCollection } from "./chunks/collections-QAzLxrPY.js";
|
|
5
|
+
import { t as ProductCollection } from "./chunks/ProductCollection-BDcBK9RN.js";
|
|
6
|
+
import { t as ProductAssetCollection } from "./chunks/ProductAssetCollection-BLfdEtYT.js";
|
|
7
7
|
import { n as ProductCard, t as ProductForm } from "./chunks/components-C6VpNVcg.js";
|
|
8
|
-
import { t as autoGeneratedComponents } from "./chunks/generated-
|
|
9
|
-
import "./chunks/models-
|
|
8
|
+
import { t as autoGeneratedComponents } from "./chunks/generated-D3OAqEL7.js";
|
|
9
|
+
import "./chunks/models-DF-egB6k.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 { startRestServer } from "@happyvertical/smrt-core";
|
package/dist/lib/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "1.0.0",
|
|
3
|
-
"timestamp":
|
|
3
|
+
"timestamp": 1783263156948,
|
|
4
4
|
"packageName": "@happyvertical/smrt-products",
|
|
5
|
-
"packageVersion": "0.38.
|
|
5
|
+
"packageVersion": "0.38.4",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-products:CategoryCollection": {
|
|
8
8
|
"name": "categorycollection",
|
|
@@ -982,7 +982,13 @@
|
|
|
982
982
|
"toPublicJSON": {
|
|
983
983
|
"name": "toPublicJSON",
|
|
984
984
|
"async": false,
|
|
985
|
-
"parameters": [
|
|
985
|
+
"parameters": [
|
|
986
|
+
{
|
|
987
|
+
"name": "options",
|
|
988
|
+
"type": "PublicJsonOptions",
|
|
989
|
+
"optional": true
|
|
990
|
+
}
|
|
991
|
+
],
|
|
986
992
|
"returnType": "Record<string>",
|
|
987
993
|
"isStatic": false,
|
|
988
994
|
"isPublic": true
|
|
@@ -1708,7 +1714,13 @@
|
|
|
1708
1714
|
"toPublicJSON": {
|
|
1709
1715
|
"name": "toPublicJSON",
|
|
1710
1716
|
"async": false,
|
|
1711
|
-
"parameters": [
|
|
1717
|
+
"parameters": [
|
|
1718
|
+
{
|
|
1719
|
+
"name": "options",
|
|
1720
|
+
"type": "PublicJsonOptions",
|
|
1721
|
+
"optional": true
|
|
1722
|
+
}
|
|
1723
|
+
],
|
|
1712
1724
|
"returnType": "Record<string>",
|
|
1713
1725
|
"isStatic": false,
|
|
1714
1726
|
"isPublic": true
|
|
@@ -2513,7 +2525,13 @@
|
|
|
2513
2525
|
"toPublicJSON": {
|
|
2514
2526
|
"name": "toPublicJSON",
|
|
2515
2527
|
"async": false,
|
|
2516
|
-
"parameters": [
|
|
2528
|
+
"parameters": [
|
|
2529
|
+
{
|
|
2530
|
+
"name": "options",
|
|
2531
|
+
"type": "PublicJsonOptions",
|
|
2532
|
+
"optional": true
|
|
2533
|
+
}
|
|
2534
|
+
],
|
|
2517
2535
|
"returnType": "Record<string>",
|
|
2518
2536
|
"isStatic": false,
|
|
2519
2537
|
"isPublic": true
|
package/dist/lib/models.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
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-
|
|
2
|
-
import "./chunks/models-
|
|
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-C181XteX.js";
|
|
2
|
+
import "./chunks/models-DF-egB6k.js";
|
|
3
3
|
export { Category, Material, Product, ProductAsset, ProductType, ProductVariant, Sku };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-07-
|
|
3
|
+
"generatedAt": "2026-07-05T14:52:37.244Z",
|
|
4
4
|
"packageName": "@happyvertical/smrt-products",
|
|
5
|
-
"packageVersion": "0.38.
|
|
5
|
+
"packageVersion": "0.38.4",
|
|
6
6
|
"sourceManifestPath": "dist/lib/manifest.json",
|
|
7
7
|
"agentDocPath": "AGENTS.md",
|
|
8
8
|
"sourceHashes": {
|
|
9
|
-
"manifest": "
|
|
10
|
-
"packageJson": "
|
|
9
|
+
"manifest": "e02b70ea71cc98dd7e85e3af15194d55e7f70e421d5c9d41e5874760d982c137",
|
|
10
|
+
"packageJson": "88841b575cfd5f8205b54dbd787f7cd5585b684fa8fe6ffac0ed9997b543361b",
|
|
11
11
|
"agents": "33d82ef8e2eb4597c4165e7576c20a02a76d224a75cadcbd89f9ce9cc1deae3c"
|
|
12
12
|
},
|
|
13
13
|
"exports": [
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"svelte": "^5.56.4",
|
|
49
49
|
"svelte-check": "^4.7.1",
|
|
50
50
|
"typescript": "^5.9.3",
|
|
51
|
-
"vite": "^8.1.
|
|
51
|
+
"vite": "^8.1.3",
|
|
52
52
|
"vitest": "^4.1.9"
|
|
53
53
|
},
|
|
54
54
|
"smrtDependencies": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-products",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.4",
|
|
4
4
|
"description": "SMRT products module: triple-purpose microservice template for standalone apps, federated modules, and NPM libraries",
|
|
5
5
|
"author": "HappyVertical",
|
|
6
6
|
"type": "module",
|
|
@@ -53,20 +53,20 @@
|
|
|
53
53
|
"./manifest.json": "./dist/lib/manifest.json"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@happyvertical/ai": "^0.
|
|
57
|
-
"@happyvertical/files": "^0.
|
|
58
|
-
"@happyvertical/logger": "^0.
|
|
59
|
-
"@happyvertical/sql": "^0.
|
|
60
|
-
"@happyvertical/utils": "^0.
|
|
56
|
+
"@happyvertical/ai": "^0.76.2",
|
|
57
|
+
"@happyvertical/files": "^0.76.2",
|
|
58
|
+
"@happyvertical/logger": "^0.76.2",
|
|
59
|
+
"@happyvertical/sql": "^0.76.2",
|
|
60
|
+
"@happyvertical/utils": "^0.76.2",
|
|
61
61
|
"cors": "^2.8.6",
|
|
62
62
|
"express": "^5.2.1",
|
|
63
|
-
"@happyvertical/smrt-assets": "0.38.
|
|
64
|
-
"@happyvertical/smrt-core": "0.38.
|
|
65
|
-
"@happyvertical/smrt-scanner": "0.38.
|
|
66
|
-
"@happyvertical/smrt-svelte": "0.38.
|
|
67
|
-
"@happyvertical/smrt-tenancy": "0.38.
|
|
68
|
-
"@happyvertical/smrt-
|
|
69
|
-
"@happyvertical/smrt-
|
|
63
|
+
"@happyvertical/smrt-assets": "0.38.4",
|
|
64
|
+
"@happyvertical/smrt-core": "0.38.4",
|
|
65
|
+
"@happyvertical/smrt-scanner": "0.38.4",
|
|
66
|
+
"@happyvertical/smrt-svelte": "0.38.4",
|
|
67
|
+
"@happyvertical/smrt-tenancy": "0.38.4",
|
|
68
|
+
"@happyvertical/smrt-web": "0.38.4",
|
|
69
|
+
"@happyvertical/smrt-ui": "0.38.4"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"svelte": "^5.56.4"
|
|
@@ -87,9 +87,9 @@
|
|
|
87
87
|
"svelte": "^5.56.4",
|
|
88
88
|
"svelte-check": "^4.7.1",
|
|
89
89
|
"typescript": "^5.9.3",
|
|
90
|
-
"vite": "^8.1.
|
|
90
|
+
"vite": "^8.1.3",
|
|
91
91
|
"vitest": "^4.1.9",
|
|
92
|
-
"@happyvertical/smrt-vitest": "0.38.
|
|
92
|
+
"@happyvertical/smrt-vitest": "0.38.4"
|
|
93
93
|
},
|
|
94
94
|
"keywords": [
|
|
95
95
|
"smrt",
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ObjectRegistry } from "@happyvertical/smrt-core";
|
|
2
|
-
//#region src/__smrt-register__.ts
|
|
3
|
-
ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":1783125241716,\"packageName\":\"@happyvertical/smrt-products\",\"packageVersion\":\"0.38.2\",\"objects\":{\"@happyvertical/smrt-products:CategoryCollection\":{\"name\":\"categorycollection\",\"className\":\"CategoryCollection\",\"qualifiedName\":\"@happyvertical/smrt-products:CategoryCollection\",\"collection\":\"categories\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/collections/CategoryCollection.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{},\"methods\":{\"getRootCategories\":{\"name\":\"getRootCategories\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Category[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"Category\",\"exportName\":\"CategoryCollection\",\"collectionExportName\":\"CategoryCollectionCollection\",\"schema\":{\"tableName\":\"category_collections\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"category_collections\\\" (\\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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"category_collections_id_idx\",\"columns\":[\"id\"]},{\"name\":\"category_collections_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"f2f42d47\"}},\"@happyvertical/smrt-products:MaterialCollection\":{\"name\":\"materialcollection\",\"className\":\"MaterialCollection\",\"qualifiedName\":\"@happyvertical/smrt-products:MaterialCollection\",\"collection\":\"products\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/collections/MaterialCollection.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{},\"methods\":{\"findByKind\":{\"name\":\"findByKind\",\"async\":true,\"parameters\":[{\"name\":\"materialKind\",\"type\":\"MaterialKind\",\"optional\":false}],\"returnType\":\"Promise<Material[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"products\"},\"extends\":\"ProductCollection\",\"exportName\":\"MaterialCollection\",\"collectionExportName\":\"MaterialCollectionCollection\",\"schema\":{\"tableName\":\"products\",\"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 \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"products_id_idx\",\"columns\":[\"id\"]},{\"name\":\"products_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"d7d2c125\"}},\"@happyvertical/smrt-products:ProductAssetCollection\":{\"name\":\"productassetcollection\",\"className\":\"ProductAssetCollection\",\"qualifiedName\":\"@happyvertical/smrt-products:ProductAssetCollection\",\"collection\":\"productassets\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/collections/ProductAssetCollection.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{},\"methods\":{\"byLeft\":{\"name\":\"byLeft\",\"async\":true,\"parameters\":[{\"name\":\"leftId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionFilterOptions\",\"optional\":true}],\"returnType\":\"Promise<TItem[]>\",\"isStatic\":false,\"isPublic\":true},\"byRight\":{\"name\":\"byRight\",\"async\":true,\"parameters\":[{\"name\":\"rightId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionFilterOptions\",\"optional\":true}],\"returnType\":\"Promise<TItem[]>\",\"isStatic\":false,\"isPublic\":true},\"attach\":{\"name\":\"attach\",\"async\":true,\"parameters\":[{\"name\":\"leftId\",\"type\":\"string\",\"optional\":false},{\"name\":\"rightId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionAttachOptions\",\"optional\":true}],\"returnType\":\"Promise<TItem>\",\"isStatic\":false,\"isPublic\":true},\"detach\":{\"name\":\"detach\",\"async\":true,\"parameters\":[{\"name\":\"leftId\",\"type\":\"string\",\"optional\":false},{\"name\":\"rightId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionFilterOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"setLinks\":{\"name\":\"setLinks\",\"async\":true,\"parameters\":[{\"name\":\"leftId\",\"type\":\"string\",\"optional\":false},{\"name\":\"rightIds\",\"type\":\"string[]\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionAttachOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getAssets\":{\"name\":\"getAssets\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"addAsset\":{\"name\":\"addAsset\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false},{\"name\":\"asset\",\"type\":\"Asset\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"any\",\"optional\":true,\"default\":\"attachment\"},{\"name\":\"sortOrder\",\"type\":\"any\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"removeAsset\":{\"name\":\"removeAsset\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false},{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"api\":false,\"mcp\":false,\"cli\":false,\"tableName\":\"product_assets\"},\"extends\":\"SmrtJunction\",\"extendsTypeArg\":\"ProductAsset\",\"exportName\":\"ProductAssetCollection\",\"collectionExportName\":\"ProductAssetCollectionCollection\",\"schema\":{\"tableName\":\"product_assets\",\"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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"product_assets_id_idx\",\"columns\":[\"id\"]},{\"name\":\"product_assets_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"ffb1b593\"}},\"@happyvertical/smrt-products:ProductCollection\":{\"name\":\"productcollection\",\"className\":\"ProductCollection\",\"qualifiedName\":\"@happyvertical/smrt-products:ProductCollection\",\"collection\":\"products\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/collections/ProductCollection.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{},\"methods\":{\"findByManufacturer\":{\"name\":\"findByManufacturer\",\"async\":true,\"parameters\":[{\"name\":\"manufacturer\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Product[]>\",\"isStatic\":false,\"isPublic\":true},\"findInStock\":{\"name\":\"findInStock\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Product[]>\",\"isStatic\":false,\"isPublic\":true},\"getAssets\":{\"name\":\"getAssets\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"addAsset\":{\"name\":\"addAsset\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false},{\"name\":\"asset\",\"type\":\"Asset\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"any\",\"optional\":true,\"default\":\"attachment\"},{\"name\":\"sortOrder\",\"type\":\"any\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"removeAsset\":{\"name\":\"removeAsset\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false},{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"Product\",\"exportName\":\"ProductCollection\",\"collectionExportName\":\"ProductCollectionCollection\",\"schema\":{\"tableName\":\"product_collections\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"product_collections\\\" (\\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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"product_collections_id_idx\",\"columns\":[\"id\"]},{\"name\":\"product_collections_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"51a90ef1\"}},\"@happyvertical/smrt-products:ProductVariantCollection\":{\"name\":\"productvariantcollection\",\"className\":\"ProductVariantCollection\",\"qualifiedName\":\"@happyvertical/smrt-products:ProductVariantCollection\",\"collection\":\"productvariants\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/collections/ProductVariantCollection.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{},\"methods\":{\"findForProduct\":{\"name\":\"findForProduct\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<ProductVariant[]>\",\"isStatic\":false,\"isPublic\":true},\"findAxis\":{\"name\":\"findAxis\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false},{\"name\":\"axisName\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<ProductVariant | null>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"product_variants\"},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"ProductVariant\",\"exportName\":\"ProductVariantCollection\",\"collectionExportName\":\"ProductVariantCollectionCollection\",\"schema\":{\"tableName\":\"product_variants\",\"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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"product_variants_id_idx\",\"columns\":[\"id\"]},{\"name\":\"product_variants_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"7e192164\"}},\"@happyvertical/smrt-products:SkuCollection\":{\"name\":\"skucollection\",\"className\":\"SkuCollection\",\"qualifiedName\":\"@happyvertical/smrt-products:SkuCollection\",\"collection\":\"skus\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/collections/SkuCollection.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{},\"methods\":{\"findByCode\":{\"name\":\"findByCode\",\"async\":true,\"parameters\":[{\"name\":\"code\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Sku | null>\",\"isStatic\":false,\"isPublic\":true},\"findByBarcode\":{\"name\":\"findByBarcode\",\"async\":true,\"parameters\":[{\"name\":\"barcode\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Sku | null>\",\"isStatic\":false,\"isPublic\":true},\"findByProduct\":{\"name\":\"findByProduct\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Sku[]>\",\"isStatic\":false,\"isPublic\":true},\"findByParent\":{\"name\":\"findByParent\",\"async\":true,\"parameters\":[{\"name\":\"parentSkuId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Sku[]>\",\"isStatic\":false,\"isPublic\":true},\"findActive\":{\"name\":\"findActive\",\"async\":true,\"parameters\":[{\"name\":\"productId\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Sku[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"product_skus\"},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"Sku\",\"exportName\":\"SkuCollection\",\"collectionExportName\":\"SkuCollectionCollection\",\"schema\":{\"tableName\":\"product_skus\",\"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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"product_skus_id_idx\",\"columns\":[\"id\"]},{\"name\":\"product_skus_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true}],\"version\":\"f3e8dedc\"}},\"@happyvertical/smrt-products:Category\":{\"name\":\"category\",\"className\":\"Category\",\"qualifiedName\":\"@happyvertical/smrt-products:Category\",\"collection\":\"categories\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/models/Category.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{\"created_at\":{\"type\":\"datetime\",\"required\":false},\"updated_at\":{\"type\":\"datetime\",\"required\":false},\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"name\":{\"type\":\"text\",\"required\":false},\"description\":{\"type\":\"text\",\"required\":false},\"parentId\":{\"type\":\"foreignKey\",\"required\":false,\"related\":\"Category\"},\"level\":{\"type\":\"integer\",\"required\":true,\"default\":0},\"productCount\":{\"type\":\"integer\",\"required\":true,\"default\":0},\"active\":{\"type\":\"boolean\",\"required\":true,\"default\":true}},\"methods\":{\"getAiUsageSnapshot\":{\"name\":\"getAiUsageSnapshot\",\"async\":false,\"parameters\":[],\"returnType\":\"AiUsageSnapshot | undefined\",\"isStatic\":false,\"isPublic\":true},\"resetAiUsage\":{\"name\":\"resetAiUsage\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"listAiUsage\":{\"name\":\"listAiUsage\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiUsageListOptions\",\"optional\":true}],\"returnType\":\"Promise<SmrtAiUsageRecord[]>\",\"isStatic\":false,\"isPublic\":true},\"summarizeAiUsage\":{\"name\":\"summarizeAiUsage\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiUsageSummaryOptions\",\"optional\":true}],\"returnType\":\"Promise<Record<string, AiUsageStats>>\",\"isStatic\":false,\"isPublic\":true},\"destroy\":{\"name\":\"destroy\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"markAsPersisted\":{\"name\":\"markAsPersisted\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"requireInsertOnSave\":{\"name\":\"requireInsertOnSave\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"initialize\":{\"name\":\"initialize\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise\",\"isStatic\":false,\"isPublic\":true},\"loadDataFromDb\":{\"name\":\"loadDataFromDb\",\"async\":true,\"parameters\":[{\"name\":\"data\",\"type\":\"Record<string>\",\"optional\":false}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getFields\":{\"name\":\"getFields\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"toJSON\":{\"name\":\"toJSON\",\"async\":false,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"toPlainObject\":{\"name\":\"toPlainObject\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string>\",\"isStatic\":false,\"isPublic\":true},\"toPublicJSON\":{\"name\":\"toPublicJSON\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string>\",\"isStatic\":false,\"isPublic\":true},\"getId\":{\"name\":\"getId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getSlug\":{\"name\":\"getSlug\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getSavedId\":{\"name\":\"getSavedId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"isSaved\":{\"name\":\"isSaved\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"save\":{\"name\":\"save\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"classifyConstraintError\":{\"name\":\"classifyConstraintError\",\"async\":false,\"parameters\":[{\"name\":\"message\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"'unique' | 'not_null' | null\",\"isStatic\":true,\"isPublic\":true},\"loadFromId\":{\"name\":\"loadFromId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"loadFromSlug\":{\"name\":\"loadFromSlug\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"is\":{\"name\":\"is\",\"async\":true,\"parameters\":[{\"name\":\"criteria\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"do\":{\"name\":\"do\",\"async\":true,\"parameters\":[{\"name\":\"instructions\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"describe\":{\"name\":\"describe\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"delete\":{\"name\":\"delete\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"isRelatedLoaded\":{\"name\":\"isRelatedLoaded\",\"async\":false,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"boolean\",\"isStatic\":false,\"isPublic\":true},\"_setLoadedRelationship\":{\"name\":\"_setLoadedRelationship\",\"async\":false,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"value\",\"type\":\"any\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"loadRelated\":{\"name\":\"loadRelated\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"loadRelatedMany\":{\"name\":\"loadRelatedMany\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any[]>\",\"isStatic\":false,\"isPublic\":true},\"getRelated\":{\"name\":\"getRelated\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"getAvailableTools\":{\"name\":\"getAvailableTools\",\"async\":false,\"parameters\":[],\"returnType\":\"AITool[]\",\"isStatic\":false,\"isPublic\":true},\"executeToolCall\":{\"name\":\"executeToolCall\",\"async\":true,\"parameters\":[{\"name\":\"toolCall\",\"type\":\"ToolCall\",\"optional\":false}],\"returnType\":\"Promise<ToolCallResult>\",\"isStatic\":false,\"isPublic\":true},\"remember\":{\"name\":\"remember\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"recall\":{\"name\":\"recall\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise\",\"isStatic\":false,\"isPublic\":true},\"recallAll\":{\"name\":\"recallAll\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":true}],\"returnType\":\"Promise<Map<string>>\",\"isStatic\":false,\"isPublic\":true},\"forget\":{\"name\":\"forget\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"forgetScope\":{\"name\":\"forgetScope\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<number>\",\"isStatic\":false,\"isPublic\":true},\"generateEmbeddings\":{\"name\":\"generateEmbeddings\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"GenerateEmbeddingsOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getEmbedding\":{\"name\":\"getEmbedding\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"model\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<number[] | null>\",\"isStatic\":false,\"isPublic\":true},\"hasStaleEmbeddings\":{\"name\":\"hasStaleEmbeddings\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<boolean>\",\"isStatic\":false,\"isPublic\":true},\"clearEmbeddings\":{\"name\":\"clearEmbeddings\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":true,\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"Category\",\"collectionExportName\":\"CategoryCollection\",\"validationRules\":[{\"field\":\"level\",\"rule\":\"required\",\"fieldType\":\"integer\"},{\"field\":\"productCount\",\"rule\":\"required\",\"fieldType\":\"integer\"},{\"field\":\"active\",\"rule\":\"required\",\"fieldType\":\"boolean\"}],\"schema\":{\"tableName\":\"categories\",\"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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false},\"parent_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false},\"level\":{\"type\":\"INTEGER\",\"notNull\":false,\"default\":0},\"product_count\":{\"type\":\"INTEGER\",\"notNull\":false,\"default\":0},\"active\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"default\":true}},\"indexes\":[{\"name\":\"categories_id_idx\",\"columns\":[\"id\"]},{\"name\":\"categories_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"categories_meta_type_idx\",\"columns\":[\"_meta_type\"]}],\"version\":\"9b7d356d\"}},\"@happyvertical/smrt-products:Material\":{\"name\":\"material\",\"className\":\"Material\",\"qualifiedName\":\"@happyvertical/smrt-products:Material\",\"collection\":\"products\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/models/Material.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{\"created_at\":{\"type\":\"datetime\",\"required\":false},\"updated_at\":{\"type\":\"datetime\",\"required\":false},\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"productType\":{\"type\":\"text\",\"required\":false},\"name\":{\"type\":\"text\",\"required\":false},\"description\":{\"type\":\"text\",\"required\":false},\"category\":{\"type\":\"text\",\"required\":false},\"manufacturer\":{\"type\":\"text\",\"required\":false},\"model\":{\"type\":\"text\",\"required\":false},\"price\":{\"type\":\"integer\",\"required\":true,\"default\":0},\"inStock\":{\"type\":\"boolean\",\"required\":true,\"default\":true},\"specifications\":{\"type\":\"json\",\"required\":false,\"default\":{}},\"tags\":{\"type\":\"json\",\"required\":false,\"default\":[]},\"materialKind\":{\"type\":\"meta\",\"required\":false,\"default\":\"component\",\"_meta\":{\"underlyingType\":\"text\"}},\"uom\":{\"type\":\"meta\",\"required\":false,\"default\":\"each\",\"_meta\":{\"underlyingType\":\"text\"}},\"costPerUnit\":{\"type\":\"meta\",\"required\":false,\"default\":0,\"_meta\":{\"underlyingType\":\"decimal\"}}},\"methods\":{\"getAiUsageSnapshot\":{\"name\":\"getAiUsageSnapshot\",\"async\":false,\"parameters\":[],\"returnType\":\"AiUsageSnapshot | undefined\",\"isStatic\":false,\"isPublic\":true},\"resetAiUsage\":{\"name\":\"resetAiUsage\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"listAiUsage\":{\"name\":\"listAiUsage\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiUsageListOptions\",\"optional\":true}],\"returnType\":\"Promise<SmrtAiUsageRecord[]>\",\"isStatic\":false,\"isPublic\":true},\"summarizeAiUsage\":{\"name\":\"summarizeAiUsage\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiUsageSummaryOptions\",\"optional\":true}],\"returnType\":\"Promise<Record<string, AiUsageStats>>\",\"isStatic\":false,\"isPublic\":true},\"destroy\":{\"name\":\"destroy\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"markAsPersisted\":{\"name\":\"markAsPersisted\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"requireInsertOnSave\":{\"name\":\"requireInsertOnSave\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"initialize\":{\"name\":\"initialize\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise\",\"isStatic\":false,\"isPublic\":true},\"loadDataFromDb\":{\"name\":\"loadDataFromDb\",\"async\":true,\"parameters\":[{\"name\":\"data\",\"type\":\"Record<string>\",\"optional\":false}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getFields\":{\"name\":\"getFields\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"toJSON\":{\"name\":\"toJSON\",\"async\":false,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"toPlainObject\":{\"name\":\"toPlainObject\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string>\",\"isStatic\":false,\"isPublic\":true},\"toPublicJSON\":{\"name\":\"toPublicJSON\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string>\",\"isStatic\":false,\"isPublic\":true},\"getId\":{\"name\":\"getId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getSlug\":{\"name\":\"getSlug\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getSavedId\":{\"name\":\"getSavedId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"isSaved\":{\"name\":\"isSaved\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"save\":{\"name\":\"save\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"classifyConstraintError\":{\"name\":\"classifyConstraintError\",\"async\":false,\"parameters\":[{\"name\":\"message\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"'unique' | 'not_null' | null\",\"isStatic\":true,\"isPublic\":true},\"loadFromId\":{\"name\":\"loadFromId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"loadFromSlug\":{\"name\":\"loadFromSlug\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"is\":{\"name\":\"is\",\"async\":true,\"parameters\":[{\"name\":\"criteria\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"do\":{\"name\":\"do\",\"async\":true,\"parameters\":[{\"name\":\"instructions\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"describe\":{\"name\":\"describe\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"delete\":{\"name\":\"delete\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"isRelatedLoaded\":{\"name\":\"isRelatedLoaded\",\"async\":false,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"boolean\",\"isStatic\":false,\"isPublic\":true},\"_setLoadedRelationship\":{\"name\":\"_setLoadedRelationship\",\"async\":false,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"value\",\"type\":\"any\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"loadRelated\":{\"name\":\"loadRelated\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"loadRelatedMany\":{\"name\":\"loadRelatedMany\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any[]>\",\"isStatic\":false,\"isPublic\":true},\"getRelated\":{\"name\":\"getRelated\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"getAvailableTools\":{\"name\":\"getAvailableTools\",\"async\":false,\"parameters\":[],\"returnType\":\"AITool[]\",\"isStatic\":false,\"isPublic\":true},\"executeToolCall\":{\"name\":\"executeToolCall\",\"async\":true,\"parameters\":[{\"name\":\"toolCall\",\"type\":\"ToolCall\",\"optional\":false}],\"returnType\":\"Promise<ToolCallResult>\",\"isStatic\":false,\"isPublic\":true},\"remember\":{\"name\":\"remember\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"recall\":{\"name\":\"recall\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise\",\"isStatic\":false,\"isPublic\":true},\"recallAll\":{\"name\":\"recallAll\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":true}],\"returnType\":\"Promise<Map<string>>\",\"isStatic\":false,\"isPublic\":true},\"forget\":{\"name\":\"forget\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"forgetScope\":{\"name\":\"forgetScope\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<number>\",\"isStatic\":false,\"isPublic\":true},\"generateEmbeddings\":{\"name\":\"generateEmbeddings\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"GenerateEmbeddingsOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getEmbedding\":{\"name\":\"getEmbedding\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"model\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<number[] | null>\",\"isStatic\":false,\"isPublic\":true},\"hasStaleEmbeddings\":{\"name\":\"hasStaleEmbeddings\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<boolean>\",\"isStatic\":false,\"isPublic\":true},\"clearEmbeddings\":{\"name\":\"clearEmbeddings\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getSpecification\":{\"name\":\"getSpecification\",\"async\":true,\"parameters\":[{\"name\":\"key\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise\",\"isStatic\":false,\"isPublic\":true},\"updateSpecification\":{\"name\":\"updateSpecification\",\"async\":true,\"parameters\":[{\"name\":\"key\",\"type\":\"string\",\"optional\":false},{\"name\":\"value\",\"type\":\"any\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getAssets\":{\"name\":\"getAssets\",\"async\":true,\"parameters\":[{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"addAsset\":{\"name\":\"addAsset\",\"async\":true,\"parameters\":[{\"name\":\"asset\",\"type\":\"Asset\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"any\",\"optional\":true,\"default\":\"attachment\"},{\"name\":\"sortOrder\",\"type\":\"any\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"removeAsset\":{\"name\":\"removeAsset\",\"async\":true,\"parameters\":[{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":true,\"tenantScoped\":{\"mode\":\"optional\"},\"tableName\":\"products\",\"tableStrategy\":\"sti\"},\"extends\":\"Product\",\"exportName\":\"Material\",\"collectionExportName\":\"MaterialCollection\",\"validationRules\":[{\"field\":\"price\",\"rule\":\"required\",\"fieldType\":\"integer\"},{\"field\":\"inStock\",\"rule\":\"required\",\"fieldType\":\"boolean\"}],\"schema\":{\"tableName\":\"products\",\"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 \\\"in_stock\\\" BOOLEAN DEFAULT TRUE,\\n \\\"specifications\\\" JSON DEFAULT '{}',\\n \\\"tags\\\" JSON DEFAULT '[]'\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"product_type\":{\"type\":\"TEXT\",\"notNull\":false},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false},\"category\":{\"type\":\"TEXT\",\"notNull\":false},\"manufacturer\":{\"type\":\"TEXT\",\"notNull\":false},\"model\":{\"type\":\"TEXT\",\"notNull\":false},\"price\":{\"type\":\"INTEGER\",\"notNull\":false,\"default\":0},\"in_stock\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"default\":true},\"specifications\":{\"type\":\"JSON\",\"notNull\":false,\"default\":{}},\"tags\":{\"type\":\"JSON\",\"notNull\":false,\"default\":[]}},\"indexes\":[{\"name\":\"products_id_idx\",\"columns\":[\"id\"]},{\"name\":\"products_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"products_meta_type_idx\",\"columns\":[\"_meta_type\"]}],\"version\":\"4a33c96d\"}},\"@happyvertical/smrt-products:Product\":{\"name\":\"product\",\"className\":\"Product\",\"qualifiedName\":\"@happyvertical/smrt-products:Product\",\"collection\":\"products\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/models/Product.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{\"created_at\":{\"type\":\"datetime\",\"required\":false},\"updated_at\":{\"type\":\"datetime\",\"required\":false},\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"productType\":{\"type\":\"text\",\"required\":false},\"name\":{\"type\":\"text\",\"required\":false},\"description\":{\"type\":\"text\",\"required\":false},\"category\":{\"type\":\"text\",\"required\":false},\"manufacturer\":{\"type\":\"text\",\"required\":false},\"model\":{\"type\":\"text\",\"required\":false},\"price\":{\"type\":\"integer\",\"required\":true,\"default\":0},\"inStock\":{\"type\":\"boolean\",\"required\":true,\"default\":true},\"specifications\":{\"type\":\"json\",\"required\":false,\"default\":{}},\"tags\":{\"type\":\"json\",\"required\":false,\"default\":[]}},\"methods\":{\"getAiUsageSnapshot\":{\"name\":\"getAiUsageSnapshot\",\"async\":false,\"parameters\":[],\"returnType\":\"AiUsageSnapshot | undefined\",\"isStatic\":false,\"isPublic\":true},\"resetAiUsage\":{\"name\":\"resetAiUsage\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"listAiUsage\":{\"name\":\"listAiUsage\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiUsageListOptions\",\"optional\":true}],\"returnType\":\"Promise<SmrtAiUsageRecord[]>\",\"isStatic\":false,\"isPublic\":true},\"summarizeAiUsage\":{\"name\":\"summarizeAiUsage\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiUsageSummaryOptions\",\"optional\":true}],\"returnType\":\"Promise<Record<string, AiUsageStats>>\",\"isStatic\":false,\"isPublic\":true},\"destroy\":{\"name\":\"destroy\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"markAsPersisted\":{\"name\":\"markAsPersisted\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"requireInsertOnSave\":{\"name\":\"requireInsertOnSave\",\"async\":false,\"parameters\":[],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"initialize\":{\"name\":\"initialize\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise\",\"isStatic\":false,\"isPublic\":true},\"loadDataFromDb\":{\"name\":\"loadDataFromDb\",\"async\":true,\"parameters\":[{\"name\":\"data\",\"type\":\"Record<string>\",\"optional\":false}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getFields\":{\"name\":\"getFields\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"toJSON\":{\"name\":\"toJSON\",\"async\":false,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"toPlainObject\":{\"name\":\"toPlainObject\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string>\",\"isStatic\":false,\"isPublic\":true},\"toPublicJSON\":{\"name\":\"toPublicJSON\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string>\",\"isStatic\":false,\"isPublic\":true},\"getId\":{\"name\":\"getId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getSlug\":{\"name\":\"getSlug\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getSavedId\":{\"name\":\"getSavedId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"isSaved\":{\"name\":\"isSaved\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"save\":{\"name\":\"save\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"classifyConstraintError\":{\"name\":\"classifyConstraintError\",\"async\":false,\"parameters\":[{\"name\":\"message\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"'unique' | 'not_null' | null\",\"isStatic\":true,\"isPublic\":true},\"loadFromId\":{\"name\":\"loadFromId\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"loadFromSlug\":{\"name\":\"loadFromSlug\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"is\":{\"name\":\"is\",\"async\":true,\"parameters\":[{\"name\":\"criteria\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"do\":{\"name\":\"do\",\"async\":true,\"parameters\":[{\"name\":\"instructions\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"describe\":{\"name\":\"describe\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"AiOperationOptions\",\"optional\":true}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"delete\":{\"name\":\"delete\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"isRelatedLoaded\":{\"name\":\"isRelatedLoaded\",\"async\":false,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"boolean\",\"isStatic\":false,\"isPublic\":true},\"_setLoadedRelationship\":{\"name\":\"_setLoadedRelationship\",\"async\":false,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"value\",\"type\":\"any\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"loadRelated\":{\"name\":\"loadRelated\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"loadRelatedMany\":{\"name\":\"loadRelatedMany\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any[]>\",\"isStatic\":false,\"isPublic\":true},\"getRelated\":{\"name\":\"getRelated\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"LoadRelatedOptions\",\"optional\":true}],\"returnType\":\"Promise<any>\",\"isStatic\":false,\"isPublic\":true},\"getAvailableTools\":{\"name\":\"getAvailableTools\",\"async\":false,\"parameters\":[],\"returnType\":\"AITool[]\",\"isStatic\":false,\"isPublic\":true},\"executeToolCall\":{\"name\":\"executeToolCall\",\"async\":true,\"parameters\":[{\"name\":\"toolCall\",\"type\":\"ToolCall\",\"optional\":false}],\"returnType\":\"Promise<ToolCallResult>\",\"isStatic\":false,\"isPublic\":true},\"remember\":{\"name\":\"remember\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"recall\":{\"name\":\"recall\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise\",\"isStatic\":false,\"isPublic\":true},\"recallAll\":{\"name\":\"recallAll\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":true}],\"returnType\":\"Promise<Map<string>>\",\"isStatic\":false,\"isPublic\":true},\"forget\":{\"name\":\"forget\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"forgetScope\":{\"name\":\"forgetScope\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"object\",\"optional\":false}],\"returnType\":\"Promise<number>\",\"isStatic\":false,\"isPublic\":true},\"generateEmbeddings\":{\"name\":\"generateEmbeddings\",\"async\":true,\"parameters\":[{\"name\":\"options\",\"type\":\"GenerateEmbeddingsOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getEmbedding\":{\"name\":\"getEmbedding\",\"async\":true,\"parameters\":[{\"name\":\"fieldName\",\"type\":\"string\",\"optional\":false},{\"name\":\"model\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<number[] | null>\",\"isStatic\":false,\"isPublic\":true},\"hasStaleEmbeddings\":{\"name\":\"hasStaleEmbeddings\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<boolean>\",\"isStatic\":false,\"isPublic\":true},\"clearEmbeddings\":{\"name\":\"clearEmbeddings\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getSpecification\":{\"name\":\"getSpecification\",\"async\":true,\"parameters\":[{\"name\":\"key\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise\",\"isStatic\":false,\"isPublic\":true},\"updateSpecification\":{\"name\":\"updateSpecification\",\"async\":true,\"parameters\":[{\"name\":\"key\",\"type\":\"string\",\"optional\":false},{\"name\":\"value\",\"type\":\"any\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getAssets\":{\"name\":\"getAssets\",\"async\":true,\"parameters\":[{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"addAsset\":{\"name\":\"addAsset\",\"async\":true,\"parameters\":[{\"name\":\"asset\",\"type\":\"Asset\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"any\",\"optional\":true,\"default\":\"attachment\"},{\"name\":\"sortOrder\",\"type\":\"any\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"removeAsset\":{\"name\":\"removeAsset\",\"async\":true,\"parameters\":[{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":true,\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"Product\",\"collectionExportName\":\"ProductCollection\",\"validationRules\":[{\"field\":\"price\",\"rule\":\"required\",\"fieldType\":\"integer\"},{\"field\":\"inStock\",\"rule\":\"required\",\"fieldType\":\"boolean\"}],\"schema\":{\"tableName\":\"products\",\"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 \\\"in_stock\\\" BOOLEAN DEFAULT TRUE,\\n \\\"specifications\\\" JSON DEFAULT '{}',\\n \\\"tags\\\" JSON DEFAULT '[]'\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"_meta_type\":{\"type\":\"TEXT\",\"notNull\":true},\"_meta_data\":{\"type\":\"JSON\",\"notNull\":false},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"product_type\":{\"type\":\"TEXT\",\"notNull\":false},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false},\"category\":{\"type\":\"TEXT\",\"notNull\":false},\"manufacturer\":{\"type\":\"TEXT\",\"notNull\":false},\"model\":{\"type\":\"TEXT\",\"notNull\":false},\"price\":{\"type\":\"INTEGER\",\"notNull\":false,\"default\":0},\"in_stock\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"default\":true},\"specifications\":{\"type\":\"JSON\",\"notNull\":false,\"default\":{}},\"tags\":{\"type\":\"JSON\",\"notNull\":false,\"default\":[]}},\"indexes\":[{\"name\":\"products_id_idx\",\"columns\":[\"id\"]},{\"name\":\"products_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"products_meta_type_idx\",\"columns\":[\"_meta_type\"]}],\"version\":\"a7b4d592\"}},\"@happyvertical/smrt-products:ProductAsset\":{\"name\":\"productasset\",\"className\":\"ProductAsset\",\"qualifiedName\":\"@happyvertical/smrt-products:ProductAsset\",\"collection\":\"productassets\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/models/ProductAsset.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"productId\":{\"type\":\"foreignKey\",\"required\":true,\"related\":\"Product\",\"_meta\":{\"required\":true}},\"assetId\":{\"type\":\"crossPackageRef\",\"required\":true,\"related\":\"@happyvertical/smrt-assets:Asset\"},\"relationship\":{\"type\":\"text\",\"required\":true,\"_meta\":{\"required\":true}},\"sortOrder\":{\"type\":\"integer\",\"required\":true,\"default\":0}},\"methods\":{},\"decoratorConfig\":{\"tableName\":\"product_assets\",\"conflictColumns\":[\"product_id\",\"asset_id\",\"relationship\",\"tenant_id\"],\"api\":false,\"mcp\":false,\"cli\":false,\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"ProductAsset\",\"collectionExportName\":\"ProductAssetCollection\",\"validationRules\":[{\"field\":\"productId\",\"rule\":\"required\",\"fieldType\":\"foreignKey\"},{\"field\":\"assetId\",\"rule\":\"required\",\"fieldType\":\"crossPackageRef\"},{\"field\":\"relationship\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"sortOrder\",\"rule\":\"required\",\"fieldType\":\"integer\"}],\"schema\":{\"tableName\":\"product_assets\",\"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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"product_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":true,\"unique\":false},\"asset_id\":{\"type\":\"UUID\",\"referenceKind\":\"crossPackageRef\",\"notNull\":true,\"unique\":false},\"relationship\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false},\"sort_order\":{\"type\":\"INTEGER\",\"notNull\":true,\"unique\":false,\"default\":0}},\"indexes\":[{\"name\":\"product_assets_id_idx\",\"columns\":[\"id\"]},{\"name\":\"product_assets_product_id_asset_id_idx\",\"columns\":[\"product_id\",\"asset_id\",\"relationship\",\"tenant_id\"],\"unique\":true}],\"version\":\"320e1554\"}},\"@happyvertical/smrt-products:ProductVariant\":{\"name\":\"productvariant\",\"className\":\"ProductVariant\",\"qualifiedName\":\"@happyvertical/smrt-products:ProductVariant\",\"collection\":\"productvariants\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/models/ProductVariant.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"productId\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"axisName\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"label\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"allowedValues\":{\"type\":\"text\",\"required\":false,\"default\":\"[]\"},\"sortOrder\":{\"type\":\"integer\",\"required\":false,\"default\":0}},\"methods\":{\"getValues\":{\"name\":\"getValues\",\"async\":false,\"parameters\":[],\"returnType\":\"string[]\",\"isStatic\":false,\"isPublic\":true},\"setValues\":{\"name\":\"setValues\",\"async\":false,\"parameters\":[{\"name\":\"value\",\"type\":\"string[] | string\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"product_variants\",\"conflictColumns\":[\"product_id\",\"axis_name\",\"tenant_id\"],\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":true,\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"ProductVariant\",\"collectionExportName\":\"ProductVariantCollection\",\"validationRules\":[{\"field\":\"productId\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"axisName\",\"rule\":\"required\",\"fieldType\":\"text\"}],\"schema\":{\"tableName\":\"product_variants\",\"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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"product_id\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"axis_name\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"label\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"allowed_values\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"[]\"},\"sort_order\":{\"type\":\"INTEGER\",\"notNull\":false,\"unique\":false,\"default\":0}},\"indexes\":[{\"name\":\"product_variants_id_idx\",\"columns\":[\"id\"]},{\"name\":\"product_variants_product_id_axis_name_idx\",\"columns\":[\"product_id\",\"axis_name\",\"tenant_id\"],\"unique\":true}],\"version\":\"2891ff02\"}},\"@happyvertical/smrt-products:Sku\":{\"name\":\"sku\",\"className\":\"Sku\",\"qualifiedName\":\"@happyvertical/smrt-products:Sku\",\"collection\":\"skus\",\"filePath\":\"/home/runner/_work/smrt/smrt/packages/products/src/lib/models/Sku.ts\",\"packageName\":\"@happyvertical/smrt-products\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"productId\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"code\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"barcode\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"name\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"attributes\":{\"type\":\"text\",\"required\":false,\"default\":\"{}\"},\"weightGrams\":{\"type\":\"decimal\",\"required\":false,\"_meta\":{}},\"parentSkuId\":{\"type\":\"text\",\"required\":false,\"default\":\"\"},\"active\":{\"type\":\"boolean\",\"required\":false,\"default\":true}},\"methods\":{\"getAttributes\":{\"name\":\"getAttributes\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string>\",\"isStatic\":false,\"isPublic\":true},\"setAttributes\":{\"name\":\"setAttributes\",\"async\":false,\"parameters\":[{\"name\":\"value\",\"type\":\"Record<string> | string\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableName\":\"product_skus\",\"conflictColumns\":[\"code\",\"tenant_id\"],\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"mcp\":{\"include\":[\"list\",\"get\"]},\"cli\":true,\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"Sku\",\"collectionExportName\":\"SkuCollection\",\"validationRules\":[{\"field\":\"productId\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"code\",\"rule\":\"required\",\"fieldType\":\"text\"}],\"schema\":{\"tableName\":\"product_skus\",\"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);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"product_id\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"code\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false,\"default\":\"\"},\"barcode\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"name\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"attributes\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"{}\"},\"weight_grams\":{\"type\":\"REAL\",\"notNull\":false,\"unique\":false},\"parent_sku_id\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false,\"default\":\"\"},\"active\":{\"type\":\"BOOLEAN\",\"notNull\":false,\"unique\":false,\"default\":true}},\"indexes\":[{\"name\":\"product_skus_id_idx\",\"columns\":[\"id\"]},{\"name\":\"product_skus_code_tenant_id_idx\",\"columns\":[\"code\",\"tenant_id\"],\"unique\":true}],\"version\":\"89d5a311\"}}},\"moduleType\":\"smrt\",\"smrtDependencies\":[\"@happyvertical/smrt-assets\",\"@happyvertical/smrt-core\",\"@happyvertical/smrt-tenancy\"]}"));
|
|
4
|
-
//#endregion
|
|
5
|
-
|
|
6
|
-
//# sourceMappingURL=__smrt-register__-Uiu0ODFT.js.map
|