@happyvertical/smrt-assets 0.49.3 → 0.49.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/manifest.json +347 -41
- package/dist/smrt-knowledge.json +10 -10
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { ObjectRegistry, SmrtCollection, SmrtHierarchical, SmrtJunction, SmrtObj
|
|
|
3
3
|
import { Tag } from "@happyvertical/smrt-tags";
|
|
4
4
|
import { TenantScoped, queryGlobal, queryWithGlobals, tenantId, withSystemContext } from "@happyvertical/smrt-tenancy";
|
|
5
5
|
//#region src/__smrt-register__.ts
|
|
6
|
-
ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":0,\"packageName\":\"@happyvertical/smrt-assets\",\"packageVersion\":\"0.49.3\",\"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\"}},\"@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_association_collections\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_association_collections\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"asset_association_collections_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true},{\"name\":\"asset_association_collections_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"0898b2a2\"}},\"@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\"}},\"@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_metafield_collections\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_metafield_collections\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"asset_metafield_collections_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true},{\"name\":\"asset_metafield_collections_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"912b98aa\"}},\"@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\"}},\"@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_status_collections\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_status_collections\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"asset_status_collections_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true},{\"name\":\"asset_status_collections_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"1b138d50\"}},\"@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\"}},\"@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_type_collections\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_type_collections\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"asset_type_collections_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true},{\"name\":\"asset_type_collections_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"40007bcf\"}},\"@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\":{\"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}],\"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},{\"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\"}},\"@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\":\"tagSlug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"removeTag\":{\"name\":\"removeTag\",\"async\":true,\"parameters\":[{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"tagSlug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getByTag\":{\"name\":\"getByTag\",\"async\":true,\"parameters\":[{\"name\":\"tagSlug\",\"type\":\"string\",\"optional\":false}],\"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\":\"asset_collections\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"asset_collections\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"asset_collections_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true},{\"name\":\"asset_collections_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"74006cef\"}},\"@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},{\"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\"}},\"@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\":\"folder_collections\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"folder_collections\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"folder_collections_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true},{\"name\":\"folder_collections_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"7d4c3d6f\"}}},\"moduleType\":\"smrt\",\"smrtDependencies\":[\"@happyvertical/smrt-core\",\"@happyvertical/smrt-tags\",\"@happyvertical/smrt-tenancy\"]}"));
|
|
6
|
+
ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":0,\"packageName\":\"@happyvertical/smrt-assets\",\"packageVersion\":\"0.49.4\",\"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\"}},\"@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\"}},\"@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\"}},\"@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\"}},\"@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\"}},\"@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\"}},\"@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\"}},\"@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\"}},\"@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\":{\"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}],\"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\"}},\"@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\":\"tagSlug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"removeTag\":{\"name\":\"removeTag\",\"async\":true,\"parameters\":[{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"tagSlug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getByTag\":{\"name\":\"getByTag\",\"async\":true,\"parameters\":[{\"name\":\"tagSlug\",\"type\":\"string\",\"optional\":false}],\"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\"}},\"@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\"}},\"@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\"}}},\"moduleType\":\"smrt\",\"smrtDependencies\":[\"@happyvertical/smrt-core\",\"@happyvertical/smrt-tags\",\"@happyvertical/smrt-tenancy\"]}"));
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/asset-association.ts
|
|
9
9
|
var __defProp$6 = Object.defineProperty;
|
package/dist/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": "1.0.0",
|
|
3
3
|
"timestamp": 0,
|
|
4
4
|
"packageName": "@happyvertical/smrt-assets",
|
|
5
|
-
"packageVersion": "0.49.
|
|
5
|
+
"packageVersion": "0.49.4",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-assets:AssetAssociation": {
|
|
8
8
|
"name": "assetassociation",
|
|
@@ -380,8 +380,8 @@
|
|
|
380
380
|
"exportName": "AssetAssociationCollection",
|
|
381
381
|
"collectionExportName": "AssetAssociationCollectionCollection",
|
|
382
382
|
"schema": {
|
|
383
|
-
"tableName": "
|
|
384
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"
|
|
383
|
+
"tableName": "asset_associations",
|
|
384
|
+
"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);",
|
|
385
385
|
"columns": {
|
|
386
386
|
"id": {
|
|
387
387
|
"type": "UUID",
|
|
@@ -407,25 +407,81 @@
|
|
|
407
407
|
"type": "TIMESTAMP",
|
|
408
408
|
"notNull": true,
|
|
409
409
|
"default": "current_timestamp"
|
|
410
|
+
},
|
|
411
|
+
"meta_type": {
|
|
412
|
+
"type": "TEXT",
|
|
413
|
+
"notNull": true,
|
|
414
|
+
"unique": false
|
|
415
|
+
},
|
|
416
|
+
"meta_id": {
|
|
417
|
+
"type": "TEXT",
|
|
418
|
+
"notNull": true,
|
|
419
|
+
"unique": false
|
|
420
|
+
},
|
|
421
|
+
"role": {
|
|
422
|
+
"type": "TEXT",
|
|
423
|
+
"notNull": true,
|
|
424
|
+
"unique": false
|
|
425
|
+
},
|
|
426
|
+
"sort_order": {
|
|
427
|
+
"type": "INTEGER",
|
|
428
|
+
"notNull": false,
|
|
429
|
+
"unique": false,
|
|
430
|
+
"default": 0
|
|
431
|
+
},
|
|
432
|
+
"tenant_id": {
|
|
433
|
+
"type": "UUID",
|
|
434
|
+
"referenceKind": "tenantId",
|
|
435
|
+
"notNull": false,
|
|
436
|
+
"unique": false
|
|
437
|
+
},
|
|
438
|
+
"asset_id": {
|
|
439
|
+
"type": "UUID",
|
|
440
|
+
"referenceKind": "foreignKey",
|
|
441
|
+
"notNull": true,
|
|
442
|
+
"unique": false,
|
|
443
|
+
"foreignKey": {
|
|
444
|
+
"table": "assets",
|
|
445
|
+
"column": "id",
|
|
446
|
+
"onDelete": "CASCADE",
|
|
447
|
+
"onUpdate": "CASCADE"
|
|
448
|
+
}
|
|
410
449
|
}
|
|
411
450
|
},
|
|
412
451
|
"indexes": [
|
|
413
452
|
{
|
|
414
|
-
"name": "
|
|
453
|
+
"name": "asset_associations_asset_id_meta_type_idx",
|
|
415
454
|
"columns": [
|
|
416
|
-
"
|
|
417
|
-
"
|
|
455
|
+
"asset_id",
|
|
456
|
+
"meta_type",
|
|
457
|
+
"meta_id",
|
|
458
|
+
"role"
|
|
418
459
|
],
|
|
419
460
|
"unique": true
|
|
420
461
|
},
|
|
421
462
|
{
|
|
422
|
-
"name": "
|
|
463
|
+
"name": "asset_associations_slug_context_idx",
|
|
464
|
+
"columns": [
|
|
465
|
+
"slug",
|
|
466
|
+
"context"
|
|
467
|
+
]
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"name": "asset_associations_tenant_id_created_at_idx",
|
|
423
471
|
"columns": [
|
|
472
|
+
"tenant_id",
|
|
424
473
|
"created_at"
|
|
425
474
|
]
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"name": "asset_associations_meta_type_meta_id_idx",
|
|
478
|
+
"columns": [
|
|
479
|
+
"meta_type",
|
|
480
|
+
"meta_id"
|
|
481
|
+
]
|
|
426
482
|
}
|
|
427
483
|
],
|
|
428
|
-
"version": "
|
|
484
|
+
"version": "faa13cea"
|
|
429
485
|
}
|
|
430
486
|
},
|
|
431
487
|
"@happyvertical/smrt-assets:AssetMetafield": {
|
|
@@ -644,8 +700,8 @@
|
|
|
644
700
|
"exportName": "AssetMetafieldCollection",
|
|
645
701
|
"collectionExportName": "AssetMetafieldCollectionCollection",
|
|
646
702
|
"schema": {
|
|
647
|
-
"tableName": "
|
|
648
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"
|
|
703
|
+
"tableName": "asset_metafields",
|
|
704
|
+
"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);",
|
|
649
705
|
"columns": {
|
|
650
706
|
"id": {
|
|
651
707
|
"type": "UUID",
|
|
@@ -662,6 +718,14 @@
|
|
|
662
718
|
"notNull": true,
|
|
663
719
|
"default": ""
|
|
664
720
|
},
|
|
721
|
+
"_meta_type": {
|
|
722
|
+
"type": "TEXT",
|
|
723
|
+
"notNull": true
|
|
724
|
+
},
|
|
725
|
+
"_meta_data": {
|
|
726
|
+
"type": "JSON",
|
|
727
|
+
"notNull": false
|
|
728
|
+
},
|
|
665
729
|
"created_at": {
|
|
666
730
|
"type": "TIMESTAMP",
|
|
667
731
|
"notNull": true,
|
|
@@ -671,25 +735,40 @@
|
|
|
671
735
|
"type": "TIMESTAMP",
|
|
672
736
|
"notNull": true,
|
|
673
737
|
"default": "current_timestamp"
|
|
738
|
+
},
|
|
739
|
+
"name": {
|
|
740
|
+
"type": "TEXT",
|
|
741
|
+
"notNull": false
|
|
742
|
+
},
|
|
743
|
+
"validation": {
|
|
744
|
+
"type": "TEXT",
|
|
745
|
+
"notNull": false
|
|
674
746
|
}
|
|
675
747
|
},
|
|
676
748
|
"indexes": [
|
|
677
749
|
{
|
|
678
|
-
"name": "
|
|
750
|
+
"name": "asset_metafields_slug_context_meta_type_idx",
|
|
679
751
|
"columns": [
|
|
680
752
|
"slug",
|
|
681
|
-
"context"
|
|
753
|
+
"context",
|
|
754
|
+
"_meta_type"
|
|
682
755
|
],
|
|
683
756
|
"unique": true
|
|
684
757
|
},
|
|
685
758
|
{
|
|
686
|
-
"name": "
|
|
759
|
+
"name": "asset_metafields_meta_type_idx",
|
|
760
|
+
"columns": [
|
|
761
|
+
"_meta_type"
|
|
762
|
+
]
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
"name": "asset_metafields_created_at_idx",
|
|
687
766
|
"columns": [
|
|
688
767
|
"created_at"
|
|
689
768
|
]
|
|
690
769
|
}
|
|
691
770
|
],
|
|
692
|
-
"version": "
|
|
771
|
+
"version": "7393718c"
|
|
693
772
|
}
|
|
694
773
|
},
|
|
695
774
|
"@happyvertical/smrt-assets:AssetStatus": {
|
|
@@ -878,8 +957,8 @@
|
|
|
878
957
|
"exportName": "AssetStatusCollection",
|
|
879
958
|
"collectionExportName": "AssetStatusCollectionCollection",
|
|
880
959
|
"schema": {
|
|
881
|
-
"tableName": "
|
|
882
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"
|
|
960
|
+
"tableName": "asset_statuses",
|
|
961
|
+
"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);",
|
|
883
962
|
"columns": {
|
|
884
963
|
"id": {
|
|
885
964
|
"type": "UUID",
|
|
@@ -896,6 +975,14 @@
|
|
|
896
975
|
"notNull": true,
|
|
897
976
|
"default": ""
|
|
898
977
|
},
|
|
978
|
+
"_meta_type": {
|
|
979
|
+
"type": "TEXT",
|
|
980
|
+
"notNull": true
|
|
981
|
+
},
|
|
982
|
+
"_meta_data": {
|
|
983
|
+
"type": "JSON",
|
|
984
|
+
"notNull": false
|
|
985
|
+
},
|
|
899
986
|
"created_at": {
|
|
900
987
|
"type": "TIMESTAMP",
|
|
901
988
|
"notNull": true,
|
|
@@ -905,25 +992,40 @@
|
|
|
905
992
|
"type": "TIMESTAMP",
|
|
906
993
|
"notNull": true,
|
|
907
994
|
"default": "current_timestamp"
|
|
995
|
+
},
|
|
996
|
+
"name": {
|
|
997
|
+
"type": "TEXT",
|
|
998
|
+
"notNull": false
|
|
999
|
+
},
|
|
1000
|
+
"description": {
|
|
1001
|
+
"type": "TEXT",
|
|
1002
|
+
"notNull": false
|
|
908
1003
|
}
|
|
909
1004
|
},
|
|
910
1005
|
"indexes": [
|
|
911
1006
|
{
|
|
912
|
-
"name": "
|
|
1007
|
+
"name": "asset_statuses_slug_context_meta_type_idx",
|
|
913
1008
|
"columns": [
|
|
914
1009
|
"slug",
|
|
915
|
-
"context"
|
|
1010
|
+
"context",
|
|
1011
|
+
"_meta_type"
|
|
916
1012
|
],
|
|
917
1013
|
"unique": true
|
|
918
1014
|
},
|
|
919
1015
|
{
|
|
920
|
-
"name": "
|
|
1016
|
+
"name": "asset_statuses_meta_type_idx",
|
|
1017
|
+
"columns": [
|
|
1018
|
+
"_meta_type"
|
|
1019
|
+
]
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
"name": "asset_statuses_created_at_idx",
|
|
921
1023
|
"columns": [
|
|
922
1024
|
"created_at"
|
|
923
1025
|
]
|
|
924
1026
|
}
|
|
925
1027
|
],
|
|
926
|
-
"version": "
|
|
1028
|
+
"version": "8251a52f"
|
|
927
1029
|
}
|
|
928
1030
|
},
|
|
929
1031
|
"@happyvertical/smrt-assets:AssetType": {
|
|
@@ -1112,8 +1214,8 @@
|
|
|
1112
1214
|
"exportName": "AssetTypeCollection",
|
|
1113
1215
|
"collectionExportName": "AssetTypeCollectionCollection",
|
|
1114
1216
|
"schema": {
|
|
1115
|
-
"tableName": "
|
|
1116
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"
|
|
1217
|
+
"tableName": "asset_types",
|
|
1218
|
+
"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);",
|
|
1117
1219
|
"columns": {
|
|
1118
1220
|
"id": {
|
|
1119
1221
|
"type": "UUID",
|
|
@@ -1130,6 +1232,14 @@
|
|
|
1130
1232
|
"notNull": true,
|
|
1131
1233
|
"default": ""
|
|
1132
1234
|
},
|
|
1235
|
+
"_meta_type": {
|
|
1236
|
+
"type": "TEXT",
|
|
1237
|
+
"notNull": true
|
|
1238
|
+
},
|
|
1239
|
+
"_meta_data": {
|
|
1240
|
+
"type": "JSON",
|
|
1241
|
+
"notNull": false
|
|
1242
|
+
},
|
|
1133
1243
|
"created_at": {
|
|
1134
1244
|
"type": "TIMESTAMP",
|
|
1135
1245
|
"notNull": true,
|
|
@@ -1139,25 +1249,40 @@
|
|
|
1139
1249
|
"type": "TIMESTAMP",
|
|
1140
1250
|
"notNull": true,
|
|
1141
1251
|
"default": "current_timestamp"
|
|
1252
|
+
},
|
|
1253
|
+
"name": {
|
|
1254
|
+
"type": "TEXT",
|
|
1255
|
+
"notNull": false
|
|
1256
|
+
},
|
|
1257
|
+
"description": {
|
|
1258
|
+
"type": "TEXT",
|
|
1259
|
+
"notNull": false
|
|
1142
1260
|
}
|
|
1143
1261
|
},
|
|
1144
1262
|
"indexes": [
|
|
1145
1263
|
{
|
|
1146
|
-
"name": "
|
|
1264
|
+
"name": "asset_types_slug_context_meta_type_idx",
|
|
1147
1265
|
"columns": [
|
|
1148
1266
|
"slug",
|
|
1149
|
-
"context"
|
|
1267
|
+
"context",
|
|
1268
|
+
"_meta_type"
|
|
1150
1269
|
],
|
|
1151
1270
|
"unique": true
|
|
1152
1271
|
},
|
|
1153
1272
|
{
|
|
1154
|
-
"name": "
|
|
1273
|
+
"name": "asset_types_meta_type_idx",
|
|
1274
|
+
"columns": [
|
|
1275
|
+
"_meta_type"
|
|
1276
|
+
]
|
|
1277
|
+
},
|
|
1278
|
+
{
|
|
1279
|
+
"name": "asset_types_created_at_idx",
|
|
1155
1280
|
"columns": [
|
|
1156
1281
|
"created_at"
|
|
1157
1282
|
]
|
|
1158
1283
|
}
|
|
1159
1284
|
],
|
|
1160
|
-
"version": "
|
|
1285
|
+
"version": "a9c93be2"
|
|
1161
1286
|
}
|
|
1162
1287
|
},
|
|
1163
1288
|
"@happyvertical/smrt-assets:Asset": {
|
|
@@ -1626,7 +1751,8 @@
|
|
|
1626
1751
|
"context",
|
|
1627
1752
|
"_meta_type"
|
|
1628
1753
|
],
|
|
1629
|
-
"unique": true
|
|
1754
|
+
"unique": true,
|
|
1755
|
+
"nullsNotDistinct": true
|
|
1630
1756
|
},
|
|
1631
1757
|
{
|
|
1632
1758
|
"name": "assets_meta_type_idx",
|
|
@@ -1928,8 +2054,8 @@
|
|
|
1928
2054
|
"exportName": "AssetCollection",
|
|
1929
2055
|
"collectionExportName": "AssetCollectionCollection",
|
|
1930
2056
|
"schema": {
|
|
1931
|
-
"tableName": "
|
|
1932
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"
|
|
2057
|
+
"tableName": "assets",
|
|
2058
|
+
"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);",
|
|
1933
2059
|
"columns": {
|
|
1934
2060
|
"id": {
|
|
1935
2061
|
"type": "UUID",
|
|
@@ -1946,6 +2072,14 @@
|
|
|
1946
2072
|
"notNull": true,
|
|
1947
2073
|
"default": ""
|
|
1948
2074
|
},
|
|
2075
|
+
"_meta_type": {
|
|
2076
|
+
"type": "TEXT",
|
|
2077
|
+
"notNull": true
|
|
2078
|
+
},
|
|
2079
|
+
"_meta_data": {
|
|
2080
|
+
"type": "JSON",
|
|
2081
|
+
"notNull": false
|
|
2082
|
+
},
|
|
1949
2083
|
"created_at": {
|
|
1950
2084
|
"type": "TIMESTAMP",
|
|
1951
2085
|
"notNull": true,
|
|
@@ -1955,25 +2089,147 @@
|
|
|
1955
2089
|
"type": "TIMESTAMP",
|
|
1956
2090
|
"notNull": true,
|
|
1957
2091
|
"default": "current_timestamp"
|
|
2092
|
+
},
|
|
2093
|
+
"tenant_id": {
|
|
2094
|
+
"type": "UUID",
|
|
2095
|
+
"referenceKind": "tenantId",
|
|
2096
|
+
"notNull": false
|
|
2097
|
+
},
|
|
2098
|
+
"name": {
|
|
2099
|
+
"type": "TEXT",
|
|
2100
|
+
"notNull": false
|
|
2101
|
+
},
|
|
2102
|
+
"source_uri": {
|
|
2103
|
+
"type": "TEXT",
|
|
2104
|
+
"notNull": false
|
|
2105
|
+
},
|
|
2106
|
+
"mime_type": {
|
|
2107
|
+
"type": "TEXT",
|
|
2108
|
+
"notNull": false
|
|
2109
|
+
},
|
|
2110
|
+
"description": {
|
|
2111
|
+
"type": "TEXT",
|
|
2112
|
+
"notNull": false
|
|
2113
|
+
},
|
|
2114
|
+
"metadata": {
|
|
2115
|
+
"type": "TEXT",
|
|
2116
|
+
"notNull": false
|
|
2117
|
+
},
|
|
2118
|
+
"version": {
|
|
2119
|
+
"type": "INTEGER",
|
|
2120
|
+
"notNull": false,
|
|
2121
|
+
"default": 1
|
|
2122
|
+
},
|
|
2123
|
+
"primary_version_id": {
|
|
2124
|
+
"type": "UUID",
|
|
2125
|
+
"referenceKind": "foreignKey",
|
|
2126
|
+
"notNull": false,
|
|
2127
|
+
"foreignKey": {
|
|
2128
|
+
"table": "assets",
|
|
2129
|
+
"column": "id",
|
|
2130
|
+
"onDelete": "NO ACTION",
|
|
2131
|
+
"onUpdate": "CASCADE"
|
|
2132
|
+
}
|
|
2133
|
+
},
|
|
2134
|
+
"type_slug": {
|
|
2135
|
+
"type": "TEXT",
|
|
2136
|
+
"notNull": false
|
|
2137
|
+
},
|
|
2138
|
+
"status_slug": {
|
|
2139
|
+
"type": "TEXT",
|
|
2140
|
+
"notNull": false
|
|
2141
|
+
},
|
|
2142
|
+
"owner_profile_id": {
|
|
2143
|
+
"type": "UUID",
|
|
2144
|
+
"referenceKind": "crossPackageRef",
|
|
2145
|
+
"notNull": false
|
|
2146
|
+
},
|
|
2147
|
+
"source_asset_id": {
|
|
2148
|
+
"type": "UUID",
|
|
2149
|
+
"referenceKind": "foreignKey",
|
|
2150
|
+
"notNull": false,
|
|
2151
|
+
"foreignKey": {
|
|
2152
|
+
"table": "assets",
|
|
2153
|
+
"column": "id",
|
|
2154
|
+
"onDelete": "NO ACTION",
|
|
2155
|
+
"onUpdate": "CASCADE"
|
|
2156
|
+
}
|
|
2157
|
+
},
|
|
2158
|
+
"folder_id": {
|
|
2159
|
+
"type": "UUID",
|
|
2160
|
+
"referenceKind": "foreignKey",
|
|
2161
|
+
"notNull": false,
|
|
2162
|
+
"foreignKey": {
|
|
2163
|
+
"table": "folders",
|
|
2164
|
+
"column": "id",
|
|
2165
|
+
"onDelete": "NO ACTION",
|
|
2166
|
+
"onUpdate": "CASCADE"
|
|
2167
|
+
}
|
|
2168
|
+
},
|
|
2169
|
+
"source_type": {
|
|
2170
|
+
"type": "TEXT",
|
|
2171
|
+
"notNull": false
|
|
2172
|
+
},
|
|
2173
|
+
"external_id": {
|
|
2174
|
+
"type": "TEXT",
|
|
2175
|
+
"notNull": false
|
|
2176
|
+
},
|
|
2177
|
+
"external_refs": {
|
|
2178
|
+
"type": "TEXT",
|
|
2179
|
+
"notNull": false
|
|
1958
2180
|
}
|
|
1959
2181
|
},
|
|
1960
2182
|
"indexes": [
|
|
1961
2183
|
{
|
|
1962
|
-
"name": "
|
|
2184
|
+
"name": "assets_slug_context_meta_type_idx",
|
|
1963
2185
|
"columns": [
|
|
2186
|
+
"tenant_id",
|
|
1964
2187
|
"slug",
|
|
1965
|
-
"context"
|
|
2188
|
+
"context",
|
|
2189
|
+
"_meta_type"
|
|
1966
2190
|
],
|
|
1967
|
-
"unique": true
|
|
2191
|
+
"unique": true,
|
|
2192
|
+
"nullsNotDistinct": true
|
|
2193
|
+
},
|
|
2194
|
+
{
|
|
2195
|
+
"name": "assets_meta_type_idx",
|
|
2196
|
+
"columns": [
|
|
2197
|
+
"_meta_type"
|
|
2198
|
+
]
|
|
1968
2199
|
},
|
|
1969
2200
|
{
|
|
1970
|
-
"name": "
|
|
2201
|
+
"name": "assets_tenant_id_created_at_idx",
|
|
1971
2202
|
"columns": [
|
|
2203
|
+
"tenant_id",
|
|
1972
2204
|
"created_at"
|
|
1973
2205
|
]
|
|
2206
|
+
},
|
|
2207
|
+
{
|
|
2208
|
+
"name": "assets_primary_version_id_idx",
|
|
2209
|
+
"columns": [
|
|
2210
|
+
"primary_version_id"
|
|
2211
|
+
]
|
|
2212
|
+
},
|
|
2213
|
+
{
|
|
2214
|
+
"name": "assets_owner_profile_id_idx",
|
|
2215
|
+
"columns": [
|
|
2216
|
+
"owner_profile_id"
|
|
2217
|
+
]
|
|
2218
|
+
},
|
|
2219
|
+
{
|
|
2220
|
+
"name": "assets_source_asset_id_idx",
|
|
2221
|
+
"columns": [
|
|
2222
|
+
"source_asset_id"
|
|
2223
|
+
]
|
|
2224
|
+
},
|
|
2225
|
+
{
|
|
2226
|
+
"name": "assets_folder_id_idx",
|
|
2227
|
+
"columns": [
|
|
2228
|
+
"folder_id"
|
|
2229
|
+
]
|
|
1974
2230
|
}
|
|
1975
2231
|
],
|
|
1976
|
-
"version": "
|
|
2232
|
+
"version": "16d6c152"
|
|
1977
2233
|
}
|
|
1978
2234
|
},
|
|
1979
2235
|
"@happyvertical/smrt-assets:Folder": {
|
|
@@ -2218,7 +2474,8 @@
|
|
|
2218
2474
|
"slug",
|
|
2219
2475
|
"context"
|
|
2220
2476
|
],
|
|
2221
|
-
"unique": true
|
|
2477
|
+
"unique": true,
|
|
2478
|
+
"nullsNotDistinct": true
|
|
2222
2479
|
},
|
|
2223
2480
|
{
|
|
2224
2481
|
"name": "folders_tenant_id_created_at_idx",
|
|
@@ -2333,8 +2590,8 @@
|
|
|
2333
2590
|
"exportName": "FolderCollection",
|
|
2334
2591
|
"collectionExportName": "FolderCollectionCollection",
|
|
2335
2592
|
"schema": {
|
|
2336
|
-
"tableName": "
|
|
2337
|
-
"ddl": "CREATE TABLE IF NOT EXISTS \"
|
|
2593
|
+
"tableName": "folders",
|
|
2594
|
+
"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);",
|
|
2338
2595
|
"columns": {
|
|
2339
2596
|
"id": {
|
|
2340
2597
|
"type": "UUID",
|
|
@@ -2360,25 +2617,74 @@
|
|
|
2360
2617
|
"type": "TIMESTAMP",
|
|
2361
2618
|
"notNull": true,
|
|
2362
2619
|
"default": "current_timestamp"
|
|
2620
|
+
},
|
|
2621
|
+
"parent_id": {
|
|
2622
|
+
"type": "UUID",
|
|
2623
|
+
"referenceKind": "foreignKey",
|
|
2624
|
+
"notNull": false,
|
|
2625
|
+
"unique": false,
|
|
2626
|
+
"foreignKey": {
|
|
2627
|
+
"table": "folders",
|
|
2628
|
+
"column": "id",
|
|
2629
|
+
"onDelete": "NO ACTION",
|
|
2630
|
+
"onUpdate": "CASCADE"
|
|
2631
|
+
}
|
|
2632
|
+
},
|
|
2633
|
+
"tenant_id": {
|
|
2634
|
+
"type": "UUID",
|
|
2635
|
+
"referenceKind": "tenantId",
|
|
2636
|
+
"notNull": false,
|
|
2637
|
+
"unique": false
|
|
2638
|
+
},
|
|
2639
|
+
"name": {
|
|
2640
|
+
"type": "TEXT",
|
|
2641
|
+
"notNull": false,
|
|
2642
|
+
"unique": false
|
|
2643
|
+
},
|
|
2644
|
+
"description": {
|
|
2645
|
+
"type": "TEXT",
|
|
2646
|
+
"notNull": false,
|
|
2647
|
+
"unique": false
|
|
2648
|
+
},
|
|
2649
|
+
"owner_profile_id": {
|
|
2650
|
+
"type": "UUID",
|
|
2651
|
+
"referenceKind": "crossPackageRef",
|
|
2652
|
+
"notNull": false,
|
|
2653
|
+
"unique": false
|
|
2363
2654
|
}
|
|
2364
2655
|
},
|
|
2365
2656
|
"indexes": [
|
|
2366
2657
|
{
|
|
2367
|
-
"name": "
|
|
2658
|
+
"name": "folders_slug_context_idx",
|
|
2368
2659
|
"columns": [
|
|
2660
|
+
"tenant_id",
|
|
2369
2661
|
"slug",
|
|
2370
2662
|
"context"
|
|
2371
2663
|
],
|
|
2372
|
-
"unique": true
|
|
2664
|
+
"unique": true,
|
|
2665
|
+
"nullsNotDistinct": true
|
|
2373
2666
|
},
|
|
2374
2667
|
{
|
|
2375
|
-
"name": "
|
|
2668
|
+
"name": "folders_tenant_id_created_at_idx",
|
|
2376
2669
|
"columns": [
|
|
2670
|
+
"tenant_id",
|
|
2377
2671
|
"created_at"
|
|
2378
2672
|
]
|
|
2673
|
+
},
|
|
2674
|
+
{
|
|
2675
|
+
"name": "folders_parent_id_idx",
|
|
2676
|
+
"columns": [
|
|
2677
|
+
"parent_id"
|
|
2678
|
+
]
|
|
2679
|
+
},
|
|
2680
|
+
{
|
|
2681
|
+
"name": "folders_owner_profile_id_idx",
|
|
2682
|
+
"columns": [
|
|
2683
|
+
"owner_profile_id"
|
|
2684
|
+
]
|
|
2379
2685
|
}
|
|
2380
2686
|
],
|
|
2381
|
-
"version": "
|
|
2687
|
+
"version": "1d0b1fcb"
|
|
2382
2688
|
}
|
|
2383
2689
|
}
|
|
2384
2690
|
},
|
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.49.
|
|
6
|
+
"packageVersion": "0.49.4",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "b15d14fc8d900d7b1accf8388b00b6ca6dee6843a495075c9da764015dcc59cd",
|
|
11
|
+
"packageJson": "a1e8cb482cc97f55aed2fa18bc98217d13f09b5dd2045b999925c9a0d1100931",
|
|
12
12
|
"agents": "7d3a64dc7e114069e8a2357253360dcaa94550ed3662148e1b9146bf9cd30b79"
|
|
13
13
|
},
|
|
14
14
|
"exports": [
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
"name": "AssetAssociationCollection",
|
|
252
252
|
"qualifiedName": "@happyvertical/smrt-assets:AssetAssociationCollection",
|
|
253
253
|
"collection": "assetassociations",
|
|
254
|
-
"tableName": "
|
|
254
|
+
"tableName": "asset_associations",
|
|
255
255
|
"packageName": "@happyvertical/smrt-assets",
|
|
256
256
|
"extends": "SmrtJunction",
|
|
257
257
|
"fields": [],
|
|
@@ -629,7 +629,7 @@
|
|
|
629
629
|
"name": "AssetMetafieldCollection",
|
|
630
630
|
"qualifiedName": "@happyvertical/smrt-assets:AssetMetafieldCollection",
|
|
631
631
|
"collection": "assetmetafields",
|
|
632
|
-
"tableName": "
|
|
632
|
+
"tableName": "asset_metafields",
|
|
633
633
|
"packageName": "@happyvertical/smrt-assets",
|
|
634
634
|
"extends": "SmrtCollection",
|
|
635
635
|
"fields": [],
|
|
@@ -867,7 +867,7 @@
|
|
|
867
867
|
"name": "AssetStatusCollection",
|
|
868
868
|
"qualifiedName": "@happyvertical/smrt-assets:AssetStatusCollection",
|
|
869
869
|
"collection": "assetstatuses",
|
|
870
|
-
"tableName": "
|
|
870
|
+
"tableName": "asset_statuses",
|
|
871
871
|
"packageName": "@happyvertical/smrt-assets",
|
|
872
872
|
"extends": "SmrtCollection",
|
|
873
873
|
"fields": [],
|
|
@@ -1105,7 +1105,7 @@
|
|
|
1105
1105
|
"name": "AssetTypeCollection",
|
|
1106
1106
|
"qualifiedName": "@happyvertical/smrt-assets:AssetTypeCollection",
|
|
1107
1107
|
"collection": "assettypes",
|
|
1108
|
-
"tableName": "
|
|
1108
|
+
"tableName": "asset_types",
|
|
1109
1109
|
"packageName": "@happyvertical/smrt-assets",
|
|
1110
1110
|
"extends": "SmrtCollection",
|
|
1111
1111
|
"fields": [],
|
|
@@ -1773,7 +1773,7 @@
|
|
|
1773
1773
|
"name": "AssetCollection",
|
|
1774
1774
|
"qualifiedName": "@happyvertical/smrt-assets:AssetCollection",
|
|
1775
1775
|
"collection": "assets",
|
|
1776
|
-
"tableName": "
|
|
1776
|
+
"tableName": "assets",
|
|
1777
1777
|
"packageName": "@happyvertical/smrt-assets",
|
|
1778
1778
|
"extends": "SmrtCollection",
|
|
1779
1779
|
"fields": [],
|
|
@@ -2591,7 +2591,7 @@
|
|
|
2591
2591
|
"name": "FolderCollection",
|
|
2592
2592
|
"qualifiedName": "@happyvertical/smrt-assets:FolderCollection",
|
|
2593
2593
|
"collection": "folders",
|
|
2594
|
-
"tableName": "
|
|
2594
|
+
"tableName": "folders",
|
|
2595
2595
|
"packageName": "@happyvertical/smrt-assets",
|
|
2596
2596
|
"extends": "SmrtCollection",
|
|
2597
2597
|
"fields": [],
|
|
@@ -4032,7 +4032,7 @@
|
|
|
4032
4032
|
"junctionCollections": 1,
|
|
4033
4033
|
"hierarchicalObjects": 1,
|
|
4034
4034
|
"polymorphicAssociations": 1,
|
|
4035
|
-
"uuidColumns":
|
|
4035
|
+
"uuidColumns": 32
|
|
4036
4036
|
},
|
|
4037
4037
|
"agentDoc": "# @happyvertical/smrt-assets\n\nProvider-agnostic asset management with versioning, type classification, and generic/provenance associations.\n\n## Models\n\n- **Asset** (STI base): versioning via `primaryVersionId` chain + `version` number. `ownerProfileId`, `typeSlug`, `statusSlug`, `mimeType`, `sourceUri`. Derivation chain via `sourceAssetId` (R3-D — was `parentId` before the rename; column `source_asset_id`).\n- **AssetType** / **AssetStatus**: lookup tables for classification and lifecycle.\n- **AssetMetafield**: custom metadata field definitions with JSON validation rules.\n- **Folder**: hierarchical container for assets. Own `SmrtHierarchical` model with its own `folders` table (R3-D — was an STI subclass of Asset before). `Asset.folderId` points to the folder.\n- **AssetAssociation**: generic/provenance polymorphic join — `assetId` + `metaType` + `metaId` + `role` + `sortOrder`. Use it when a relationship is not owned by a base/domain model join table like `content_assets`, `profile_assets`, `event_assets`, `place_assets`, or `product_assets`.\n\n## Key Patterns\n\n- **Versioning**: `createNewVersion()` increments version, chains via `primaryVersionId`. `findVersions()` to retrieve history.\n- **Tag integration**: `addTag()`/`removeTag()` use raw `db.upsert()` on `asset_tags` join table (not a SMRT model).\n- **AssetStore**: abstraction for provider-agnostic file I/O (S3, local, etc.).\n- **Ownership rule**: base/domain-owned asset relationships should live on noun join tables such as `content_assets`, `profile_assets`, `event_assets`, `place_assets`, and `product_assets`; keep `AssetAssociation` for generic/provenance links like image derivation.\n\n## Runtime surface\n\nApps and agents should depend on the public **asset runtime** rather than hand-wiring a collection + store per-package (#1128).\n\n- `createAssetRuntime({ db, storage })` → `AssetRuntime` bundling `AssetCollection`, `AssetAssociationCollection`, and an initialized `AssetStore`.\n- `AssetRuntime.storeSourceAsset(name, data, opts)` — create a new source asset (record + bytes).\n- `AssetRuntime.storeDerivedAsset(source, name, data, opts)` — create a derivative with `sourceAssetId` set and (by default) a provenance `AssetAssociation` under a chosen role.\n- `AssetRuntime.linkDerivation(source, derivative, { role })` — record provenance without touching bytes.\n- `AssetRuntime.setExtractionStatus(asset, status, { error?, extractedAt? })` — write canonical extraction metadata into the asset's description JSON sidecar. Non-destructive: if `description` is free-form prose or non-object JSON, the original value is preserved under the reserved `text` key instead of being overwritten. Existing JSON objects are merged into.\n\nAgents that need asset I/O should accept an `AssetRuntimeLike` in their options rather than asking callers to pass a store + collection separately.\n\n## Serving contract\n\n- `serveAsset({ runtime, asset, tenantId?, disposition?, canAccess?, headers?, remoteMode? })` → standard Web `Response`.\n - `404` when the id doesn't resolve; `403` when the tenant mismatches or `canAccess` denies; `302` when `remoteMode: 'redirect'` and the asset's `sourceUri` is `http(s)`; `502` when `remoteMode: 'proxy'` and the origin fetch fails; `500` on store read errors or unexpected failures; `200` otherwise with `Content-Type`, `Content-Length`, and `Content-Disposition` set.\n - Assets whose `sourceUri` is `http(s)` are supported via `remoteMode`: `'proxy'` (default, fetch and return bytes), `'redirect'` (302 to the origin), or `'error'` (treat as misconfiguration). Pass `fetchImpl` to swap the fetch client.\n - `Content-Disposition` filenames are sanitised (control characters stripped, `\"` / `\\` / `/` replaced) to prevent header injection on untrusted asset names.\n - The 500 body is a generic `'Internal error serving asset'`; the underlying error is logged via `console.error` so operators can debug without leaking paths/bucket names to clients.\n - Works in SvelteKit `+server.ts` endpoints, Hono, and any runtime with a global `Response` (Node 18+). Pass `responseCtor` for older runtimes.\n- `resolveAssetForServing(options)` → `{ asset, data, contentType, filename, size }` when callers want to render their own framework response. Throws `AssetServeError(status)` on the same failure modes.\n\n## Source/derived vocabulary\n\nThe following roles are exported as `ASSET_ROLES` and should be preferred over ad-hoc strings when apps want cross-package tooling (serving, UI pickers) to agree on meaning:\n\n| Role | Use |\n|------|-----|\n| `source_document` | original upstream document (agenda PDF, minutes) |\n| `document_image` | page/extracted image derived from a source document |\n| `thumbnail` | preview rendition of another asset |\n| `proof` | non-canonical evidence asset backing a fact |\n| `derivation_source` | \"came from\" link on generated media |\n| `attachment` | generic owner-join link |\n| `hero` | primary/featured asset on an owner |\n\nCanonical metadata keys are exported as `ASSET_METADATA_KEYS`: `extractionStatus`, `extractionError`, `extractedAt`, `sourceUrl`, `sourceHash`, `pageNumber`. Extraction status values live in `ASSET_EXTRACTION_STATUS` (`pending | running | succeeded | failed`).\n\n## UI Registry\n\nThe `./ui` subpath exports `ASSETS_MODULE_META` and `ASSETS_UI_SLOTS` so registry-driven hosts (smrt-chat, dynamic admin shells) can discover the package's Svelte components without a hard import.\n\n```ts\nimport { ASSETS_MODULE_META, ASSETS_UI_SLOTS } from '@happyvertical/smrt-assets/ui';\nimport '@happyvertical/smrt-assets/svelte'; // side-effect: ModuleUIRegistry.register(...)\nimport { ModuleUIRegistry } from '@happyvertical/smrt-ui/registry';\n\nconst AssetManager = ModuleUIRegistry.get('@happyvertical/smrt-assets', 'asset-manager');\n```\n\nRegistered slots: `asset-manager` (admin), `asset-grid` / `asset-list` (list), `asset-detail` (detail), `asset-toolbar` / `asset-action-bar` (action), `asset-create-modal` (form). Slot IDs are stable contracts — host apps reference them by string.\n\n## Gotchas\n\n- **Files SDK is a lazy boundary (#1979)**: `AssetStore` loads `@happyvertical/files` through `src/files-runtime.ts` (bundler-invisible), because smrt-assets is reachable from provider-neutral consumer graphs via profiles. Node/tsx/vite-dev runtimes resolve it on first file operation; fully-bundled deployments import `@happyvertical/smrt-assets/filesystem` at startup. Never import the files SDK statically from modules reachable from `src/index.ts`.\n- **Version history manual**: `findVersions()` chaining required — no ORM shortcut\n- **Tag management uses raw SQL**: `asset_tags` is a join table, not an SMRT model\n- **Folder tree traversal**: via `SmrtHierarchical` (`getParent`/`getChildren`/`getAncestors`/`getDescendants`/`getHierarchy`/`moveTo`); `FolderCollection.getTree(rootId?)` and `getPath(folderId)` wrap these for convenience\n- **AssetAssociation polymorphic FK**: requires manual `metaType` string matching\n- **Optional tenancy**: assets can be global (tenantId=null) or tenant-scoped\n"
|
|
4038
4038
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-assets",
|
|
3
|
-
"version": "0.49.
|
|
3
|
+
"version": "0.49.4",
|
|
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.89.6",
|
|
47
47
|
"@happyvertical/files": "^0.89.6",
|
|
48
48
|
"@happyvertical/logger": "^0.89.6",
|
|
49
|
-
"@happyvertical/smrt-core": "0.49.
|
|
50
|
-
"@happyvertical/smrt-tags": "0.49.
|
|
51
|
-
"@happyvertical/smrt-tenancy": "0.49.
|
|
52
|
-
"@happyvertical/smrt-types": "0.49.
|
|
53
|
-
"@happyvertical/smrt-ui": "0.49.
|
|
49
|
+
"@happyvertical/smrt-core": "0.49.4",
|
|
50
|
+
"@happyvertical/smrt-tags": "0.49.4",
|
|
51
|
+
"@happyvertical/smrt-tenancy": "0.49.4",
|
|
52
|
+
"@happyvertical/smrt-types": "0.49.4",
|
|
53
|
+
"@happyvertical/smrt-ui": "0.49.4",
|
|
54
54
|
"@happyvertical/sql": "^0.89.6",
|
|
55
55
|
"@happyvertical/utils": "^0.89.6"
|
|
56
56
|
},
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@happyvertical/smrt-playground": "0.49.
|
|
67
|
-
"@happyvertical/smrt-vitest": "0.49.
|
|
66
|
+
"@happyvertical/smrt-playground": "0.49.4",
|
|
67
|
+
"@happyvertical/smrt-vitest": "0.49.4",
|
|
68
68
|
"@sveltejs/adapter-auto": "^7.0.1",
|
|
69
69
|
"@sveltejs/kit": "^2.69.1",
|
|
70
70
|
"@sveltejs/package": "^2.5.8",
|