@happyvertical/smrt-assets 0.53.0 → 0.53.2
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/index.js +1 -1
- package/dist/manifest.json +1 -1
- package/dist/smrt-knowledge.json +3 -3
- package/package.json +9 -9
- package/dist/svelte/__tests__/ActionBar.test.js +0 -72
- package/dist/svelte/__tests__/AssetDetail.test.js +0 -57
- package/dist/svelte/__tests__/AssetGrid.test.js +0 -69
- package/dist/svelte/__tests__/AssetList.test.js +0 -72
- package/dist/svelte/__tests__/AssetManager.test.js +0 -21
- package/dist/svelte/__tests__/AssetManagerRoute.test.js +0 -16
- package/dist/svelte/__tests__/AssetToolbar.test.js +0 -39
- package/dist/svelte/__tests__/CreateAssetModal.test.js +0 -42
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
15
15
|
};
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/__smrt-register__.ts
|
|
18
|
-
ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":0,\"packageName\":\"@happyvertical/smrt-assets\",\"packageVersion\":\"0.53.0\",\"objects\":{\"@happyvertical/smrt-assets:AssetAssociation\":{\"name\":\"assetassociation\",\"className\":\"AssetAssociation\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetAssociation\",\"collection\":\"assetassociations\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-association.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{\"metaType\":{\"type\":\"text\",\"required\":true,\"_meta\":{\"required\":true}},\"metaId\":{\"type\":\"text\",\"required\":true,\"_meta\":{\"required\":true}},\"role\":{\"type\":\"text\",\"required\":true,\"_meta\":{\"required\":true}},\"sortOrder\":{\"type\":\"integer\",\"required\":false,\"default\":0},\"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}}},\"assetId\":{\"type\":\"foreignKey\",\"required\":true,\"related\":\"Asset\",\"_meta\":{\"required\":true}}},\"methods\":{\"hydrate\":{\"name\":\"hydrate\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<T | null>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"conflictColumns\":[\"asset_id\",\"meta_type\",\"meta_id\",\"role\"],\"api\":{\"include\":[\"list\",\"get\",\"create\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\",\"create\"]},\"cli\":{\"skipApiCheck\":true},\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtPolymorphicAssociation\",\"exportName\":\"AssetAssociation\",\"collectionExportName\":\"AssetAssociationCollection\",\"validationRules\":[{\"field\":\"metaType\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"metaId\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"role\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"assetId\",\"rule\":\"required\",\"fieldType\":\"foreignKey\"}],\"schema\":{\"tableName\":\"asset_associations\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_associations\\\" (\\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 \\\"meta_type\\\" TEXT NOT NULL,\\n \\\"meta_id\\\" TEXT NOT NULL,\\n \\\"role\\\" TEXT NOT NULL,\\n \\\"sort_order\\\" INTEGER DEFAULT 0,\\n \\\"tenant_id\\\" UUID,\\n \\\"asset_id\\\" UUID NOT NULL\\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\"},\"meta_type\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false},\"meta_id\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false},\"role\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false},\"sort_order\":{\"type\":\"INTEGER\",\"notNull\":false,\"unique\":false,\"default\":0},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"asset_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":true,\"unique\":false,\"foreignKey\":{\"table\":\"assets\",\"column\":\"id\",\"onDelete\":\"CASCADE\",\"onUpdate\":\"CASCADE\"}}},\"indexes\":[{\"name\":\"asset_associations_asset_id_meta_type_idx\",\"columns\":[\"asset_id\",\"meta_type\",\"meta_id\",\"role\"],\"unique\":true},{\"name\":\"asset_associations_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"asset_associations_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"asset_associations_meta_type_meta_id_idx\",\"columns\":[\"meta_type\",\"meta_id\"]}],\"version\":\"faa13cea\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetAssociationCollection\":{\"name\":\"assetassociationcollection\",\"className\":\"AssetAssociationCollection\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetAssociationCollection\",\"collection\":\"assetassociations\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-associations.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{},\"methods\":{\"byLeft\":{\"name\":\"byLeft\",\"async\":true,\"parameters\":[{\"name\":\"metaType\",\"type\":\"string\",\"optional\":false},{\"name\":\"metaId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionFilterOptions\",\"optional\":true}],\"returnType\":\"Promise<AssetAssociation[]>\",\"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\":\"metaType\",\"type\":\"string\",\"optional\":false},{\"name\":\"metaId\",\"type\":\"string\",\"optional\":false},{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionAttachOptions\",\"optional\":true}],\"returnType\":\"Promise<AssetAssociation>\",\"isStatic\":false,\"isPublic\":true},\"detach\":{\"name\":\"detach\",\"async\":true,\"parameters\":[{\"name\":\"metaType\",\"type\":\"string\",\"optional\":false},{\"name\":\"metaId\",\"type\":\"string\",\"optional\":false},{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionFilterOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"setLinks\":{\"name\":\"setLinks\",\"async\":true,\"parameters\":[{\"name\":\"metaType\",\"type\":\"string\",\"optional\":false},{\"name\":\"metaId\",\"type\":\"string\",\"optional\":false},{\"name\":\"assetIds\",\"type\":\"string[]\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionAttachOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtJunction\",\"extendsTypeArg\":\"AssetAssociation\",\"exportName\":\"AssetAssociationCollection\",\"collectionExportName\":\"AssetAssociationCollectionCollection\",\"schema\":{\"tableName\":\"asset_associations\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_associations\\\" (\\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 \\\"meta_type\\\" TEXT NOT NULL,\\n \\\"meta_id\\\" TEXT NOT NULL,\\n \\\"role\\\" TEXT NOT NULL,\\n \\\"sort_order\\\" INTEGER DEFAULT 0,\\n \\\"tenant_id\\\" UUID,\\n \\\"asset_id\\\" UUID NOT NULL\\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\"},\"meta_type\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false},\"meta_id\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false},\"role\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false},\"sort_order\":{\"type\":\"INTEGER\",\"notNull\":false,\"unique\":false,\"default\":0},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"asset_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":true,\"unique\":false,\"foreignKey\":{\"table\":\"assets\",\"column\":\"id\",\"onDelete\":\"CASCADE\",\"onUpdate\":\"CASCADE\"}}},\"indexes\":[{\"name\":\"asset_associations_asset_id_meta_type_idx\",\"columns\":[\"asset_id\",\"meta_type\",\"meta_id\",\"role\"],\"unique\":true},{\"name\":\"asset_associations_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"asset_associations_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"asset_associations_meta_type_meta_id_idx\",\"columns\":[\"meta_type\",\"meta_id\"]}],\"version\":\"faa13cea\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetMetafield\":{\"name\":\"assetmetafield\",\"className\":\"AssetMetafield\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetMetafield\",\"collection\":\"assetmetafields\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-metafield.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{\"created_at\":{\"type\":\"datetime\",\"required\":false},\"updated_at\":{\"type\":\"datetime\",\"required\":false},\"name\":{\"type\":\"text\",\"required\":false},\"validation\":{\"type\":\"text\",\"required\":false}},\"methods\":{\"getValidation\":{\"name\":\"getValidation\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string, unknown>\",\"isStatic\":false,\"isPublic\":true},\"setValidation\":{\"name\":\"setValidation\",\"async\":false,\"parameters\":[{\"name\":\"rules\",\"type\":\"Record<string, unknown>\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"getBySlug\":{\"name\":\"getBySlug\",\"async\":true,\"parameters\":[{\"name\":\"_slug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<AssetMetafield | null>\",\"isStatic\":true,\"isPublic\":true}},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\",\"create\"]},\"cli\":{\"skipApiCheck\":true}},\"extends\":\"SmrtObject\",\"exportName\":\"AssetMetafield\",\"collectionExportName\":\"AssetMetafieldCollection\",\"schema\":{\"tableName\":\"asset_metafields\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_metafields\\\" (\\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 \\\"name\\\" TEXT,\\n \\\"validation\\\" TEXT\\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\"},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"validation\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"asset_metafields_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"asset_metafields_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"asset_metafields_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"7393718c\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetMetafieldCollection\":{\"name\":\"assetmetafieldcollection\",\"className\":\"AssetMetafieldCollection\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetMetafieldCollection\",\"collection\":\"assetmetafields\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-metafields.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{},\"methods\":{\"getOrCreate\":{\"name\":\"getOrCreate\",\"async\":true,\"parameters\":[{\"name\":\"slug\",\"type\":\"string\",\"optional\":false},{\"name\":\"name\",\"type\":\"string\",\"optional\":true},{\"name\":\"validation\",\"type\":\"string | Record<string, unknown>\",\"optional\":true,\"unionBranches\":[{\"type\":\"string\"},{\"type\":\"Record<string, unknown>\"}]}],\"returnType\":\"Promise<AssetMetafield>\",\"isStatic\":false,\"isPublic\":true},\"initializeCommonMetafields\":{\"name\":\"initializeCommonMetafields\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"AssetMetafield\",\"exportName\":\"AssetMetafieldCollection\",\"collectionExportName\":\"AssetMetafieldCollectionCollection\",\"schema\":{\"tableName\":\"asset_metafields\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_metafields\\\" (\\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 \\\"name\\\" TEXT,\\n \\\"validation\\\" TEXT\\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\"},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"validation\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"asset_metafields_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"asset_metafields_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"asset_metafields_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"7393718c\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetStatus\":{\"name\":\"assetstatus\",\"className\":\"AssetStatus\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetStatus\",\"collection\":\"assetstatuses\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-status.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{\"created_at\":{\"type\":\"datetime\",\"required\":false},\"updated_at\":{\"type\":\"datetime\",\"required\":false},\"name\":{\"type\":\"text\",\"required\":false},\"description\":{\"type\":\"text\",\"required\":false}},\"methods\":{\"getBySlug\":{\"name\":\"getBySlug\",\"async\":true,\"parameters\":[{\"name\":\"_slug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<AssetStatus | null>\",\"isStatic\":true,\"isPublic\":true}},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\",\"create\"]},\"cli\":{\"skipApiCheck\":true}},\"extends\":\"SmrtObject\",\"exportName\":\"AssetStatus\",\"collectionExportName\":\"AssetStatusCollection\",\"schema\":{\"tableName\":\"asset_statuses\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_statuses\\\" (\\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 \\\"name\\\" TEXT,\\n \\\"description\\\" TEXT\\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\"},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"asset_statuses_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"asset_statuses_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"asset_statuses_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"8251a52f\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetStatusCollection\":{\"name\":\"assetstatuscollection\",\"className\":\"AssetStatusCollection\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetStatusCollection\",\"collection\":\"assetstatuses\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-statuses.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{},\"methods\":{\"getOrCreate\":{\"name\":\"getOrCreate\",\"async\":true,\"parameters\":[{\"name\":\"slug\",\"type\":\"string\",\"optional\":false},{\"name\":\"name\",\"type\":\"string\",\"optional\":true},{\"name\":\"description\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<AssetStatus>\",\"isStatic\":false,\"isPublic\":true},\"initializeCommonStatuses\":{\"name\":\"initializeCommonStatuses\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"AssetStatus\",\"exportName\":\"AssetStatusCollection\",\"collectionExportName\":\"AssetStatusCollectionCollection\",\"schema\":{\"tableName\":\"asset_statuses\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_statuses\\\" (\\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 \\\"name\\\" TEXT,\\n \\\"description\\\" TEXT\\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\"},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"asset_statuses_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"asset_statuses_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"asset_statuses_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"8251a52f\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetTag\":{\"name\":\"assettag\",\"className\":\"AssetTag\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetTag\",\"collection\":\"assettags\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-tag.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"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}}},\"assetId\":{\"type\":\"foreignKey\",\"required\":true,\"related\":\"Asset\",\"_meta\":{\"required\":true,\"onDelete\":\"CASCADE\"}},\"tagId\":{\"type\":\"crossPackageRef\",\"required\":true,\"related\":\"@happyvertical/smrt-tags:Tag\",\"_meta\":{\"onDelete\":\"CASCADE\"}}},\"methods\":{},\"decoratorConfig\":{\"tableName\":\"asset_tags\",\"conflictColumns\":[\"asset_id\",\"tag_id\"],\"api\":false,\"mcp\":false,\"cli\":false,\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"AssetTag\",\"collectionExportName\":\"AssetTagCollection\",\"validationRules\":[{\"field\":\"assetId\",\"rule\":\"required\",\"fieldType\":\"foreignKey\"},{\"field\":\"tagId\",\"rule\":\"required\",\"fieldType\":\"crossPackageRef\"}],\"schema\":{\"tableName\":\"asset_tags\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_tags\\\" (\\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 \\\"asset_id\\\" UUID NOT NULL,\\n \\\"tag_id\\\" UUID NOT NULL\\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},\"asset_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":true,\"unique\":false,\"foreignKey\":{\"table\":\"assets\",\"column\":\"id\",\"onDelete\":\"CASCADE\",\"onUpdate\":\"CASCADE\"}},\"tag_id\":{\"type\":\"UUID\",\"referenceKind\":\"crossPackageRef\",\"notNull\":true,\"unique\":false}},\"indexes\":[{\"name\":\"asset_tags_asset_id_tag_id_idx\",\"columns\":[\"asset_id\",\"tag_id\"],\"unique\":true},{\"name\":\"asset_tags_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"asset_tags_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"asset_tags_tag_id_idx\",\"columns\":[\"tag_id\"]}],\"version\":\"e60d24f5\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetTagCollection\":{\"name\":\"assettagcollection\",\"className\":\"AssetTagCollection\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetTagCollection\",\"collection\":\"assettags\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-tags.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"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}},\"decoratorConfig\":{\"tableName\":\"asset_tags\",\"api\":false,\"mcp\":false,\"cli\":false},\"extends\":\"SmrtJunction\",\"extendsTypeArg\":\"AssetTag\",\"exportName\":\"AssetTagCollection\",\"collectionExportName\":\"AssetTagCollectionCollection\",\"schema\":{\"tableName\":\"asset_tags\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_tags\\\" (\\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 \\\"asset_id\\\" UUID NOT NULL,\\n \\\"tag_id\\\" UUID NOT NULL\\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},\"asset_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":true,\"unique\":false,\"foreignKey\":{\"table\":\"assets\",\"column\":\"id\",\"onDelete\":\"CASCADE\",\"onUpdate\":\"CASCADE\"}},\"tag_id\":{\"type\":\"UUID\",\"referenceKind\":\"crossPackageRef\",\"notNull\":true,\"unique\":false}},\"indexes\":[{\"name\":\"asset_tags_asset_id_tag_id_idx\",\"columns\":[\"asset_id\",\"tag_id\"],\"unique\":true},{\"name\":\"asset_tags_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"asset_tags_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"asset_tags_tag_id_idx\",\"columns\":[\"tag_id\"]}],\"version\":\"e60d24f5\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetType\":{\"name\":\"assettype\",\"className\":\"AssetType\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetType\",\"collection\":\"assettypes\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-type.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{\"created_at\":{\"type\":\"datetime\",\"required\":false},\"updated_at\":{\"type\":\"datetime\",\"required\":false},\"name\":{\"type\":\"text\",\"required\":false},\"description\":{\"type\":\"text\",\"required\":false}},\"methods\":{\"getBySlug\":{\"name\":\"getBySlug\",\"async\":true,\"parameters\":[{\"name\":\"_slug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<AssetType | null>\",\"isStatic\":true,\"isPublic\":true}},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\",\"create\"]},\"cli\":{\"skipApiCheck\":true}},\"extends\":\"SmrtObject\",\"exportName\":\"AssetType\",\"collectionExportName\":\"AssetTypeCollection\",\"schema\":{\"tableName\":\"asset_types\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_types\\\" (\\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 \\\"name\\\" TEXT,\\n \\\"description\\\" TEXT\\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\"},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"asset_types_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"asset_types_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"asset_types_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"a9c93be2\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetTypeCollection\":{\"name\":\"assettypecollection\",\"className\":\"AssetTypeCollection\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetTypeCollection\",\"collection\":\"assettypes\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-types.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{},\"methods\":{\"getOrCreate\":{\"name\":\"getOrCreate\",\"async\":true,\"parameters\":[{\"name\":\"slug\",\"type\":\"string\",\"optional\":false},{\"name\":\"name\",\"type\":\"string\",\"optional\":true},{\"name\":\"description\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<AssetType>\",\"isStatic\":false,\"isPublic\":true},\"initializeCommonTypes\":{\"name\":\"initializeCommonTypes\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"AssetType\",\"exportName\":\"AssetTypeCollection\",\"collectionExportName\":\"AssetTypeCollectionCollection\",\"schema\":{\"tableName\":\"asset_types\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_types\\\" (\\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 \\\"name\\\" TEXT,\\n \\\"description\\\" TEXT\\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\"},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"asset_types_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"asset_types_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"asset_types_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"a9c93be2\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:Asset\":{\"name\":\"asset\",\"className\":\"Asset\",\"qualifiedName\":\"@happyvertical/smrt-assets:Asset\",\"collection\":\"assets\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"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},\"sourceUri\":{\"type\":\"text\",\"required\":false},\"mimeType\":{\"type\":\"text\",\"required\":false},\"description\":{\"type\":\"text\",\"required\":false},\"metadata\":{\"type\":\"text\",\"required\":false},\"version\":{\"type\":\"integer\",\"required\":true,\"default\":1},\"primaryVersionId\":{\"type\":\"foreignKey\",\"required\":false,\"related\":\"Asset\"},\"typeSlug\":{\"type\":\"text\",\"required\":false},\"statusSlug\":{\"type\":\"text\",\"required\":false},\"ownerProfileId\":{\"type\":\"crossPackageRef\",\"required\":false,\"related\":\"@happyvertical/smrt-profiles:Profile\"},\"sourceAssetId\":{\"type\":\"foreignKey\",\"required\":false,\"related\":\"Asset\"},\"folderId\":{\"type\":\"foreignKey\",\"required\":false,\"related\":\"Folder\"},\"sourceType\":{\"type\":\"text\",\"required\":false},\"externalId\":{\"type\":\"text\",\"required\":false},\"externalRefs\":{\"type\":\"text\",\"required\":false},\"createdAt\":{\"type\":\"text\",\"required\":false},\"updatedAt\":{\"type\":\"text\",\"required\":false}},\"methods\":{\"getSlug\":{\"name\":\"getSlug\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<string | null | undefined>\",\"isStatic\":false,\"isPublic\":true},\"getMetadata\":{\"name\":\"getMetadata\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string, unknown>\",\"isStatic\":false,\"isPublic\":true},\"setMetadata\":{\"name\":\"setMetadata\",\"async\":false,\"parameters\":[{\"name\":\"metadata\",\"type\":\"Record<string, unknown>\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"mergeMetadata\":{\"name\":\"mergeMetadata\",\"async\":false,\"parameters\":[{\"name\":\"metadata\",\"type\":\"Record<string, unknown>\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"getExternalRefs\":{\"name\":\"getExternalRefs\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string, AssetExternalReference>\",\"isStatic\":false,\"isPublic\":true},\"getExternalRef\":{\"name\":\"getExternalRef\",\"async\":false,\"parameters\":[{\"name\":\"provider\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"AssetExternalReference | null\",\"isStatic\":false,\"isPublic\":true},\"setExternalRef\":{\"name\":\"setExternalRef\",\"async\":false,\"parameters\":[{\"name\":\"provider\",\"type\":\"string\",\"optional\":false},{\"name\":\"reference\",\"type\":\"any\",\"optional\":false,\"typeUnresolved\":true}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"getTags\":{\"name\":\"getTags\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Tag[]>\",\"isStatic\":false,\"isPublic\":true},\"hasTag\":{\"name\":\"hasTag\",\"async\":true,\"parameters\":[{\"name\":\"tagSlug\",\"type\":\"string\",\"optional\":false},{\"name\":\"context\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<boolean>\",\"isStatic\":false,\"isPublic\":true},\"getSource\":{\"name\":\"getSource\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Asset | null>\",\"isStatic\":false,\"isPublic\":true},\"getDerivatives\":{\"name\":\"getDerivatives\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"getType\":{\"name\":\"getType\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<AssetType | null>\",\"isStatic\":false,\"isPublic\":true},\"getStatus\":{\"name\":\"getStatus\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<AssetStatus | null>\",\"isStatic\":false,\"isPublic\":true},\"getAssociations\":{\"name\":\"getAssociations\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<AssetAssociation[]>\",\"isStatic\":false,\"isPublic\":true},\"associateWith\":{\"name\":\"associateWith\",\"async\":true,\"parameters\":[{\"name\":\"metaType\",\"type\":\"string\",\"optional\":false},{\"name\":\"metaId\",\"type\":\"string\",\"optional\":false},{\"name\":\"role\",\"type\":\"any\",\"optional\":true,\"default\":\"default\"}],\"returnType\":\"Promise<AssetAssociation>\",\"isStatic\":false,\"isPublic\":true},\"getBySlug\":{\"name\":\"getBySlug\",\"async\":true,\"parameters\":[{\"name\":\"_slug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset | null>\",\"isStatic\":true,\"isPublic\":true}},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"cli\":{\"skipApiCheck\":true},\"tenantScoped\":{\"mode\":\"optional\"},\"conflictColumns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"]},\"extends\":\"SmrtObject\",\"exportName\":\"Asset\",\"collectionExportName\":\"AssetCollection\",\"validationRules\":[{\"field\":\"version\",\"rule\":\"required\",\"fieldType\":\"integer\"}],\"schema\":{\"tableName\":\"assets\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"assets\\\" (\\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 \\\"source_uri\\\" TEXT,\\n \\\"mime_type\\\" TEXT,\\n \\\"description\\\" TEXT,\\n \\\"metadata\\\" TEXT,\\n \\\"version\\\" INTEGER DEFAULT 1,\\n \\\"primary_version_id\\\" UUID,\\n \\\"type_slug\\\" TEXT,\\n \\\"status_slug\\\" TEXT,\\n \\\"owner_profile_id\\\" UUID,\\n \\\"source_asset_id\\\" UUID,\\n \\\"folder_id\\\" UUID,\\n \\\"source_type\\\" TEXT,\\n \\\"external_id\\\" TEXT,\\n \\\"external_refs\\\" TEXT\\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},\"source_uri\":{\"type\":\"TEXT\",\"notNull\":false},\"mime_type\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false},\"metadata\":{\"type\":\"TEXT\",\"notNull\":false},\"version\":{\"type\":\"INTEGER\",\"notNull\":false,\"default\":1},\"primary_version_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"assets\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"type_slug\":{\"type\":\"TEXT\",\"notNull\":false},\"status_slug\":{\"type\":\"TEXT\",\"notNull\":false},\"owner_profile_id\":{\"type\":\"UUID\",\"referenceKind\":\"crossPackageRef\",\"notNull\":false},\"source_asset_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"assets\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"folder_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"folders\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"source_type\":{\"type\":\"TEXT\",\"notNull\":false},\"external_id\":{\"type\":\"TEXT\",\"notNull\":false},\"external_refs\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"assets_slug_context_meta_type_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"assets_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"assets_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"assets_primary_version_id_idx\",\"columns\":[\"primary_version_id\"]},{\"name\":\"assets_owner_profile_id_idx\",\"columns\":[\"owner_profile_id\"]},{\"name\":\"assets_source_asset_id_idx\",\"columns\":[\"source_asset_id\"]},{\"name\":\"assets_folder_id_idx\",\"columns\":[\"folder_id\"]}],\"version\":\"16d6c152\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetCollection\":{\"name\":\"assetcollection\",\"className\":\"AssetCollection\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetCollection\",\"collection\":\"assets\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/assets.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{},\"methods\":{\"findByTenant\":{\"name\":\"findByTenant\",\"async\":true,\"parameters\":[{\"name\":\"tenantId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"findGlobal\":{\"name\":\"findGlobal\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"findWithGlobals\":{\"name\":\"findWithGlobals\",\"async\":true,\"parameters\":[{\"name\":\"tenantId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"addTag\":{\"name\":\"addTag\",\"async\":true,\"parameters\":[{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"tag\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"AssetTagInput\",\"optional\":true}],\"returnType\":\"Promise<Tag>\",\"isStatic\":false,\"isPublic\":true},\"removeTag\":{\"name\":\"removeTag\",\"async\":true,\"parameters\":[{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"tag\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"Pick<AssetTagInput, 'context'>\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"setTags\":{\"name\":\"setTags\",\"async\":true,\"parameters\":[{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"tags\",\"type\":\"string[]\",\"optional\":false},{\"name\":\"options\",\"type\":\"Pick<AssetTagInput, 'context'>\",\"optional\":true}],\"returnType\":\"Promise<Tag[]>\",\"isStatic\":false,\"isPublic\":true},\"getTagsForAssets\":{\"name\":\"getTagsForAssets\",\"async\":true,\"parameters\":[{\"name\":\"assetIds\",\"type\":\"string[]\",\"optional\":false}],\"returnType\":\"Promise<Map<string, Tag[]>>\",\"isStatic\":false,\"isPublic\":true},\"getByTag\":{\"name\":\"getByTag\",\"async\":true,\"parameters\":[{\"name\":\"tag\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"Pick<AssetTagInput, 'context'>\",\"optional\":true}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"getByType\":{\"name\":\"getByType\",\"async\":true,\"parameters\":[{\"name\":\"typeSlug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"getByStatus\":{\"name\":\"getByStatus\",\"async\":true,\"parameters\":[{\"name\":\"statusSlug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"getByOwner\":{\"name\":\"getByOwner\",\"async\":true,\"parameters\":[{\"name\":\"ownerProfileId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"createNewVersion\":{\"name\":\"createNewVersion\",\"async\":true,\"parameters\":[{\"name\":\"primaryVersionId\",\"type\":\"string\",\"optional\":false},{\"name\":\"newSourceUri\",\"type\":\"string\",\"optional\":false},{\"name\":\"updates\",\"type\":\"Partial<Asset>\",\"optional\":true}],\"returnType\":\"Promise<Asset>\",\"isStatic\":false,\"isPublic\":true},\"getLatestVersion\":{\"name\":\"getLatestVersion\",\"async\":true,\"parameters\":[{\"name\":\"primaryVersionId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset | null>\",\"isStatic\":false,\"isPublic\":true},\"listVersions\":{\"name\":\"listVersions\",\"async\":true,\"parameters\":[{\"name\":\"primaryVersionId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"getDerivatives\":{\"name\":\"getDerivatives\",\"async\":true,\"parameters\":[{\"name\":\"sourceAssetId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"getByMimeType\":{\"name\":\"getByMimeType\",\"async\":true,\"parameters\":[{\"name\":\"mimePattern\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"rollbackToVersion\":{\"name\":\"rollbackToVersion\",\"async\":true,\"parameters\":[{\"name\":\"primaryVersionId\",\"type\":\"string\",\"optional\":false},{\"name\":\"targetVersion\",\"type\":\"number\",\"optional\":false}],\"returnType\":\"Promise<Asset>\",\"isStatic\":false,\"isPublic\":true},\"getByFolder\":{\"name\":\"getByFolder\",\"async\":true,\"parameters\":[{\"name\":\"folderId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"Asset\",\"exportName\":\"AssetCollection\",\"collectionExportName\":\"AssetCollectionCollection\",\"schema\":{\"tableName\":\"assets\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"assets\\\" (\\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 \\\"source_uri\\\" TEXT,\\n \\\"mime_type\\\" TEXT,\\n \\\"description\\\" TEXT,\\n \\\"metadata\\\" TEXT,\\n \\\"version\\\" INTEGER DEFAULT 1,\\n \\\"primary_version_id\\\" UUID,\\n \\\"type_slug\\\" TEXT,\\n \\\"status_slug\\\" TEXT,\\n \\\"owner_profile_id\\\" UUID,\\n \\\"source_asset_id\\\" UUID,\\n \\\"folder_id\\\" UUID,\\n \\\"source_type\\\" TEXT,\\n \\\"external_id\\\" TEXT,\\n \\\"external_refs\\\" TEXT\\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},\"source_uri\":{\"type\":\"TEXT\",\"notNull\":false},\"mime_type\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false},\"metadata\":{\"type\":\"TEXT\",\"notNull\":false},\"version\":{\"type\":\"INTEGER\",\"notNull\":false,\"default\":1},\"primary_version_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"assets\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"type_slug\":{\"type\":\"TEXT\",\"notNull\":false},\"status_slug\":{\"type\":\"TEXT\",\"notNull\":false},\"owner_profile_id\":{\"type\":\"UUID\",\"referenceKind\":\"crossPackageRef\",\"notNull\":false},\"source_asset_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"assets\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"folder_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"folders\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"source_type\":{\"type\":\"TEXT\",\"notNull\":false},\"external_id\":{\"type\":\"TEXT\",\"notNull\":false},\"external_refs\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"assets_slug_context_meta_type_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"assets_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"assets_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"assets_primary_version_id_idx\",\"columns\":[\"primary_version_id\"]},{\"name\":\"assets_owner_profile_id_idx\",\"columns\":[\"owner_profile_id\"]},{\"name\":\"assets_source_asset_id_idx\",\"columns\":[\"source_asset_id\"]},{\"name\":\"assets_folder_id_idx\",\"columns\":[\"folder_id\"]}],\"version\":\"16d6c152\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:Folder\":{\"name\":\"folder\",\"className\":\"Folder\",\"qualifiedName\":\"@happyvertical/smrt-assets:Folder\",\"collection\":\"folders\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/folder.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{\"parentId\":{\"type\":\"foreignKey\",\"required\":false,\"related\":\"Folder\",\"_meta\":{\"nullable\":true}},\"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},\"ownerProfileId\":{\"type\":\"crossPackageRef\",\"required\":false,\"related\":\"@happyvertical/smrt-profiles:Profile\"},\"createdAt\":{\"type\":\"text\",\"required\":false},\"updatedAt\":{\"type\":\"text\",\"required\":false}},\"methods\":{\"getParent\":{\"name\":\"getParent\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<this | null>\",\"isStatic\":false,\"isPublic\":true},\"getChildren\":{\"name\":\"getChildren\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<this[]>\",\"isStatic\":false,\"isPublic\":true},\"getAncestors\":{\"name\":\"getAncestors\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<this[]>\",\"isStatic\":false,\"isPublic\":true},\"getDescendants\":{\"name\":\"getDescendants\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<this[]>\",\"isStatic\":false,\"isPublic\":true},\"getHierarchy\":{\"name\":\"getHierarchy\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<HierarchyView<this>>\",\"isStatic\":false,\"isPublic\":true},\"moveTo\":{\"name\":\"moveTo\",\"async\":true,\"parameters\":[{\"name\":\"newParent\",\"type\":\"this | string | null\",\"optional\":false,\"unionBranches\":[{\"type\":\"this\"},{\"type\":\"string\"},{\"type\":\"null\"}]}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getBySlug\":{\"name\":\"getBySlug\",\"async\":true,\"parameters\":[{\"name\":\"_slug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Folder | null>\",\"isStatic\":true,\"isPublic\":true}},\"decoratorConfig\":{\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"cli\":{\"skipApiCheck\":true},\"tenantScoped\":{\"mode\":\"optional\"},\"conflictColumns\":[\"tenant_id\",\"slug\",\"context\"]},\"extends\":\"SmrtHierarchical\",\"exportName\":\"Folder\",\"collectionExportName\":\"FolderCollection\",\"schema\":{\"tableName\":\"folders\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"folders\\\" (\\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 \\\"parent_id\\\" UUID,\\n \\\"tenant_id\\\" UUID,\\n \\\"name\\\" TEXT,\\n \\\"description\\\" TEXT,\\n \\\"owner_profile_id\\\" UUID\\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\"},\"parent_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"unique\":false,\"foreignKey\":{\"table\":\"folders\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"name\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"owner_profile_id\":{\"type\":\"UUID\",\"referenceKind\":\"crossPackageRef\",\"notNull\":false,\"unique\":false}},\"indexes\":[{\"name\":\"folders_slug_context_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"folders_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"folders_parent_id_idx\",\"columns\":[\"parent_id\"]},{\"name\":\"folders_owner_profile_id_idx\",\"columns\":[\"owner_profile_id\"]}],\"version\":\"1d0b1fcb\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:FolderCollection\":{\"name\":\"foldercollection\",\"className\":\"FolderCollection\",\"qualifiedName\":\"@happyvertical/smrt-assets:FolderCollection\",\"collection\":\"folders\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/folders.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{},\"methods\":{\"getTree\":{\"name\":\"getTree\",\"async\":true,\"parameters\":[{\"name\":\"rootId\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Folder[]>\",\"isStatic\":false,\"isPublic\":true},\"getPath\":{\"name\":\"getPath\",\"async\":true,\"parameters\":[{\"name\":\"folderId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Folder[]>\",\"isStatic\":false,\"isPublic\":true},\"getContents\":{\"name\":\"getContents\",\"async\":true,\"parameters\":[{\"name\":\"folderId\",\"type\":\"string\",\"optional\":false},{\"name\":\"assetCollection\",\"type\":\"AssetCollection\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"moveAsset\":{\"name\":\"moveAsset\",\"async\":true,\"parameters\":[{\"name\":\"asset\",\"type\":\"Asset\",\"optional\":false},{\"name\":\"folderId\",\"type\":\"string | null\",\"optional\":false,\"unionBranches\":[{\"type\":\"string\"},{\"type\":\"null\"}]}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"Folder\",\"exportName\":\"FolderCollection\",\"collectionExportName\":\"FolderCollectionCollection\",\"schema\":{\"tableName\":\"folders\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"folders\\\" (\\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 \\\"parent_id\\\" UUID,\\n \\\"tenant_id\\\" UUID,\\n \\\"name\\\" TEXT,\\n \\\"description\\\" TEXT,\\n \\\"owner_profile_id\\\" UUID\\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\"},\"parent_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"unique\":false,\"foreignKey\":{\"table\":\"folders\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"name\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"owner_profile_id\":{\"type\":\"UUID\",\"referenceKind\":\"crossPackageRef\",\"notNull\":false,\"unique\":false}},\"indexes\":[{\"name\":\"folders_slug_context_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"folders_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"folders_parent_id_idx\",\"columns\":[\"parent_id\"]},{\"name\":\"folders_owner_profile_id_idx\",\"columns\":[\"owner_profile_id\"]}],\"version\":\"1d0b1fcb\"},\"importPath\":\"@happyvertical/smrt-assets\"}},\"moduleType\":\"smrt\",\"smrtDependencies\":[\"@happyvertical/smrt-core\",\"@happyvertical/smrt-tags\",\"@happyvertical/smrt-tenancy\"]}"));
|
|
18
|
+
ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":0,\"packageName\":\"@happyvertical/smrt-assets\",\"packageVersion\":\"0.53.2\",\"objects\":{\"@happyvertical/smrt-assets:AssetAssociation\":{\"name\":\"assetassociation\",\"className\":\"AssetAssociation\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetAssociation\",\"collection\":\"assetassociations\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-association.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{\"metaType\":{\"type\":\"text\",\"required\":true,\"_meta\":{\"required\":true}},\"metaId\":{\"type\":\"text\",\"required\":true,\"_meta\":{\"required\":true}},\"role\":{\"type\":\"text\",\"required\":true,\"_meta\":{\"required\":true}},\"sortOrder\":{\"type\":\"integer\",\"required\":false,\"default\":0},\"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}}},\"assetId\":{\"type\":\"foreignKey\",\"required\":true,\"related\":\"Asset\",\"_meta\":{\"required\":true}}},\"methods\":{\"hydrate\":{\"name\":\"hydrate\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<T | null>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"conflictColumns\":[\"asset_id\",\"meta_type\",\"meta_id\",\"role\"],\"api\":{\"include\":[\"list\",\"get\",\"create\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\",\"create\"]},\"cli\":{\"skipApiCheck\":true},\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtPolymorphicAssociation\",\"exportName\":\"AssetAssociation\",\"collectionExportName\":\"AssetAssociationCollection\",\"validationRules\":[{\"field\":\"metaType\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"metaId\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"role\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"assetId\",\"rule\":\"required\",\"fieldType\":\"foreignKey\"}],\"schema\":{\"tableName\":\"asset_associations\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_associations\\\" (\\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 \\\"meta_type\\\" TEXT NOT NULL,\\n \\\"meta_id\\\" TEXT NOT NULL,\\n \\\"role\\\" TEXT NOT NULL,\\n \\\"sort_order\\\" INTEGER DEFAULT 0,\\n \\\"tenant_id\\\" UUID,\\n \\\"asset_id\\\" UUID NOT NULL\\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\"},\"meta_type\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false},\"meta_id\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false},\"role\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false},\"sort_order\":{\"type\":\"INTEGER\",\"notNull\":false,\"unique\":false,\"default\":0},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"asset_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":true,\"unique\":false,\"foreignKey\":{\"table\":\"assets\",\"column\":\"id\",\"onDelete\":\"CASCADE\",\"onUpdate\":\"CASCADE\"}}},\"indexes\":[{\"name\":\"asset_associations_asset_id_meta_type_idx\",\"columns\":[\"asset_id\",\"meta_type\",\"meta_id\",\"role\"],\"unique\":true},{\"name\":\"asset_associations_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"asset_associations_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"asset_associations_meta_type_meta_id_idx\",\"columns\":[\"meta_type\",\"meta_id\"]}],\"version\":\"faa13cea\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetAssociationCollection\":{\"name\":\"assetassociationcollection\",\"className\":\"AssetAssociationCollection\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetAssociationCollection\",\"collection\":\"assetassociations\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-associations.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{},\"methods\":{\"byLeft\":{\"name\":\"byLeft\",\"async\":true,\"parameters\":[{\"name\":\"metaType\",\"type\":\"string\",\"optional\":false},{\"name\":\"metaId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionFilterOptions\",\"optional\":true}],\"returnType\":\"Promise<AssetAssociation[]>\",\"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\":\"metaType\",\"type\":\"string\",\"optional\":false},{\"name\":\"metaId\",\"type\":\"string\",\"optional\":false},{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionAttachOptions\",\"optional\":true}],\"returnType\":\"Promise<AssetAssociation>\",\"isStatic\":false,\"isPublic\":true},\"detach\":{\"name\":\"detach\",\"async\":true,\"parameters\":[{\"name\":\"metaType\",\"type\":\"string\",\"optional\":false},{\"name\":\"metaId\",\"type\":\"string\",\"optional\":false},{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionFilterOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"setLinks\":{\"name\":\"setLinks\",\"async\":true,\"parameters\":[{\"name\":\"metaType\",\"type\":\"string\",\"optional\":false},{\"name\":\"metaId\",\"type\":\"string\",\"optional\":false},{\"name\":\"assetIds\",\"type\":\"string[]\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionAttachOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtJunction\",\"extendsTypeArg\":\"AssetAssociation\",\"exportName\":\"AssetAssociationCollection\",\"collectionExportName\":\"AssetAssociationCollectionCollection\",\"schema\":{\"tableName\":\"asset_associations\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_associations\\\" (\\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 \\\"meta_type\\\" TEXT NOT NULL,\\n \\\"meta_id\\\" TEXT NOT NULL,\\n \\\"role\\\" TEXT NOT NULL,\\n \\\"sort_order\\\" INTEGER DEFAULT 0,\\n \\\"tenant_id\\\" UUID,\\n \\\"asset_id\\\" UUID NOT NULL\\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\"},\"meta_type\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false},\"meta_id\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false},\"role\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false},\"sort_order\":{\"type\":\"INTEGER\",\"notNull\":false,\"unique\":false,\"default\":0},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"asset_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":true,\"unique\":false,\"foreignKey\":{\"table\":\"assets\",\"column\":\"id\",\"onDelete\":\"CASCADE\",\"onUpdate\":\"CASCADE\"}}},\"indexes\":[{\"name\":\"asset_associations_asset_id_meta_type_idx\",\"columns\":[\"asset_id\",\"meta_type\",\"meta_id\",\"role\"],\"unique\":true},{\"name\":\"asset_associations_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"asset_associations_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"asset_associations_meta_type_meta_id_idx\",\"columns\":[\"meta_type\",\"meta_id\"]}],\"version\":\"faa13cea\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetMetafield\":{\"name\":\"assetmetafield\",\"className\":\"AssetMetafield\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetMetafield\",\"collection\":\"assetmetafields\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-metafield.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{\"created_at\":{\"type\":\"datetime\",\"required\":false},\"updated_at\":{\"type\":\"datetime\",\"required\":false},\"name\":{\"type\":\"text\",\"required\":false},\"validation\":{\"type\":\"text\",\"required\":false}},\"methods\":{\"getValidation\":{\"name\":\"getValidation\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string, unknown>\",\"isStatic\":false,\"isPublic\":true},\"setValidation\":{\"name\":\"setValidation\",\"async\":false,\"parameters\":[{\"name\":\"rules\",\"type\":\"Record<string, unknown>\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"getBySlug\":{\"name\":\"getBySlug\",\"async\":true,\"parameters\":[{\"name\":\"_slug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<AssetMetafield | null>\",\"isStatic\":true,\"isPublic\":true}},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\",\"create\"]},\"cli\":{\"skipApiCheck\":true}},\"extends\":\"SmrtObject\",\"exportName\":\"AssetMetafield\",\"collectionExportName\":\"AssetMetafieldCollection\",\"schema\":{\"tableName\":\"asset_metafields\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_metafields\\\" (\\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 \\\"name\\\" TEXT,\\n \\\"validation\\\" TEXT\\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\"},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"validation\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"asset_metafields_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"asset_metafields_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"asset_metafields_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"7393718c\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetMetafieldCollection\":{\"name\":\"assetmetafieldcollection\",\"className\":\"AssetMetafieldCollection\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetMetafieldCollection\",\"collection\":\"assetmetafields\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-metafields.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{},\"methods\":{\"getOrCreate\":{\"name\":\"getOrCreate\",\"async\":true,\"parameters\":[{\"name\":\"slug\",\"type\":\"string\",\"optional\":false},{\"name\":\"name\",\"type\":\"string\",\"optional\":true},{\"name\":\"validation\",\"type\":\"string | Record<string, unknown>\",\"optional\":true,\"unionBranches\":[{\"type\":\"string\"},{\"type\":\"Record<string, unknown>\"}]}],\"returnType\":\"Promise<AssetMetafield>\",\"isStatic\":false,\"isPublic\":true},\"initializeCommonMetafields\":{\"name\":\"initializeCommonMetafields\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"AssetMetafield\",\"exportName\":\"AssetMetafieldCollection\",\"collectionExportName\":\"AssetMetafieldCollectionCollection\",\"schema\":{\"tableName\":\"asset_metafields\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_metafields\\\" (\\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 \\\"name\\\" TEXT,\\n \\\"validation\\\" TEXT\\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\"},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"validation\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"asset_metafields_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"asset_metafields_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"asset_metafields_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"7393718c\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetStatus\":{\"name\":\"assetstatus\",\"className\":\"AssetStatus\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetStatus\",\"collection\":\"assetstatuses\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-status.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{\"created_at\":{\"type\":\"datetime\",\"required\":false},\"updated_at\":{\"type\":\"datetime\",\"required\":false},\"name\":{\"type\":\"text\",\"required\":false},\"description\":{\"type\":\"text\",\"required\":false}},\"methods\":{\"getBySlug\":{\"name\":\"getBySlug\",\"async\":true,\"parameters\":[{\"name\":\"_slug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<AssetStatus | null>\",\"isStatic\":true,\"isPublic\":true}},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\",\"create\"]},\"cli\":{\"skipApiCheck\":true}},\"extends\":\"SmrtObject\",\"exportName\":\"AssetStatus\",\"collectionExportName\":\"AssetStatusCollection\",\"schema\":{\"tableName\":\"asset_statuses\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_statuses\\\" (\\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 \\\"name\\\" TEXT,\\n \\\"description\\\" TEXT\\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\"},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"asset_statuses_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"asset_statuses_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"asset_statuses_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"8251a52f\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetStatusCollection\":{\"name\":\"assetstatuscollection\",\"className\":\"AssetStatusCollection\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetStatusCollection\",\"collection\":\"assetstatuses\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-statuses.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{},\"methods\":{\"getOrCreate\":{\"name\":\"getOrCreate\",\"async\":true,\"parameters\":[{\"name\":\"slug\",\"type\":\"string\",\"optional\":false},{\"name\":\"name\",\"type\":\"string\",\"optional\":true},{\"name\":\"description\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<AssetStatus>\",\"isStatic\":false,\"isPublic\":true},\"initializeCommonStatuses\":{\"name\":\"initializeCommonStatuses\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"AssetStatus\",\"exportName\":\"AssetStatusCollection\",\"collectionExportName\":\"AssetStatusCollectionCollection\",\"schema\":{\"tableName\":\"asset_statuses\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_statuses\\\" (\\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 \\\"name\\\" TEXT,\\n \\\"description\\\" TEXT\\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\"},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"asset_statuses_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"asset_statuses_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"asset_statuses_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"8251a52f\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetTag\":{\"name\":\"assettag\",\"className\":\"AssetTag\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetTag\",\"collection\":\"assettags\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-tag.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"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}}},\"assetId\":{\"type\":\"foreignKey\",\"required\":true,\"related\":\"Asset\",\"_meta\":{\"required\":true,\"onDelete\":\"CASCADE\"}},\"tagId\":{\"type\":\"crossPackageRef\",\"required\":true,\"related\":\"@happyvertical/smrt-tags:Tag\",\"_meta\":{\"onDelete\":\"CASCADE\"}}},\"methods\":{},\"decoratorConfig\":{\"tableName\":\"asset_tags\",\"conflictColumns\":[\"asset_id\",\"tag_id\"],\"api\":false,\"mcp\":false,\"cli\":false,\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"AssetTag\",\"collectionExportName\":\"AssetTagCollection\",\"validationRules\":[{\"field\":\"assetId\",\"rule\":\"required\",\"fieldType\":\"foreignKey\"},{\"field\":\"tagId\",\"rule\":\"required\",\"fieldType\":\"crossPackageRef\"}],\"schema\":{\"tableName\":\"asset_tags\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_tags\\\" (\\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 \\\"asset_id\\\" UUID NOT NULL,\\n \\\"tag_id\\\" UUID NOT NULL\\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},\"asset_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":true,\"unique\":false,\"foreignKey\":{\"table\":\"assets\",\"column\":\"id\",\"onDelete\":\"CASCADE\",\"onUpdate\":\"CASCADE\"}},\"tag_id\":{\"type\":\"UUID\",\"referenceKind\":\"crossPackageRef\",\"notNull\":true,\"unique\":false}},\"indexes\":[{\"name\":\"asset_tags_asset_id_tag_id_idx\",\"columns\":[\"asset_id\",\"tag_id\"],\"unique\":true},{\"name\":\"asset_tags_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"asset_tags_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"asset_tags_tag_id_idx\",\"columns\":[\"tag_id\"]}],\"version\":\"e60d24f5\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetTagCollection\":{\"name\":\"assettagcollection\",\"className\":\"AssetTagCollection\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetTagCollection\",\"collection\":\"assettags\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-tags.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"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}},\"decoratorConfig\":{\"tableName\":\"asset_tags\",\"api\":false,\"mcp\":false,\"cli\":false},\"extends\":\"SmrtJunction\",\"extendsTypeArg\":\"AssetTag\",\"exportName\":\"AssetTagCollection\",\"collectionExportName\":\"AssetTagCollectionCollection\",\"schema\":{\"tableName\":\"asset_tags\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_tags\\\" (\\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 \\\"asset_id\\\" UUID NOT NULL,\\n \\\"tag_id\\\" UUID NOT NULL\\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},\"asset_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":true,\"unique\":false,\"foreignKey\":{\"table\":\"assets\",\"column\":\"id\",\"onDelete\":\"CASCADE\",\"onUpdate\":\"CASCADE\"}},\"tag_id\":{\"type\":\"UUID\",\"referenceKind\":\"crossPackageRef\",\"notNull\":true,\"unique\":false}},\"indexes\":[{\"name\":\"asset_tags_asset_id_tag_id_idx\",\"columns\":[\"asset_id\",\"tag_id\"],\"unique\":true},{\"name\":\"asset_tags_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"asset_tags_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"asset_tags_tag_id_idx\",\"columns\":[\"tag_id\"]}],\"version\":\"e60d24f5\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetType\":{\"name\":\"assettype\",\"className\":\"AssetType\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetType\",\"collection\":\"assettypes\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-type.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{\"created_at\":{\"type\":\"datetime\",\"required\":false},\"updated_at\":{\"type\":\"datetime\",\"required\":false},\"name\":{\"type\":\"text\",\"required\":false},\"description\":{\"type\":\"text\",\"required\":false}},\"methods\":{\"getBySlug\":{\"name\":\"getBySlug\",\"async\":true,\"parameters\":[{\"name\":\"_slug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<AssetType | null>\",\"isStatic\":true,\"isPublic\":true}},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\",\"create\"]},\"cli\":{\"skipApiCheck\":true}},\"extends\":\"SmrtObject\",\"exportName\":\"AssetType\",\"collectionExportName\":\"AssetTypeCollection\",\"schema\":{\"tableName\":\"asset_types\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_types\\\" (\\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 \\\"name\\\" TEXT,\\n \\\"description\\\" TEXT\\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\"},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"asset_types_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"asset_types_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"asset_types_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"a9c93be2\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetTypeCollection\":{\"name\":\"assettypecollection\",\"className\":\"AssetTypeCollection\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetTypeCollection\",\"collection\":\"assettypes\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset-types.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{},\"methods\":{\"getOrCreate\":{\"name\":\"getOrCreate\",\"async\":true,\"parameters\":[{\"name\":\"slug\",\"type\":\"string\",\"optional\":false},{\"name\":\"name\",\"type\":\"string\",\"optional\":true},{\"name\":\"description\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<AssetType>\",\"isStatic\":false,\"isPublic\":true},\"initializeCommonTypes\":{\"name\":\"initializeCommonTypes\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"AssetType\",\"exportName\":\"AssetTypeCollection\",\"collectionExportName\":\"AssetTypeCollectionCollection\",\"schema\":{\"tableName\":\"asset_types\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_types\\\" (\\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 \\\"name\\\" TEXT,\\n \\\"description\\\" TEXT\\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\"},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"asset_types_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"asset_types_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"asset_types_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"a9c93be2\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:Asset\":{\"name\":\"asset\",\"className\":\"Asset\",\"qualifiedName\":\"@happyvertical/smrt-assets:Asset\",\"collection\":\"assets\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/asset.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"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},\"sourceUri\":{\"type\":\"text\",\"required\":false},\"mimeType\":{\"type\":\"text\",\"required\":false},\"description\":{\"type\":\"text\",\"required\":false},\"metadata\":{\"type\":\"text\",\"required\":false},\"version\":{\"type\":\"integer\",\"required\":true,\"default\":1},\"primaryVersionId\":{\"type\":\"foreignKey\",\"required\":false,\"related\":\"Asset\"},\"typeSlug\":{\"type\":\"text\",\"required\":false},\"statusSlug\":{\"type\":\"text\",\"required\":false},\"ownerProfileId\":{\"type\":\"crossPackageRef\",\"required\":false,\"related\":\"@happyvertical/smrt-profiles:Profile\"},\"sourceAssetId\":{\"type\":\"foreignKey\",\"required\":false,\"related\":\"Asset\"},\"folderId\":{\"type\":\"foreignKey\",\"required\":false,\"related\":\"Folder\"},\"sourceType\":{\"type\":\"text\",\"required\":false},\"externalId\":{\"type\":\"text\",\"required\":false},\"externalRefs\":{\"type\":\"text\",\"required\":false},\"createdAt\":{\"type\":\"text\",\"required\":false},\"updatedAt\":{\"type\":\"text\",\"required\":false}},\"methods\":{\"getSlug\":{\"name\":\"getSlug\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<string | null | undefined>\",\"isStatic\":false,\"isPublic\":true},\"getMetadata\":{\"name\":\"getMetadata\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string, unknown>\",\"isStatic\":false,\"isPublic\":true},\"setMetadata\":{\"name\":\"setMetadata\",\"async\":false,\"parameters\":[{\"name\":\"metadata\",\"type\":\"Record<string, unknown>\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"mergeMetadata\":{\"name\":\"mergeMetadata\",\"async\":false,\"parameters\":[{\"name\":\"metadata\",\"type\":\"Record<string, unknown>\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"getExternalRefs\":{\"name\":\"getExternalRefs\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string, AssetExternalReference>\",\"isStatic\":false,\"isPublic\":true},\"getExternalRef\":{\"name\":\"getExternalRef\",\"async\":false,\"parameters\":[{\"name\":\"provider\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"AssetExternalReference | null\",\"isStatic\":false,\"isPublic\":true},\"setExternalRef\":{\"name\":\"setExternalRef\",\"async\":false,\"parameters\":[{\"name\":\"provider\",\"type\":\"string\",\"optional\":false},{\"name\":\"reference\",\"type\":\"any\",\"optional\":false,\"typeUnresolved\":true}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"getTags\":{\"name\":\"getTags\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Tag[]>\",\"isStatic\":false,\"isPublic\":true},\"hasTag\":{\"name\":\"hasTag\",\"async\":true,\"parameters\":[{\"name\":\"tagSlug\",\"type\":\"string\",\"optional\":false},{\"name\":\"context\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<boolean>\",\"isStatic\":false,\"isPublic\":true},\"getSource\":{\"name\":\"getSource\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Asset | null>\",\"isStatic\":false,\"isPublic\":true},\"getDerivatives\":{\"name\":\"getDerivatives\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"getType\":{\"name\":\"getType\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<AssetType | null>\",\"isStatic\":false,\"isPublic\":true},\"getStatus\":{\"name\":\"getStatus\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<AssetStatus | null>\",\"isStatic\":false,\"isPublic\":true},\"getAssociations\":{\"name\":\"getAssociations\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<AssetAssociation[]>\",\"isStatic\":false,\"isPublic\":true},\"associateWith\":{\"name\":\"associateWith\",\"async\":true,\"parameters\":[{\"name\":\"metaType\",\"type\":\"string\",\"optional\":false},{\"name\":\"metaId\",\"type\":\"string\",\"optional\":false},{\"name\":\"role\",\"type\":\"any\",\"optional\":true,\"default\":\"default\"}],\"returnType\":\"Promise<AssetAssociation>\",\"isStatic\":false,\"isPublic\":true},\"getBySlug\":{\"name\":\"getBySlug\",\"async\":true,\"parameters\":[{\"name\":\"_slug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset | null>\",\"isStatic\":true,\"isPublic\":true}},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"cli\":{\"skipApiCheck\":true},\"tenantScoped\":{\"mode\":\"optional\"},\"conflictColumns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"]},\"extends\":\"SmrtObject\",\"exportName\":\"Asset\",\"collectionExportName\":\"AssetCollection\",\"validationRules\":[{\"field\":\"version\",\"rule\":\"required\",\"fieldType\":\"integer\"}],\"schema\":{\"tableName\":\"assets\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"assets\\\" (\\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 \\\"source_uri\\\" TEXT,\\n \\\"mime_type\\\" TEXT,\\n \\\"description\\\" TEXT,\\n \\\"metadata\\\" TEXT,\\n \\\"version\\\" INTEGER DEFAULT 1,\\n \\\"primary_version_id\\\" UUID,\\n \\\"type_slug\\\" TEXT,\\n \\\"status_slug\\\" TEXT,\\n \\\"owner_profile_id\\\" UUID,\\n \\\"source_asset_id\\\" UUID,\\n \\\"folder_id\\\" UUID,\\n \\\"source_type\\\" TEXT,\\n \\\"external_id\\\" TEXT,\\n \\\"external_refs\\\" TEXT\\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},\"source_uri\":{\"type\":\"TEXT\",\"notNull\":false},\"mime_type\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false},\"metadata\":{\"type\":\"TEXT\",\"notNull\":false},\"version\":{\"type\":\"INTEGER\",\"notNull\":false,\"default\":1},\"primary_version_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"assets\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"type_slug\":{\"type\":\"TEXT\",\"notNull\":false},\"status_slug\":{\"type\":\"TEXT\",\"notNull\":false},\"owner_profile_id\":{\"type\":\"UUID\",\"referenceKind\":\"crossPackageRef\",\"notNull\":false},\"source_asset_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"assets\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"folder_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"folders\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"source_type\":{\"type\":\"TEXT\",\"notNull\":false},\"external_id\":{\"type\":\"TEXT\",\"notNull\":false},\"external_refs\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"assets_slug_context_meta_type_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"assets_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"assets_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"assets_primary_version_id_idx\",\"columns\":[\"primary_version_id\"]},{\"name\":\"assets_owner_profile_id_idx\",\"columns\":[\"owner_profile_id\"]},{\"name\":\"assets_source_asset_id_idx\",\"columns\":[\"source_asset_id\"]},{\"name\":\"assets_folder_id_idx\",\"columns\":[\"folder_id\"]}],\"version\":\"16d6c152\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:AssetCollection\":{\"name\":\"assetcollection\",\"className\":\"AssetCollection\",\"qualifiedName\":\"@happyvertical/smrt-assets:AssetCollection\",\"collection\":\"assets\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/assets.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{},\"methods\":{\"findByTenant\":{\"name\":\"findByTenant\",\"async\":true,\"parameters\":[{\"name\":\"tenantId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"findGlobal\":{\"name\":\"findGlobal\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"findWithGlobals\":{\"name\":\"findWithGlobals\",\"async\":true,\"parameters\":[{\"name\":\"tenantId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"addTag\":{\"name\":\"addTag\",\"async\":true,\"parameters\":[{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"tag\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"AssetTagInput\",\"optional\":true}],\"returnType\":\"Promise<Tag>\",\"isStatic\":false,\"isPublic\":true},\"removeTag\":{\"name\":\"removeTag\",\"async\":true,\"parameters\":[{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"tag\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"Pick<AssetTagInput, 'context'>\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"setTags\":{\"name\":\"setTags\",\"async\":true,\"parameters\":[{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"tags\",\"type\":\"string[]\",\"optional\":false},{\"name\":\"options\",\"type\":\"Pick<AssetTagInput, 'context'>\",\"optional\":true}],\"returnType\":\"Promise<Tag[]>\",\"isStatic\":false,\"isPublic\":true},\"getTagsForAssets\":{\"name\":\"getTagsForAssets\",\"async\":true,\"parameters\":[{\"name\":\"assetIds\",\"type\":\"string[]\",\"optional\":false}],\"returnType\":\"Promise<Map<string, Tag[]>>\",\"isStatic\":false,\"isPublic\":true},\"getByTag\":{\"name\":\"getByTag\",\"async\":true,\"parameters\":[{\"name\":\"tag\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"Pick<AssetTagInput, 'context'>\",\"optional\":true}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"getByType\":{\"name\":\"getByType\",\"async\":true,\"parameters\":[{\"name\":\"typeSlug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"getByStatus\":{\"name\":\"getByStatus\",\"async\":true,\"parameters\":[{\"name\":\"statusSlug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"getByOwner\":{\"name\":\"getByOwner\",\"async\":true,\"parameters\":[{\"name\":\"ownerProfileId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"createNewVersion\":{\"name\":\"createNewVersion\",\"async\":true,\"parameters\":[{\"name\":\"primaryVersionId\",\"type\":\"string\",\"optional\":false},{\"name\":\"newSourceUri\",\"type\":\"string\",\"optional\":false},{\"name\":\"updates\",\"type\":\"Partial<Asset>\",\"optional\":true}],\"returnType\":\"Promise<Asset>\",\"isStatic\":false,\"isPublic\":true},\"getLatestVersion\":{\"name\":\"getLatestVersion\",\"async\":true,\"parameters\":[{\"name\":\"primaryVersionId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset | null>\",\"isStatic\":false,\"isPublic\":true},\"listVersions\":{\"name\":\"listVersions\",\"async\":true,\"parameters\":[{\"name\":\"primaryVersionId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"getDerivatives\":{\"name\":\"getDerivatives\",\"async\":true,\"parameters\":[{\"name\":\"sourceAssetId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"getByMimeType\":{\"name\":\"getByMimeType\",\"async\":true,\"parameters\":[{\"name\":\"mimePattern\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"rollbackToVersion\":{\"name\":\"rollbackToVersion\",\"async\":true,\"parameters\":[{\"name\":\"primaryVersionId\",\"type\":\"string\",\"optional\":false},{\"name\":\"targetVersion\",\"type\":\"number\",\"optional\":false}],\"returnType\":\"Promise<Asset>\",\"isStatic\":false,\"isPublic\":true},\"getByFolder\":{\"name\":\"getByFolder\",\"async\":true,\"parameters\":[{\"name\":\"folderId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"Asset\",\"exportName\":\"AssetCollection\",\"collectionExportName\":\"AssetCollectionCollection\",\"schema\":{\"tableName\":\"assets\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"assets\\\" (\\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 \\\"source_uri\\\" TEXT,\\n \\\"mime_type\\\" TEXT,\\n \\\"description\\\" TEXT,\\n \\\"metadata\\\" TEXT,\\n \\\"version\\\" INTEGER DEFAULT 1,\\n \\\"primary_version_id\\\" UUID,\\n \\\"type_slug\\\" TEXT,\\n \\\"status_slug\\\" TEXT,\\n \\\"owner_profile_id\\\" UUID,\\n \\\"source_asset_id\\\" UUID,\\n \\\"folder_id\\\" UUID,\\n \\\"source_type\\\" TEXT,\\n \\\"external_id\\\" TEXT,\\n \\\"external_refs\\\" TEXT\\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},\"source_uri\":{\"type\":\"TEXT\",\"notNull\":false},\"mime_type\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false},\"metadata\":{\"type\":\"TEXT\",\"notNull\":false},\"version\":{\"type\":\"INTEGER\",\"notNull\":false,\"default\":1},\"primary_version_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"assets\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"type_slug\":{\"type\":\"TEXT\",\"notNull\":false},\"status_slug\":{\"type\":\"TEXT\",\"notNull\":false},\"owner_profile_id\":{\"type\":\"UUID\",\"referenceKind\":\"crossPackageRef\",\"notNull\":false},\"source_asset_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"assets\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"folder_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"folders\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"source_type\":{\"type\":\"TEXT\",\"notNull\":false},\"external_id\":{\"type\":\"TEXT\",\"notNull\":false},\"external_refs\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"assets_slug_context_meta_type_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"assets_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"assets_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"assets_primary_version_id_idx\",\"columns\":[\"primary_version_id\"]},{\"name\":\"assets_owner_profile_id_idx\",\"columns\":[\"owner_profile_id\"]},{\"name\":\"assets_source_asset_id_idx\",\"columns\":[\"source_asset_id\"]},{\"name\":\"assets_folder_id_idx\",\"columns\":[\"folder_id\"]}],\"version\":\"16d6c152\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:Folder\":{\"name\":\"folder\",\"className\":\"Folder\",\"qualifiedName\":\"@happyvertical/smrt-assets:Folder\",\"collection\":\"folders\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/folder.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{\"parentId\":{\"type\":\"foreignKey\",\"required\":false,\"related\":\"Folder\",\"_meta\":{\"nullable\":true}},\"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},\"ownerProfileId\":{\"type\":\"crossPackageRef\",\"required\":false,\"related\":\"@happyvertical/smrt-profiles:Profile\"},\"createdAt\":{\"type\":\"text\",\"required\":false},\"updatedAt\":{\"type\":\"text\",\"required\":false}},\"methods\":{\"getParent\":{\"name\":\"getParent\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<this | null>\",\"isStatic\":false,\"isPublic\":true},\"getChildren\":{\"name\":\"getChildren\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<this[]>\",\"isStatic\":false,\"isPublic\":true},\"getAncestors\":{\"name\":\"getAncestors\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<this[]>\",\"isStatic\":false,\"isPublic\":true},\"getDescendants\":{\"name\":\"getDescendants\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<this[]>\",\"isStatic\":false,\"isPublic\":true},\"getHierarchy\":{\"name\":\"getHierarchy\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<HierarchyView<this>>\",\"isStatic\":false,\"isPublic\":true},\"moveTo\":{\"name\":\"moveTo\",\"async\":true,\"parameters\":[{\"name\":\"newParent\",\"type\":\"this | string | null\",\"optional\":false,\"unionBranches\":[{\"type\":\"this\"},{\"type\":\"string\"},{\"type\":\"null\"}]}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getBySlug\":{\"name\":\"getBySlug\",\"async\":true,\"parameters\":[{\"name\":\"_slug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Folder | null>\",\"isStatic\":true,\"isPublic\":true}},\"decoratorConfig\":{\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"cli\":{\"skipApiCheck\":true},\"tenantScoped\":{\"mode\":\"optional\"},\"conflictColumns\":[\"tenant_id\",\"slug\",\"context\"]},\"extends\":\"SmrtHierarchical\",\"exportName\":\"Folder\",\"collectionExportName\":\"FolderCollection\",\"schema\":{\"tableName\":\"folders\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"folders\\\" (\\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 \\\"parent_id\\\" UUID,\\n \\\"tenant_id\\\" UUID,\\n \\\"name\\\" TEXT,\\n \\\"description\\\" TEXT,\\n \\\"owner_profile_id\\\" UUID\\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\"},\"parent_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"unique\":false,\"foreignKey\":{\"table\":\"folders\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"name\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"owner_profile_id\":{\"type\":\"UUID\",\"referenceKind\":\"crossPackageRef\",\"notNull\":false,\"unique\":false}},\"indexes\":[{\"name\":\"folders_slug_context_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"folders_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"folders_parent_id_idx\",\"columns\":[\"parent_id\"]},{\"name\":\"folders_owner_profile_id_idx\",\"columns\":[\"owner_profile_id\"]}],\"version\":\"1d0b1fcb\"},\"importPath\":\"@happyvertical/smrt-assets\"},\"@happyvertical/smrt-assets:FolderCollection\":{\"name\":\"foldercollection\",\"className\":\"FolderCollection\",\"qualifiedName\":\"@happyvertical/smrt-assets:FolderCollection\",\"collection\":\"folders\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/assets/src/folders.ts\",\"packageName\":\"@happyvertical/smrt-assets\",\"fields\":{},\"methods\":{\"getTree\":{\"name\":\"getTree\",\"async\":true,\"parameters\":[{\"name\":\"rootId\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Folder[]>\",\"isStatic\":false,\"isPublic\":true},\"getPath\":{\"name\":\"getPath\",\"async\":true,\"parameters\":[{\"name\":\"folderId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Folder[]>\",\"isStatic\":false,\"isPublic\":true},\"getContents\":{\"name\":\"getContents\",\"async\":true,\"parameters\":[{\"name\":\"folderId\",\"type\":\"string\",\"optional\":false},{\"name\":\"assetCollection\",\"type\":\"AssetCollection\",\"optional\":false}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"moveAsset\":{\"name\":\"moveAsset\",\"async\":true,\"parameters\":[{\"name\":\"asset\",\"type\":\"Asset\",\"optional\":false},{\"name\":\"folderId\",\"type\":\"string | null\",\"optional\":false,\"unionBranches\":[{\"type\":\"string\"},{\"type\":\"null\"}]}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"Folder\",\"exportName\":\"FolderCollection\",\"collectionExportName\":\"FolderCollectionCollection\",\"schema\":{\"tableName\":\"folders\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"folders\\\" (\\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 \\\"parent_id\\\" UUID,\\n \\\"tenant_id\\\" UUID,\\n \\\"name\\\" TEXT,\\n \\\"description\\\" TEXT,\\n \\\"owner_profile_id\\\" UUID\\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\"},\"parent_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"unique\":false,\"foreignKey\":{\"table\":\"folders\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"name\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false,\"unique\":false},\"owner_profile_id\":{\"type\":\"UUID\",\"referenceKind\":\"crossPackageRef\",\"notNull\":false,\"unique\":false}},\"indexes\":[{\"name\":\"folders_slug_context_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"folders_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"folders_parent_id_idx\",\"columns\":[\"parent_id\"]},{\"name\":\"folders_owner_profile_id_idx\",\"columns\":[\"owner_profile_id\"]}],\"version\":\"1d0b1fcb\"},\"importPath\":\"@happyvertical/smrt-assets\"}},\"moduleType\":\"smrt\",\"smrtDependencies\":[\"@happyvertical/smrt-core\",\"@happyvertical/smrt-tags\",\"@happyvertical/smrt-tenancy\"]}"));
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/asset-association.ts
|
|
21
21
|
var __defProp$8 = Object.defineProperty;
|
package/dist/manifest.json
CHANGED
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-assets",
|
|
6
|
-
"packageVersion": "0.53.
|
|
6
|
+
"packageVersion": "0.53.2",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "3c4816732d6b77de466d4935d827836b9a011d9834afe6ed872532e3c65cb098",
|
|
11
|
+
"packageJson": "b2cd3c0ac44084c156875bb368ac28bf8004084fac3e007eb9c77ecd0989ad04",
|
|
12
12
|
"agents": "b20a644cf88ab66f1086b329be02d127f5396026260fbc2c515d5842cfe3d3de"
|
|
13
13
|
},
|
|
14
14
|
"exports": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-assets",
|
|
3
|
-
"version": "0.53.
|
|
3
|
+
"version": "0.53.2",
|
|
4
4
|
"smrtJsdoc": "strict",
|
|
5
5
|
"description": "Asset management system with versioning, metadata, and AI-powered operations for SMRT framework",
|
|
6
6
|
"type": "module",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"@happyvertical/ai": "^0.98.0",
|
|
47
47
|
"@happyvertical/files": "^0.98.0",
|
|
48
48
|
"@happyvertical/logger": "^0.98.0",
|
|
49
|
-
"@happyvertical/smrt-core": "0.53.
|
|
50
|
-
"@happyvertical/smrt-tags": "0.53.
|
|
51
|
-
"@happyvertical/smrt-tenancy": "0.53.
|
|
52
|
-
"@happyvertical/smrt-types": "0.53.
|
|
53
|
-
"@happyvertical/smrt-ui": "0.53.
|
|
49
|
+
"@happyvertical/smrt-core": "0.53.2",
|
|
50
|
+
"@happyvertical/smrt-tags": "0.53.2",
|
|
51
|
+
"@happyvertical/smrt-tenancy": "0.53.2",
|
|
52
|
+
"@happyvertical/smrt-types": "0.53.2",
|
|
53
|
+
"@happyvertical/smrt-ui": "0.53.2",
|
|
54
54
|
"@happyvertical/sql": "^0.98.0",
|
|
55
55
|
"@happyvertical/utils": "^0.98.0"
|
|
56
56
|
},
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@happyvertical/smrt-playground": "0.53.
|
|
67
|
-
"@happyvertical/smrt-vitest": "0.53.
|
|
66
|
+
"@happyvertical/smrt-playground": "0.53.2",
|
|
67
|
+
"@happyvertical/smrt-vitest": "0.53.2",
|
|
68
68
|
"@sveltejs/adapter-auto": "^7.0.1",
|
|
69
69
|
"@sveltejs/kit": "2.69.1",
|
|
70
70
|
"@sveltejs/package": "^2.5.8",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"directory": "packages/assets"
|
|
99
99
|
},
|
|
100
100
|
"scripts": {
|
|
101
|
-
"build": "SMRT_PACKAGE_BUILD=1 svelte-kit sync && SMRT_PACKAGE_BUILD=1 vite build --mode library && SMRT_PACKAGE_BUILD=1 svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json",
|
|
101
|
+
"build": "SMRT_PACKAGE_BUILD=1 svelte-kit sync && SMRT_PACKAGE_BUILD=1 vite build --mode library && SMRT_PACKAGE_BUILD=1 svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json && node ../../scripts/prune-svelte-package-artifacts.js dist",
|
|
102
102
|
"build:watch": "vite build --mode library --watch",
|
|
103
103
|
"clean": "rm -rf dist",
|
|
104
104
|
"dev": "vite dev",
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// @vitest-environment jsdom
|
|
2
|
-
/**
|
|
3
|
-
* First component test in a domain package via the shared S11 harness (#1416):
|
|
4
|
-
* the whole Testing-Library + axe surface comes from `@happyvertical/smrt-vitest`
|
|
5
|
-
* (no per-package testing-library deps), and the jsdom `<dialog>` polyfill +
|
|
6
|
-
* jest-dom matchers come from the shared `svelte-setup` in vitest.config.
|
|
7
|
-
*/
|
|
8
|
-
import { expectNoA11yViolations, render, screen, userEvent, within, } from '@happyvertical/smrt-vitest/svelte';
|
|
9
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
10
|
-
import ActionBar from '../ActionBar.svelte';
|
|
11
|
-
// ActionBar only reads `selectedAssets.length` and forwards the array to its
|
|
12
|
-
// callbacks, so minimal id-only stubs are enough to drive it.
|
|
13
|
-
const selected = [{ id: '1' }, { id: '2' }];
|
|
14
|
-
describe('ActionBar', () => {
|
|
15
|
-
it('shows the selected count and clears the selection', async () => {
|
|
16
|
-
const onClearSelection = vi.fn();
|
|
17
|
-
render(ActionBar, {
|
|
18
|
-
props: { selectedAssets: selected, onClearSelection, onDelete: vi.fn() },
|
|
19
|
-
});
|
|
20
|
-
expect(screen.getByText('2 selected')).toBeInTheDocument();
|
|
21
|
-
await userEvent.click(screen.getByRole('button', { name: 'Clear' }));
|
|
22
|
-
expect(onClearSelection).toHaveBeenCalledTimes(1);
|
|
23
|
-
});
|
|
24
|
-
it('renders nothing when no assets are selected', () => {
|
|
25
|
-
const { container } = render(ActionBar, {
|
|
26
|
-
props: {
|
|
27
|
-
selectedAssets: [],
|
|
28
|
-
onClearSelection: vi.fn(),
|
|
29
|
-
onDelete: vi.fn(),
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
expect(container.querySelector('.action-bar')).toBeNull();
|
|
33
|
-
});
|
|
34
|
-
it('confirms deletion through the inline dialog', async () => {
|
|
35
|
-
const onDelete = vi.fn();
|
|
36
|
-
render(ActionBar, {
|
|
37
|
-
props: { selectedAssets: selected, onClearSelection: vi.fn(), onDelete },
|
|
38
|
-
});
|
|
39
|
-
await userEvent.click(screen.getByRole('button', { name: 'Delete' }));
|
|
40
|
-
// The library ConfirmDialog (S10) labels its dialog by the title heading.
|
|
41
|
-
// Asserting the interpolated title AND message proves Svelte attribute-string
|
|
42
|
-
// interpolation (`"… {count} …"`) resolves for component props (count = 2).
|
|
43
|
-
const dialog = screen.getByRole('dialog', { name: /Delete 2 assets\?/ });
|
|
44
|
-
expect(within(dialog).getByText(/This action cannot be undone\./)).toBeInTheDocument();
|
|
45
|
-
await userEvent.click(within(dialog).getByRole('button', { name: 'Delete' }));
|
|
46
|
-
expect(onDelete).toHaveBeenCalledWith(selected);
|
|
47
|
-
});
|
|
48
|
-
it('cancels deletion and dismisses the dialog', async () => {
|
|
49
|
-
render(ActionBar, {
|
|
50
|
-
props: {
|
|
51
|
-
selectedAssets: selected,
|
|
52
|
-
onClearSelection: vi.fn(),
|
|
53
|
-
onDelete: vi.fn(),
|
|
54
|
-
},
|
|
55
|
-
});
|
|
56
|
-
await userEvent.click(screen.getByRole('button', { name: 'Delete' }));
|
|
57
|
-
await userEvent.click(within(screen.getByRole('dialog')).getByRole('button', {
|
|
58
|
-
name: 'Cancel',
|
|
59
|
-
}));
|
|
60
|
-
expect(screen.queryByRole('dialog')).not.toBeInTheDocument();
|
|
61
|
-
});
|
|
62
|
-
it('is axe-clean', async () => {
|
|
63
|
-
const { container } = render(ActionBar, {
|
|
64
|
-
props: {
|
|
65
|
-
selectedAssets: selected,
|
|
66
|
-
onClearSelection: vi.fn(),
|
|
67
|
-
onDelete: vi.fn(),
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
await expectNoA11yViolations(container);
|
|
71
|
-
});
|
|
72
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// @vitest-environment jsdom
|
|
2
|
-
/**
|
|
3
|
-
* Component coverage for AssetDetail via the shared S11 harness (#1416).
|
|
4
|
-
* `open: true` drives the <dialog> showModal effect (polyfilled in the shared
|
|
5
|
-
* setup), so these exercise the real open state.
|
|
6
|
-
*/
|
|
7
|
-
import { render, screen, userEvent } from '@happyvertical/smrt-vitest/svelte';
|
|
8
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
9
|
-
import AssetDetail from '../AssetDetail.svelte';
|
|
10
|
-
const asset = {
|
|
11
|
-
id: '1',
|
|
12
|
-
name: 'photo.png',
|
|
13
|
-
mimeType: 'image/png',
|
|
14
|
-
typeSlug: 'image',
|
|
15
|
-
statusSlug: 'published',
|
|
16
|
-
sourceUri: 'file:///photo.png',
|
|
17
|
-
description: 'a picture',
|
|
18
|
-
metadata: '',
|
|
19
|
-
};
|
|
20
|
-
const baseProps = (over = {}) => ({
|
|
21
|
-
asset,
|
|
22
|
-
open: true,
|
|
23
|
-
onClose: vi.fn(),
|
|
24
|
-
...over,
|
|
25
|
-
});
|
|
26
|
-
describe('AssetDetail', () => {
|
|
27
|
-
it('renders the detail dialog for an asset', () => {
|
|
28
|
-
render(AssetDetail, { props: baseProps() });
|
|
29
|
-
expect(screen.getByRole('heading', { name: 'photo.png', hidden: true })).toBeInTheDocument();
|
|
30
|
-
});
|
|
31
|
-
it('closes via the close button', async () => {
|
|
32
|
-
const onClose = vi.fn();
|
|
33
|
-
render(AssetDetail, { props: baseProps({ onClose }) });
|
|
34
|
-
// The library Modal (S10) provides the dialog's close affordance, labelled
|
|
35
|
-
// "Close modal".
|
|
36
|
-
await userEvent.click(screen.getByRole('button', { name: 'Close modal', hidden: true }));
|
|
37
|
-
expect(onClose).toHaveBeenCalled();
|
|
38
|
-
});
|
|
39
|
-
it('deletes the asset', async () => {
|
|
40
|
-
const onDelete = vi.fn();
|
|
41
|
-
render(AssetDetail, { props: baseProps({ onDelete }) });
|
|
42
|
-
await userEvent.click(screen.getByRole('button', { name: 'Delete', hidden: true }));
|
|
43
|
-
expect(onDelete).toHaveBeenCalledWith(expect.objectContaining({ id: '1' }));
|
|
44
|
-
});
|
|
45
|
-
it('saves metadata edits', async () => {
|
|
46
|
-
const onSave = vi.fn();
|
|
47
|
-
render(AssetDetail, { props: baseProps({ onSave }) });
|
|
48
|
-
await userEvent.click(screen.getByRole('button', { name: 'Save', hidden: true }));
|
|
49
|
-
expect(onSave).toHaveBeenCalled();
|
|
50
|
-
});
|
|
51
|
-
it('renders nothing meaningful when closed with no asset', () => {
|
|
52
|
-
const { container } = render(AssetDetail, {
|
|
53
|
-
props: baseProps({ asset: null, open: false }),
|
|
54
|
-
});
|
|
55
|
-
expect(container.textContent).not.toContain('photo.png');
|
|
56
|
-
});
|
|
57
|
-
});
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
// @vitest-environment jsdom
|
|
2
|
-
/**
|
|
3
|
-
* Component coverage for AssetGrid via the shared S11 harness (#1416), plus the
|
|
4
|
-
* S12 a11y remediation (#1417): the whole-card open action is now a stretched
|
|
5
|
-
* "Open <name>" button instead of a role="button" card wrapping the checkbox
|
|
6
|
-
* (which tripped axe's nested-interactive rule), so axe is asserted here.
|
|
7
|
-
*/
|
|
8
|
-
import { expectNoA11yViolations, render, screen, userEvent, } from '@happyvertical/smrt-vitest/svelte';
|
|
9
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
10
|
-
import AssetGrid from '../AssetGrid.svelte';
|
|
11
|
-
const assets = [
|
|
12
|
-
{
|
|
13
|
-
id: '1',
|
|
14
|
-
name: 'photo.png',
|
|
15
|
-
mimeType: 'image/png',
|
|
16
|
-
typeSlug: 'image',
|
|
17
|
-
statusSlug: 'published',
|
|
18
|
-
sourceUri: 'file:///1',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
id: '2',
|
|
22
|
-
name: 'clip.mp4',
|
|
23
|
-
mimeType: 'video/mp4',
|
|
24
|
-
typeSlug: 'video',
|
|
25
|
-
statusSlug: 'published',
|
|
26
|
-
sourceUri: 'file:///2',
|
|
27
|
-
},
|
|
28
|
-
];
|
|
29
|
-
const baseProps = (over = {}) => ({
|
|
30
|
-
assets,
|
|
31
|
-
selectedIds: new Set(),
|
|
32
|
-
onSelectionChange: vi.fn(),
|
|
33
|
-
onAssetClick: vi.fn(),
|
|
34
|
-
...over,
|
|
35
|
-
});
|
|
36
|
-
describe('AssetGrid', () => {
|
|
37
|
-
it('renders a tile per asset', () => {
|
|
38
|
-
render(AssetGrid, { props: baseProps() });
|
|
39
|
-
expect(screen.getByText('photo.png')).toBeInTheDocument();
|
|
40
|
-
expect(screen.getByText('clip.mp4')).toBeInTheDocument();
|
|
41
|
-
});
|
|
42
|
-
it('opens an asset via its stretched open button', async () => {
|
|
43
|
-
const onAssetClick = vi.fn();
|
|
44
|
-
render(AssetGrid, { props: baseProps({ onAssetClick }) });
|
|
45
|
-
await userEvent.click(screen.getByRole('button', { name: 'Open photo.png' }));
|
|
46
|
-
expect(onAssetClick).toHaveBeenCalledWith(expect.objectContaining({ id: '1' }));
|
|
47
|
-
});
|
|
48
|
-
it('labels the card action "Select" in pick mode', () => {
|
|
49
|
-
render(AssetGrid, { props: baseProps({ mode: 'pick' }) });
|
|
50
|
-
expect(screen.getByRole('button', { name: 'Select photo.png' })).toBeInTheDocument();
|
|
51
|
-
expect(screen.queryByRole('button', { name: 'Open photo.png' })).toBeNull();
|
|
52
|
-
});
|
|
53
|
-
it('toggles selection via the per-asset checkbox', async () => {
|
|
54
|
-
const onSelectionChange = vi.fn();
|
|
55
|
-
render(AssetGrid, { props: baseProps({ onSelectionChange }) });
|
|
56
|
-
await userEvent.click(screen.getByLabelText('Select photo.png'));
|
|
57
|
-
expect(onSelectionChange).toHaveBeenCalledTimes(1);
|
|
58
|
-
});
|
|
59
|
-
it('renders without assets', () => {
|
|
60
|
-
const { container } = render(AssetGrid, {
|
|
61
|
-
props: baseProps({ assets: [] }),
|
|
62
|
-
});
|
|
63
|
-
expect(container.querySelector('*')).toBeTruthy();
|
|
64
|
-
});
|
|
65
|
-
it('is axe-clean', async () => {
|
|
66
|
-
const { container } = render(AssetGrid, { props: baseProps() });
|
|
67
|
-
await expectNoA11yViolations(container);
|
|
68
|
-
});
|
|
69
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// @vitest-environment jsdom
|
|
2
|
-
/**
|
|
3
|
-
* Component coverage for AssetList via the shared S11 harness (#1416), plus the
|
|
4
|
-
* S12 a11y remediation (#1417): the row's open action is now a name button in
|
|
5
|
-
* its cell instead of a role="button" <tr> nesting the checkbox (axe
|
|
6
|
-
* nested-interactive), so axe is asserted here.
|
|
7
|
-
*/
|
|
8
|
-
import { expectNoA11yViolations, render, screen, userEvent, } from '@happyvertical/smrt-vitest/svelte';
|
|
9
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
10
|
-
import AssetList from '../AssetList.svelte';
|
|
11
|
-
const assets = [
|
|
12
|
-
{
|
|
13
|
-
id: '1',
|
|
14
|
-
name: 'photo.png',
|
|
15
|
-
mimeType: 'image/png',
|
|
16
|
-
typeSlug: 'image',
|
|
17
|
-
statusSlug: 'published',
|
|
18
|
-
sourceUri: 'file:///1',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
id: '2',
|
|
22
|
-
name: 'doc.pdf',
|
|
23
|
-
mimeType: 'application/pdf',
|
|
24
|
-
typeSlug: 'document',
|
|
25
|
-
statusSlug: 'published',
|
|
26
|
-
sourceUri: 'file:///2',
|
|
27
|
-
},
|
|
28
|
-
];
|
|
29
|
-
const baseProps = (over = {}) => ({
|
|
30
|
-
assets,
|
|
31
|
-
selectedIds: new Set(),
|
|
32
|
-
sort: { field: 'name', direction: 'asc' },
|
|
33
|
-
onSelectionChange: vi.fn(),
|
|
34
|
-
onAssetClick: vi.fn(),
|
|
35
|
-
onSortChange: vi.fn(),
|
|
36
|
-
...over,
|
|
37
|
-
});
|
|
38
|
-
describe('AssetList', () => {
|
|
39
|
-
it('renders a row per asset', () => {
|
|
40
|
-
render(AssetList, { props: baseProps() });
|
|
41
|
-
expect(screen.getByText('photo.png')).toBeInTheDocument();
|
|
42
|
-
expect(screen.getByText('doc.pdf')).toBeInTheDocument();
|
|
43
|
-
});
|
|
44
|
-
it('select-all toggles the selection', async () => {
|
|
45
|
-
const onSelectionChange = vi.fn();
|
|
46
|
-
render(AssetList, { props: baseProps({ onSelectionChange }) });
|
|
47
|
-
await userEvent.click(screen.getByLabelText('Select all'));
|
|
48
|
-
expect(onSelectionChange).toHaveBeenCalledTimes(1);
|
|
49
|
-
});
|
|
50
|
-
it('clicking a sortable column header re-sorts', async () => {
|
|
51
|
-
const onSortChange = vi.fn();
|
|
52
|
-
render(AssetList, { props: baseProps({ onSortChange }) });
|
|
53
|
-
await userEvent.click(screen.getByRole('button', { name: /Name/ }));
|
|
54
|
-
expect(onSortChange).toHaveBeenCalledTimes(1);
|
|
55
|
-
});
|
|
56
|
-
it('opens an asset via its name button', async () => {
|
|
57
|
-
const onAssetClick = vi.fn();
|
|
58
|
-
render(AssetList, { props: baseProps({ onAssetClick }) });
|
|
59
|
-
await userEvent.click(screen.getByRole('button', { name: 'photo.png' }));
|
|
60
|
-
expect(onAssetClick).toHaveBeenCalledWith(expect.objectContaining({ id: '1' }));
|
|
61
|
-
});
|
|
62
|
-
it('renders without assets', () => {
|
|
63
|
-
const { container } = render(AssetList, {
|
|
64
|
-
props: baseProps({ assets: [] }),
|
|
65
|
-
});
|
|
66
|
-
expect(container.querySelector('*')).toBeTruthy();
|
|
67
|
-
});
|
|
68
|
-
it('is axe-clean', async () => {
|
|
69
|
-
const { container } = render(AssetList, { props: baseProps() });
|
|
70
|
-
await expectNoA11yViolations(container);
|
|
71
|
-
});
|
|
72
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// @vitest-environment jsdom
|
|
2
|
-
/**
|
|
3
|
-
* Component coverage for AssetManager (the asset UI shell) via the shared S11
|
|
4
|
-
* harness (#1416).
|
|
5
|
-
*/
|
|
6
|
-
import { render, screen } from '@happyvertical/smrt-vitest/svelte';
|
|
7
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
8
|
-
import AssetManager from '../AssetManager.svelte';
|
|
9
|
-
describe('AssetManager', () => {
|
|
10
|
-
it('renders the manager shell with its toolbar', () => {
|
|
11
|
-
render(AssetManager, { props: {} });
|
|
12
|
-
// The toolbar (AssetToolbar) renders its labelled search control.
|
|
13
|
-
expect(screen.getByLabelText('Search assets')).toBeInTheDocument();
|
|
14
|
-
});
|
|
15
|
-
it('renders in pick mode', () => {
|
|
16
|
-
const { container } = render(AssetManager, {
|
|
17
|
-
props: { mode: 'pick', onSelect: vi.fn() },
|
|
18
|
-
});
|
|
19
|
-
expect(container.querySelector('*')).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// @vitest-environment jsdom
|
|
2
|
-
/**
|
|
3
|
-
* Component coverage for the package route surface via the shared S11 harness
|
|
4
|
-
* (#1416) — it composes AssetManager with a custom action.
|
|
5
|
-
*/
|
|
6
|
-
import { render, screen } from '@happyvertical/smrt-vitest/svelte';
|
|
7
|
-
import { describe, expect, it } from 'vitest';
|
|
8
|
-
import AssetManagerRoute from '../routes/AssetManagerRoute.svelte';
|
|
9
|
-
describe('AssetManagerRoute', () => {
|
|
10
|
-
it('renders the route surface with an embedded asset manager', () => {
|
|
11
|
-
render(AssetManagerRoute);
|
|
12
|
-
expect(screen.getByText('Package Route Surface')).toBeInTheDocument();
|
|
13
|
-
// AssetManager's toolbar renders inside the route.
|
|
14
|
-
expect(screen.getByLabelText('Search assets')).toBeInTheDocument();
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// @vitest-environment jsdom
|
|
2
|
-
/**
|
|
3
|
-
* Component coverage for AssetToolbar via the shared S11 harness (#1416).
|
|
4
|
-
*/
|
|
5
|
-
import { expectNoA11yViolations, render, screen, userEvent, } from '@happyvertical/smrt-vitest/svelte';
|
|
6
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
7
|
-
import AssetToolbar from '../AssetToolbar.svelte';
|
|
8
|
-
const baseProps = (over = {}) => ({
|
|
9
|
-
view: 'grid',
|
|
10
|
-
filters: { search: '', types: [], tags: [], mimePatterns: [] },
|
|
11
|
-
sort: { field: 'name', direction: 'asc' },
|
|
12
|
-
onViewChange: vi.fn(),
|
|
13
|
-
onFilterChange: vi.fn(),
|
|
14
|
-
onSortChange: vi.fn(),
|
|
15
|
-
...over,
|
|
16
|
-
});
|
|
17
|
-
describe('AssetToolbar', () => {
|
|
18
|
-
it('renders search, filter, sort, and view controls', () => {
|
|
19
|
-
render(AssetToolbar, { props: baseProps() });
|
|
20
|
-
expect(screen.getByLabelText('Search assets')).toBeInTheDocument();
|
|
21
|
-
expect(screen.getByLabelText('Sort assets')).toBeInTheDocument();
|
|
22
|
-
expect(screen.getByRole('group', { name: 'View mode' })).toBeInTheDocument();
|
|
23
|
-
});
|
|
24
|
-
it('clears the active search', async () => {
|
|
25
|
-
const onFilterChange = vi.fn();
|
|
26
|
-
render(AssetToolbar, {
|
|
27
|
-
props: baseProps({
|
|
28
|
-
filters: { search: 'photo', types: [], tags: [], mimePatterns: [] },
|
|
29
|
-
onFilterChange,
|
|
30
|
-
}),
|
|
31
|
-
});
|
|
32
|
-
await userEvent.click(screen.getByLabelText('Clear search'));
|
|
33
|
-
expect(onFilterChange).toHaveBeenCalledWith(expect.objectContaining({ search: '' }));
|
|
34
|
-
});
|
|
35
|
-
it('is axe-clean', async () => {
|
|
36
|
-
const { container } = render(AssetToolbar, { props: baseProps() });
|
|
37
|
-
await expectNoA11yViolations(container);
|
|
38
|
-
});
|
|
39
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// @vitest-environment jsdom
|
|
2
|
-
/**
|
|
3
|
-
* Component coverage for CreateAssetModal via the shared S11 harness (#1416).
|
|
4
|
-
* The jsdom `<dialog>` showModal/close polyfill comes from the shared setup.
|
|
5
|
-
*/
|
|
6
|
-
import { render, screen, userEvent } from '@happyvertical/smrt-vitest/svelte';
|
|
7
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
8
|
-
import CreateAssetModal from '../CreateAssetModal.svelte';
|
|
9
|
-
const baseProps = (over = {}) => ({
|
|
10
|
-
open: true,
|
|
11
|
-
oncreate: vi.fn(),
|
|
12
|
-
onclose: vi.fn(),
|
|
13
|
-
...over,
|
|
14
|
-
});
|
|
15
|
-
describe('CreateAssetModal', () => {
|
|
16
|
-
it('renders the upload dialog with a dropzone when open and empty', () => {
|
|
17
|
-
render(CreateAssetModal, { props: baseProps() });
|
|
18
|
-
expect(screen.getByRole('heading', { name: 'Upload Asset', hidden: true })).toBeInTheDocument();
|
|
19
|
-
expect(screen.getByText(/Drag & drop/, { hidden: true })).toBeTruthy();
|
|
20
|
-
});
|
|
21
|
-
it('pre-loads an initial file into the metadata form', () => {
|
|
22
|
-
// A non-image file avoids URL.createObjectURL (unimplemented in jsdom).
|
|
23
|
-
const file = new File(['x'], 'notes.txt', { type: 'text/plain' });
|
|
24
|
-
render(CreateAssetModal, { props: baseProps({ initialFile: file }) });
|
|
25
|
-
expect(screen.getByText('notes.txt', { hidden: true })).toBeInTheDocument();
|
|
26
|
-
});
|
|
27
|
-
it('closes via Cancel', async () => {
|
|
28
|
-
const onclose = vi.fn();
|
|
29
|
-
render(CreateAssetModal, { props: baseProps({ onclose }) });
|
|
30
|
-
await userEvent.click(screen.getByRole('button', { name: 'Cancel', hidden: true }));
|
|
31
|
-
expect(onclose).toHaveBeenCalled();
|
|
32
|
-
});
|
|
33
|
-
it('submits the pre-loaded file', async () => {
|
|
34
|
-
const oncreate = vi.fn();
|
|
35
|
-
const file = new File(['x'], 'notes.txt', { type: 'text/plain' });
|
|
36
|
-
render(CreateAssetModal, {
|
|
37
|
-
props: baseProps({ initialFile: file, oncreate }),
|
|
38
|
-
});
|
|
39
|
-
await userEvent.click(screen.getByRole('button', { name: /Upload/, hidden: true }));
|
|
40
|
-
expect(oncreate).toHaveBeenCalledWith(expect.objectContaining({ file: expect.any(File) }));
|
|
41
|
-
});
|
|
42
|
-
});
|