@happyvertical/smrt-events 0.34.0 → 0.34.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/collections/EventCollection.d.ts +9 -2
- package/dist/collections/EventCollection.d.ts.map +1 -1
- package/dist/collections/EventParticipantCollection.d.ts +13 -0
- package/dist/collections/EventParticipantCollection.d.ts.map +1 -1
- package/dist/collections/EventSeriesCollection.d.ts +9 -2
- package/dist/collections/EventSeriesCollection.d.ts.map +1 -1
- package/dist/collections/EventTypeCollection.d.ts +9 -2
- package/dist/collections/EventTypeCollection.d.ts.map +1 -1
- package/dist/index.js +58 -24
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +2 -2
- package/dist/smrt-knowledge.json +4 -4
- package/package.json +9 -9
|
@@ -92,13 +92,20 @@ export declare class EventCollection extends SmrtCollection<Event> {
|
|
|
92
92
|
*/
|
|
93
93
|
findByTenant(tenantId: string): Promise<Event[]>;
|
|
94
94
|
/**
|
|
95
|
-
* Find all global events (no tenant association)
|
|
95
|
+
* Find all global events (no tenant association).
|
|
96
|
+
*
|
|
97
|
+
* Routes through the shared tenant-global helper so it does not throw under
|
|
98
|
+
* an active tenant context (an explicit `tenant_id IS NULL` filter would be
|
|
99
|
+
* flagged as an isolation violation). (#1600)
|
|
96
100
|
*
|
|
97
101
|
* @returns Array of Event instances with no tenant
|
|
98
102
|
*/
|
|
99
103
|
findGlobal(): Promise<Event[]>;
|
|
100
104
|
/**
|
|
101
|
-
* Find events for a tenant including global events
|
|
105
|
+
* Find events for a tenant including global events.
|
|
106
|
+
*
|
|
107
|
+
* Fails closed if an active tenant context requests a different tenant's
|
|
108
|
+
* rows; the admin/system path keeps the cross-tenant capability. (#1600)
|
|
102
109
|
*
|
|
103
110
|
* @param tenantId - Tenant ID to filter by
|
|
104
111
|
* @returns Array of Event instances for the tenant and global events
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventCollection.d.ts","sourceRoot":"","sources":["../../src/collections/EventCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAMxD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"EventCollection.d.ts","sourceRoot":"","sources":["../../src/collections/EventCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAMxD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEhE,qBAAa,eAAgB,SAAQ,cAAc,CAAC,KAAK,CAAC;IACxD,MAAM,CAAC,QAAQ,CAAC,UAAU,eAAS;IAEnC;;;;;OAKG;IACG,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAIvD;;;;;OAKG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAInD;;;;;;OAMG;IACG,cAAc,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAStE;;;;;OAKG;IACG,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAcnD;;;;;OAKG;IACG,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAIxD;;;;;OAKG;IACG,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAIjD;;;;OAIG;IACG,aAAa,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAKvC;;;;;OAKG;IACG,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAIrD;;;;;OAKG;IACG,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAOpD,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAInE,QAAQ,CACZ,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,KAAK,EACZ,YAAY,SAAe,EAC3B,SAAS,SAAI,GACZ,OAAO,CAAC,IAAI,CAAC;IAWV,WAAW,CACf,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC;IAUhB;;;;;;OAMG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAmD3E;;;;OAIG;IACG,aAAa,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IASvC;;;;;OAKG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAItD;;;;;;;;OAQG;IACG,UAAU,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;IAIpC;;;;;;;;OAQG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;CAG1D"}
|
|
@@ -36,7 +36,20 @@ export declare class EventParticipantCollection extends SmrtJunction<EventPartic
|
|
|
36
36
|
byPlacement: Record<number, number>;
|
|
37
37
|
}>;
|
|
38
38
|
findByTenant(tenantId: string): Promise<EventParticipant[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Find all global participants (no tenant association).
|
|
41
|
+
*
|
|
42
|
+
* Routes through the shared tenant-global helper so it does not throw under
|
|
43
|
+
* an active tenant context (an explicit `tenant_id IS NULL` filter would be
|
|
44
|
+
* flagged as an isolation violation). (#1600)
|
|
45
|
+
*/
|
|
39
46
|
findGlobal(): Promise<EventParticipant[]>;
|
|
47
|
+
/**
|
|
48
|
+
* Find participants for a tenant plus all global participants.
|
|
49
|
+
*
|
|
50
|
+
* Fails closed if an active tenant context requests a different tenant's
|
|
51
|
+
* rows; the admin/system path keeps the cross-tenant capability. (#1600)
|
|
52
|
+
*/
|
|
40
53
|
findWithGlobals(tenantId: string): Promise<EventParticipant[]>;
|
|
41
54
|
}
|
|
42
55
|
//# sourceMappingURL=EventParticipantCollection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventParticipantCollection.d.ts","sourceRoot":"","sources":["../../src/collections/EventParticipantCollection.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAQ,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"EventParticipantCollection.d.ts","sourceRoot":"","sources":["../../src/collections/EventParticipantCollection.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAQ,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAIzD,qBACa,0BAA2B,SAAQ,YAAY,CAAC,gBAAgB,CAAC;IAC5E,MAAM,CAAC,QAAQ,CAAC,UAAU,0BAAoB;IAC9C,SAAS,CAAC,SAAS,SAAa;IAChC,SAAS,CAAC,UAAU,SAAe;IAGnC,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC1C,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAQ;IAM9C;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAWlE;;OAEG;IACG,UAAU,CACd,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAI9B;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAI3D;;OAEG;IACG,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAI3D;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAqB5E;;OAEG;IACG,mBAAmB,CACvB,SAAS,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC;QACT,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC/B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACrC,CAAC;IAqCI,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAIjE;;;;;;OAMG;IACG,UAAU,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAI/C;;;;;OAKG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;CAOrE"}
|
|
@@ -46,13 +46,20 @@ export declare class EventSeriesCollection extends SmrtCollection<EventSeries> {
|
|
|
46
46
|
*/
|
|
47
47
|
findByTenant(tenantId: string): Promise<EventSeries[]>;
|
|
48
48
|
/**
|
|
49
|
-
* Find all global event series (no tenant association)
|
|
49
|
+
* Find all global event series (no tenant association).
|
|
50
|
+
*
|
|
51
|
+
* Routes through the shared tenant-global helper so it does not throw under
|
|
52
|
+
* an active tenant context (an explicit `tenant_id IS NULL` filter would be
|
|
53
|
+
* flagged as an isolation violation). (#1600)
|
|
50
54
|
*
|
|
51
55
|
* @returns Array of EventSeries instances with no tenant
|
|
52
56
|
*/
|
|
53
57
|
findGlobal(): Promise<EventSeries[]>;
|
|
54
58
|
/**
|
|
55
|
-
* Find event series for a tenant including global series
|
|
59
|
+
* Find event series for a tenant including global series.
|
|
60
|
+
*
|
|
61
|
+
* Fails closed if an active tenant context requests a different tenant's
|
|
62
|
+
* rows; the admin/system path keeps the cross-tenant capability. (#1600)
|
|
56
63
|
*
|
|
57
64
|
* @param tenantId - Tenant ID to filter by
|
|
58
65
|
* @returns Array of EventSeries instances for the tenant and global series
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventSeriesCollection.d.ts","sourceRoot":"","sources":["../../src/collections/EventSeriesCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"EventSeriesCollection.d.ts","sourceRoot":"","sources":["../../src/collections/EventSeriesCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEzD,qBAAa,qBAAsB,SAAQ,cAAc,CAAC,WAAW,CAAC;IACpE,MAAM,CAAC,QAAQ,CAAC,UAAU,qBAAe;IAEzC;;;;;OAKG;IACG,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAIjE;;;;OAIG;IACG,SAAS,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAWzC;;;;;OAKG;IACG,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAczD;;;;;OAKG;IACG,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAIvD;;;;;;OAMG;IACG,MAAM,CACV,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,WAAW,EAAE,CAAC;IAsCzB;;;;;OAKG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAI5D;;;;;;;;OAQG;IACG,UAAU,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAI1C;;;;;;;;OAQG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAOhE"}
|
|
@@ -37,13 +37,20 @@ export declare class EventTypeCollection extends SmrtCollection<EventType> {
|
|
|
37
37
|
*/
|
|
38
38
|
findByTenant(tenantId: string): Promise<EventType[]>;
|
|
39
39
|
/**
|
|
40
|
-
* Find all global event types (no tenant association)
|
|
40
|
+
* Find all global event types (no tenant association).
|
|
41
|
+
*
|
|
42
|
+
* Routes through the shared tenant-global helper so it does not throw under
|
|
43
|
+
* an active tenant context (an explicit `tenant_id IS NULL` filter would be
|
|
44
|
+
* flagged as an isolation violation). (#1600)
|
|
41
45
|
*
|
|
42
46
|
* @returns Array of EventType instances with no tenant
|
|
43
47
|
*/
|
|
44
48
|
findGlobal(): Promise<EventType[]>;
|
|
45
49
|
/**
|
|
46
|
-
* Find event types for a tenant including global types
|
|
50
|
+
* Find event types for a tenant including global types.
|
|
51
|
+
*
|
|
52
|
+
* Fails closed if an active tenant context requests a different tenant's
|
|
53
|
+
* rows; the admin/system path keeps the cross-tenant capability. (#1600)
|
|
47
54
|
*
|
|
48
55
|
* @param tenantId - Tenant ID to filter by
|
|
49
56
|
* @returns Array of EventType instances for the tenant and global types
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventTypeCollection.d.ts","sourceRoot":"","sources":["../../src/collections/EventTypeCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"EventTypeCollection.d.ts","sourceRoot":"","sources":["../../src/collections/EventTypeCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,SAAS,CAAC;IAChE,MAAM,CAAC,QAAQ,CAAC,UAAU,mBAAa;IAEvC;;;;;;OAMG;IACG,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAkBlE;;;;;OAKG;IACG,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAIxD;;;;;;;;;;OAUG;IACG,kBAAkB,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IA0DhD;;;;;OAKG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAI1D;;;;;;;;OAQG;IACG,UAAU,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IAIxC;;;;;;;;OAQG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;CAO9D"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ObjectRegistry, foreignKey, crossPackageRef, field, smrt, SmrtObject, SmrtJunction, SmrtHierarchical, SmrtCollection } from "@happyvertical/smrt-core";
|
|
2
2
|
import { getOwnedAssetsFromCollection, addOwnedAssetFromCollection, removeOwnedAssetFromCollection, resolveOwnedAssetsById, assertValidOwnedAssetRelationship, assertValidOwnedAssetSortOrder } from "@happyvertical/smrt-assets";
|
|
3
|
-
import { tenantId, TenantScoped } from "@happyvertical/smrt-tenancy";
|
|
3
|
+
import { tenantId, TenantScoped, queryGlobal, queryWithGlobals } from "@happyvertical/smrt-tenancy";
|
|
4
4
|
import { EVENTS_MODULE_META, EVENTS_UI_SLOTS } from "./ui.js";
|
|
5
5
|
import { calculateDuration, calculateNextOccurrence, checkSchedulingConflict, formatDuration, formatEventDateRange, generateEventSlug, getEventStatusFromDates, isEventNow, parseRecurrencePattern, sortEventsByDate, validateEventStatus } from "./utils.js";
|
|
6
6
|
ObjectRegistry.registerPackageManifest(
|
|
@@ -553,24 +553,28 @@ class EventCollection extends SmrtCollection {
|
|
|
553
553
|
return this.list({ where: { tenantId: tenantId2 } });
|
|
554
554
|
}
|
|
555
555
|
/**
|
|
556
|
-
* Find all global events (no tenant association)
|
|
556
|
+
* Find all global events (no tenant association).
|
|
557
|
+
*
|
|
558
|
+
* Routes through the shared tenant-global helper so it does not throw under
|
|
559
|
+
* an active tenant context (an explicit `tenant_id IS NULL` filter would be
|
|
560
|
+
* flagged as an isolation violation). (#1600)
|
|
557
561
|
*
|
|
558
562
|
* @returns Array of Event instances with no tenant
|
|
559
563
|
*/
|
|
560
564
|
async findGlobal() {
|
|
561
|
-
return this
|
|
565
|
+
return queryGlobal(this);
|
|
562
566
|
}
|
|
563
567
|
/**
|
|
564
|
-
* Find events for a tenant including global events
|
|
568
|
+
* Find events for a tenant including global events.
|
|
569
|
+
*
|
|
570
|
+
* Fails closed if an active tenant context requests a different tenant's
|
|
571
|
+
* rows; the admin/system path keeps the cross-tenant capability. (#1600)
|
|
565
572
|
*
|
|
566
573
|
* @param tenantId - Tenant ID to filter by
|
|
567
574
|
* @returns Array of Event instances for the tenant and global events
|
|
568
575
|
*/
|
|
569
576
|
async findWithGlobals(tenantId2) {
|
|
570
|
-
return this.
|
|
571
|
-
`SELECT * FROM ${this.tableName} WHERE tenant_id = ? OR tenant_id IS NULL`,
|
|
572
|
-
[tenantId2]
|
|
573
|
-
);
|
|
577
|
+
return queryWithGlobals(this, tenantId2, "Event.findWithGlobals");
|
|
574
578
|
}
|
|
575
579
|
}
|
|
576
580
|
const EventCollection$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -842,13 +846,27 @@ let EventParticipantCollection = class extends SmrtJunction {
|
|
|
842
846
|
async findByTenant(tenantId2) {
|
|
843
847
|
return this.list({ where: { tenantId: tenantId2 } });
|
|
844
848
|
}
|
|
849
|
+
/**
|
|
850
|
+
* Find all global participants (no tenant association).
|
|
851
|
+
*
|
|
852
|
+
* Routes through the shared tenant-global helper so it does not throw under
|
|
853
|
+
* an active tenant context (an explicit `tenant_id IS NULL` filter would be
|
|
854
|
+
* flagged as an isolation violation). (#1600)
|
|
855
|
+
*/
|
|
845
856
|
async findGlobal() {
|
|
846
|
-
return this
|
|
857
|
+
return queryGlobal(this);
|
|
847
858
|
}
|
|
859
|
+
/**
|
|
860
|
+
* Find participants for a tenant plus all global participants.
|
|
861
|
+
*
|
|
862
|
+
* Fails closed if an active tenant context requests a different tenant's
|
|
863
|
+
* rows; the admin/system path keeps the cross-tenant capability. (#1600)
|
|
864
|
+
*/
|
|
848
865
|
async findWithGlobals(tenantId2) {
|
|
849
|
-
return
|
|
850
|
-
|
|
851
|
-
|
|
866
|
+
return queryWithGlobals(
|
|
867
|
+
this,
|
|
868
|
+
tenantId2,
|
|
869
|
+
"EventParticipant.findWithGlobals"
|
|
852
870
|
);
|
|
853
871
|
}
|
|
854
872
|
};
|
|
@@ -1132,23 +1150,31 @@ class EventSeriesCollection extends SmrtCollection {
|
|
|
1132
1150
|
return this.list({ where: { tenantId: tenantId2 } });
|
|
1133
1151
|
}
|
|
1134
1152
|
/**
|
|
1135
|
-
* Find all global event series (no tenant association)
|
|
1153
|
+
* Find all global event series (no tenant association).
|
|
1154
|
+
*
|
|
1155
|
+
* Routes through the shared tenant-global helper so it does not throw under
|
|
1156
|
+
* an active tenant context (an explicit `tenant_id IS NULL` filter would be
|
|
1157
|
+
* flagged as an isolation violation). (#1600)
|
|
1136
1158
|
*
|
|
1137
1159
|
* @returns Array of EventSeries instances with no tenant
|
|
1138
1160
|
*/
|
|
1139
1161
|
async findGlobal() {
|
|
1140
|
-
return this
|
|
1162
|
+
return queryGlobal(this);
|
|
1141
1163
|
}
|
|
1142
1164
|
/**
|
|
1143
|
-
* Find event series for a tenant including global series
|
|
1165
|
+
* Find event series for a tenant including global series.
|
|
1166
|
+
*
|
|
1167
|
+
* Fails closed if an active tenant context requests a different tenant's
|
|
1168
|
+
* rows; the admin/system path keeps the cross-tenant capability. (#1600)
|
|
1144
1169
|
*
|
|
1145
1170
|
* @param tenantId - Tenant ID to filter by
|
|
1146
1171
|
* @returns Array of EventSeries instances for the tenant and global series
|
|
1147
1172
|
*/
|
|
1148
1173
|
async findWithGlobals(tenantId2) {
|
|
1149
|
-
return
|
|
1150
|
-
|
|
1151
|
-
|
|
1174
|
+
return queryWithGlobals(
|
|
1175
|
+
this,
|
|
1176
|
+
tenantId2,
|
|
1177
|
+
"EventSeries.findWithGlobals"
|
|
1152
1178
|
);
|
|
1153
1179
|
}
|
|
1154
1180
|
}
|
|
@@ -1367,23 +1393,31 @@ class EventTypeCollection extends SmrtCollection {
|
|
|
1367
1393
|
return this.list({ where: { tenantId: tenantId2 } });
|
|
1368
1394
|
}
|
|
1369
1395
|
/**
|
|
1370
|
-
* Find all global event types (no tenant association)
|
|
1396
|
+
* Find all global event types (no tenant association).
|
|
1397
|
+
*
|
|
1398
|
+
* Routes through the shared tenant-global helper so it does not throw under
|
|
1399
|
+
* an active tenant context (an explicit `tenant_id IS NULL` filter would be
|
|
1400
|
+
* flagged as an isolation violation). (#1600)
|
|
1371
1401
|
*
|
|
1372
1402
|
* @returns Array of EventType instances with no tenant
|
|
1373
1403
|
*/
|
|
1374
1404
|
async findGlobal() {
|
|
1375
|
-
return this
|
|
1405
|
+
return queryGlobal(this);
|
|
1376
1406
|
}
|
|
1377
1407
|
/**
|
|
1378
|
-
* Find event types for a tenant including global types
|
|
1408
|
+
* Find event types for a tenant including global types.
|
|
1409
|
+
*
|
|
1410
|
+
* Fails closed if an active tenant context requests a different tenant's
|
|
1411
|
+
* rows; the admin/system path keeps the cross-tenant capability. (#1600)
|
|
1379
1412
|
*
|
|
1380
1413
|
* @param tenantId - Tenant ID to filter by
|
|
1381
1414
|
* @returns Array of EventType instances for the tenant and global types
|
|
1382
1415
|
*/
|
|
1383
1416
|
async findWithGlobals(tenantId2) {
|
|
1384
|
-
return
|
|
1385
|
-
|
|
1386
|
-
|
|
1417
|
+
return queryWithGlobals(
|
|
1418
|
+
this,
|
|
1419
|
+
tenantId2,
|
|
1420
|
+
"EventType.findWithGlobals"
|
|
1387
1421
|
);
|
|
1388
1422
|
}
|
|
1389
1423
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/__smrt-register__.ts","../src/models/EventAsset.ts","../src/collections/EventAssetCollection.ts","../src/models/Event.ts","../src/collections/EventCollection.ts","../src/models/EventParticipant.ts","../src/collections/EventParticipantCollection.ts","../src/models/EventSeries.ts","../src/collections/EventSeriesCollection.ts","../src/models/EventType.ts","../src/collections/EventTypeCollection.ts"],"sourcesContent":["/**\n * Self-registers this package's build-time manifest before any @smrt() decorator\n * in the package fires. Fixes issue #1132: in consumer runtimes (tsx, SvelteKit\n * SSR, plain `vite dev`) the decorator's synchronous manifest lookup previously\n * missed because no step populated the global manifest cache — classes got\n * registered with zero fields and `save()` / `toJSON()` silently dropped every\n * declared property.\n *\n * Import this module as the first statement in `src/index.ts` so its top-level\n * side effect runs ahead of any class module's @smrt() decorator.\n *\n * Silent no-op in dev/test, where the vitest plugin already populates manifests\n * via a different path. Only needs to succeed in the published dist output.\n *\n * @see https://github.com/happyvertical/smrt/issues/1132\n */\nimport { ObjectRegistry } from '@happyvertical/smrt-core';\n\n// `new URL('./manifest.json', import.meta.url)` resolves at runtime to the\n// manifest sitting next to this module's compiled output. Vite warns at build\n// time that it cannot pre-resolve the URL; that is the intended behavior —\n// the URL must resolve to dist/manifest.json at runtime, not be inlined.\nObjectRegistry.registerPackageManifest(\n new URL('./manifest.json', import.meta.url),\n);\n","import type { SmrtObjectOptions } from '@happyvertical/smrt-core';\nimport {\n crossPackageRef,\n field,\n foreignKey,\n SmrtObject,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\n\nexport interface EventAssetOptions extends SmrtObjectOptions {\n eventId?: string;\n assetId?: string;\n relationship?: string;\n sortOrder?: number;\n tenantId?: string | null;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableName: 'event_assets',\n conflictColumns: ['event_id', 'asset_id', 'relationship'],\n api: false,\n mcp: false,\n cli: false,\n})\nexport class EventAsset extends SmrtObject {\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n @foreignKey('Event', { required: true })\n eventId = '';\n\n @crossPackageRef('@happyvertical/smrt-assets:Asset', { required: true })\n assetId = '';\n\n @field({ required: true })\n relationship = 'attachment';\n\n @field()\n sortOrder = 0;\n\n constructor(options: EventAssetOptions = {}) {\n super(options);\n if (options.eventId) this.eventId = options.eventId;\n if (options.assetId) this.assetId = options.assetId;\n if (options.relationship) this.relationship = options.relationship;\n if (options.sortOrder !== undefined) this.sortOrder = options.sortOrder;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n }\n}\n","import type { Asset } from '@happyvertical/smrt-assets';\nimport {\n addOwnedAssetFromCollection,\n getOwnedAssetsFromCollection,\n removeOwnedAssetFromCollection,\n} from '@happyvertical/smrt-assets';\nimport type { SmrtCollectionOptions } from '@happyvertical/smrt-core';\nimport { SmrtJunction, smrt } from '@happyvertical/smrt-core';\nimport { EventAsset } from '../models/EventAsset';\nimport type { EventCollection } from './EventCollection';\n\nexport interface EventAssetCollectionOptions extends SmrtCollectionOptions {}\n\n@smrt({\n api: false,\n mcp: false,\n cli: false,\n})\nexport class EventAssetCollection extends SmrtJunction<EventAsset> {\n static readonly _itemClass = EventAsset;\n protected leftField = 'eventId';\n protected rightField = 'assetId';\n\n private eventCollectionPromise: Promise<EventCollection> | null = null;\n\n private async getEventCollection(): Promise<EventCollection> {\n if (!this.eventCollectionPromise) {\n const { EventCollection } = await import('./EventCollection');\n this.eventCollectionPromise = EventCollection.create({ db: this.db });\n }\n\n return this.eventCollectionPromise;\n }\n\n async getAssets(eventId: string, relationship?: string): Promise<Asset[]> {\n return getOwnedAssetsFromCollection(\n await this.getEventCollection(),\n eventId,\n relationship,\n );\n }\n\n async addAsset(\n eventId: string,\n asset: Asset,\n relationship = 'attachment',\n sortOrder = 0,\n ): Promise<void> {\n await addOwnedAssetFromCollection(\n await this.getEventCollection(),\n 'Event',\n eventId,\n asset,\n relationship,\n sortOrder,\n );\n }\n\n async removeAsset(\n eventId: string,\n assetId: string,\n relationship?: string,\n ): Promise<void> {\n await removeOwnedAssetFromCollection(\n await this.getEventCollection(),\n 'Event',\n eventId,\n assetId,\n relationship,\n );\n }\n}\n","/**\n * Event model - Hierarchical event instances\n *\n * Infinitely nestable: Game → Period → Goal → Assist\n */\n\nimport type { Asset } from '@happyvertical/smrt-assets';\nimport {\n assertValidOwnedAssetRelationship,\n assertValidOwnedAssetSortOrder,\n resolveOwnedAssetsById,\n} from '@happyvertical/smrt-assets';\nimport {\n crossPackageRef,\n foreignKey,\n SmrtHierarchical,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { EventOptions, EventStatus } from '../types';\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n api: { include: ['list', 'get', 'create', 'update', 'delete'] },\n mcp: { include: ['list', 'get', 'create', 'update'] },\n cli: true,\n})\nexport class Event extends SmrtHierarchical {\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n name: string = '';\n @foreignKey('EventSeries')\n seriesId = ''; // FK to EventSeries (nullable for standalone events)\n // parentId inherited from SmrtHierarchical (self-reference to parent Event)\n @foreignKey('EventType')\n typeId = ''; // FK to EventType\n @crossPackageRef('@happyvertical/smrt-places:Place')\n placeId = ''; // FK to Place (from @happyvertical/smrt-places)\n description = '';\n startDate: Date | null = null;\n endDate: Date | null = null;\n status: EventStatus = 'scheduled';\n round: number | null = null; // Sequence/round number in series\n metadata = ''; // JSON metadata (stored as text)\n externalId = ''; // External system identifier\n source = ''; // Source system\n\n // Timestamps\n createdAt = new Date();\n updatedAt = new Date();\n\n constructor(options: EventOptions = {}) {\n super(options);\n\n if (options.seriesId !== undefined) this.seriesId = options.seriesId;\n if (options.parentId !== undefined)\n this.parentId = options.parentId ?? null;\n if (options.typeId) this.typeId = options.typeId;\n if (options.placeId !== undefined) this.placeId = options.placeId;\n if (options.description !== undefined)\n this.description = options.description;\n if (options.startDate !== undefined)\n this.startDate = options.startDate || null;\n if (options.endDate !== undefined) this.endDate = options.endDate || null;\n if (options.status !== undefined) this.status = options.status;\n if (options.round !== undefined) this.round = options.round;\n if (options.externalId !== undefined) this.externalId = options.externalId;\n if (options.source !== undefined) this.source = options.source;\n\n // Handle metadata - can be object or JSON string\n if (options.metadata !== undefined) {\n if (typeof options.metadata === 'string') {\n this.metadata = options.metadata;\n } else {\n this.metadata = JSON.stringify(options.metadata);\n }\n }\n\n if (options.createdAt) this.createdAt = options.createdAt;\n if (options.updatedAt) this.updatedAt = options.updatedAt;\n }\n\n /**\n * Get metadata as parsed object\n *\n * @returns Parsed metadata object or empty object\n */\n getMetadata(): Record<string, any> {\n if (!this.metadata) return {};\n try {\n return JSON.parse(this.metadata);\n } catch {\n return {};\n }\n }\n\n /**\n * Set metadata from object\n *\n * @param data - Metadata object to store\n */\n setMetadata(data: Record<string, any>): void {\n this.metadata = JSON.stringify(data);\n }\n\n /**\n * Update metadata by merging with existing values\n *\n * @param updates - Partial metadata to merge\n */\n updateMetadata(updates: Record<string, any>): void {\n const current = this.getMetadata();\n this.setMetadata({ ...current, ...updates });\n }\n\n /**\n * Update event status\n *\n * @param newStatus - New status to set\n */\n async updateStatus(newStatus: EventStatus): Promise<void> {\n this.status = newStatus;\n this.updatedAt = new Date();\n await this.save();\n }\n\n /**\n * Get the series for this event\n *\n * @returns EventSeries instance or null\n */\n async getSeries() {\n if (!this.seriesId) return null;\n\n const { EventSeriesCollection } = await import(\n '../collections/EventSeriesCollection'\n );\n const collection = await (EventSeriesCollection as any).create(\n this.options,\n );\n\n return await collection.get({ id: this.seriesId });\n }\n\n /**\n * Get the event type\n *\n * @returns EventType instance or null\n */\n async getType() {\n if (!this.typeId) return null;\n\n const { EventTypeCollection } = await import(\n '../collections/EventTypeCollection'\n );\n const collection = await (EventTypeCollection as any).create(this.options);\n\n return await collection.get({ id: this.typeId });\n }\n\n /**\n * Get the place for this event\n *\n * @returns Place instance or null\n */\n async getPlace() {\n if (!this.placeId) return null;\n\n try {\n const { PlaceCollection } = await import('@happyvertical/smrt-places');\n const collection = await (PlaceCollection as any).create(this.options);\n\n return await collection.get({ id: this.placeId });\n } catch {\n // @happyvertical/smrt-places not available\n return null;\n }\n }\n\n // Hierarchy traversal (getParent / getChildren / getAncestors /\n // getDescendants / getHierarchy / moveTo) provided by SmrtHierarchical.\n\n /**\n * Get the root event (top-level ancestor) of this event's hierarchy.\n *\n * @returns Root event instance — `this` when already root\n */\n async getRootEvent(): Promise<Event> {\n const ancestors = await this.getAncestors();\n return (ancestors.length > 0 ? ancestors[0] : this) as Event;\n }\n\n /**\n * Get all participants for this event\n *\n * @returns Array of EventParticipant instances\n */\n async getParticipants() {\n const { EventParticipantCollection } = await import(\n '../collections/EventParticipantCollection'\n );\n const collection = await (EventParticipantCollection as any).create(\n this.options,\n );\n\n return await collection.list({ where: { eventId: this.id } });\n }\n\n private async getEventAssetCollection() {\n const { EventAssetCollection } = await import(\n '../collections/EventAssetCollection'\n );\n return EventAssetCollection.create({ db: this.db });\n }\n async getAssets(relationship?: string): Promise<Asset[]> {\n if (!this.id) {\n return [];\n }\n\n const eventAssets = await this.getEventAssetCollection();\n const linkedAssets = await eventAssets.byLeft(\n this.id,\n relationship ? { relationship } : {},\n );\n\n return resolveOwnedAssetsById(\n this.db,\n linkedAssets.map((link) => link.assetId),\n this.tenantId,\n );\n }\n\n async addAsset(\n asset: Asset,\n relationship = 'attachment',\n sortOrder = 0,\n ): Promise<void> {\n if (!this.id || !asset.id) {\n throw new Error('Cannot associate unsaved event or asset');\n }\n\n assertValidOwnedAssetRelationship(relationship);\n assertValidOwnedAssetSortOrder(sortOrder);\n\n const eventAssets = await this.getEventAssetCollection();\n await eventAssets.attach(this.id, asset.id, {\n relationship,\n sortOrder,\n tenantId: this.tenantId,\n });\n }\n\n async removeAsset(assetId: string, relationship?: string): Promise<void> {\n if (!this.id) {\n return;\n }\n\n const eventAssets = await this.getEventAssetCollection();\n await eventAssets.detach(\n this.id,\n assetId,\n relationship ? { relationship } : {},\n );\n }\n\n /**\n * Check if event is currently in progress\n *\n * @returns True if current time is between start and end\n */\n isInProgress(): boolean {\n if (this.status !== 'in_progress') return false;\n\n const now = new Date();\n if (this.startDate && now < this.startDate) return false;\n if (this.endDate && now > this.endDate) return false;\n\n return true;\n }\n\n /**\n * Check if event is a root event (no parent)\n *\n * @returns True if parentId is null/empty\n */\n isRoot(): boolean {\n return !this.parentId;\n }\n}\n","/**\n * EventCollection - Collection manager for Event objects\n *\n * Provides hierarchy traversal, filtering, and search capabilities.\n */\n\nimport type { Asset } from '@happyvertical/smrt-assets';\nimport {\n addOwnedAssetFromCollection,\n getOwnedAssetsFromCollection,\n removeOwnedAssetFromCollection,\n} from '@happyvertical/smrt-assets';\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { Event } from '../models/Event';\nimport type { EventSearchFilters, EventStatus } from '../types';\n\nexport class EventCollection extends SmrtCollection<Event> {\n static readonly _itemClass = Event;\n\n /**\n * Get events by series\n *\n * @param seriesId - EventSeries ID\n * @returns Array of Event instances\n */\n async getBySeriesId(seriesId: string): Promise<Event[]> {\n return await this.list({ where: { seriesId } });\n }\n\n /**\n * Get events at a specific place\n *\n * @param placeId - Place ID\n * @returns Array of Event instances\n */\n async getByPlace(placeId: string): Promise<Event[]> {\n return await this.list({ where: { placeId } });\n }\n\n /**\n * Get events by date range\n *\n * @param startDate - Start of date range\n * @param endDate - End of date range\n * @returns Array of Event instances\n */\n async getByDateRange(startDate: Date, endDate: Date): Promise<Event[]> {\n const allEvents = await this.list({});\n\n return allEvents.filter((event) => {\n if (!event.startDate) return false;\n return event.startDate >= startDate && event.startDate <= endDate;\n });\n }\n\n /**\n * Get upcoming events\n *\n * @param limit - Maximum number of events to return\n * @returns Array of Event instances starting in the future\n */\n async getUpcoming(limit?: number): Promise<Event[]> {\n const allEvents = await this.list({});\n const now = new Date();\n\n const upcoming = allEvents\n .filter((event) => event.startDate && event.startDate > now)\n .sort((a, b) => {\n if (!a.startDate || !b.startDate) return 0;\n return a.startDate.getTime() - b.startDate.getTime();\n });\n\n return limit ? upcoming.slice(0, limit) : upcoming;\n }\n\n /**\n * Get events by status\n *\n * @param status - Event status to filter by\n * @returns Array of Event instances\n */\n async getByStatus(status: EventStatus): Promise<Event[]> {\n return await this.list({ where: { status } });\n }\n\n /**\n * Get events by type\n *\n * @param typeId - EventType ID\n * @returns Array of Event instances\n */\n async getByType(typeId: string): Promise<Event[]> {\n return await this.list({ where: { typeId } });\n }\n\n /**\n * Get root events (no parent)\n *\n * @returns Array of Event instances with no parent\n */\n async getRootEvents(): Promise<Event[]> {\n const allEvents = await this.list({});\n return allEvents.filter((event) => !event.parentId);\n }\n\n /**\n * Get children of a parent event\n *\n * @param parentId - Parent event ID\n * @returns Array of child Event instances\n */\n async getByParent(parentId: string): Promise<Event[]> {\n return await this.list({ where: { parentId } });\n }\n\n /**\n * Get full event tree (hierarchy)\n *\n * @param eventId - Root event ID\n * @returns Object with root event and nested children\n */\n async getEventTree(eventId: string): Promise<Event | null> {\n const event = await this.get({ id: eventId });\n if (!event) return null;\n\n return await event.getHierarchy().then((h) => h.current);\n }\n\n async getAssets(eventId: string, relationship?: string): Promise<Asset[]> {\n return getOwnedAssetsFromCollection(this, eventId, relationship);\n }\n\n async addAsset(\n eventId: string,\n asset: Asset,\n relationship = 'attachment',\n sortOrder = 0,\n ): Promise<void> {\n await addOwnedAssetFromCollection(\n this,\n 'Event',\n eventId,\n asset,\n relationship,\n sortOrder,\n );\n }\n\n async removeAsset(\n eventId: string,\n assetId: string,\n relationship?: string,\n ): Promise<void> {\n await removeOwnedAssetFromCollection(\n this,\n 'Event',\n eventId,\n assetId,\n relationship,\n );\n }\n\n /**\n * Search events with filters\n *\n * @param query - Search query for name/description\n * @param filters - Additional filter criteria\n * @returns Array of matching Event instances\n */\n async search(query: string, filters?: EventSearchFilters): Promise<Event[]> {\n let events = await this.list({});\n\n // Filter by query\n if (query) {\n const lowerQuery = query.toLowerCase();\n events = events.filter(\n (e) =>\n e.name?.toLowerCase().includes(lowerQuery) ||\n e.description?.toLowerCase().includes(lowerQuery),\n );\n }\n\n // Apply filters\n if (filters) {\n if (filters.typeId) {\n events = events.filter((e) => e.typeId === filters.typeId);\n }\n if (filters.seriesId) {\n events = events.filter((e) => e.seriesId === filters.seriesId);\n }\n if (filters.placeId) {\n events = events.filter((e) => e.placeId === filters.placeId);\n }\n if (filters.status) {\n if (Array.isArray(filters.status)) {\n events = events.filter((e) => filters.status?.includes(e.status));\n } else {\n events = events.filter((e) => e.status === filters.status);\n }\n }\n if (filters.startDate) {\n const startDate = filters.startDate;\n events = events.filter((e) => e.startDate && e.startDate >= startDate);\n }\n if (filters.endDate) {\n const endDate = filters.endDate;\n events = events.filter((e) => e.startDate && e.startDate <= endDate);\n }\n if (filters.organizerId) {\n // Filter by series organizer\n events = events.filter(async (e) => {\n const series = await e.getSeries();\n return series && series.organizerId === filters.organizerId;\n });\n }\n }\n\n return events;\n }\n\n /**\n * Get events in progress\n *\n * @returns Array of Event instances currently in progress\n */\n async getInProgress(): Promise<Event[]> {\n const inProgressEvents = await this.getByStatus('in_progress');\n return inProgressEvents.filter((event) => event.isInProgress());\n }\n\n // ============================================\n // Tenant Helper Methods\n // ============================================\n\n /**\n * Find all events for a specific tenant\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of Event instances for the tenant\n */\n async findByTenant(tenantId: string): Promise<Event[]> {\n return this.list({ where: { tenantId } });\n }\n\n /**\n * Find all global events (no tenant association)\n *\n * @returns Array of Event instances with no tenant\n */\n async findGlobal(): Promise<Event[]> {\n return this.list({ where: { tenantId: null } });\n }\n\n /**\n * Find events for a tenant including global events\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of Event instances for the tenant and global events\n */\n async findWithGlobals(tenantId: string): Promise<Event[]> {\n return this.query(\n `SELECT * FROM ${this.tableName} WHERE tenant_id = ? OR tenant_id IS NULL`,\n [tenantId],\n );\n }\n}\n","/**\n * EventParticipant model - Links participants to events\n *\n * Tracks who participated in an event with role and placement\n */\n\nimport {\n crossPackageRef,\n foreignKey,\n SmrtObject,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { EventParticipantOptions } from '../types';\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n // Junction table - uses event_id + profile_id + role as natural key\n // instead of slug-based conflict columns\n conflictColumns: ['event_id', 'profile_id', 'role'],\n api: { include: ['list', 'get', 'create', 'update', 'delete'] },\n mcp: { include: ['list', 'get', 'create', 'update'] },\n cli: true,\n})\nexport class EventParticipant extends SmrtObject {\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n // id inherited from SmrtObject\n\n @foreignKey('Event')\n eventId = ''; // FK to Event\n @crossPackageRef('@happyvertical/smrt-profiles:Profile')\n profileId = ''; // FK to Profile (from @happyvertical/smrt-profiles)\n role: string = ''; // Participant role (ParticipantRole or custom)\n placement: number | null = null; // Numeric position/placement\n groupId = ''; // Optional grouping (e.g., team ID for individual players)\n metadata = ''; // JSON metadata (stored as text)\n externalId = ''; // External system identifier\n source = ''; // Source system\n\n // Timestamps\n createdAt = new Date();\n updatedAt = new Date();\n\n constructor(options: EventParticipantOptions = {}) {\n super(options);\n\n if (options.eventId) this.eventId = options.eventId;\n if (options.profileId) this.profileId = options.profileId;\n if (options.role !== undefined) this.role = options.role;\n if (options.placement !== undefined) this.placement = options.placement;\n if (options.groupId !== undefined) this.groupId = options.groupId;\n if (options.externalId !== undefined) this.externalId = options.externalId;\n if (options.source !== undefined) this.source = options.source;\n\n // Handle metadata - can be object or JSON string\n if (options.metadata !== undefined) {\n if (typeof options.metadata === 'string') {\n this.metadata = options.metadata;\n } else {\n this.metadata = JSON.stringify(options.metadata);\n }\n }\n\n if (options.createdAt) this.createdAt = options.createdAt;\n if (options.updatedAt) this.updatedAt = options.updatedAt;\n }\n\n /**\n * Get metadata as parsed object\n *\n * @returns Parsed metadata object or empty object\n */\n getMetadata(): Record<string, any> {\n if (!this.metadata) return {};\n try {\n return JSON.parse(this.metadata);\n } catch {\n return {};\n }\n }\n\n /**\n * Set metadata from object\n *\n * @param data - Metadata object to store\n */\n setMetadata(data: Record<string, any>): void {\n this.metadata = JSON.stringify(data);\n }\n\n /**\n * Update metadata by merging with existing values\n *\n * @param updates - Partial metadata to merge\n */\n updateMetadata(updates: Record<string, any>): void {\n const current = this.getMetadata();\n this.setMetadata({ ...current, ...updates });\n }\n\n /**\n * Get the event for this participant\n *\n * @returns Event instance or null\n */\n async getEvent() {\n if (!this.eventId) return null;\n\n const { EventCollection } = await import('../collections/EventCollection');\n const collection = await (EventCollection as any).create(this.options);\n\n return await collection.get({ id: this.eventId });\n }\n\n /**\n * Get the profile for this participant\n *\n * @returns Profile instance or null\n */\n async getProfile() {\n if (!this.profileId) return null;\n\n try {\n const { ProfileCollection } = await import(\n '@happyvertical/smrt-profiles'\n );\n const collection = await (ProfileCollection as any).create(this.options);\n\n return await collection.get({ id: this.profileId });\n } catch {\n // @happyvertical/smrt-profiles not available\n return null;\n }\n }\n\n /**\n * Get group participants (others with same groupId)\n *\n * @returns Array of EventParticipant instances\n */\n async getGroupParticipants(): Promise<EventParticipant[]> {\n if (!this.groupId) return [];\n\n const { EventParticipantCollection } = await import(\n '../collections/EventParticipantCollection'\n );\n const collection = await (EventParticipantCollection as any).create(\n this.options,\n );\n\n const participants = await collection.list({\n where: { eventId: this.eventId, groupId: this.groupId },\n });\n\n // Exclude self from results\n return participants.filter((p: EventParticipant) => p.id !== this.id);\n }\n\n /**\n * Check if this is a home participant (placement = 0)\n *\n * @returns True if placement is 0\n */\n isHome(): boolean {\n return this.placement === 0;\n }\n\n /**\n * Check if this is an away participant (placement = 1)\n *\n * @returns True if placement is 1\n */\n isAway(): boolean {\n return this.placement === 1;\n }\n}\n","/**\n * EventParticipantCollection — junction collection for Event ↔ Profile links.\n *\n * The generic junction surface (byLeft/byRight/attach/detach/setLinks) comes\n * from `SmrtJunction`. Domain-specific helpers (placement-ordered queries,\n * home/away accessors, statistics, tenant scoping) live alongside.\n */\n\nimport { SmrtJunction, smrt } from '@happyvertical/smrt-core';\nimport { EventParticipant } from '../models/EventParticipant';\nimport type { ParticipantSearchFilters } from '../types';\n\n// Decorator with empty config — only needed so the scanner detects the\n// class. See FactContentCollection for the full rationale.\n@smrt()\nexport class EventParticipantCollection extends SmrtJunction<EventParticipant> {\n static readonly _itemClass = EventParticipant;\n protected leftField = 'eventId';\n protected rightField = 'profileId';\n // EventParticipant has no sortOrder column; `placement` is domain ordering\n // (0=home, 1=away) and must not be auto-assigned by setLinks.\n protected sortField: string | null = null;\n protected positionField: string | null = null;\n\n // ============================================\n // Domain helpers\n // ============================================\n\n /**\n * Get participants ordered by placement (nulls last).\n */\n async getByPlacement(eventId: string): Promise<EventParticipant[]> {\n const participants = await this.byLeft(eventId);\n\n return participants.sort((a, b) => {\n if (a.placement === null && b.placement === null) return 0;\n if (a.placement === null) return 1;\n if (b.placement === null) return -1;\n return a.placement - b.placement;\n });\n }\n\n /**\n * Get participants by group within an event.\n */\n async getByGroup(\n eventId: string,\n groupId: string,\n ): Promise<EventParticipant[]> {\n return this.byLeft(eventId, { groupId });\n }\n\n /**\n * Get the home participant(s) — placement = 0.\n */\n async getHome(eventId: string): Promise<EventParticipant[]> {\n return this.byLeft(eventId, { placement: 0 });\n }\n\n /**\n * Get the away participant(s) — placement = 1.\n */\n async getAway(eventId: string): Promise<EventParticipant[]> {\n return this.byLeft(eventId, { placement: 1 });\n }\n\n /**\n * Search participants with optional filters.\n */\n async search(filters: ParticipantSearchFilters): Promise<EventParticipant[]> {\n let participants = await this.list({});\n\n if (filters.eventId) {\n participants = participants.filter((p) => p.eventId === filters.eventId);\n }\n if (filters.profileId) {\n participants = participants.filter(\n (p) => p.profileId === filters.profileId,\n );\n }\n if (filters.role) {\n participants = participants.filter((p) => p.role === filters.role);\n }\n if (filters.groupId) {\n participants = participants.filter((p) => p.groupId === filters.groupId);\n }\n\n return participants;\n }\n\n /**\n * Get participation statistics for a profile, optionally filtered by event type.\n */\n async getParticipantStats(\n profileId: string,\n eventTypeId?: string,\n ): Promise<{\n totalEvents: number;\n byRole: Record<string, number>;\n byPlacement: Record<number, number>;\n }> {\n const participants = await this.byRight(profileId);\n\n let filteredParticipants = participants;\n if (eventTypeId) {\n filteredParticipants = [];\n for (const participant of participants) {\n const event = await participant.getEvent();\n if (event && event.typeId === eventTypeId) {\n filteredParticipants.push(participant);\n }\n }\n }\n\n const byRole: Record<string, number> = {};\n const byPlacement: Record<number, number> = {};\n\n for (const participant of filteredParticipants) {\n byRole[participant.role] = (byRole[participant.role] || 0) + 1;\n\n if (participant.placement !== null) {\n byPlacement[participant.placement] =\n (byPlacement[participant.placement] || 0) + 1;\n }\n }\n\n return {\n totalEvents: filteredParticipants.length,\n byRole,\n byPlacement,\n };\n }\n\n // ============================================\n // Tenant helpers\n // ============================================\n\n async findByTenant(tenantId: string): Promise<EventParticipant[]> {\n return this.list({ where: { tenantId } });\n }\n\n async findGlobal(): Promise<EventParticipant[]> {\n return this.list({ where: { tenantId: null } });\n }\n\n async findWithGlobals(tenantId: string): Promise<EventParticipant[]> {\n return this.query(\n `SELECT * FROM ${this.tableName} WHERE tenant_id = ? OR tenant_id IS NULL`,\n [tenantId],\n );\n }\n}\n","/**\n * EventSeries model - Groups related events (season, tour, conference, etc.)\n *\n * Examples: '2024 NBA Finals', 'Summer Tour 2024', 'Town Council 2024'\n */\n\nimport {\n crossPackageRef,\n foreignKey,\n SmrtObject,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { EventSeriesOptions, RecurrencePattern } from '../types';\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n api: { include: ['list', 'get', 'create', 'update', 'delete'] },\n mcp: { include: ['list', 'get', 'create', 'update'] },\n cli: true,\n})\nexport class EventSeries extends SmrtObject {\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n name: string = '';\n @foreignKey('EventType')\n typeId = ''; // FK to EventType\n @crossPackageRef('@happyvertical/smrt-profiles:Profile')\n organizerId = ''; // FK to Profile (from @happyvertical/smrt-profiles)\n description = '';\n startDate: Date | null = null;\n endDate: Date | null = null;\n recurrence = ''; // JSON recurrence pattern (stored as text)\n metadata = ''; // JSON metadata (stored as text)\n externalId = ''; // External system identifier\n source = ''; // Source system (e.g., 'ticketmaster', 'espn')\n\n // Timestamps\n createdAt = new Date();\n updatedAt = new Date();\n\n constructor(options: EventSeriesOptions = {}) {\n super(options);\n\n if (options.typeId) this.typeId = options.typeId;\n if (options.organizerId) this.organizerId = options.organizerId;\n if (options.description !== undefined)\n this.description = options.description;\n if (options.startDate !== undefined)\n this.startDate = options.startDate || null;\n if (options.endDate !== undefined) this.endDate = options.endDate || null;\n if (options.externalId !== undefined) this.externalId = options.externalId;\n if (options.source !== undefined) this.source = options.source;\n\n // Handle recurrence - can be object or JSON string\n if (options.recurrence !== undefined) {\n if (typeof options.recurrence === 'string') {\n this.recurrence = options.recurrence;\n } else {\n this.recurrence = JSON.stringify(options.recurrence);\n }\n }\n\n // Handle metadata - can be object or JSON string\n if (options.metadata !== undefined) {\n if (typeof options.metadata === 'string') {\n this.metadata = options.metadata;\n } else {\n this.metadata = JSON.stringify(options.metadata);\n }\n }\n\n if (options.createdAt) this.createdAt = options.createdAt;\n if (options.updatedAt) this.updatedAt = options.updatedAt;\n }\n\n /**\n * Get recurrence pattern as parsed object\n *\n * @returns Parsed recurrence pattern or null\n */\n getRecurrence(): RecurrencePattern | null {\n if (!this.recurrence) return null;\n try {\n return JSON.parse(this.recurrence) as RecurrencePattern;\n } catch {\n return null;\n }\n }\n\n /**\n * Set recurrence pattern from object\n *\n * @param pattern - Recurrence pattern to store\n */\n setRecurrence(pattern: RecurrencePattern): void {\n this.recurrence = JSON.stringify(pattern);\n }\n\n /**\n * Get metadata as parsed object\n *\n * @returns Parsed metadata object or empty object\n */\n getMetadata(): Record<string, any> {\n if (!this.metadata) return {};\n try {\n return JSON.parse(this.metadata);\n } catch {\n return {};\n }\n }\n\n /**\n * Set metadata from object\n *\n * @param data - Metadata object to store\n */\n setMetadata(data: Record<string, any>): void {\n this.metadata = JSON.stringify(data);\n }\n\n /**\n * Update metadata by merging with existing values\n *\n * @param updates - Partial metadata to merge\n */\n updateMetadata(updates: Record<string, any>): void {\n const current = this.getMetadata();\n this.setMetadata({ ...current, ...updates });\n }\n\n /**\n * Get the event type for this series\n *\n * @returns EventType instance or null\n */\n async getType() {\n if (!this.typeId) return null;\n\n const { EventTypeCollection } = await import(\n '../collections/EventTypeCollection'\n );\n const collection = await (EventTypeCollection as any).create(this.options);\n\n return await collection.get({ id: this.typeId });\n }\n\n /**\n * Get the organizer profile for this series\n *\n * @returns Profile instance or null\n */\n async getOrganizer() {\n if (!this.organizerId) return null;\n\n // Import Profile from @happyvertical/smrt-profiles\n try {\n const { ProfileCollection } = await import(\n '@happyvertical/smrt-profiles'\n );\n const collection = await (ProfileCollection as any).create(this.options);\n\n return await collection.get({ id: this.organizerId });\n } catch {\n // @happyvertical/smrt-profiles not available\n return null;\n }\n }\n\n /**\n * Get all events in this series\n *\n * @returns Array of Event instances\n */\n async getEvents() {\n const { EventCollection } = await import('../collections/EventCollection');\n const collection = await (EventCollection as any).create(this.options);\n\n return await collection.list({ where: { seriesId: this.id } });\n }\n\n /**\n * Check if series is currently active\n *\n * @returns True if current date is between start and end\n */\n isActive(): boolean {\n const now = new Date();\n if (this.startDate && now < this.startDate) return false;\n if (this.endDate && now > this.endDate) return false;\n return true;\n }\n}\n","/**\n * EventSeriesCollection - Collection manager for EventSeries objects\n *\n * Provides queries for series by organizer, status, and date ranges.\n */\n\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { EventSeries } from '../models/EventSeries';\nimport type { EventSeriesSearchFilters } from '../types';\n\nexport class EventSeriesCollection extends SmrtCollection<EventSeries> {\n static readonly _itemClass = EventSeries;\n\n /**\n * Get series by organizer\n *\n * @param organizerId - Profile ID of the organizer\n * @returns Array of EventSeries instances\n */\n async getByOrganizer(organizerId: string): Promise<EventSeries[]> {\n return await this.list({ where: { organizerId } });\n }\n\n /**\n * Get currently active series\n *\n * @returns Array of EventSeries instances active today\n */\n async getActive(): Promise<EventSeries[]> {\n const allSeries = await this.list({});\n const now = new Date();\n\n return allSeries.filter((series) => {\n if (series.startDate && now < series.startDate) return false;\n if (series.endDate && now > series.endDate) return false;\n return true;\n });\n }\n\n /**\n * Get upcoming series\n *\n * @param limit - Maximum number of series to return\n * @returns Array of EventSeries instances starting in the future\n */\n async getUpcoming(limit?: number): Promise<EventSeries[]> {\n const allSeries = await this.list({});\n const now = new Date();\n\n const upcoming = allSeries\n .filter((series) => series.startDate && series.startDate > now)\n .sort((a, b) => {\n if (!a.startDate || !b.startDate) return 0;\n return a.startDate.getTime() - b.startDate.getTime();\n });\n\n return limit ? upcoming.slice(0, limit) : upcoming;\n }\n\n /**\n * Get series by type\n *\n * @param typeId - EventType ID\n * @returns Array of EventSeries instances\n */\n async getByType(typeId: string): Promise<EventSeries[]> {\n return await this.list({ where: { typeId } });\n }\n\n /**\n * Search series with filters\n *\n * @param query - Search query for name/description\n * @param filters - Additional filter criteria\n * @returns Array of matching EventSeries instances\n */\n async search(\n query: string,\n filters?: EventSeriesSearchFilters,\n ): Promise<EventSeries[]> {\n let series = await this.list({});\n\n // Filter by query\n if (query) {\n const lowerQuery = query.toLowerCase();\n series = series.filter(\n (s) =>\n s.name?.toLowerCase().includes(lowerQuery) ||\n s.description?.toLowerCase().includes(lowerQuery),\n );\n }\n\n // Apply filters\n if (filters) {\n if (filters.typeId) {\n series = series.filter((s) => s.typeId === filters.typeId);\n }\n if (filters.organizerId) {\n series = series.filter((s) => s.organizerId === filters.organizerId);\n }\n if (filters.startDate) {\n const startDate = filters.startDate;\n series = series.filter((s) => s.startDate && s.startDate >= startDate);\n }\n if (filters.endDate) {\n const endDate = filters.endDate;\n series = series.filter((s) => s.endDate && s.endDate <= endDate);\n }\n }\n\n return series;\n }\n\n // ============================================\n // Tenant Helper Methods\n // ============================================\n\n /**\n * Find all event series for a specific tenant\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of EventSeries instances for the tenant\n */\n async findByTenant(tenantId: string): Promise<EventSeries[]> {\n return this.list({ where: { tenantId } });\n }\n\n /**\n * Find all global event series (no tenant association)\n *\n * @returns Array of EventSeries instances with no tenant\n */\n async findGlobal(): Promise<EventSeries[]> {\n return this.list({ where: { tenantId: null } });\n }\n\n /**\n * Find event series for a tenant including global series\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of EventSeries instances for the tenant and global series\n */\n async findWithGlobals(tenantId: string): Promise<EventSeries[]> {\n return this.query(\n `SELECT * FROM ${this.tableName} WHERE tenant_id = ? OR tenant_id IS NULL`,\n [tenantId],\n );\n }\n}\n","/**\n * EventType model - Defines types/categories of events\n *\n * Examples: 'basketball-game', 'concert', 'conference', 'goal', 'period'\n */\n\nimport { field, SmrtObject, smrt } from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { EventTypeOptions } from '../types';\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n api: { include: ['list', 'get', 'create', 'update', 'delete'] },\n mcp: { include: ['list', 'get', 'create'] },\n cli: true,\n})\nexport class EventType extends SmrtObject {\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n @field({ required: true })\n name: string = '';\n\n description: string = ''; // Optional description\n schema: string = ''; // JSON schema for event metadata (stored as text)\n participantSchema: string = ''; // JSON schema for participant metadata (stored as text)\n\n // Timestamps\n createdAt: Date = new Date();\n updatedAt: Date = new Date();\n\n constructor(options: EventTypeOptions = {}) {\n super(options);\n if (options.name) this.name = options.name;\n if (options.description !== undefined)\n this.description = options.description;\n\n // Handle schema - can be object or JSON string\n if (options.schema !== undefined) {\n if (typeof options.schema === 'string') {\n this.schema = options.schema;\n } else {\n this.schema = JSON.stringify(options.schema);\n }\n }\n\n // Handle participant schema\n if (options.participantSchema !== undefined) {\n if (typeof options.participantSchema === 'string') {\n this.participantSchema = options.participantSchema;\n } else {\n this.participantSchema = JSON.stringify(options.participantSchema);\n }\n }\n\n if (options.createdAt) this.createdAt = options.createdAt;\n if (options.updatedAt) this.updatedAt = options.updatedAt;\n }\n\n /**\n * Get schema as parsed object\n *\n * @returns Parsed schema object or empty object if no schema\n */\n getSchema(): Record<string, any> {\n if (!this.schema) return {};\n try {\n return JSON.parse(this.schema);\n } catch {\n return {};\n }\n }\n\n /**\n * Set schema from object\n *\n * @param data - Schema object to store\n */\n setSchema(data: Record<string, any>): void {\n this.schema = JSON.stringify(data);\n }\n\n /**\n * Get participant schema as parsed object\n *\n * @returns Parsed participant schema object or empty object\n */\n getParticipantSchema(): Record<string, any> {\n if (!this.participantSchema) return {};\n try {\n return JSON.parse(this.participantSchema);\n } catch {\n return {};\n }\n }\n\n /**\n * Set participant schema from object\n *\n * @param data - Participant schema object to store\n */\n setParticipantSchema(data: Record<string, any>): void {\n this.participantSchema = JSON.stringify(data);\n }\n\n /**\n * Convenience method for slug-based lookup\n *\n * @param slug - The slug to search for\n * @returns EventType instance or null if not found\n */\n static async getBySlug(_slug: string): Promise<EventType | null> {\n // Will be auto-implemented by SMRT\n return null;\n }\n}\n","/**\n * EventTypeCollection - Collection manager for EventType objects\n *\n * Provides lookup and creation for event types.\n */\n\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { EventType } from '../models/EventType';\n\nexport class EventTypeCollection extends SmrtCollection<EventType> {\n static readonly _itemClass = EventType;\n\n /**\n * Get or create an event type by slug\n *\n * @param slug - EventType slug (e.g., 'basketball-game', 'concert')\n * @param name - Optional display name (defaults to capitalized slug)\n * @returns EventType instance\n */\n async getOrCreate(slug: string, name?: string): Promise<EventType> {\n // First try to find existing type with this slug\n const existing = await this.get({ slug });\n\n if (existing) {\n return existing;\n }\n\n // Create new type with auto-generated name if not provided\n const displayName =\n name || slug.replace(/-/g, ' ').replace(/\\b\\w/g, (l) => l.toUpperCase());\n\n return await this.create({\n slug,\n name: displayName,\n });\n }\n\n /**\n * Get an event type by slug\n *\n * @param slug - EventType slug to search for\n * @returns EventType instance or null if not found\n */\n async getBySlug(slug: string): Promise<EventType | null> {\n return await this.get({ slug });\n }\n\n /**\n * Initialize default event types\n *\n * Creates common event types if they don't exist:\n * - Sports: game, period, goal, assist, penalty\n * - Entertainment: concert, performance, song\n * - Professional: conference, session, presentation, workshop\n * - Community: meeting, agenda-item, motion, vote\n *\n * @returns Array of created/existing event types\n */\n async initializeDefaults(): Promise<EventType[]> {\n const defaults = [\n // Sports\n { slug: 'game', name: 'Game' },\n { slug: 'match', name: 'Match' },\n { slug: 'period', name: 'Period' },\n { slug: 'quarter', name: 'Quarter' },\n { slug: 'inning', name: 'Inning' },\n { slug: 'goal', name: 'Goal' },\n { slug: 'assist', name: 'Assist' },\n { slug: 'penalty', name: 'Penalty' },\n { slug: 'substitution', name: 'Substitution' },\n\n // Entertainment\n { slug: 'concert', name: 'Concert' },\n { slug: 'performance', name: 'Performance' },\n { slug: 'set', name: 'Set' },\n { slug: 'song', name: 'Song' },\n { slug: 'theater', name: 'Theater' },\n { slug: 'show', name: 'Show' },\n\n // Professional\n { slug: 'conference', name: 'Conference' },\n { slug: 'session', name: 'Session' },\n { slug: 'presentation', name: 'Presentation' },\n { slug: 'workshop', name: 'Workshop' },\n { slug: 'seminar', name: 'Seminar' },\n { slug: 'keynote', name: 'Keynote' },\n { slug: 'panel', name: 'Panel' },\n\n // Community\n { slug: 'meeting', name: 'Meeting' },\n { slug: 'town-hall', name: 'Town Hall' },\n { slug: 'agenda-item', name: 'Agenda Item' },\n { slug: 'motion', name: 'Motion' },\n { slug: 'amendment', name: 'Amendment' },\n { slug: 'vote', name: 'Vote' },\n { slug: 'discussion', name: 'Discussion' },\n\n // General\n { slug: 'event', name: 'Event' },\n { slug: 'activity', name: 'Activity' },\n { slug: 'action', name: 'Action' },\n ];\n\n const types: EventType[] = [];\n for (const def of defaults) {\n const type = await this.getOrCreate(def.slug, def.name);\n types.push(type);\n }\n\n return types;\n }\n\n // ============================================\n // Tenant Helper Methods\n // ============================================\n\n /**\n * Find all event types for a specific tenant\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of EventType instances for the tenant\n */\n async findByTenant(tenantId: string): Promise<EventType[]> {\n return this.list({ where: { tenantId } });\n }\n\n /**\n * Find all global event types (no tenant association)\n *\n * @returns Array of EventType instances with no tenant\n */\n async findGlobal(): Promise<EventType[]> {\n return this.list({ where: { tenantId: null } });\n }\n\n /**\n * Find event types for a tenant including global types\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of EventType instances for the tenant and global types\n */\n async findWithGlobals(tenantId: string): Promise<EventType[]> {\n return this.query(\n `SELECT * FROM ${this.tableName} WHERE tenant_id = ? OR tenant_id IS NULL`,\n [tenantId],\n );\n }\n}\n"],"names":["__decorateClass","EventCollection","__publicField","EventSeriesCollection","EventTypeCollection","EventParticipantCollection","EventAssetCollection","tenantId"],"mappings":";;;;;AAsBA,eAAe;AAAA,EACb,IAAA,IAAA,mBAAA,YAAA,GAAA;AACF;;;;;;;;;;;ACEO,IAAM,aAAN,cAAyB,WAAW;A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QAAA;AAAA,MACvB,EAAE,MAAM,YAAY,MAAM,WAAA;AAAA,MAC1B,EAAE,MAAM,UAAU,MAAM,SAAA;AAAA,IAAS;AAGnC,UAAM,QAAqB,CAAA;AAC3B,eAAW,OAAO,UAAU;AAC1B,YAAM,OAAO,MAAM,KAAK,YAAY,IAAI,MAAM,IAAI,IAAI;AACtD,YAAM,KAAK,IAAI;AAAA,IACjB;AAEA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAM,aAAaA,WAAwC;AACzD,WAAO,KAAK,KAAK,EAAE,OAAO,EAAE,UAAAA,UAAA,GAAY;AAAA,EAC1C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,aAAmC;AACvC,WAAO,KAAK,KAAK,EAAE,OAAO,EAAE,UAAU,KAAA,GAAQ;AAAA,EAChD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,gBAAgBA,WAAwC;AAC5D,WAAO,KAAK;AAAA,MACV,iBAAiB,KAAK,SAAS;AAAA,MAC/B,CAACA,SAAQ;AAAA,IAAA;AAAA,EAEb;AACF;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/__smrt-register__.ts","../src/models/EventAsset.ts","../src/collections/EventAssetCollection.ts","../src/models/Event.ts","../src/collections/EventCollection.ts","../src/models/EventParticipant.ts","../src/collections/EventParticipantCollection.ts","../src/models/EventSeries.ts","../src/collections/EventSeriesCollection.ts","../src/models/EventType.ts","../src/collections/EventTypeCollection.ts"],"sourcesContent":["/**\n * Self-registers this package's build-time manifest before any @smrt() decorator\n * in the package fires. Fixes issue #1132: in consumer runtimes (tsx, SvelteKit\n * SSR, plain `vite dev`) the decorator's synchronous manifest lookup previously\n * missed because no step populated the global manifest cache — classes got\n * registered with zero fields and `save()` / `toJSON()` silently dropped every\n * declared property.\n *\n * Import this module as the first statement in `src/index.ts` so its top-level\n * side effect runs ahead of any class module's @smrt() decorator.\n *\n * Silent no-op in dev/test, where the vitest plugin already populates manifests\n * via a different path. Only needs to succeed in the published dist output.\n *\n * @see https://github.com/happyvertical/smrt/issues/1132\n */\nimport { ObjectRegistry } from '@happyvertical/smrt-core';\n\n// `new URL('./manifest.json', import.meta.url)` resolves at runtime to the\n// manifest sitting next to this module's compiled output. Vite warns at build\n// time that it cannot pre-resolve the URL; that is the intended behavior —\n// the URL must resolve to dist/manifest.json at runtime, not be inlined.\nObjectRegistry.registerPackageManifest(\n new URL('./manifest.json', import.meta.url),\n);\n","import type { SmrtObjectOptions } from '@happyvertical/smrt-core';\nimport {\n crossPackageRef,\n field,\n foreignKey,\n SmrtObject,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\n\nexport interface EventAssetOptions extends SmrtObjectOptions {\n eventId?: string;\n assetId?: string;\n relationship?: string;\n sortOrder?: number;\n tenantId?: string | null;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableName: 'event_assets',\n conflictColumns: ['event_id', 'asset_id', 'relationship'],\n api: false,\n mcp: false,\n cli: false,\n})\nexport class EventAsset extends SmrtObject {\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n @foreignKey('Event', { required: true })\n eventId = '';\n\n @crossPackageRef('@happyvertical/smrt-assets:Asset', { required: true })\n assetId = '';\n\n @field({ required: true })\n relationship = 'attachment';\n\n @field()\n sortOrder = 0;\n\n constructor(options: EventAssetOptions = {}) {\n super(options);\n if (options.eventId) this.eventId = options.eventId;\n if (options.assetId) this.assetId = options.assetId;\n if (options.relationship) this.relationship = options.relationship;\n if (options.sortOrder !== undefined) this.sortOrder = options.sortOrder;\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n }\n}\n","import type { Asset } from '@happyvertical/smrt-assets';\nimport {\n addOwnedAssetFromCollection,\n getOwnedAssetsFromCollection,\n removeOwnedAssetFromCollection,\n} from '@happyvertical/smrt-assets';\nimport type { SmrtCollectionOptions } from '@happyvertical/smrt-core';\nimport { SmrtJunction, smrt } from '@happyvertical/smrt-core';\nimport { EventAsset } from '../models/EventAsset';\nimport type { EventCollection } from './EventCollection';\n\nexport interface EventAssetCollectionOptions extends SmrtCollectionOptions {}\n\n@smrt({\n api: false,\n mcp: false,\n cli: false,\n})\nexport class EventAssetCollection extends SmrtJunction<EventAsset> {\n static readonly _itemClass = EventAsset;\n protected leftField = 'eventId';\n protected rightField = 'assetId';\n\n private eventCollectionPromise: Promise<EventCollection> | null = null;\n\n private async getEventCollection(): Promise<EventCollection> {\n if (!this.eventCollectionPromise) {\n const { EventCollection } = await import('./EventCollection');\n this.eventCollectionPromise = EventCollection.create({ db: this.db });\n }\n\n return this.eventCollectionPromise;\n }\n\n async getAssets(eventId: string, relationship?: string): Promise<Asset[]> {\n return getOwnedAssetsFromCollection(\n await this.getEventCollection(),\n eventId,\n relationship,\n );\n }\n\n async addAsset(\n eventId: string,\n asset: Asset,\n relationship = 'attachment',\n sortOrder = 0,\n ): Promise<void> {\n await addOwnedAssetFromCollection(\n await this.getEventCollection(),\n 'Event',\n eventId,\n asset,\n relationship,\n sortOrder,\n );\n }\n\n async removeAsset(\n eventId: string,\n assetId: string,\n relationship?: string,\n ): Promise<void> {\n await removeOwnedAssetFromCollection(\n await this.getEventCollection(),\n 'Event',\n eventId,\n assetId,\n relationship,\n );\n }\n}\n","/**\n * Event model - Hierarchical event instances\n *\n * Infinitely nestable: Game → Period → Goal → Assist\n */\n\nimport type { Asset } from '@happyvertical/smrt-assets';\nimport {\n assertValidOwnedAssetRelationship,\n assertValidOwnedAssetSortOrder,\n resolveOwnedAssetsById,\n} from '@happyvertical/smrt-assets';\nimport {\n crossPackageRef,\n foreignKey,\n SmrtHierarchical,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { EventOptions, EventStatus } from '../types';\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n api: { include: ['list', 'get', 'create', 'update', 'delete'] },\n mcp: { include: ['list', 'get', 'create', 'update'] },\n cli: true,\n})\nexport class Event extends SmrtHierarchical {\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n name: string = '';\n @foreignKey('EventSeries')\n seriesId = ''; // FK to EventSeries (nullable for standalone events)\n // parentId inherited from SmrtHierarchical (self-reference to parent Event)\n @foreignKey('EventType')\n typeId = ''; // FK to EventType\n @crossPackageRef('@happyvertical/smrt-places:Place')\n placeId = ''; // FK to Place (from @happyvertical/smrt-places)\n description = '';\n startDate: Date | null = null;\n endDate: Date | null = null;\n status: EventStatus = 'scheduled';\n round: number | null = null; // Sequence/round number in series\n metadata = ''; // JSON metadata (stored as text)\n externalId = ''; // External system identifier\n source = ''; // Source system\n\n // Timestamps\n createdAt = new Date();\n updatedAt = new Date();\n\n constructor(options: EventOptions = {}) {\n super(options);\n\n if (options.seriesId !== undefined) this.seriesId = options.seriesId;\n if (options.parentId !== undefined)\n this.parentId = options.parentId ?? null;\n if (options.typeId) this.typeId = options.typeId;\n if (options.placeId !== undefined) this.placeId = options.placeId;\n if (options.description !== undefined)\n this.description = options.description;\n if (options.startDate !== undefined)\n this.startDate = options.startDate || null;\n if (options.endDate !== undefined) this.endDate = options.endDate || null;\n if (options.status !== undefined) this.status = options.status;\n if (options.round !== undefined) this.round = options.round;\n if (options.externalId !== undefined) this.externalId = options.externalId;\n if (options.source !== undefined) this.source = options.source;\n\n // Handle metadata - can be object or JSON string\n if (options.metadata !== undefined) {\n if (typeof options.metadata === 'string') {\n this.metadata = options.metadata;\n } else {\n this.metadata = JSON.stringify(options.metadata);\n }\n }\n\n if (options.createdAt) this.createdAt = options.createdAt;\n if (options.updatedAt) this.updatedAt = options.updatedAt;\n }\n\n /**\n * Get metadata as parsed object\n *\n * @returns Parsed metadata object or empty object\n */\n getMetadata(): Record<string, any> {\n if (!this.metadata) return {};\n try {\n return JSON.parse(this.metadata);\n } catch {\n return {};\n }\n }\n\n /**\n * Set metadata from object\n *\n * @param data - Metadata object to store\n */\n setMetadata(data: Record<string, any>): void {\n this.metadata = JSON.stringify(data);\n }\n\n /**\n * Update metadata by merging with existing values\n *\n * @param updates - Partial metadata to merge\n */\n updateMetadata(updates: Record<string, any>): void {\n const current = this.getMetadata();\n this.setMetadata({ ...current, ...updates });\n }\n\n /**\n * Update event status\n *\n * @param newStatus - New status to set\n */\n async updateStatus(newStatus: EventStatus): Promise<void> {\n this.status = newStatus;\n this.updatedAt = new Date();\n await this.save();\n }\n\n /**\n * Get the series for this event\n *\n * @returns EventSeries instance or null\n */\n async getSeries() {\n if (!this.seriesId) return null;\n\n const { EventSeriesCollection } = await import(\n '../collections/EventSeriesCollection'\n );\n const collection = await (EventSeriesCollection as any).create(\n this.options,\n );\n\n return await collection.get({ id: this.seriesId });\n }\n\n /**\n * Get the event type\n *\n * @returns EventType instance or null\n */\n async getType() {\n if (!this.typeId) return null;\n\n const { EventTypeCollection } = await import(\n '../collections/EventTypeCollection'\n );\n const collection = await (EventTypeCollection as any).create(this.options);\n\n return await collection.get({ id: this.typeId });\n }\n\n /**\n * Get the place for this event\n *\n * @returns Place instance or null\n */\n async getPlace() {\n if (!this.placeId) return null;\n\n try {\n const { PlaceCollection } = await import('@happyvertical/smrt-places');\n const collection = await (PlaceCollection as any).create(this.options);\n\n return await collection.get({ id: this.placeId });\n } catch {\n // @happyvertical/smrt-places not available\n return null;\n }\n }\n\n // Hierarchy traversal (getParent / getChildren / getAncestors /\n // getDescendants / getHierarchy / moveTo) provided by SmrtHierarchical.\n\n /**\n * Get the root event (top-level ancestor) of this event's hierarchy.\n *\n * @returns Root event instance — `this` when already root\n */\n async getRootEvent(): Promise<Event> {\n const ancestors = await this.getAncestors();\n return (ancestors.length > 0 ? ancestors[0] : this) as Event;\n }\n\n /**\n * Get all participants for this event\n *\n * @returns Array of EventParticipant instances\n */\n async getParticipants() {\n const { EventParticipantCollection } = await import(\n '../collections/EventParticipantCollection'\n );\n const collection = await (EventParticipantCollection as any).create(\n this.options,\n );\n\n return await collection.list({ where: { eventId: this.id } });\n }\n\n private async getEventAssetCollection() {\n const { EventAssetCollection } = await import(\n '../collections/EventAssetCollection'\n );\n return EventAssetCollection.create({ db: this.db });\n }\n async getAssets(relationship?: string): Promise<Asset[]> {\n if (!this.id) {\n return [];\n }\n\n const eventAssets = await this.getEventAssetCollection();\n const linkedAssets = await eventAssets.byLeft(\n this.id,\n relationship ? { relationship } : {},\n );\n\n return resolveOwnedAssetsById(\n this.db,\n linkedAssets.map((link) => link.assetId),\n this.tenantId,\n );\n }\n\n async addAsset(\n asset: Asset,\n relationship = 'attachment',\n sortOrder = 0,\n ): Promise<void> {\n if (!this.id || !asset.id) {\n throw new Error('Cannot associate unsaved event or asset');\n }\n\n assertValidOwnedAssetRelationship(relationship);\n assertValidOwnedAssetSortOrder(sortOrder);\n\n const eventAssets = await this.getEventAssetCollection();\n await eventAssets.attach(this.id, asset.id, {\n relationship,\n sortOrder,\n tenantId: this.tenantId,\n });\n }\n\n async removeAsset(assetId: string, relationship?: string): Promise<void> {\n if (!this.id) {\n return;\n }\n\n const eventAssets = await this.getEventAssetCollection();\n await eventAssets.detach(\n this.id,\n assetId,\n relationship ? { relationship } : {},\n );\n }\n\n /**\n * Check if event is currently in progress\n *\n * @returns True if current time is between start and end\n */\n isInProgress(): boolean {\n if (this.status !== 'in_progress') return false;\n\n const now = new Date();\n if (this.startDate && now < this.startDate) return false;\n if (this.endDate && now > this.endDate) return false;\n\n return true;\n }\n\n /**\n * Check if event is a root event (no parent)\n *\n * @returns True if parentId is null/empty\n */\n isRoot(): boolean {\n return !this.parentId;\n }\n}\n","/**\n * EventCollection - Collection manager for Event objects\n *\n * Provides hierarchy traversal, filtering, and search capabilities.\n */\n\nimport type { Asset } from '@happyvertical/smrt-assets';\nimport {\n addOwnedAssetFromCollection,\n getOwnedAssetsFromCollection,\n removeOwnedAssetFromCollection,\n} from '@happyvertical/smrt-assets';\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { queryGlobal, queryWithGlobals } from '@happyvertical/smrt-tenancy';\nimport { Event } from '../models/Event';\nimport type { EventSearchFilters, EventStatus } from '../types';\n\nexport class EventCollection extends SmrtCollection<Event> {\n static readonly _itemClass = Event;\n\n /**\n * Get events by series\n *\n * @param seriesId - EventSeries ID\n * @returns Array of Event instances\n */\n async getBySeriesId(seriesId: string): Promise<Event[]> {\n return await this.list({ where: { seriesId } });\n }\n\n /**\n * Get events at a specific place\n *\n * @param placeId - Place ID\n * @returns Array of Event instances\n */\n async getByPlace(placeId: string): Promise<Event[]> {\n return await this.list({ where: { placeId } });\n }\n\n /**\n * Get events by date range\n *\n * @param startDate - Start of date range\n * @param endDate - End of date range\n * @returns Array of Event instances\n */\n async getByDateRange(startDate: Date, endDate: Date): Promise<Event[]> {\n const allEvents = await this.list({});\n\n return allEvents.filter((event) => {\n if (!event.startDate) return false;\n return event.startDate >= startDate && event.startDate <= endDate;\n });\n }\n\n /**\n * Get upcoming events\n *\n * @param limit - Maximum number of events to return\n * @returns Array of Event instances starting in the future\n */\n async getUpcoming(limit?: number): Promise<Event[]> {\n const allEvents = await this.list({});\n const now = new Date();\n\n const upcoming = allEvents\n .filter((event) => event.startDate && event.startDate > now)\n .sort((a, b) => {\n if (!a.startDate || !b.startDate) return 0;\n return a.startDate.getTime() - b.startDate.getTime();\n });\n\n return limit ? upcoming.slice(0, limit) : upcoming;\n }\n\n /**\n * Get events by status\n *\n * @param status - Event status to filter by\n * @returns Array of Event instances\n */\n async getByStatus(status: EventStatus): Promise<Event[]> {\n return await this.list({ where: { status } });\n }\n\n /**\n * Get events by type\n *\n * @param typeId - EventType ID\n * @returns Array of Event instances\n */\n async getByType(typeId: string): Promise<Event[]> {\n return await this.list({ where: { typeId } });\n }\n\n /**\n * Get root events (no parent)\n *\n * @returns Array of Event instances with no parent\n */\n async getRootEvents(): Promise<Event[]> {\n const allEvents = await this.list({});\n return allEvents.filter((event) => !event.parentId);\n }\n\n /**\n * Get children of a parent event\n *\n * @param parentId - Parent event ID\n * @returns Array of child Event instances\n */\n async getByParent(parentId: string): Promise<Event[]> {\n return await this.list({ where: { parentId } });\n }\n\n /**\n * Get full event tree (hierarchy)\n *\n * @param eventId - Root event ID\n * @returns Object with root event and nested children\n */\n async getEventTree(eventId: string): Promise<Event | null> {\n const event = await this.get({ id: eventId });\n if (!event) return null;\n\n return await event.getHierarchy().then((h) => h.current);\n }\n\n async getAssets(eventId: string, relationship?: string): Promise<Asset[]> {\n return getOwnedAssetsFromCollection(this, eventId, relationship);\n }\n\n async addAsset(\n eventId: string,\n asset: Asset,\n relationship = 'attachment',\n sortOrder = 0,\n ): Promise<void> {\n await addOwnedAssetFromCollection(\n this,\n 'Event',\n eventId,\n asset,\n relationship,\n sortOrder,\n );\n }\n\n async removeAsset(\n eventId: string,\n assetId: string,\n relationship?: string,\n ): Promise<void> {\n await removeOwnedAssetFromCollection(\n this,\n 'Event',\n eventId,\n assetId,\n relationship,\n );\n }\n\n /**\n * Search events with filters\n *\n * @param query - Search query for name/description\n * @param filters - Additional filter criteria\n * @returns Array of matching Event instances\n */\n async search(query: string, filters?: EventSearchFilters): Promise<Event[]> {\n let events = await this.list({});\n\n // Filter by query\n if (query) {\n const lowerQuery = query.toLowerCase();\n events = events.filter(\n (e) =>\n e.name?.toLowerCase().includes(lowerQuery) ||\n e.description?.toLowerCase().includes(lowerQuery),\n );\n }\n\n // Apply filters\n if (filters) {\n if (filters.typeId) {\n events = events.filter((e) => e.typeId === filters.typeId);\n }\n if (filters.seriesId) {\n events = events.filter((e) => e.seriesId === filters.seriesId);\n }\n if (filters.placeId) {\n events = events.filter((e) => e.placeId === filters.placeId);\n }\n if (filters.status) {\n if (Array.isArray(filters.status)) {\n events = events.filter((e) => filters.status?.includes(e.status));\n } else {\n events = events.filter((e) => e.status === filters.status);\n }\n }\n if (filters.startDate) {\n const startDate = filters.startDate;\n events = events.filter((e) => e.startDate && e.startDate >= startDate);\n }\n if (filters.endDate) {\n const endDate = filters.endDate;\n events = events.filter((e) => e.startDate && e.startDate <= endDate);\n }\n if (filters.organizerId) {\n // Filter by series organizer\n events = events.filter(async (e) => {\n const series = await e.getSeries();\n return series && series.organizerId === filters.organizerId;\n });\n }\n }\n\n return events;\n }\n\n /**\n * Get events in progress\n *\n * @returns Array of Event instances currently in progress\n */\n async getInProgress(): Promise<Event[]> {\n const inProgressEvents = await this.getByStatus('in_progress');\n return inProgressEvents.filter((event) => event.isInProgress());\n }\n\n // ============================================\n // Tenant Helper Methods\n // ============================================\n\n /**\n * Find all events for a specific tenant\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of Event instances for the tenant\n */\n async findByTenant(tenantId: string): Promise<Event[]> {\n return this.list({ where: { tenantId } });\n }\n\n /**\n * Find all global events (no tenant association).\n *\n * Routes through the shared tenant-global helper so it does not throw under\n * an active tenant context (an explicit `tenant_id IS NULL` filter would be\n * flagged as an isolation violation). (#1600)\n *\n * @returns Array of Event instances with no tenant\n */\n async findGlobal(): Promise<Event[]> {\n return queryGlobal<Event>(this);\n }\n\n /**\n * Find events for a tenant including global events.\n *\n * Fails closed if an active tenant context requests a different tenant's\n * rows; the admin/system path keeps the cross-tenant capability. (#1600)\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of Event instances for the tenant and global events\n */\n async findWithGlobals(tenantId: string): Promise<Event[]> {\n return queryWithGlobals<Event>(this, tenantId, 'Event.findWithGlobals');\n }\n}\n","/**\n * EventParticipant model - Links participants to events\n *\n * Tracks who participated in an event with role and placement\n */\n\nimport {\n crossPackageRef,\n foreignKey,\n SmrtObject,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { EventParticipantOptions } from '../types';\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n // Junction table - uses event_id + profile_id + role as natural key\n // instead of slug-based conflict columns\n conflictColumns: ['event_id', 'profile_id', 'role'],\n api: { include: ['list', 'get', 'create', 'update', 'delete'] },\n mcp: { include: ['list', 'get', 'create', 'update'] },\n cli: true,\n})\nexport class EventParticipant extends SmrtObject {\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n // id inherited from SmrtObject\n\n @foreignKey('Event')\n eventId = ''; // FK to Event\n @crossPackageRef('@happyvertical/smrt-profiles:Profile')\n profileId = ''; // FK to Profile (from @happyvertical/smrt-profiles)\n role: string = ''; // Participant role (ParticipantRole or custom)\n placement: number | null = null; // Numeric position/placement\n groupId = ''; // Optional grouping (e.g., team ID for individual players)\n metadata = ''; // JSON metadata (stored as text)\n externalId = ''; // External system identifier\n source = ''; // Source system\n\n // Timestamps\n createdAt = new Date();\n updatedAt = new Date();\n\n constructor(options: EventParticipantOptions = {}) {\n super(options);\n\n if (options.eventId) this.eventId = options.eventId;\n if (options.profileId) this.profileId = options.profileId;\n if (options.role !== undefined) this.role = options.role;\n if (options.placement !== undefined) this.placement = options.placement;\n if (options.groupId !== undefined) this.groupId = options.groupId;\n if (options.externalId !== undefined) this.externalId = options.externalId;\n if (options.source !== undefined) this.source = options.source;\n\n // Handle metadata - can be object or JSON string\n if (options.metadata !== undefined) {\n if (typeof options.metadata === 'string') {\n this.metadata = options.metadata;\n } else {\n this.metadata = JSON.stringify(options.metadata);\n }\n }\n\n if (options.createdAt) this.createdAt = options.createdAt;\n if (options.updatedAt) this.updatedAt = options.updatedAt;\n }\n\n /**\n * Get metadata as parsed object\n *\n * @returns Parsed metadata object or empty object\n */\n getMetadata(): Record<string, any> {\n if (!this.metadata) return {};\n try {\n return JSON.parse(this.metadata);\n } catch {\n return {};\n }\n }\n\n /**\n * Set metadata from object\n *\n * @param data - Metadata object to store\n */\n setMetadata(data: Record<string, any>): void {\n this.metadata = JSON.stringify(data);\n }\n\n /**\n * Update metadata by merging with existing values\n *\n * @param updates - Partial metadata to merge\n */\n updateMetadata(updates: Record<string, any>): void {\n const current = this.getMetadata();\n this.setMetadata({ ...current, ...updates });\n }\n\n /**\n * Get the event for this participant\n *\n * @returns Event instance or null\n */\n async getEvent() {\n if (!this.eventId) return null;\n\n const { EventCollection } = await import('../collections/EventCollection');\n const collection = await (EventCollection as any).create(this.options);\n\n return await collection.get({ id: this.eventId });\n }\n\n /**\n * Get the profile for this participant\n *\n * @returns Profile instance or null\n */\n async getProfile() {\n if (!this.profileId) return null;\n\n try {\n const { ProfileCollection } = await import(\n '@happyvertical/smrt-profiles'\n );\n const collection = await (ProfileCollection as any).create(this.options);\n\n return await collection.get({ id: this.profileId });\n } catch {\n // @happyvertical/smrt-profiles not available\n return null;\n }\n }\n\n /**\n * Get group participants (others with same groupId)\n *\n * @returns Array of EventParticipant instances\n */\n async getGroupParticipants(): Promise<EventParticipant[]> {\n if (!this.groupId) return [];\n\n const { EventParticipantCollection } = await import(\n '../collections/EventParticipantCollection'\n );\n const collection = await (EventParticipantCollection as any).create(\n this.options,\n );\n\n const participants = await collection.list({\n where: { eventId: this.eventId, groupId: this.groupId },\n });\n\n // Exclude self from results\n return participants.filter((p: EventParticipant) => p.id !== this.id);\n }\n\n /**\n * Check if this is a home participant (placement = 0)\n *\n * @returns True if placement is 0\n */\n isHome(): boolean {\n return this.placement === 0;\n }\n\n /**\n * Check if this is an away participant (placement = 1)\n *\n * @returns True if placement is 1\n */\n isAway(): boolean {\n return this.placement === 1;\n }\n}\n","/**\n * EventParticipantCollection — junction collection for Event ↔ Profile links.\n *\n * The generic junction surface (byLeft/byRight/attach/detach/setLinks) comes\n * from `SmrtJunction`. Domain-specific helpers (placement-ordered queries,\n * home/away accessors, statistics, tenant scoping) live alongside.\n */\n\nimport { SmrtJunction, smrt } from '@happyvertical/smrt-core';\nimport { queryGlobal, queryWithGlobals } from '@happyvertical/smrt-tenancy';\nimport { EventParticipant } from '../models/EventParticipant';\nimport type { ParticipantSearchFilters } from '../types';\n\n// Decorator with empty config — only needed so the scanner detects the\n// class. See FactContentCollection for the full rationale.\n@smrt()\nexport class EventParticipantCollection extends SmrtJunction<EventParticipant> {\n static readonly _itemClass = EventParticipant;\n protected leftField = 'eventId';\n protected rightField = 'profileId';\n // EventParticipant has no sortOrder column; `placement` is domain ordering\n // (0=home, 1=away) and must not be auto-assigned by setLinks.\n protected sortField: string | null = null;\n protected positionField: string | null = null;\n\n // ============================================\n // Domain helpers\n // ============================================\n\n /**\n * Get participants ordered by placement (nulls last).\n */\n async getByPlacement(eventId: string): Promise<EventParticipant[]> {\n const participants = await this.byLeft(eventId);\n\n return participants.sort((a, b) => {\n if (a.placement === null && b.placement === null) return 0;\n if (a.placement === null) return 1;\n if (b.placement === null) return -1;\n return a.placement - b.placement;\n });\n }\n\n /**\n * Get participants by group within an event.\n */\n async getByGroup(\n eventId: string,\n groupId: string,\n ): Promise<EventParticipant[]> {\n return this.byLeft(eventId, { groupId });\n }\n\n /**\n * Get the home participant(s) — placement = 0.\n */\n async getHome(eventId: string): Promise<EventParticipant[]> {\n return this.byLeft(eventId, { placement: 0 });\n }\n\n /**\n * Get the away participant(s) — placement = 1.\n */\n async getAway(eventId: string): Promise<EventParticipant[]> {\n return this.byLeft(eventId, { placement: 1 });\n }\n\n /**\n * Search participants with optional filters.\n */\n async search(filters: ParticipantSearchFilters): Promise<EventParticipant[]> {\n let participants = await this.list({});\n\n if (filters.eventId) {\n participants = participants.filter((p) => p.eventId === filters.eventId);\n }\n if (filters.profileId) {\n participants = participants.filter(\n (p) => p.profileId === filters.profileId,\n );\n }\n if (filters.role) {\n participants = participants.filter((p) => p.role === filters.role);\n }\n if (filters.groupId) {\n participants = participants.filter((p) => p.groupId === filters.groupId);\n }\n\n return participants;\n }\n\n /**\n * Get participation statistics for a profile, optionally filtered by event type.\n */\n async getParticipantStats(\n profileId: string,\n eventTypeId?: string,\n ): Promise<{\n totalEvents: number;\n byRole: Record<string, number>;\n byPlacement: Record<number, number>;\n }> {\n const participants = await this.byRight(profileId);\n\n let filteredParticipants = participants;\n if (eventTypeId) {\n filteredParticipants = [];\n for (const participant of participants) {\n const event = await participant.getEvent();\n if (event && event.typeId === eventTypeId) {\n filteredParticipants.push(participant);\n }\n }\n }\n\n const byRole: Record<string, number> = {};\n const byPlacement: Record<number, number> = {};\n\n for (const participant of filteredParticipants) {\n byRole[participant.role] = (byRole[participant.role] || 0) + 1;\n\n if (participant.placement !== null) {\n byPlacement[participant.placement] =\n (byPlacement[participant.placement] || 0) + 1;\n }\n }\n\n return {\n totalEvents: filteredParticipants.length,\n byRole,\n byPlacement,\n };\n }\n\n // ============================================\n // Tenant helpers\n // ============================================\n\n async findByTenant(tenantId: string): Promise<EventParticipant[]> {\n return this.list({ where: { tenantId } });\n }\n\n /**\n * Find all global participants (no tenant association).\n *\n * Routes through the shared tenant-global helper so it does not throw under\n * an active tenant context (an explicit `tenant_id IS NULL` filter would be\n * flagged as an isolation violation). (#1600)\n */\n async findGlobal(): Promise<EventParticipant[]> {\n return queryGlobal<EventParticipant>(this);\n }\n\n /**\n * Find participants for a tenant plus all global participants.\n *\n * Fails closed if an active tenant context requests a different tenant's\n * rows; the admin/system path keeps the cross-tenant capability. (#1600)\n */\n async findWithGlobals(tenantId: string): Promise<EventParticipant[]> {\n return queryWithGlobals<EventParticipant>(\n this,\n tenantId,\n 'EventParticipant.findWithGlobals',\n );\n }\n}\n","/**\n * EventSeries model - Groups related events (season, tour, conference, etc.)\n *\n * Examples: '2024 NBA Finals', 'Summer Tour 2024', 'Town Council 2024'\n */\n\nimport {\n crossPackageRef,\n foreignKey,\n SmrtObject,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { EventSeriesOptions, RecurrencePattern } from '../types';\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n api: { include: ['list', 'get', 'create', 'update', 'delete'] },\n mcp: { include: ['list', 'get', 'create', 'update'] },\n cli: true,\n})\nexport class EventSeries extends SmrtObject {\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n name: string = '';\n @foreignKey('EventType')\n typeId = ''; // FK to EventType\n @crossPackageRef('@happyvertical/smrt-profiles:Profile')\n organizerId = ''; // FK to Profile (from @happyvertical/smrt-profiles)\n description = '';\n startDate: Date | null = null;\n endDate: Date | null = null;\n recurrence = ''; // JSON recurrence pattern (stored as text)\n metadata = ''; // JSON metadata (stored as text)\n externalId = ''; // External system identifier\n source = ''; // Source system (e.g., 'ticketmaster', 'espn')\n\n // Timestamps\n createdAt = new Date();\n updatedAt = new Date();\n\n constructor(options: EventSeriesOptions = {}) {\n super(options);\n\n if (options.typeId) this.typeId = options.typeId;\n if (options.organizerId) this.organizerId = options.organizerId;\n if (options.description !== undefined)\n this.description = options.description;\n if (options.startDate !== undefined)\n this.startDate = options.startDate || null;\n if (options.endDate !== undefined) this.endDate = options.endDate || null;\n if (options.externalId !== undefined) this.externalId = options.externalId;\n if (options.source !== undefined) this.source = options.source;\n\n // Handle recurrence - can be object or JSON string\n if (options.recurrence !== undefined) {\n if (typeof options.recurrence === 'string') {\n this.recurrence = options.recurrence;\n } else {\n this.recurrence = JSON.stringify(options.recurrence);\n }\n }\n\n // Handle metadata - can be object or JSON string\n if (options.metadata !== undefined) {\n if (typeof options.metadata === 'string') {\n this.metadata = options.metadata;\n } else {\n this.metadata = JSON.stringify(options.metadata);\n }\n }\n\n if (options.createdAt) this.createdAt = options.createdAt;\n if (options.updatedAt) this.updatedAt = options.updatedAt;\n }\n\n /**\n * Get recurrence pattern as parsed object\n *\n * @returns Parsed recurrence pattern or null\n */\n getRecurrence(): RecurrencePattern | null {\n if (!this.recurrence) return null;\n try {\n return JSON.parse(this.recurrence) as RecurrencePattern;\n } catch {\n return null;\n }\n }\n\n /**\n * Set recurrence pattern from object\n *\n * @param pattern - Recurrence pattern to store\n */\n setRecurrence(pattern: RecurrencePattern): void {\n this.recurrence = JSON.stringify(pattern);\n }\n\n /**\n * Get metadata as parsed object\n *\n * @returns Parsed metadata object or empty object\n */\n getMetadata(): Record<string, any> {\n if (!this.metadata) return {};\n try {\n return JSON.parse(this.metadata);\n } catch {\n return {};\n }\n }\n\n /**\n * Set metadata from object\n *\n * @param data - Metadata object to store\n */\n setMetadata(data: Record<string, any>): void {\n this.metadata = JSON.stringify(data);\n }\n\n /**\n * Update metadata by merging with existing values\n *\n * @param updates - Partial metadata to merge\n */\n updateMetadata(updates: Record<string, any>): void {\n const current = this.getMetadata();\n this.setMetadata({ ...current, ...updates });\n }\n\n /**\n * Get the event type for this series\n *\n * @returns EventType instance or null\n */\n async getType() {\n if (!this.typeId) return null;\n\n const { EventTypeCollection } = await import(\n '../collections/EventTypeCollection'\n );\n const collection = await (EventTypeCollection as any).create(this.options);\n\n return await collection.get({ id: this.typeId });\n }\n\n /**\n * Get the organizer profile for this series\n *\n * @returns Profile instance or null\n */\n async getOrganizer() {\n if (!this.organizerId) return null;\n\n // Import Profile from @happyvertical/smrt-profiles\n try {\n const { ProfileCollection } = await import(\n '@happyvertical/smrt-profiles'\n );\n const collection = await (ProfileCollection as any).create(this.options);\n\n return await collection.get({ id: this.organizerId });\n } catch {\n // @happyvertical/smrt-profiles not available\n return null;\n }\n }\n\n /**\n * Get all events in this series\n *\n * @returns Array of Event instances\n */\n async getEvents() {\n const { EventCollection } = await import('../collections/EventCollection');\n const collection = await (EventCollection as any).create(this.options);\n\n return await collection.list({ where: { seriesId: this.id } });\n }\n\n /**\n * Check if series is currently active\n *\n * @returns True if current date is between start and end\n */\n isActive(): boolean {\n const now = new Date();\n if (this.startDate && now < this.startDate) return false;\n if (this.endDate && now > this.endDate) return false;\n return true;\n }\n}\n","/**\n * EventSeriesCollection - Collection manager for EventSeries objects\n *\n * Provides queries for series by organizer, status, and date ranges.\n */\n\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { queryGlobal, queryWithGlobals } from '@happyvertical/smrt-tenancy';\nimport { EventSeries } from '../models/EventSeries';\nimport type { EventSeriesSearchFilters } from '../types';\n\nexport class EventSeriesCollection extends SmrtCollection<EventSeries> {\n static readonly _itemClass = EventSeries;\n\n /**\n * Get series by organizer\n *\n * @param organizerId - Profile ID of the organizer\n * @returns Array of EventSeries instances\n */\n async getByOrganizer(organizerId: string): Promise<EventSeries[]> {\n return await this.list({ where: { organizerId } });\n }\n\n /**\n * Get currently active series\n *\n * @returns Array of EventSeries instances active today\n */\n async getActive(): Promise<EventSeries[]> {\n const allSeries = await this.list({});\n const now = new Date();\n\n return allSeries.filter((series) => {\n if (series.startDate && now < series.startDate) return false;\n if (series.endDate && now > series.endDate) return false;\n return true;\n });\n }\n\n /**\n * Get upcoming series\n *\n * @param limit - Maximum number of series to return\n * @returns Array of EventSeries instances starting in the future\n */\n async getUpcoming(limit?: number): Promise<EventSeries[]> {\n const allSeries = await this.list({});\n const now = new Date();\n\n const upcoming = allSeries\n .filter((series) => series.startDate && series.startDate > now)\n .sort((a, b) => {\n if (!a.startDate || !b.startDate) return 0;\n return a.startDate.getTime() - b.startDate.getTime();\n });\n\n return limit ? upcoming.slice(0, limit) : upcoming;\n }\n\n /**\n * Get series by type\n *\n * @param typeId - EventType ID\n * @returns Array of EventSeries instances\n */\n async getByType(typeId: string): Promise<EventSeries[]> {\n return await this.list({ where: { typeId } });\n }\n\n /**\n * Search series with filters\n *\n * @param query - Search query for name/description\n * @param filters - Additional filter criteria\n * @returns Array of matching EventSeries instances\n */\n async search(\n query: string,\n filters?: EventSeriesSearchFilters,\n ): Promise<EventSeries[]> {\n let series = await this.list({});\n\n // Filter by query\n if (query) {\n const lowerQuery = query.toLowerCase();\n series = series.filter(\n (s) =>\n s.name?.toLowerCase().includes(lowerQuery) ||\n s.description?.toLowerCase().includes(lowerQuery),\n );\n }\n\n // Apply filters\n if (filters) {\n if (filters.typeId) {\n series = series.filter((s) => s.typeId === filters.typeId);\n }\n if (filters.organizerId) {\n series = series.filter((s) => s.organizerId === filters.organizerId);\n }\n if (filters.startDate) {\n const startDate = filters.startDate;\n series = series.filter((s) => s.startDate && s.startDate >= startDate);\n }\n if (filters.endDate) {\n const endDate = filters.endDate;\n series = series.filter((s) => s.endDate && s.endDate <= endDate);\n }\n }\n\n return series;\n }\n\n // ============================================\n // Tenant Helper Methods\n // ============================================\n\n /**\n * Find all event series for a specific tenant\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of EventSeries instances for the tenant\n */\n async findByTenant(tenantId: string): Promise<EventSeries[]> {\n return this.list({ where: { tenantId } });\n }\n\n /**\n * Find all global event series (no tenant association).\n *\n * Routes through the shared tenant-global helper so it does not throw under\n * an active tenant context (an explicit `tenant_id IS NULL` filter would be\n * flagged as an isolation violation). (#1600)\n *\n * @returns Array of EventSeries instances with no tenant\n */\n async findGlobal(): Promise<EventSeries[]> {\n return queryGlobal<EventSeries>(this);\n }\n\n /**\n * Find event series for a tenant including global series.\n *\n * Fails closed if an active tenant context requests a different tenant's\n * rows; the admin/system path keeps the cross-tenant capability. (#1600)\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of EventSeries instances for the tenant and global series\n */\n async findWithGlobals(tenantId: string): Promise<EventSeries[]> {\n return queryWithGlobals<EventSeries>(\n this,\n tenantId,\n 'EventSeries.findWithGlobals',\n );\n }\n}\n","/**\n * EventType model - Defines types/categories of events\n *\n * Examples: 'basketball-game', 'concert', 'conference', 'goal', 'period'\n */\n\nimport { field, SmrtObject, smrt } from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { EventTypeOptions } from '../types';\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableStrategy: 'sti',\n api: { include: ['list', 'get', 'create', 'update', 'delete'] },\n mcp: { include: ['list', 'get', 'create'] },\n cli: true,\n})\nexport class EventType extends SmrtObject {\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n @field({ required: true })\n name: string = '';\n\n description: string = ''; // Optional description\n schema: string = ''; // JSON schema for event metadata (stored as text)\n participantSchema: string = ''; // JSON schema for participant metadata (stored as text)\n\n // Timestamps\n createdAt: Date = new Date();\n updatedAt: Date = new Date();\n\n constructor(options: EventTypeOptions = {}) {\n super(options);\n if (options.name) this.name = options.name;\n if (options.description !== undefined)\n this.description = options.description;\n\n // Handle schema - can be object or JSON string\n if (options.schema !== undefined) {\n if (typeof options.schema === 'string') {\n this.schema = options.schema;\n } else {\n this.schema = JSON.stringify(options.schema);\n }\n }\n\n // Handle participant schema\n if (options.participantSchema !== undefined) {\n if (typeof options.participantSchema === 'string') {\n this.participantSchema = options.participantSchema;\n } else {\n this.participantSchema = JSON.stringify(options.participantSchema);\n }\n }\n\n if (options.createdAt) this.createdAt = options.createdAt;\n if (options.updatedAt) this.updatedAt = options.updatedAt;\n }\n\n /**\n * Get schema as parsed object\n *\n * @returns Parsed schema object or empty object if no schema\n */\n getSchema(): Record<string, any> {\n if (!this.schema) return {};\n try {\n return JSON.parse(this.schema);\n } catch {\n return {};\n }\n }\n\n /**\n * Set schema from object\n *\n * @param data - Schema object to store\n */\n setSchema(data: Record<string, any>): void {\n this.schema = JSON.stringify(data);\n }\n\n /**\n * Get participant schema as parsed object\n *\n * @returns Parsed participant schema object or empty object\n */\n getParticipantSchema(): Record<string, any> {\n if (!this.participantSchema) return {};\n try {\n return JSON.parse(this.participantSchema);\n } catch {\n return {};\n }\n }\n\n /**\n * Set participant schema from object\n *\n * @param data - Participant schema object to store\n */\n setParticipantSchema(data: Record<string, any>): void {\n this.participantSchema = JSON.stringify(data);\n }\n\n /**\n * Convenience method for slug-based lookup\n *\n * @param slug - The slug to search for\n * @returns EventType instance or null if not found\n */\n static async getBySlug(_slug: string): Promise<EventType | null> {\n // Will be auto-implemented by SMRT\n return null;\n }\n}\n","/**\n * EventTypeCollection - Collection manager for EventType objects\n *\n * Provides lookup and creation for event types.\n */\n\nimport { SmrtCollection } from '@happyvertical/smrt-core';\nimport { queryGlobal, queryWithGlobals } from '@happyvertical/smrt-tenancy';\nimport { EventType } from '../models/EventType';\n\nexport class EventTypeCollection extends SmrtCollection<EventType> {\n static readonly _itemClass = EventType;\n\n /**\n * Get or create an event type by slug\n *\n * @param slug - EventType slug (e.g., 'basketball-game', 'concert')\n * @param name - Optional display name (defaults to capitalized slug)\n * @returns EventType instance\n */\n async getOrCreate(slug: string, name?: string): Promise<EventType> {\n // First try to find existing type with this slug\n const existing = await this.get({ slug });\n\n if (existing) {\n return existing;\n }\n\n // Create new type with auto-generated name if not provided\n const displayName =\n name || slug.replace(/-/g, ' ').replace(/\\b\\w/g, (l) => l.toUpperCase());\n\n return await this.create({\n slug,\n name: displayName,\n });\n }\n\n /**\n * Get an event type by slug\n *\n * @param slug - EventType slug to search for\n * @returns EventType instance or null if not found\n */\n async getBySlug(slug: string): Promise<EventType | null> {\n return await this.get({ slug });\n }\n\n /**\n * Initialize default event types\n *\n * Creates common event types if they don't exist:\n * - Sports: game, period, goal, assist, penalty\n * - Entertainment: concert, performance, song\n * - Professional: conference, session, presentation, workshop\n * - Community: meeting, agenda-item, motion, vote\n *\n * @returns Array of created/existing event types\n */\n async initializeDefaults(): Promise<EventType[]> {\n const defaults = [\n // Sports\n { slug: 'game', name: 'Game' },\n { slug: 'match', name: 'Match' },\n { slug: 'period', name: 'Period' },\n { slug: 'quarter', name: 'Quarter' },\n { slug: 'inning', name: 'Inning' },\n { slug: 'goal', name: 'Goal' },\n { slug: 'assist', name: 'Assist' },\n { slug: 'penalty', name: 'Penalty' },\n { slug: 'substitution', name: 'Substitution' },\n\n // Entertainment\n { slug: 'concert', name: 'Concert' },\n { slug: 'performance', name: 'Performance' },\n { slug: 'set', name: 'Set' },\n { slug: 'song', name: 'Song' },\n { slug: 'theater', name: 'Theater' },\n { slug: 'show', name: 'Show' },\n\n // Professional\n { slug: 'conference', name: 'Conference' },\n { slug: 'session', name: 'Session' },\n { slug: 'presentation', name: 'Presentation' },\n { slug: 'workshop', name: 'Workshop' },\n { slug: 'seminar', name: 'Seminar' },\n { slug: 'keynote', name: 'Keynote' },\n { slug: 'panel', name: 'Panel' },\n\n // Community\n { slug: 'meeting', name: 'Meeting' },\n { slug: 'town-hall', name: 'Town Hall' },\n { slug: 'agenda-item', name: 'Agenda Item' },\n { slug: 'motion', name: 'Motion' },\n { slug: 'amendment', name: 'Amendment' },\n { slug: 'vote', name: 'Vote' },\n { slug: 'discussion', name: 'Discussion' },\n\n // General\n { slug: 'event', name: 'Event' },\n { slug: 'activity', name: 'Activity' },\n { slug: 'action', name: 'Action' },\n ];\n\n const types: EventType[] = [];\n for (const def of defaults) {\n const type = await this.getOrCreate(def.slug, def.name);\n types.push(type);\n }\n\n return types;\n }\n\n // ============================================\n // Tenant Helper Methods\n // ============================================\n\n /**\n * Find all event types for a specific tenant\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of EventType instances for the tenant\n */\n async findByTenant(tenantId: string): Promise<EventType[]> {\n return this.list({ where: { tenantId } });\n }\n\n /**\n * Find all global event types (no tenant association).\n *\n * Routes through the shared tenant-global helper so it does not throw under\n * an active tenant context (an explicit `tenant_id IS NULL` filter would be\n * flagged as an isolation violation). (#1600)\n *\n * @returns Array of EventType instances with no tenant\n */\n async findGlobal(): Promise<EventType[]> {\n return queryGlobal<EventType>(this);\n }\n\n /**\n * Find event types for a tenant including global types.\n *\n * Fails closed if an active tenant context requests a different tenant's\n * rows; the admin/system path keeps the cross-tenant capability. (#1600)\n *\n * @param tenantId - Tenant ID to filter by\n * @returns Array of EventType instances for the tenant and global types\n */\n async findWithGlobals(tenantId: string): Promise<EventType[]> {\n return queryWithGlobals<EventType>(\n this,\n tenantId,\n 'EventType.findWithGlobals',\n );\n }\n}\n"],"names":["__decorateClass","EventCollection","__publicField","EventSeriesCollection","EventTypeCollection","EventParticipantCollection","EventAssetCollection","tenantId"],"mappings":";;;;;AAsBA,eAAe;AAAA,EACb,IAAA,IAAA,mBAAA,YAAA,GAAA;AACF;;;;;;;;;;;ACEO,IAAM,aAAN,cAAyB,WAAW;AAAA,EAEzC,WAA0B;AAAA,EAG1B,UAAU;AAAA,EAGV,UAAU;AAAA,EAGV,eAAe;AAAA,EAGf,YAAY;AAAA,EAEZ,YAAY,UAA6B,IAAI;AAC3C,UAAM,OAAO;AACb,QAAI,QAAQ,QAAS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AACtD,YAAM,KAAK,IAAI;AAAA,IACjB;AAEA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAM,aAAaA,WAAwC;AACzD,WAAO,KAAK,KAAK,EAAE,OAAO,EAAE,UAAAA,UAAA,GAAY;AAAA,EAC1C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,aAAmC;AACvC,WAAO,YAAuB,IAAI;AAAA,EACpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWA,MAAM,gBAAgBA,WAAwC;AAC5D,WAAO;AAAA,MACL;AAAA,MACAA;AAAA,MACA;AAAA,IAAA;AAAA,EAEJ;AACF;;;;;"}
|
package/dist/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "1.0.0",
|
|
3
|
-
"timestamp":
|
|
3
|
+
"timestamp": 1782251547508,
|
|
4
4
|
"packageName": "@happyvertical/smrt-events",
|
|
5
|
-
"packageVersion": "0.34.
|
|
5
|
+
"packageVersion": "0.34.2",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-events:EventAssetCollection": {
|
|
8
8
|
"name": "eventassetcollection",
|
package/dist/smrt-knowledge.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-06-
|
|
3
|
+
"generatedAt": "2026-06-23T21:52:27.874Z",
|
|
4
4
|
"packageName": "@happyvertical/smrt-events",
|
|
5
|
-
"packageVersion": "0.34.
|
|
5
|
+
"packageVersion": "0.34.2",
|
|
6
6
|
"sourceManifestPath": "dist/manifest.json",
|
|
7
7
|
"agentDocPath": "AGENTS.md",
|
|
8
8
|
"sourceHashes": {
|
|
9
|
-
"manifest": "
|
|
10
|
-
"packageJson": "
|
|
9
|
+
"manifest": "178e905f38e73fa22975591b545b7027ac1e1bac56fa014b2a38889566c9551f",
|
|
10
|
+
"packageJson": "b3d173a6244a22467a00df6ee6c2639f4dc34ddb205514d2fca2322d9c8af129",
|
|
11
11
|
"agents": "297e9ee2a72287267bf9774c77587203db5215951075847172ebb012345f599e"
|
|
12
12
|
},
|
|
13
13
|
"exports": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-events",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.2",
|
|
4
4
|
"description": "Hierarchical event management with participant tracking and SMRT framework support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
"@happyvertical/logger": "^0.74.7",
|
|
50
50
|
"@happyvertical/sql": "^0.74.7",
|
|
51
51
|
"@happyvertical/utils": "^0.74.7",
|
|
52
|
-
"@happyvertical/smrt-core": "0.34.
|
|
53
|
-
"@happyvertical/smrt-
|
|
54
|
-
"@happyvertical/smrt-profiles": "0.34.
|
|
55
|
-
"@happyvertical/smrt-tenancy": "0.34.
|
|
56
|
-
"@happyvertical/smrt-
|
|
57
|
-
"@happyvertical/smrt-
|
|
58
|
-
"@happyvertical/smrt-
|
|
52
|
+
"@happyvertical/smrt-core": "0.34.2",
|
|
53
|
+
"@happyvertical/smrt-places": "0.34.2",
|
|
54
|
+
"@happyvertical/smrt-profiles": "0.34.2",
|
|
55
|
+
"@happyvertical/smrt-tenancy": "0.34.2",
|
|
56
|
+
"@happyvertical/smrt-types": "0.34.2",
|
|
57
|
+
"@happyvertical/smrt-ui": "0.34.2",
|
|
58
|
+
"@happyvertical/smrt-assets": "0.34.2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@sveltejs/package": "^2.5.7",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"typescript": "^5.9.3",
|
|
68
68
|
"vite": "^7.3.1",
|
|
69
69
|
"vitest": "^4.0.17",
|
|
70
|
-
"@happyvertical/smrt-vitest": "0.34.
|
|
70
|
+
"@happyvertical/smrt-vitest": "0.34.2"
|
|
71
71
|
},
|
|
72
72
|
"keywords": [
|
|
73
73
|
"events",
|