@happyvertical/smrt-places 0.49.2 → 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 CHANGED
@@ -5,7 +5,7 @@ import { addOwnedAssetFromCollection, assertValidOwnedAssetRelationship, assertV
5
5
  import { TenantScoped, queryGlobal, queryWithGlobals, tenantId } from "@happyvertical/smrt-tenancy";
6
6
  import { getGeoAdapter } from "@happyvertical/geo";
7
7
  //#region src/__smrt-register__.ts
8
- ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":0,\"packageName\":\"@happyvertical/smrt-places\",\"packageVersion\":\"0.49.2\",\"objects\":{\"@happyvertical/smrt-places:PlaceAssetCollection\":{\"name\":\"placeassetcollection\",\"className\":\"PlaceAssetCollection\",\"qualifiedName\":\"@happyvertical/smrt-places:PlaceAssetCollection\",\"collection\":\"placeassets\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/places/src/collections/PlaceAssetCollection.ts\",\"packageName\":\"@happyvertical/smrt-places\",\"fields\":{},\"methods\":{\"byLeft\":{\"name\":\"byLeft\",\"async\":true,\"parameters\":[{\"name\":\"leftId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionFilterOptions\",\"optional\":true}],\"returnType\":\"Promise<TItem[]>\",\"isStatic\":false,\"isPublic\":true},\"byRight\":{\"name\":\"byRight\",\"async\":true,\"parameters\":[{\"name\":\"rightId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionFilterOptions\",\"optional\":true}],\"returnType\":\"Promise<TItem[]>\",\"isStatic\":false,\"isPublic\":true},\"attach\":{\"name\":\"attach\",\"async\":true,\"parameters\":[{\"name\":\"leftId\",\"type\":\"string\",\"optional\":false},{\"name\":\"rightId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionAttachOptions\",\"optional\":true}],\"returnType\":\"Promise<TItem>\",\"isStatic\":false,\"isPublic\":true},\"detach\":{\"name\":\"detach\",\"async\":true,\"parameters\":[{\"name\":\"leftId\",\"type\":\"string\",\"optional\":false},{\"name\":\"rightId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionFilterOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"setLinks\":{\"name\":\"setLinks\",\"async\":true,\"parameters\":[{\"name\":\"leftId\",\"type\":\"string\",\"optional\":false},{\"name\":\"rightIds\",\"type\":\"string[]\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionAttachOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getAssets\":{\"name\":\"getAssets\",\"async\":true,\"parameters\":[{\"name\":\"placeId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"addAsset\":{\"name\":\"addAsset\",\"async\":true,\"parameters\":[{\"name\":\"placeId\",\"type\":\"string\",\"optional\":false},{\"name\":\"asset\",\"type\":\"Asset\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"any\",\"optional\":true,\"default\":\"attachment\"},{\"name\":\"sortOrder\",\"type\":\"any\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"removeAsset\":{\"name\":\"removeAsset\",\"async\":true,\"parameters\":[{\"name\":\"placeId\",\"type\":\"string\",\"optional\":false},{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"api\":false,\"mcp\":false,\"cli\":false,\"tableName\":\"place_assets\"},\"extends\":\"SmrtJunction\",\"extendsTypeArg\":\"PlaceAsset\",\"exportName\":\"PlaceAssetCollection\",\"collectionExportName\":\"PlaceAssetCollectionCollection\",\"schema\":{\"tableName\":\"place_assets\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"place_assets\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"}},\"indexes\":[{\"name\":\"place_assets_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true},{\"name\":\"place_assets_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"ceff1c5e\"}},\"@happyvertical/smrt-places:PlaceCollection\":{\"name\":\"placecollection\",\"className\":\"PlaceCollection\",\"qualifiedName\":\"@happyvertical/smrt-places:PlaceCollection\",\"collection\":\"places\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/places/src/collections/PlaceCollection.ts\",\"packageName\":\"@happyvertical/smrt-places\",\"fields\":{},\"methods\":{\"lookupOrCreate\":{\"name\":\"lookupOrCreate\",\"async\":true,\"parameters\":[{\"name\":\"query\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"LookupOrCreateOptions\",\"optional\":true}],\"returnType\":\"Promise<Place | null>\",\"isStatic\":false,\"isPublic\":true},\"discoverNearby\":{\"name\":\"discoverNearby\",\"async\":true,\"parameters\":[{\"name\":\"latitude\",\"type\":\"number\",\"optional\":false},{\"name\":\"longitude\",\"type\":\"number\",\"optional\":false},{\"name\":\"radiusMeters\",\"type\":\"number\",\"optional\":false},{\"name\":\"options\",\"type\":\"DiscoverNearbyOptions\",\"optional\":true}],\"returnType\":\"Promise<Place[]>\",\"isStatic\":false,\"isPublic\":true},\"resolveTrackPlaces\":{\"name\":\"resolveTrackPlaces\",\"async\":true,\"parameters\":[{\"name\":\"points\",\"type\":\"ReadonlyArray<TrackPoint>\",\"optional\":false},{\"name\":\"options\",\"type\":\"ResolveTrackPlacesOptions\",\"optional\":true}],\"returnType\":\"Promise<TrackPlacesResult>\",\"isStatic\":false,\"isPublic\":true},\"getChildren\":{\"name\":\"getChildren\",\"async\":true,\"parameters\":[{\"name\":\"parentId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Place[]>\",\"isStatic\":false,\"isPublic\":true},\"getRootPlaces\":{\"name\":\"getRootPlaces\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Place[]>\",\"isStatic\":false,\"isPublic\":true},\"getByType\":{\"name\":\"getByType\",\"async\":true,\"parameters\":[{\"name\":\"typeSlug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Place[]>\",\"isStatic\":false,\"isPublic\":true},\"getHierarchy\":{\"name\":\"getHierarchy\",\"async\":true,\"parameters\":[{\"name\":\"placeId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getAssets\":{\"name\":\"getAssets\",\"async\":true,\"parameters\":[{\"name\":\"placeId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"addAsset\":{\"name\":\"addAsset\",\"async\":true,\"parameters\":[{\"name\":\"placeId\",\"type\":\"string\",\"optional\":false},{\"name\":\"asset\",\"type\":\"Asset\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"any\",\"optional\":true,\"default\":\"attachment\"},{\"name\":\"sortOrder\",\"type\":\"any\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"removeAsset\":{\"name\":\"removeAsset\",\"async\":true,\"parameters\":[{\"name\":\"placeId\",\"type\":\"string\",\"optional\":false},{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"searchByProximity\":{\"name\":\"searchByProximity\",\"async\":true,\"parameters\":[{\"name\":\"latitude\",\"type\":\"number\",\"optional\":false},{\"name\":\"longitude\",\"type\":\"number\",\"optional\":false},{\"name\":\"radiusKm\",\"type\":\"number\",\"optional\":true}],\"returnType\":\"Promise<Place[]>\",\"isStatic\":false,\"isPublic\":true},\"findByTenant\":{\"name\":\"findByTenant\",\"async\":true,\"parameters\":[{\"name\":\"tenantId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Place[]>\",\"isStatic\":false,\"isPublic\":true},\"findGlobal\":{\"name\":\"findGlobal\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Place[]>\",\"isStatic\":false,\"isPublic\":true},\"findWithGlobals\":{\"name\":\"findWithGlobals\",\"async\":true,\"parameters\":[{\"name\":\"tenantId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Place[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"Place\",\"exportName\":\"PlaceCollection\",\"collectionExportName\":\"PlaceCollectionCollection\",\"schema\":{\"tableName\":\"place_collections\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"place_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\":\"place_collections_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true},{\"name\":\"place_collections_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"d0da2f8d\"}},\"@happyvertical/smrt-places:PlaceTypeCollection\":{\"name\":\"placetypecollection\",\"className\":\"PlaceTypeCollection\",\"qualifiedName\":\"@happyvertical/smrt-places:PlaceTypeCollection\",\"collection\":\"placetypes\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/places/src/collections/PlaceTypeCollection.ts\",\"packageName\":\"@happyvertical/smrt-places\",\"fields\":{},\"methods\":{\"getOrCreate\":{\"name\":\"getOrCreate\",\"async\":true,\"parameters\":[{\"name\":\"slug\",\"type\":\"string\",\"optional\":false},{\"name\":\"name\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<PlaceType>\",\"isStatic\":false,\"isPublic\":true},\"getBySlug\":{\"name\":\"getBySlug\",\"async\":true,\"parameters\":[{\"name\":\"slug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<PlaceType | null>\",\"isStatic\":false,\"isPublic\":true},\"initializeDefaults\":{\"name\":\"initializeDefaults\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<PlaceType[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"PlaceType\",\"exportName\":\"PlaceTypeCollection\",\"collectionExportName\":\"PlaceTypeCollectionCollection\",\"schema\":{\"tableName\":\"place_type_collections\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"place_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\":\"place_type_collections_slug_context_idx\",\"columns\":[\"slug\",\"context\"],\"unique\":true},{\"name\":\"place_type_collections_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"b6691888\"}},\"@happyvertical/smrt-places:Place\":{\"name\":\"place\",\"className\":\"Place\",\"qualifiedName\":\"@happyvertical/smrt-places:Place\",\"collection\":\"places\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/places/src/models/Place.ts\",\"packageName\":\"@happyvertical/smrt-places\",\"fields\":{\"created_at\":{\"type\":\"datetime\",\"required\":false},\"updated_at\":{\"type\":\"datetime\",\"required\":false},\"parentId\":{\"type\":\"foreignKey\",\"required\":false,\"related\":\"Place\",\"_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}}},\"typeId\":{\"type\":\"foreignKey\",\"required\":false,\"related\":\"PlaceType\"},\"name\":{\"type\":\"text\",\"required\":false},\"description\":{\"type\":\"text\",\"required\":false},\"latitude\":{\"type\":\"decimal\",\"required\":false,\"_meta\":{}},\"longitude\":{\"type\":\"decimal\",\"required\":false,\"_meta\":{}},\"streetNumber\":{\"type\":\"text\",\"required\":false},\"streetName\":{\"type\":\"text\",\"required\":false},\"city\":{\"type\":\"text\",\"required\":false},\"region\":{\"type\":\"text\",\"required\":false},\"country\":{\"type\":\"text\",\"required\":false},\"postalCode\":{\"type\":\"text\",\"required\":false},\"countryCode\":{\"type\":\"text\",\"required\":false},\"timezone\":{\"type\":\"text\",\"required\":false},\"externalId\":{\"type\":\"text\",\"required\":false},\"source\":{\"type\":\"text\",\"required\":false},\"metadata\":{\"type\":\"text\",\"required\":false},\"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},\"getGeoData\":{\"name\":\"getGeoData\",\"async\":false,\"parameters\":[],\"returnType\":\"GeoData\",\"isStatic\":false,\"isPublic\":true},\"hasCoordinates\":{\"name\":\"hasCoordinates\",\"async\":false,\"parameters\":[],\"returnType\":\"boolean\",\"isStatic\":false,\"isPublic\":true},\"getMetadata\":{\"name\":\"getMetadata\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string, unknown>\",\"isStatic\":false,\"isPublic\":true},\"setMetadata\":{\"name\":\"setMetadata\",\"async\":false,\"parameters\":[{\"name\":\"data\",\"type\":\"Record<string, unknown>\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"updateMetadata\":{\"name\":\"updateMetadata\",\"async\":false,\"parameters\":[{\"name\":\"updates\",\"type\":\"Record<string, unknown>\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"getType\":{\"name\":\"getType\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getAssets\":{\"name\":\"getAssets\",\"async\":true,\"parameters\":[{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"addAsset\":{\"name\":\"addAsset\",\"async\":true,\"parameters\":[{\"name\":\"asset\",\"type\":\"Asset\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"any\",\"optional\":true,\"default\":\"attachment\"},{\"name\":\"sortOrder\",\"type\":\"any\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"removeAsset\":{\"name\":\"removeAsset\",\"async\":true,\"parameters\":[{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"cli\":{\"skipApiCheck\":true},\"tenantScoped\":{\"mode\":\"optional\"},\"conflictColumns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"]},\"extends\":\"SmrtHierarchical\",\"exportName\":\"Place\",\"collectionExportName\":\"PlaceCollection\",\"schema\":{\"tableName\":\"places\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"places\\\" (\\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 \\\"parent_id\\\" UUID,\\n \\\"tenant_id\\\" UUID,\\n \\\"type_id\\\" UUID,\\n \\\"name\\\" TEXT,\\n \\\"description\\\" TEXT,\\n \\\"latitude\\\" REAL,\\n \\\"longitude\\\" REAL,\\n \\\"street_number\\\" TEXT,\\n \\\"street_name\\\" TEXT,\\n \\\"city\\\" TEXT,\\n \\\"region\\\" TEXT,\\n \\\"country\\\" TEXT,\\n \\\"postal_code\\\" TEXT,\\n \\\"country_code\\\" TEXT,\\n \\\"timezone\\\" TEXT,\\n \\\"external_id\\\" TEXT,\\n \\\"source\\\" TEXT,\\n \\\"metadata\\\" 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\"},\"parent_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"places\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"type_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"place_types\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false},\"latitude\":{\"type\":\"REAL\",\"notNull\":false},\"longitude\":{\"type\":\"REAL\",\"notNull\":false},\"street_number\":{\"type\":\"TEXT\",\"notNull\":false},\"street_name\":{\"type\":\"TEXT\",\"notNull\":false},\"city\":{\"type\":\"TEXT\",\"notNull\":false},\"region\":{\"type\":\"TEXT\",\"notNull\":false},\"country\":{\"type\":\"TEXT\",\"notNull\":false},\"postal_code\":{\"type\":\"TEXT\",\"notNull\":false},\"country_code\":{\"type\":\"TEXT\",\"notNull\":false},\"timezone\":{\"type\":\"TEXT\",\"notNull\":false},\"external_id\":{\"type\":\"TEXT\",\"notNull\":false},\"source\":{\"type\":\"TEXT\",\"notNull\":false},\"metadata\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"places_slug_context_meta_type_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"places_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"places_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"places_parent_id_idx\",\"columns\":[\"parent_id\"]},{\"name\":\"places_type_id_idx\",\"columns\":[\"type_id\"]}],\"version\":\"f670088c\"}},\"@happyvertical/smrt-places:PlaceAsset\":{\"name\":\"placeasset\",\"className\":\"PlaceAsset\",\"qualifiedName\":\"@happyvertical/smrt-places:PlaceAsset\",\"collection\":\"placeassets\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/places/src/models/PlaceAsset.ts\",\"packageName\":\"@happyvertical/smrt-places\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"placeId\":{\"type\":\"foreignKey\",\"required\":true,\"related\":\"Place\",\"_meta\":{\"required\":true}},\"assetId\":{\"type\":\"crossPackageRef\",\"required\":true,\"related\":\"@happyvertical/smrt-assets:Asset\"},\"relationship\":{\"type\":\"text\",\"required\":true,\"_meta\":{\"required\":true}},\"sortOrder\":{\"type\":\"integer\",\"required\":true,\"default\":0}},\"methods\":{},\"decoratorConfig\":{\"tableName\":\"place_assets\",\"conflictColumns\":[\"place_id\",\"asset_id\",\"relationship\"],\"api\":false,\"mcp\":false,\"cli\":false,\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"PlaceAsset\",\"collectionExportName\":\"PlaceAssetCollection\",\"validationRules\":[{\"field\":\"placeId\",\"rule\":\"required\",\"fieldType\":\"foreignKey\"},{\"field\":\"assetId\",\"rule\":\"required\",\"fieldType\":\"crossPackageRef\"},{\"field\":\"relationship\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"sortOrder\",\"rule\":\"required\",\"fieldType\":\"integer\"}],\"schema\":{\"tableName\":\"place_assets\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"place_assets\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"place_id\\\" UUID NOT NULL,\\n \\\"asset_id\\\" UUID NOT NULL,\\n \\\"relationship\\\" TEXT NOT NULL,\\n \\\"sort_order\\\" INTEGER NOT NULL DEFAULT 0\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"place_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":true,\"unique\":false,\"foreignKey\":{\"table\":\"places\",\"column\":\"id\",\"onDelete\":\"CASCADE\",\"onUpdate\":\"CASCADE\"}},\"asset_id\":{\"type\":\"UUID\",\"referenceKind\":\"crossPackageRef\",\"notNull\":true,\"unique\":false},\"relationship\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false},\"sort_order\":{\"type\":\"INTEGER\",\"notNull\":true,\"unique\":false,\"default\":0}},\"indexes\":[{\"name\":\"place_assets_place_id_asset_id_idx\",\"columns\":[\"place_id\",\"asset_id\",\"relationship\"],\"unique\":true},{\"name\":\"place_assets_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"place_assets_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"place_assets_asset_id_idx\",\"columns\":[\"asset_id\"]}],\"version\":\"adf47666\"}},\"@happyvertical/smrt-places:PlaceType\":{\"name\":\"placetype\",\"className\":\"PlaceType\",\"qualifiedName\":\"@happyvertical/smrt-places:PlaceType\",\"collection\":\"placetypes\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/places/src/models/PlaceType.ts\",\"packageName\":\"@happyvertical/smrt-places\",\"fields\":{\"created_at\":{\"type\":\"datetime\",\"required\":false},\"updated_at\":{\"type\":\"datetime\",\"required\":false},\"name\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"description\":{\"type\":\"text\",\"required\":false},\"createdAt\":{\"type\":\"text\",\"required\":false},\"updatedAt\":{\"type\":\"text\",\"required\":false}},\"methods\":{\"getBySlug\":{\"name\":\"getBySlug\",\"async\":true,\"parameters\":[{\"name\":\"_slug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<PlaceType | 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\":\"PlaceType\",\"collectionExportName\":\"PlaceTypeCollection\",\"validationRules\":[{\"field\":\"name\",\"rule\":\"required\",\"fieldType\":\"text\"}],\"schema\":{\"tableName\":\"place_types\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"place_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 DEFAULT '',\\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,\"default\":\"\"},\"description\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"place_types_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"place_types_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"place_types_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"8c3bb691\"}}},\"moduleType\":\"smrt\",\"smrtDependencies\":[\"@happyvertical/smrt-assets\",\"@happyvertical/smrt-core\",\"@happyvertical/smrt-tenancy\"]}"));
8
+ ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":0,\"packageName\":\"@happyvertical/smrt-places\",\"packageVersion\":\"0.49.4\",\"objects\":{\"@happyvertical/smrt-places:PlaceAssetCollection\":{\"name\":\"placeassetcollection\",\"className\":\"PlaceAssetCollection\",\"qualifiedName\":\"@happyvertical/smrt-places:PlaceAssetCollection\",\"collection\":\"placeassets\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/places/src/collections/PlaceAssetCollection.ts\",\"packageName\":\"@happyvertical/smrt-places\",\"fields\":{},\"methods\":{\"byLeft\":{\"name\":\"byLeft\",\"async\":true,\"parameters\":[{\"name\":\"leftId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionFilterOptions\",\"optional\":true}],\"returnType\":\"Promise<TItem[]>\",\"isStatic\":false,\"isPublic\":true},\"byRight\":{\"name\":\"byRight\",\"async\":true,\"parameters\":[{\"name\":\"rightId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionFilterOptions\",\"optional\":true}],\"returnType\":\"Promise<TItem[]>\",\"isStatic\":false,\"isPublic\":true},\"attach\":{\"name\":\"attach\",\"async\":true,\"parameters\":[{\"name\":\"leftId\",\"type\":\"string\",\"optional\":false},{\"name\":\"rightId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionAttachOptions\",\"optional\":true}],\"returnType\":\"Promise<TItem>\",\"isStatic\":false,\"isPublic\":true},\"detach\":{\"name\":\"detach\",\"async\":true,\"parameters\":[{\"name\":\"leftId\",\"type\":\"string\",\"optional\":false},{\"name\":\"rightId\",\"type\":\"string\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionFilterOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"setLinks\":{\"name\":\"setLinks\",\"async\":true,\"parameters\":[{\"name\":\"leftId\",\"type\":\"string\",\"optional\":false},{\"name\":\"rightIds\",\"type\":\"string[]\",\"optional\":false},{\"name\":\"opts\",\"type\":\"JunctionAttachOptions\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"getAssets\":{\"name\":\"getAssets\",\"async\":true,\"parameters\":[{\"name\":\"placeId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"addAsset\":{\"name\":\"addAsset\",\"async\":true,\"parameters\":[{\"name\":\"placeId\",\"type\":\"string\",\"optional\":false},{\"name\":\"asset\",\"type\":\"Asset\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"any\",\"optional\":true,\"default\":\"attachment\"},{\"name\":\"sortOrder\",\"type\":\"any\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"removeAsset\":{\"name\":\"removeAsset\",\"async\":true,\"parameters\":[{\"name\":\"placeId\",\"type\":\"string\",\"optional\":false},{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"api\":false,\"mcp\":false,\"cli\":false,\"tableName\":\"place_assets\"},\"extends\":\"SmrtJunction\",\"extendsTypeArg\":\"PlaceAsset\",\"exportName\":\"PlaceAssetCollection\",\"collectionExportName\":\"PlaceAssetCollectionCollection\",\"schema\":{\"tableName\":\"place_assets\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"place_assets\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"place_id\\\" UUID NOT NULL,\\n \\\"asset_id\\\" UUID NOT NULL,\\n \\\"relationship\\\" TEXT NOT NULL,\\n \\\"sort_order\\\" INTEGER NOT NULL DEFAULT 0\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"place_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":true,\"unique\":false,\"foreignKey\":{\"table\":\"places\",\"column\":\"id\",\"onDelete\":\"CASCADE\",\"onUpdate\":\"CASCADE\"}},\"asset_id\":{\"type\":\"UUID\",\"referenceKind\":\"crossPackageRef\",\"notNull\":true,\"unique\":false},\"relationship\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false},\"sort_order\":{\"type\":\"INTEGER\",\"notNull\":true,\"unique\":false,\"default\":0}},\"indexes\":[{\"name\":\"place_assets_place_id_asset_id_idx\",\"columns\":[\"place_id\",\"asset_id\",\"relationship\"],\"unique\":true},{\"name\":\"place_assets_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"place_assets_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"place_assets_asset_id_idx\",\"columns\":[\"asset_id\"]}],\"version\":\"adf47666\"}},\"@happyvertical/smrt-places:PlaceCollection\":{\"name\":\"placecollection\",\"className\":\"PlaceCollection\",\"qualifiedName\":\"@happyvertical/smrt-places:PlaceCollection\",\"collection\":\"places\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/places/src/collections/PlaceCollection.ts\",\"packageName\":\"@happyvertical/smrt-places\",\"fields\":{},\"methods\":{\"lookupOrCreate\":{\"name\":\"lookupOrCreate\",\"async\":true,\"parameters\":[{\"name\":\"query\",\"type\":\"string\",\"optional\":false},{\"name\":\"options\",\"type\":\"LookupOrCreateOptions\",\"optional\":true}],\"returnType\":\"Promise<Place | null>\",\"isStatic\":false,\"isPublic\":true},\"discoverNearby\":{\"name\":\"discoverNearby\",\"async\":true,\"parameters\":[{\"name\":\"latitude\",\"type\":\"number\",\"optional\":false},{\"name\":\"longitude\",\"type\":\"number\",\"optional\":false},{\"name\":\"radiusMeters\",\"type\":\"number\",\"optional\":false},{\"name\":\"options\",\"type\":\"DiscoverNearbyOptions\",\"optional\":true}],\"returnType\":\"Promise<Place[]>\",\"isStatic\":false,\"isPublic\":true},\"resolveTrackPlaces\":{\"name\":\"resolveTrackPlaces\",\"async\":true,\"parameters\":[{\"name\":\"points\",\"type\":\"ReadonlyArray<TrackPoint>\",\"optional\":false},{\"name\":\"options\",\"type\":\"ResolveTrackPlacesOptions\",\"optional\":true}],\"returnType\":\"Promise<TrackPlacesResult>\",\"isStatic\":false,\"isPublic\":true},\"getChildren\":{\"name\":\"getChildren\",\"async\":true,\"parameters\":[{\"name\":\"parentId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Place[]>\",\"isStatic\":false,\"isPublic\":true},\"getRootPlaces\":{\"name\":\"getRootPlaces\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Place[]>\",\"isStatic\":false,\"isPublic\":true},\"getByType\":{\"name\":\"getByType\",\"async\":true,\"parameters\":[{\"name\":\"typeSlug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Place[]>\",\"isStatic\":false,\"isPublic\":true},\"getHierarchy\":{\"name\":\"getHierarchy\",\"async\":true,\"parameters\":[{\"name\":\"placeId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getAssets\":{\"name\":\"getAssets\",\"async\":true,\"parameters\":[{\"name\":\"placeId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"addAsset\":{\"name\":\"addAsset\",\"async\":true,\"parameters\":[{\"name\":\"placeId\",\"type\":\"string\",\"optional\":false},{\"name\":\"asset\",\"type\":\"Asset\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"any\",\"optional\":true,\"default\":\"attachment\"},{\"name\":\"sortOrder\",\"type\":\"any\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"removeAsset\":{\"name\":\"removeAsset\",\"async\":true,\"parameters\":[{\"name\":\"placeId\",\"type\":\"string\",\"optional\":false},{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"searchByProximity\":{\"name\":\"searchByProximity\",\"async\":true,\"parameters\":[{\"name\":\"latitude\",\"type\":\"number\",\"optional\":false},{\"name\":\"longitude\",\"type\":\"number\",\"optional\":false},{\"name\":\"radiusKm\",\"type\":\"number\",\"optional\":true}],\"returnType\":\"Promise<Place[]>\",\"isStatic\":false,\"isPublic\":true},\"findByTenant\":{\"name\":\"findByTenant\",\"async\":true,\"parameters\":[{\"name\":\"tenantId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Place[]>\",\"isStatic\":false,\"isPublic\":true},\"findGlobal\":{\"name\":\"findGlobal\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<Place[]>\",\"isStatic\":false,\"isPublic\":true},\"findWithGlobals\":{\"name\":\"findWithGlobals\",\"async\":true,\"parameters\":[{\"name\":\"tenantId\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<Place[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"Place\",\"exportName\":\"PlaceCollection\",\"collectionExportName\":\"PlaceCollectionCollection\",\"schema\":{\"tableName\":\"places\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"places\\\" (\\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 \\\"parent_id\\\" UUID,\\n \\\"tenant_id\\\" UUID,\\n \\\"type_id\\\" UUID,\\n \\\"name\\\" TEXT,\\n \\\"description\\\" TEXT,\\n \\\"latitude\\\" REAL,\\n \\\"longitude\\\" REAL,\\n \\\"street_number\\\" TEXT,\\n \\\"street_name\\\" TEXT,\\n \\\"city\\\" TEXT,\\n \\\"region\\\" TEXT,\\n \\\"country\\\" TEXT,\\n \\\"postal_code\\\" TEXT,\\n \\\"country_code\\\" TEXT,\\n \\\"timezone\\\" TEXT,\\n \\\"external_id\\\" TEXT,\\n \\\"source\\\" TEXT,\\n \\\"metadata\\\" 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\"},\"parent_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"places\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"type_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"place_types\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false},\"latitude\":{\"type\":\"REAL\",\"notNull\":false},\"longitude\":{\"type\":\"REAL\",\"notNull\":false},\"street_number\":{\"type\":\"TEXT\",\"notNull\":false},\"street_name\":{\"type\":\"TEXT\",\"notNull\":false},\"city\":{\"type\":\"TEXT\",\"notNull\":false},\"region\":{\"type\":\"TEXT\",\"notNull\":false},\"country\":{\"type\":\"TEXT\",\"notNull\":false},\"postal_code\":{\"type\":\"TEXT\",\"notNull\":false},\"country_code\":{\"type\":\"TEXT\",\"notNull\":false},\"timezone\":{\"type\":\"TEXT\",\"notNull\":false},\"external_id\":{\"type\":\"TEXT\",\"notNull\":false},\"source\":{\"type\":\"TEXT\",\"notNull\":false},\"metadata\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"places_slug_context_meta_type_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"places_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"places_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"places_parent_id_idx\",\"columns\":[\"parent_id\"]},{\"name\":\"places_type_id_idx\",\"columns\":[\"type_id\"]}],\"version\":\"f670088c\"}},\"@happyvertical/smrt-places:PlaceTypeCollection\":{\"name\":\"placetypecollection\",\"className\":\"PlaceTypeCollection\",\"qualifiedName\":\"@happyvertical/smrt-places:PlaceTypeCollection\",\"collection\":\"placetypes\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/places/src/collections/PlaceTypeCollection.ts\",\"packageName\":\"@happyvertical/smrt-places\",\"fields\":{},\"methods\":{\"getOrCreate\":{\"name\":\"getOrCreate\",\"async\":true,\"parameters\":[{\"name\":\"slug\",\"type\":\"string\",\"optional\":false},{\"name\":\"name\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<PlaceType>\",\"isStatic\":false,\"isPublic\":true},\"getBySlug\":{\"name\":\"getBySlug\",\"async\":true,\"parameters\":[{\"name\":\"slug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<PlaceType | null>\",\"isStatic\":false,\"isPublic\":true},\"initializeDefaults\":{\"name\":\"initializeDefaults\",\"async\":true,\"parameters\":[],\"returnType\":\"Promise<PlaceType[]>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{},\"extends\":\"SmrtCollection\",\"extendsTypeArg\":\"PlaceType\",\"exportName\":\"PlaceTypeCollection\",\"collectionExportName\":\"PlaceTypeCollectionCollection\",\"schema\":{\"tableName\":\"place_types\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"place_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 DEFAULT '',\\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,\"default\":\"\"},\"description\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"place_types_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"place_types_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"place_types_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"8c3bb691\"}},\"@happyvertical/smrt-places:Place\":{\"name\":\"place\",\"className\":\"Place\",\"qualifiedName\":\"@happyvertical/smrt-places:Place\",\"collection\":\"places\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/places/src/models/Place.ts\",\"packageName\":\"@happyvertical/smrt-places\",\"fields\":{\"created_at\":{\"type\":\"datetime\",\"required\":false},\"updated_at\":{\"type\":\"datetime\",\"required\":false},\"parentId\":{\"type\":\"foreignKey\",\"required\":false,\"related\":\"Place\",\"_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}}},\"typeId\":{\"type\":\"foreignKey\",\"required\":false,\"related\":\"PlaceType\"},\"name\":{\"type\":\"text\",\"required\":false},\"description\":{\"type\":\"text\",\"required\":false},\"latitude\":{\"type\":\"decimal\",\"required\":false,\"_meta\":{}},\"longitude\":{\"type\":\"decimal\",\"required\":false,\"_meta\":{}},\"streetNumber\":{\"type\":\"text\",\"required\":false},\"streetName\":{\"type\":\"text\",\"required\":false},\"city\":{\"type\":\"text\",\"required\":false},\"region\":{\"type\":\"text\",\"required\":false},\"country\":{\"type\":\"text\",\"required\":false},\"postalCode\":{\"type\":\"text\",\"required\":false},\"countryCode\":{\"type\":\"text\",\"required\":false},\"timezone\":{\"type\":\"text\",\"required\":false},\"externalId\":{\"type\":\"text\",\"required\":false},\"source\":{\"type\":\"text\",\"required\":false},\"metadata\":{\"type\":\"text\",\"required\":false},\"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},\"getGeoData\":{\"name\":\"getGeoData\",\"async\":false,\"parameters\":[],\"returnType\":\"GeoData\",\"isStatic\":false,\"isPublic\":true},\"hasCoordinates\":{\"name\":\"hasCoordinates\",\"async\":false,\"parameters\":[],\"returnType\":\"boolean\",\"isStatic\":false,\"isPublic\":true},\"getMetadata\":{\"name\":\"getMetadata\",\"async\":false,\"parameters\":[],\"returnType\":\"Record<string, unknown>\",\"isStatic\":false,\"isPublic\":true},\"setMetadata\":{\"name\":\"setMetadata\",\"async\":false,\"parameters\":[{\"name\":\"data\",\"type\":\"Record<string, unknown>\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"updateMetadata\":{\"name\":\"updateMetadata\",\"async\":false,\"parameters\":[{\"name\":\"updates\",\"type\":\"Record<string, unknown>\",\"optional\":false}],\"returnType\":\"void\",\"isStatic\":false,\"isPublic\":true},\"getType\":{\"name\":\"getType\",\"async\":true,\"parameters\":[],\"returnType\":\"any\",\"isStatic\":false,\"isPublic\":true},\"getAssets\":{\"name\":\"getAssets\",\"async\":true,\"parameters\":[{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<Asset[]>\",\"isStatic\":false,\"isPublic\":true},\"addAsset\":{\"name\":\"addAsset\",\"async\":true,\"parameters\":[{\"name\":\"asset\",\"type\":\"Asset\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"any\",\"optional\":true,\"default\":\"attachment\"},{\"name\":\"sortOrder\",\"type\":\"any\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true},\"removeAsset\":{\"name\":\"removeAsset\",\"async\":true,\"parameters\":[{\"name\":\"assetId\",\"type\":\"string\",\"optional\":false},{\"name\":\"relationship\",\"type\":\"string\",\"optional\":true}],\"returnType\":\"Promise<void>\",\"isStatic\":false,\"isPublic\":true}},\"decoratorConfig\":{\"tableStrategy\":\"sti\",\"api\":{\"include\":[\"list\",\"get\",\"create\",\"update\",\"delete\"]},\"mcp\":{\"include\":[\"list\",\"get\",\"create\",\"update\"]},\"cli\":{\"skipApiCheck\":true},\"tenantScoped\":{\"mode\":\"optional\"},\"conflictColumns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"]},\"extends\":\"SmrtHierarchical\",\"exportName\":\"Place\",\"collectionExportName\":\"PlaceCollection\",\"schema\":{\"tableName\":\"places\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"places\\\" (\\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 \\\"parent_id\\\" UUID,\\n \\\"tenant_id\\\" UUID,\\n \\\"type_id\\\" UUID,\\n \\\"name\\\" TEXT,\\n \\\"description\\\" TEXT,\\n \\\"latitude\\\" REAL,\\n \\\"longitude\\\" REAL,\\n \\\"street_number\\\" TEXT,\\n \\\"street_name\\\" TEXT,\\n \\\"city\\\" TEXT,\\n \\\"region\\\" TEXT,\\n \\\"country\\\" TEXT,\\n \\\"postal_code\\\" TEXT,\\n \\\"country_code\\\" TEXT,\\n \\\"timezone\\\" TEXT,\\n \\\"external_id\\\" TEXT,\\n \\\"source\\\" TEXT,\\n \\\"metadata\\\" 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\"},\"parent_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"places\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false},\"type_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":false,\"foreignKey\":{\"table\":\"place_types\",\"column\":\"id\",\"onDelete\":\"NO ACTION\",\"onUpdate\":\"CASCADE\"}},\"name\":{\"type\":\"TEXT\",\"notNull\":false},\"description\":{\"type\":\"TEXT\",\"notNull\":false},\"latitude\":{\"type\":\"REAL\",\"notNull\":false},\"longitude\":{\"type\":\"REAL\",\"notNull\":false},\"street_number\":{\"type\":\"TEXT\",\"notNull\":false},\"street_name\":{\"type\":\"TEXT\",\"notNull\":false},\"city\":{\"type\":\"TEXT\",\"notNull\":false},\"region\":{\"type\":\"TEXT\",\"notNull\":false},\"country\":{\"type\":\"TEXT\",\"notNull\":false},\"postal_code\":{\"type\":\"TEXT\",\"notNull\":false},\"country_code\":{\"type\":\"TEXT\",\"notNull\":false},\"timezone\":{\"type\":\"TEXT\",\"notNull\":false},\"external_id\":{\"type\":\"TEXT\",\"notNull\":false},\"source\":{\"type\":\"TEXT\",\"notNull\":false},\"metadata\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"places_slug_context_meta_type_idx\",\"columns\":[\"tenant_id\",\"slug\",\"context\",\"_meta_type\"],\"unique\":true,\"nullsNotDistinct\":true},{\"name\":\"places_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"places_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"places_parent_id_idx\",\"columns\":[\"parent_id\"]},{\"name\":\"places_type_id_idx\",\"columns\":[\"type_id\"]}],\"version\":\"f670088c\"}},\"@happyvertical/smrt-places:PlaceAsset\":{\"name\":\"placeasset\",\"className\":\"PlaceAsset\",\"qualifiedName\":\"@happyvertical/smrt-places:PlaceAsset\",\"collection\":\"placeassets\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/places/src/models/PlaceAsset.ts\",\"packageName\":\"@happyvertical/smrt-places\",\"fields\":{\"tenantId\":{\"type\":\"text\",\"required\":false,\"_meta\":{\"sqlType\":\"UUID\",\"nullable\":true,\"__tenancy\":{\"isTenantIdField\":true,\"autoFilter\":true,\"required\":false,\"autoPopulate\":true,\"nullable\":true,\"mode\":\"optional\",\"field\":\"tenantId\",\"allowSuperAdminBypass\":false}}},\"placeId\":{\"type\":\"foreignKey\",\"required\":true,\"related\":\"Place\",\"_meta\":{\"required\":true}},\"assetId\":{\"type\":\"crossPackageRef\",\"required\":true,\"related\":\"@happyvertical/smrt-assets:Asset\"},\"relationship\":{\"type\":\"text\",\"required\":true,\"_meta\":{\"required\":true}},\"sortOrder\":{\"type\":\"integer\",\"required\":true,\"default\":0}},\"methods\":{},\"decoratorConfig\":{\"tableName\":\"place_assets\",\"conflictColumns\":[\"place_id\",\"asset_id\",\"relationship\"],\"api\":false,\"mcp\":false,\"cli\":false,\"tenantScoped\":{\"mode\":\"optional\"}},\"extends\":\"SmrtObject\",\"exportName\":\"PlaceAsset\",\"collectionExportName\":\"PlaceAssetCollection\",\"validationRules\":[{\"field\":\"placeId\",\"rule\":\"required\",\"fieldType\":\"foreignKey\"},{\"field\":\"assetId\",\"rule\":\"required\",\"fieldType\":\"crossPackageRef\"},{\"field\":\"relationship\",\"rule\":\"required\",\"fieldType\":\"text\"},{\"field\":\"sortOrder\",\"rule\":\"required\",\"fieldType\":\"integer\"}],\"schema\":{\"tableName\":\"place_assets\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"place_assets\\\" (\\n \\\"id\\\" UUID PRIMARY KEY NOT NULL,\\n \\\"slug\\\" TEXT NOT NULL,\\n \\\"context\\\" TEXT NOT NULL DEFAULT '',\\n \\\"created_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"updated_at\\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\\"tenant_id\\\" UUID,\\n \\\"place_id\\\" UUID NOT NULL,\\n \\\"asset_id\\\" UUID NOT NULL,\\n \\\"relationship\\\" TEXT NOT NULL,\\n \\\"sort_order\\\" INTEGER NOT NULL DEFAULT 0\\n);\",\"columns\":{\"id\":{\"type\":\"UUID\",\"primaryKey\":true,\"referenceKind\":\"id\",\"notNull\":true},\"slug\":{\"type\":\"TEXT\",\"notNull\":true},\"context\":{\"type\":\"TEXT\",\"notNull\":true,\"default\":\"\"},\"created_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"updated_at\":{\"type\":\"TIMESTAMP\",\"notNull\":true,\"default\":\"current_timestamp\"},\"tenant_id\":{\"type\":\"UUID\",\"referenceKind\":\"tenantId\",\"notNull\":false,\"unique\":false},\"place_id\":{\"type\":\"UUID\",\"referenceKind\":\"foreignKey\",\"notNull\":true,\"unique\":false,\"foreignKey\":{\"table\":\"places\",\"column\":\"id\",\"onDelete\":\"CASCADE\",\"onUpdate\":\"CASCADE\"}},\"asset_id\":{\"type\":\"UUID\",\"referenceKind\":\"crossPackageRef\",\"notNull\":true,\"unique\":false},\"relationship\":{\"type\":\"TEXT\",\"notNull\":true,\"unique\":false},\"sort_order\":{\"type\":\"INTEGER\",\"notNull\":true,\"unique\":false,\"default\":0}},\"indexes\":[{\"name\":\"place_assets_place_id_asset_id_idx\",\"columns\":[\"place_id\",\"asset_id\",\"relationship\"],\"unique\":true},{\"name\":\"place_assets_slug_context_idx\",\"columns\":[\"slug\",\"context\"]},{\"name\":\"place_assets_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]},{\"name\":\"place_assets_asset_id_idx\",\"columns\":[\"asset_id\"]}],\"version\":\"adf47666\"}},\"@happyvertical/smrt-places:PlaceType\":{\"name\":\"placetype\",\"className\":\"PlaceType\",\"qualifiedName\":\"@happyvertical/smrt-places:PlaceType\",\"collection\":\"placetypes\",\"filePath\":\"/home/runner/work/smrt/smrt/packages/places/src/models/PlaceType.ts\",\"packageName\":\"@happyvertical/smrt-places\",\"fields\":{\"created_at\":{\"type\":\"datetime\",\"required\":false},\"updated_at\":{\"type\":\"datetime\",\"required\":false},\"name\":{\"type\":\"text\",\"required\":true,\"default\":\"\",\"_meta\":{\"required\":true}},\"description\":{\"type\":\"text\",\"required\":false},\"createdAt\":{\"type\":\"text\",\"required\":false},\"updatedAt\":{\"type\":\"text\",\"required\":false}},\"methods\":{\"getBySlug\":{\"name\":\"getBySlug\",\"async\":true,\"parameters\":[{\"name\":\"_slug\",\"type\":\"string\",\"optional\":false}],\"returnType\":\"Promise<PlaceType | 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\":\"PlaceType\",\"collectionExportName\":\"PlaceTypeCollection\",\"validationRules\":[{\"field\":\"name\",\"rule\":\"required\",\"fieldType\":\"text\"}],\"schema\":{\"tableName\":\"place_types\",\"ddl\":\"CREATE TABLE IF NOT EXISTS \\\"place_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 DEFAULT '',\\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,\"default\":\"\"},\"description\":{\"type\":\"TEXT\",\"notNull\":false}},\"indexes\":[{\"name\":\"place_types_slug_context_meta_type_idx\",\"columns\":[\"slug\",\"context\",\"_meta_type\"],\"unique\":true},{\"name\":\"place_types_meta_type_idx\",\"columns\":[\"_meta_type\"]},{\"name\":\"place_types_created_at_idx\",\"columns\":[\"created_at\"]}],\"version\":\"8c3bb691\"}}},\"moduleType\":\"smrt\",\"smrtDependencies\":[\"@happyvertical/smrt-assets\",\"@happyvertical/smrt-core\",\"@happyvertical/smrt-tenancy\"]}"));
9
9
  //#endregion
10
10
  //#region src/models/PlaceAsset.ts
11
11
  var __defProp$2 = Object.defineProperty;
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-places",
5
- "packageVersion": "0.49.2",
5
+ "packageVersion": "0.49.4",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-places:PlaceAssetCollection": {
8
8
  "name": "placeassetcollection",
@@ -209,7 +209,7 @@
209
209
  "collectionExportName": "PlaceAssetCollectionCollection",
210
210
  "schema": {
211
211
  "tableName": "place_assets",
212
- "ddl": "CREATE TABLE IF NOT EXISTS \"place_assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
212
+ "ddl": "CREATE TABLE IF NOT EXISTS \"place_assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"place_id\" UUID NOT NULL,\n \"asset_id\" UUID NOT NULL,\n \"relationship\" TEXT NOT NULL,\n \"sort_order\" INTEGER NOT NULL DEFAULT 0\n);",
213
213
  "columns": {
214
214
  "id": {
215
215
  "type": "UUID",
@@ -235,25 +235,75 @@
235
235
  "type": "TIMESTAMP",
236
236
  "notNull": true,
237
237
  "default": "current_timestamp"
238
+ },
239
+ "tenant_id": {
240
+ "type": "UUID",
241
+ "referenceKind": "tenantId",
242
+ "notNull": false,
243
+ "unique": false
244
+ },
245
+ "place_id": {
246
+ "type": "UUID",
247
+ "referenceKind": "foreignKey",
248
+ "notNull": true,
249
+ "unique": false,
250
+ "foreignKey": {
251
+ "table": "places",
252
+ "column": "id",
253
+ "onDelete": "CASCADE",
254
+ "onUpdate": "CASCADE"
255
+ }
256
+ },
257
+ "asset_id": {
258
+ "type": "UUID",
259
+ "referenceKind": "crossPackageRef",
260
+ "notNull": true,
261
+ "unique": false
262
+ },
263
+ "relationship": {
264
+ "type": "TEXT",
265
+ "notNull": true,
266
+ "unique": false
267
+ },
268
+ "sort_order": {
269
+ "type": "INTEGER",
270
+ "notNull": true,
271
+ "unique": false,
272
+ "default": 0
238
273
  }
239
274
  },
240
275
  "indexes": [
276
+ {
277
+ "name": "place_assets_place_id_asset_id_idx",
278
+ "columns": [
279
+ "place_id",
280
+ "asset_id",
281
+ "relationship"
282
+ ],
283
+ "unique": true
284
+ },
241
285
  {
242
286
  "name": "place_assets_slug_context_idx",
243
287
  "columns": [
244
288
  "slug",
245
289
  "context"
246
- ],
247
- "unique": true
290
+ ]
248
291
  },
249
292
  {
250
- "name": "place_assets_created_at_idx",
293
+ "name": "place_assets_tenant_id_created_at_idx",
251
294
  "columns": [
295
+ "tenant_id",
252
296
  "created_at"
253
297
  ]
298
+ },
299
+ {
300
+ "name": "place_assets_asset_id_idx",
301
+ "columns": [
302
+ "asset_id"
303
+ ]
254
304
  }
255
305
  ],
256
- "version": "ceff1c5e"
306
+ "version": "adf47666"
257
307
  }
258
308
  },
259
309
  "@happyvertical/smrt-places:PlaceCollection": {
@@ -522,8 +572,8 @@
522
572
  "exportName": "PlaceCollection",
523
573
  "collectionExportName": "PlaceCollectionCollection",
524
574
  "schema": {
525
- "tableName": "place_collections",
526
- "ddl": "CREATE TABLE IF NOT EXISTS \"place_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);",
575
+ "tableName": "places",
576
+ "ddl": "CREATE TABLE IF NOT EXISTS \"places\" (\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 \"parent_id\" UUID,\n \"tenant_id\" UUID,\n \"type_id\" UUID,\n \"name\" TEXT,\n \"description\" TEXT,\n \"latitude\" REAL,\n \"longitude\" REAL,\n \"street_number\" TEXT,\n \"street_name\" TEXT,\n \"city\" TEXT,\n \"region\" TEXT,\n \"country\" TEXT,\n \"postal_code\" TEXT,\n \"country_code\" TEXT,\n \"timezone\" TEXT,\n \"external_id\" TEXT,\n \"source\" TEXT,\n \"metadata\" TEXT\n);",
527
577
  "columns": {
528
578
  "id": {
529
579
  "type": "UUID",
@@ -540,6 +590,14 @@
540
590
  "notNull": true,
541
591
  "default": ""
542
592
  },
593
+ "_meta_type": {
594
+ "type": "TEXT",
595
+ "notNull": true
596
+ },
597
+ "_meta_data": {
598
+ "type": "JSON",
599
+ "notNull": false
600
+ },
543
601
  "created_at": {
544
602
  "type": "TIMESTAMP",
545
603
  "notNull": true,
@@ -549,25 +607,134 @@
549
607
  "type": "TIMESTAMP",
550
608
  "notNull": true,
551
609
  "default": "current_timestamp"
610
+ },
611
+ "parent_id": {
612
+ "type": "UUID",
613
+ "referenceKind": "foreignKey",
614
+ "notNull": false,
615
+ "foreignKey": {
616
+ "table": "places",
617
+ "column": "id",
618
+ "onDelete": "NO ACTION",
619
+ "onUpdate": "CASCADE"
620
+ }
621
+ },
622
+ "tenant_id": {
623
+ "type": "UUID",
624
+ "referenceKind": "tenantId",
625
+ "notNull": false
626
+ },
627
+ "type_id": {
628
+ "type": "UUID",
629
+ "referenceKind": "foreignKey",
630
+ "notNull": false,
631
+ "foreignKey": {
632
+ "table": "place_types",
633
+ "column": "id",
634
+ "onDelete": "NO ACTION",
635
+ "onUpdate": "CASCADE"
636
+ }
637
+ },
638
+ "name": {
639
+ "type": "TEXT",
640
+ "notNull": false
641
+ },
642
+ "description": {
643
+ "type": "TEXT",
644
+ "notNull": false
645
+ },
646
+ "latitude": {
647
+ "type": "REAL",
648
+ "notNull": false
649
+ },
650
+ "longitude": {
651
+ "type": "REAL",
652
+ "notNull": false
653
+ },
654
+ "street_number": {
655
+ "type": "TEXT",
656
+ "notNull": false
657
+ },
658
+ "street_name": {
659
+ "type": "TEXT",
660
+ "notNull": false
661
+ },
662
+ "city": {
663
+ "type": "TEXT",
664
+ "notNull": false
665
+ },
666
+ "region": {
667
+ "type": "TEXT",
668
+ "notNull": false
669
+ },
670
+ "country": {
671
+ "type": "TEXT",
672
+ "notNull": false
673
+ },
674
+ "postal_code": {
675
+ "type": "TEXT",
676
+ "notNull": false
677
+ },
678
+ "country_code": {
679
+ "type": "TEXT",
680
+ "notNull": false
681
+ },
682
+ "timezone": {
683
+ "type": "TEXT",
684
+ "notNull": false
685
+ },
686
+ "external_id": {
687
+ "type": "TEXT",
688
+ "notNull": false
689
+ },
690
+ "source": {
691
+ "type": "TEXT",
692
+ "notNull": false
693
+ },
694
+ "metadata": {
695
+ "type": "TEXT",
696
+ "notNull": false
552
697
  }
553
698
  },
554
699
  "indexes": [
555
700
  {
556
- "name": "place_collections_slug_context_idx",
701
+ "name": "places_slug_context_meta_type_idx",
557
702
  "columns": [
703
+ "tenant_id",
558
704
  "slug",
559
- "context"
705
+ "context",
706
+ "_meta_type"
560
707
  ],
561
- "unique": true
708
+ "unique": true,
709
+ "nullsNotDistinct": true
562
710
  },
563
711
  {
564
- "name": "place_collections_created_at_idx",
712
+ "name": "places_meta_type_idx",
713
+ "columns": [
714
+ "_meta_type"
715
+ ]
716
+ },
717
+ {
718
+ "name": "places_tenant_id_created_at_idx",
565
719
  "columns": [
720
+ "tenant_id",
566
721
  "created_at"
567
722
  ]
723
+ },
724
+ {
725
+ "name": "places_parent_id_idx",
726
+ "columns": [
727
+ "parent_id"
728
+ ]
729
+ },
730
+ {
731
+ "name": "places_type_id_idx",
732
+ "columns": [
733
+ "type_id"
734
+ ]
568
735
  }
569
736
  ],
570
- "version": "d0da2f8d"
737
+ "version": "f670088c"
571
738
  }
572
739
  },
573
740
  "@happyvertical/smrt-places:PlaceTypeCollection": {
@@ -627,8 +794,8 @@
627
794
  "exportName": "PlaceTypeCollection",
628
795
  "collectionExportName": "PlaceTypeCollectionCollection",
629
796
  "schema": {
630
- "tableName": "place_type_collections",
631
- "ddl": "CREATE TABLE IF NOT EXISTS \"place_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);",
797
+ "tableName": "place_types",
798
+ "ddl": "CREATE TABLE IF NOT EXISTS \"place_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 DEFAULT '',\n \"description\" TEXT\n);",
632
799
  "columns": {
633
800
  "id": {
634
801
  "type": "UUID",
@@ -645,6 +812,14 @@
645
812
  "notNull": true,
646
813
  "default": ""
647
814
  },
815
+ "_meta_type": {
816
+ "type": "TEXT",
817
+ "notNull": true
818
+ },
819
+ "_meta_data": {
820
+ "type": "JSON",
821
+ "notNull": false
822
+ },
648
823
  "created_at": {
649
824
  "type": "TIMESTAMP",
650
825
  "notNull": true,
@@ -654,25 +829,41 @@
654
829
  "type": "TIMESTAMP",
655
830
  "notNull": true,
656
831
  "default": "current_timestamp"
832
+ },
833
+ "name": {
834
+ "type": "TEXT",
835
+ "notNull": false,
836
+ "default": ""
837
+ },
838
+ "description": {
839
+ "type": "TEXT",
840
+ "notNull": false
657
841
  }
658
842
  },
659
843
  "indexes": [
660
844
  {
661
- "name": "place_type_collections_slug_context_idx",
845
+ "name": "place_types_slug_context_meta_type_idx",
662
846
  "columns": [
663
847
  "slug",
664
- "context"
848
+ "context",
849
+ "_meta_type"
665
850
  ],
666
851
  "unique": true
667
852
  },
668
853
  {
669
- "name": "place_type_collections_created_at_idx",
854
+ "name": "place_types_meta_type_idx",
855
+ "columns": [
856
+ "_meta_type"
857
+ ]
858
+ },
859
+ {
860
+ "name": "place_types_created_at_idx",
670
861
  "columns": [
671
862
  "created_at"
672
863
  ]
673
864
  }
674
865
  ],
675
- "version": "b6691888"
866
+ "version": "8c3bb691"
676
867
  }
677
868
  },
678
869
  "@happyvertical/smrt-places:Place": {
@@ -1147,7 +1338,8 @@
1147
1338
  "context",
1148
1339
  "_meta_type"
1149
1340
  ],
1150
- "unique": true
1341
+ "unique": true,
1342
+ "nullsNotDistinct": true
1151
1343
  },
1152
1344
  {
1153
1345
  "name": "places_meta_type_idx",
@@ -3,12 +3,12 @@
3
3
  "sensitiveFieldsExcluded": true,
4
4
  "generatedAt": "1970-01-01T00:00:00.000Z",
5
5
  "packageName": "@happyvertical/smrt-places",
6
- "packageVersion": "0.49.2",
6
+ "packageVersion": "0.49.4",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "650d19082303925b2de4c317fd598914b69d363e5d9f79486c6ec938c0993f3a",
11
- "packageJson": "11a534965eb05a2da0940e0d915412d4e04dd85444a973ccbab3a895cea6fb2c",
10
+ "manifest": "eb5cf523eb343ba5350394894869ed32c89eae12688ddd515ef61d7b511dcb51",
11
+ "packageJson": "8b613a5a274f50b2f424b8bdf65086fcc648cb134d6b9a0f56cd224ed39ba3bc",
12
12
  "agents": "1f12a465f3ef103ac0ba27bcec1ec2b982fd0f5e8a63b9a42738f2c79ecebe49"
13
13
  },
14
14
  "exports": [
@@ -222,7 +222,7 @@
222
222
  "name": "PlaceCollection",
223
223
  "qualifiedName": "@happyvertical/smrt-places:PlaceCollection",
224
224
  "collection": "places",
225
- "tableName": "place_collections",
225
+ "tableName": "places",
226
226
  "packageName": "@happyvertical/smrt-places",
227
227
  "extends": "SmrtCollection",
228
228
  "fields": [],
@@ -656,7 +656,7 @@
656
656
  "name": "PlaceTypeCollection",
657
657
  "qualifiedName": "@happyvertical/smrt-places:PlaceTypeCollection",
658
658
  "collection": "placetypes",
659
- "tableName": "place_type_collections",
659
+ "tableName": "place_types",
660
660
  "packageName": "@happyvertical/smrt-places",
661
661
  "extends": "SmrtCollection",
662
662
  "fields": [],
@@ -2219,7 +2219,7 @@
2219
2219
  "junctionCollections": 1,
2220
2220
  "hierarchicalObjects": 1,
2221
2221
  "polymorphicAssociations": 0,
2222
- "uuidColumns": 12
2222
+ "uuidColumns": 18
2223
2223
  },
2224
2224
  "agentDoc": "# @happyvertical/smrt-places\n\nHierarchical geographic database with organic growth via geocoding integration.\n\n## Models\n\n- **Place** (STI): hierarchical via `parentId`. Optional geo fields (all nullable — supports abstract places like game zones). `externalId`/`source` from geocoder. Metadata JSON.\n- **PlaceAsset**: dedicated owned-asset join in `place_assets` with `relationship` and `sortOrder`.\n- **PlaceType**: slug-based classification (country, city, building, zone, room, region).\n\n## Key Collection Methods\n\n| Method | Purpose |\n|--------|---------|\n| `lookupOrCreate(query)` | DB first → geocode if not found → create. Organic growth pattern. |\n| `findByCoordinates(lat, lng, threshold)` | Default 0.0001° ≈ 11m tolerance at equator |\n| `searchByProximity(lat, lng, radiusKm)` | Haversine distance, sorted by proximity |\n| `findWithGlobals(tenantId)` | Tenant + global (tenantId=null) places |\n| `getRootPlaces()`, `getByType(slug)` | Hierarchy + type queries |\n| `getAssets()` / `addAsset()` / `removeAsset()` | Owned asset helpers on both `Place` and `PlaceCollection`, backed by `place_assets` |\n\nHierarchy traversal: `getParent()`, `getChildren()`, `getAncestors()`, `getDescendants()`, `getHierarchy()`.\n\n## Gotchas\n\n- **Geo providers**: Google Maps needs `GOOGLE_MAPS_API_KEY`; OpenStreetMap is default\n- **Abstract places allowed**: lat/lng nullable — supports non-geographic locations\n- **Coordinate tolerance varies by latitude**: 0.0001° ≈ 11m at equator, less at poles\n- **Optional tenancy** with nullable tenantId\n"
2225
2225
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-places",
3
- "version": "0.49.2",
3
+ "version": "0.49.4",
4
4
  "description": "Hierarchical place management with geo integration and SMRT framework support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -28,14 +28,14 @@
28
28
  "@happyvertical/files": "^0.89.6",
29
29
  "@happyvertical/geo": "^0.89.6",
30
30
  "@happyvertical/logger": "^0.89.6",
31
- "@happyvertical/smrt-assets": "0.49.2",
32
- "@happyvertical/smrt-core": "0.49.2",
33
- "@happyvertical/smrt-tenancy": "0.49.2",
31
+ "@happyvertical/smrt-assets": "0.49.4",
32
+ "@happyvertical/smrt-core": "0.49.4",
33
+ "@happyvertical/smrt-tenancy": "0.49.4",
34
34
  "@happyvertical/sql": "^0.89.6",
35
35
  "@happyvertical/utils": "^0.89.6"
36
36
  },
37
37
  "devDependencies": {
38
- "@happyvertical/smrt-vitest": "0.49.2",
38
+ "@happyvertical/smrt-vitest": "0.49.4",
39
39
  "@types/node": "24.13.2",
40
40
  "fast-glob": "3.3.3",
41
41
  "typescript": "5.9.3",