@happyvertical/smrt-properties 0.51.31 → 0.51.33

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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=__smrt-register__.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"__smrt-register__.d.ts","sourceRoot":"","sources":["../src/__smrt-register__.ts"],"names":[],"mappings":""}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * PropertyCollection - Collection manager for Property objects
3
+ *
4
+ * Provides querying and management operations for Property entities.
5
+ */
6
+ import { SmrtCollection } from '@happyvertical/smrt-core';
7
+ import { Property } from '../models/Property';
8
+ import type { PropertyStatus } from '../types';
9
+ export declare class PropertyCollection extends SmrtCollection<Property> {
10
+ static readonly _itemClass: typeof Property;
11
+ /**
12
+ * Find a property by domain
13
+ *
14
+ * @param domain - Domain name
15
+ * @returns Property or null
16
+ */
17
+ findByDomain(domain: string): Promise<Property | null>;
18
+ /**
19
+ * Find properties by repository ID
20
+ *
21
+ * @param repositoryId - Repository ID
22
+ * @returns Array of properties
23
+ */
24
+ findByRepository(repositoryId: string): Promise<Property[]>;
25
+ /**
26
+ * Find properties by owner ID
27
+ *
28
+ * @param ownerId - Owner profile ID
29
+ * @returns Array of properties
30
+ */
31
+ findByOwner(ownerId: string): Promise<Property[]>;
32
+ /**
33
+ * Find active properties
34
+ *
35
+ * @returns Array of active properties
36
+ */
37
+ findActive(): Promise<Property[]>;
38
+ /**
39
+ * Find properties by status
40
+ *
41
+ * @param status - Property status
42
+ * @returns Array of properties with the given status
43
+ */
44
+ findByStatus(status: PropertyStatus): Promise<Property[]>;
45
+ /**
46
+ * Get or create a property by domain
47
+ *
48
+ * @param domain - Domain name
49
+ * @param defaults - Default values for creation
50
+ * @returns Property (existing or newly created)
51
+ */
52
+ getOrCreateByDomain(domain: string, defaults?: {
53
+ name?: string;
54
+ url?: string;
55
+ repositoryId?: string | null;
56
+ ownerId?: string | null;
57
+ }): Promise<Property>;
58
+ /**
59
+ * Count properties by status
60
+ *
61
+ * @returns Object with counts per status
62
+ */
63
+ countByStatus(): Promise<Record<PropertyStatus, number>>;
64
+ /**
65
+ * Find properties belonging to a specific tenant
66
+ *
67
+ * @param tenantId - Tenant ID to filter by
68
+ * @returns Array of properties for the tenant
69
+ */
70
+ findByTenant(tenantId: string): Promise<Property[]>;
71
+ /**
72
+ * Find all global properties (no tenant association).
73
+ *
74
+ * Routes through the shared tenant-global helper so it does not throw under
75
+ * an active tenant context (an explicit `tenant_id IS NULL` filter would be
76
+ * flagged as an isolation violation). (#1600)
77
+ *
78
+ * @returns Array of global properties
79
+ */
80
+ findGlobal(): Promise<Property[]>;
81
+ /**
82
+ * Find properties for a tenant plus all global properties.
83
+ *
84
+ * Fails closed if an active tenant context requests a different tenant's
85
+ * rows; the admin/system path keeps the cross-tenant capability. (#1600)
86
+ *
87
+ * @param tenantId - Tenant ID to filter by
88
+ * @returns Array of tenant-specific and global properties
89
+ */
90
+ findWithGlobals(tenantId: string): Promise<Property[]>;
91
+ }
92
+ //# sourceMappingURL=Properties.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Properties.d.ts","sourceRoot":"","sources":["../../src/collections/Properties.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,qBAAa,kBAAmB,SAAQ,cAAc,CAAC,QAAQ,CAAC;IAC9D,MAAM,CAAC,QAAQ,CAAC,UAAU,kBAAY;IAEtC;;;;;OAKG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAQ5D;;;;;OAKG;IACG,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAMjE;;;;;OAKG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAMvD;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAMvC;;;;;OAKG;IACG,YAAY,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAM/D;;;;;;OAMG;IACG,mBAAmB,CACvB,MAAM,EAAE,MAAM,EACd,QAAQ,GAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC7B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACpB,GACL,OAAO,CAAC,QAAQ,CAAC;IAkBpB;;;;OAIG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IAmB9D;;;;;OAKG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAIzD;;;;;;;;OAQG;IACG,UAAU,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAIvC;;;;;;;;OAQG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;CAO7D"}
@@ -0,0 +1,137 @@
1
+ /**
2
+ * ZoneCollection - Collection manager for Zone objects
3
+ *
4
+ * Provides querying and tree operations for Zone entities.
5
+ */
6
+ import { SmrtCollection } from '@happyvertical/smrt-core';
7
+ import { Zone } from '../models/Zone';
8
+ import type { ZoneTree } from '../types';
9
+ export declare class ZoneCollection extends SmrtCollection<Zone> {
10
+ static readonly _itemClass: typeof Zone;
11
+ /**
12
+ * Find all zones for a property
13
+ *
14
+ * @param propertyId - Property ID
15
+ * @returns Array of zones
16
+ */
17
+ findByProperty(propertyId: string): Promise<Zone[]>;
18
+ /**
19
+ * Find top-level zones for a property (no parent)
20
+ *
21
+ * @param propertyId - Property ID
22
+ * @returns Array of top-level zones
23
+ */
24
+ findTopLevel(propertyId: string): Promise<Zone[]>;
25
+ /**
26
+ * Find direct children of a zone
27
+ *
28
+ * @param parentId - Parent zone ID
29
+ * @returns Array of child zones
30
+ */
31
+ findChildren(parentId: string): Promise<Zone[]>;
32
+ /**
33
+ * Find zones by path pattern
34
+ *
35
+ * @param propertyId - Property ID
36
+ * @param path - URL path to match
37
+ * @returns Array of matching zones
38
+ */
39
+ findByPath(propertyId: string, path: string): Promise<Zone[]>;
40
+ /**
41
+ * Find zones by type
42
+ *
43
+ * @param propertyId - Property ID
44
+ * @param type - Zone type
45
+ * @returns Array of zones of the given type
46
+ */
47
+ findByType(propertyId: string, type: string): Promise<Zone[]>;
48
+ /**
49
+ * Get the complete zone tree for a property
50
+ *
51
+ * @param propertyId - Property ID
52
+ * @returns ZoneTree structure
53
+ */
54
+ getTree(propertyId: string): Promise<ZoneTree<Zone>>;
55
+ /**
56
+ * Get all ancestors of a zone (path to root)
57
+ *
58
+ * @param zoneId - Zone ID
59
+ * @returns Array of ancestors (from root to parent)
60
+ */
61
+ getAncestors(zoneId: string): Promise<Zone[]>;
62
+ /**
63
+ * Get all descendants of a zone recursively
64
+ *
65
+ * @param zoneId - Zone ID
66
+ * @returns Array of all descendant zones
67
+ */
68
+ getDescendants(zoneId: string): Promise<Zone[]>;
69
+ /**
70
+ * Get the depth of the deepest zone in a property
71
+ *
72
+ * @param propertyId - Property ID
73
+ * @returns Maximum depth (0 = only top-level zones)
74
+ */
75
+ getMaxDepth(propertyId: string): Promise<number>;
76
+ /**
77
+ * Find zones with specific dimensions
78
+ *
79
+ * @param propertyId - Property ID
80
+ * @param width - Required width
81
+ * @param height - Required height
82
+ * @returns Array of matching zones
83
+ */
84
+ findByDimensions(propertyId: string, width: number, height: number): Promise<Zone[]>;
85
+ /**
86
+ * Find zones that allow a specific format
87
+ *
88
+ * @param propertyId - Property ID
89
+ * @param format - Format to check
90
+ * @returns Array of zones allowing the format
91
+ */
92
+ findByAllowedFormat(propertyId: string, format: string): Promise<Zone[]>;
93
+ /**
94
+ * Move a zone to a new parent
95
+ *
96
+ * @param zoneId - Zone ID to move
97
+ * @param newParentId - New parent ID (null for top-level)
98
+ * @returns Updated zone
99
+ */
100
+ moveZone(zoneId: string, newParentId: string | null): Promise<Zone | null>;
101
+ /**
102
+ * Delete a zone and optionally its descendants
103
+ *
104
+ * @param zoneId - Zone ID to delete
105
+ * @param cascade - Whether to delete descendants
106
+ * @returns Number of zones deleted
107
+ */
108
+ deleteZone(zoneId: string, cascade?: boolean): Promise<number>;
109
+ /**
110
+ * Find zones belonging to a specific tenant
111
+ *
112
+ * @param tenantId - Tenant ID to filter by
113
+ * @returns Array of zones for the tenant
114
+ */
115
+ findByTenant(tenantId: string): Promise<Zone[]>;
116
+ /**
117
+ * Find all global zones (no tenant association).
118
+ *
119
+ * Routes through the shared tenant-global helper so it does not throw under
120
+ * an active tenant context (an explicit `tenant_id IS NULL` filter would be
121
+ * flagged as an isolation violation). (#1600)
122
+ *
123
+ * @returns Array of global zones
124
+ */
125
+ findGlobal(): Promise<Zone[]>;
126
+ /**
127
+ * Find zones for a tenant plus all global zones.
128
+ *
129
+ * Fails closed if an active tenant context requests a different tenant's
130
+ * rows; the admin/system path keeps the cross-tenant capability. (#1600)
131
+ *
132
+ * @param tenantId - Tenant ID to filter by
133
+ * @returns Array of tenant-specific and global zones
134
+ */
135
+ findWithGlobals(tenantId: string): Promise<Zone[]>;
136
+ }
137
+ //# sourceMappingURL=Zones.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Zones.d.ts","sourceRoot":"","sources":["../../src/collections/Zones.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,IAAI,EAAE,M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EAClB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,EAAE,CAAC;IAKlB;;;;;;OAMG;IACG,QAAQ,CACZ,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,IAAI,GACzB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAkBvB;;;;;;OAMG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,OAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IA+B3E;;;;;OAKG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAIrD;;;;;;;;OAQG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAInC;;;;;;;;OAQG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;CAGzD"}
@@ -0,0 +1,3 @@
1
+ export { PropertyCollection } from './Properties';
2
+ export { ZoneCollection } from './Zones';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collections/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC"}