@happyvertical/smrt-sites 0.51.17 → 0.51.18

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.
@@ -2,86 +2,445 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-sites",
5
- "packageVersion": "0.51.17",
5
+ "packageVersion": "0.51.18",
6
6
  "objects": {
7
- "@happyvertical/smrt-sites:SiteAgentBindingCollection": {
8
- "name": "siteagentbindingcollection",
9
- "className": "SiteAgentBindingCollection",
10
- "qualifiedName": "@happyvertical/smrt-sites:SiteAgentBindingCollection",
11
- "collection": "siteagentbindings",
12
- "filePath": "/home/runner/work/smrt/smrt/packages/sites/src/collections/SiteAgentBindingCollection.ts",
7
+ "@happyvertical/smrt-sites:Site": {
8
+ "name": "site",
9
+ "className": "Site",
10
+ "qualifiedName": "@happyvertical/smrt-sites:Site",
11
+ "collection": "sites",
12
+ "filePath": "/home/runner/work/smrt/smrt/packages/sites/src/models/Site.ts",
13
13
  "packageName": "@happyvertical/smrt-sites",
14
- "fields": {},
15
- "methods": {
16
- "findBySite": {
17
- "name": "findBySite",
18
- "async": true,
19
- "parameters": [
20
- {
21
- "name": "siteId",
22
- "type": "string",
23
- "optional": false
14
+ "fields": {
15
+ "tenantId": {
16
+ "type": "text",
17
+ "required": true,
18
+ "_meta": {
19
+ "sqlType": "UUID",
20
+ "__tenancy": {
21
+ "isTenantIdField": true,
22
+ "autoFilter": true,
23
+ "required": true,
24
+ "autoPopulate": true,
25
+ "nullable": false,
26
+ "mode": "required",
27
+ "field": "tenantId",
28
+ "allowSuperAdminBypass": false
24
29
  }
25
- ],
26
- "returnType": "Promise<SiteAgentBinding[]>",
30
+ }
31
+ },
32
+ "name": {
33
+ "type": "text",
34
+ "required": false,
35
+ "default": ""
36
+ },
37
+ "domain": {
38
+ "type": "text",
39
+ "required": false,
40
+ "default": ""
41
+ },
42
+ "status": {
43
+ "type": "text",
44
+ "required": false,
45
+ "default": "draft"
46
+ },
47
+ "tier": {
48
+ "type": "text",
49
+ "required": false,
50
+ "default": "free"
51
+ },
52
+ "databaseUrl": {
53
+ "type": "text",
54
+ "required": false,
55
+ "default": ""
56
+ },
57
+ "databaseType": {
58
+ "type": "text",
59
+ "required": false,
60
+ "default": ""
61
+ },
62
+ "portalConfig": {
63
+ "type": "text",
64
+ "required": false,
65
+ "default": ""
66
+ },
67
+ "repositoryUrl": {
68
+ "type": "text",
69
+ "required": false,
70
+ "default": ""
71
+ },
72
+ "templateName": {
73
+ "type": "text",
74
+ "required": false,
75
+ "default": ""
76
+ },
77
+ "provisioningStatus": {
78
+ "type": "text",
79
+ "required": false,
80
+ "default": ""
81
+ },
82
+ "provisionedAt": {
83
+ "type": "datetime",
84
+ "required": false
85
+ },
86
+ "provisioningError": {
87
+ "type": "text",
88
+ "required": false,
89
+ "default": ""
90
+ },
91
+ "metadata": {
92
+ "type": "text",
93
+ "required": false,
94
+ "default": ""
95
+ },
96
+ "createdAt": {
97
+ "type": "datetime",
98
+ "required": false
99
+ },
100
+ "updatedAt": {
101
+ "type": "datetime",
102
+ "required": false
103
+ }
104
+ },
105
+ "methods": {
106
+ "isActive": {
107
+ "name": "isActive",
108
+ "async": false,
109
+ "parameters": [],
110
+ "returnType": "boolean",
27
111
  "isStatic": false,
28
112
  "isPublic": true
29
113
  },
30
- "findByAgent": {
31
- "name": "findByAgent",
32
- "async": true,
114
+ "isReady": {
115
+ "name": "isReady",
116
+ "async": false,
117
+ "parameters": [],
118
+ "returnType": "boolean",
119
+ "isStatic": false,
120
+ "isPublic": true
121
+ },
122
+ "getPortalConfig": {
123
+ "name": "getPortalConfig",
124
+ "async": false,
125
+ "parameters": [],
126
+ "returnType": "SitePortalConfig",
127
+ "isStatic": false,
128
+ "isPublic": true
129
+ },
130
+ "setPortalConfig": {
131
+ "name": "setPortalConfig",
132
+ "async": false,
33
133
  "parameters": [
34
134
  {
35
- "name": "agentClass",
36
- "type": "string",
135
+ "name": "config",
136
+ "type": "SitePortalConfig",
37
137
  "optional": false
38
138
  }
39
139
  ],
40
- "returnType": "Promise<SiteAgentBinding[]>",
140
+ "returnType": "void",
41
141
  "isStatic": false,
42
142
  "isPublic": true
43
143
  },
44
- "findEnabled": {
45
- "name": "findEnabled",
46
- "async": true,
144
+ "getMetadata": {
145
+ "name": "getMetadata",
146
+ "async": false,
147
+ "parameters": [],
148
+ "returnType": "Record<string, unknown>",
149
+ "isStatic": false,
150
+ "isPublic": true
151
+ },
152
+ "setMetadata": {
153
+ "name": "setMetadata",
154
+ "async": false,
47
155
  "parameters": [
48
156
  {
49
- "name": "siteId",
50
- "type": "string",
157
+ "name": "data",
158
+ "type": "Record<string, unknown>",
51
159
  "optional": false
52
160
  }
53
161
  ],
54
- "returnType": "Promise<SiteAgentBinding[]>",
162
+ "returnType": "void",
55
163
  "isStatic": false,
56
164
  "isPublic": true
57
165
  },
58
- "findBySiteAndAgent": {
59
- "name": "findBySiteAndAgent",
60
- "async": true,
166
+ "updateMetadata": {
167
+ "name": "updateMetadata",
168
+ "async": false,
61
169
  "parameters": [
62
170
  {
63
- "name": "siteId",
64
- "type": "string",
65
- "optional": false
66
- },
67
- {
68
- "name": "agentClass",
69
- "type": "string",
171
+ "name": "updates",
172
+ "type": "Record<string, unknown>",
70
173
  "optional": false
71
174
  }
72
175
  ],
73
- "returnType": "Promise<SiteAgentBinding | null>",
176
+ "returnType": "void",
74
177
  "isStatic": false,
75
178
  "isPublic": true
76
179
  }
77
180
  },
78
181
  "decoratorConfig": {
79
- "tableName": "site_agent_bindings"
182
+ "tableName": "sites",
183
+ "api": {
184
+ "include": [
185
+ "list",
186
+ "get",
187
+ "create",
188
+ "update",
189
+ "delete"
190
+ ]
191
+ },
192
+ "mcp": {
193
+ "include": [
194
+ "list",
195
+ "get",
196
+ "create",
197
+ "update"
198
+ ]
199
+ },
200
+ "cli": {
201
+ "skipApiCheck": true
202
+ },
203
+ "conflictColumns": [
204
+ "tenant_id",
205
+ "domain"
206
+ ],
207
+ "tenantScoped": {
208
+ "mode": "required"
209
+ }
80
210
  },
81
- "extends": "SmrtCollection",
82
- "extendsTypeArg": "SiteAgentBinding",
83
- "exportName": "SiteAgentBindingCollection",
84
- "collectionExportName": "SiteAgentBindingCollectionCollection",
211
+ "extends": "SmrtObject",
212
+ "exportName": "Site",
213
+ "collectionExportName": "SiteCollection",
214
+ "validationRules": [],
215
+ "schema": {
216
+ "tableName": "sites",
217
+ "ddl": "CREATE TABLE IF NOT EXISTS \"sites\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"name\" TEXT DEFAULT '',\n \"domain\" TEXT DEFAULT '',\n \"status\" TEXT DEFAULT 'draft',\n \"tier\" TEXT DEFAULT 'free',\n \"database_url\" TEXT DEFAULT '',\n \"database_type\" TEXT DEFAULT '',\n \"portal_config\" TEXT DEFAULT '',\n \"repository_url\" TEXT DEFAULT '',\n \"template_name\" TEXT DEFAULT '',\n \"provisioning_status\" TEXT DEFAULT '',\n \"provisioned_at\" TIMESTAMP,\n \"provisioning_error\" TEXT DEFAULT '',\n \"metadata\" TEXT DEFAULT ''\n);",
218
+ "columns": {
219
+ "id": {
220
+ "type": "UUID",
221
+ "primaryKey": true,
222
+ "referenceKind": "id",
223
+ "notNull": true
224
+ },
225
+ "slug": {
226
+ "type": "TEXT",
227
+ "notNull": true
228
+ },
229
+ "context": {
230
+ "type": "TEXT",
231
+ "notNull": true,
232
+ "default": ""
233
+ },
234
+ "created_at": {
235
+ "type": "TIMESTAMP",
236
+ "notNull": true,
237
+ "default": "current_timestamp"
238
+ },
239
+ "updated_at": {
240
+ "type": "TIMESTAMP",
241
+ "notNull": true,
242
+ "default": "current_timestamp"
243
+ },
244
+ "tenant_id": {
245
+ "type": "UUID",
246
+ "referenceKind": "tenantId",
247
+ "notNull": true,
248
+ "unique": false
249
+ },
250
+ "name": {
251
+ "type": "TEXT",
252
+ "notNull": false,
253
+ "unique": false,
254
+ "default": ""
255
+ },
256
+ "domain": {
257
+ "type": "TEXT",
258
+ "notNull": false,
259
+ "unique": false,
260
+ "default": ""
261
+ },
262
+ "status": {
263
+ "type": "TEXT",
264
+ "notNull": false,
265
+ "unique": false,
266
+ "default": "draft"
267
+ },
268
+ "tier": {
269
+ "type": "TEXT",
270
+ "notNull": false,
271
+ "unique": false,
272
+ "default": "free"
273
+ },
274
+ "database_url": {
275
+ "type": "TEXT",
276
+ "notNull": false,
277
+ "unique": false,
278
+ "default": ""
279
+ },
280
+ "database_type": {
281
+ "type": "TEXT",
282
+ "notNull": false,
283
+ "unique": false,
284
+ "default": ""
285
+ },
286
+ "portal_config": {
287
+ "type": "TEXT",
288
+ "notNull": false,
289
+ "unique": false,
290
+ "default": ""
291
+ },
292
+ "repository_url": {
293
+ "type": "TEXT",
294
+ "notNull": false,
295
+ "unique": false,
296
+ "default": ""
297
+ },
298
+ "template_name": {
299
+ "type": "TEXT",
300
+ "notNull": false,
301
+ "unique": false,
302
+ "default": ""
303
+ },
304
+ "provisioning_status": {
305
+ "type": "TEXT",
306
+ "notNull": false,
307
+ "unique": false,
308
+ "default": ""
309
+ },
310
+ "provisioned_at": {
311
+ "type": "TIMESTAMP",
312
+ "notNull": false,
313
+ "unique": false
314
+ },
315
+ "provisioning_error": {
316
+ "type": "TEXT",
317
+ "notNull": false,
318
+ "unique": false,
319
+ "default": ""
320
+ },
321
+ "metadata": {
322
+ "type": "TEXT",
323
+ "notNull": false,
324
+ "unique": false,
325
+ "default": ""
326
+ }
327
+ },
328
+ "indexes": [
329
+ {
330
+ "name": "sites_tenant_id_domain_idx",
331
+ "columns": [
332
+ "tenant_id",
333
+ "domain"
334
+ ],
335
+ "unique": true,
336
+ "nullsNotDistinct": true
337
+ },
338
+ {
339
+ "name": "sites_slug_context_idx",
340
+ "columns": [
341
+ "slug",
342
+ "context"
343
+ ]
344
+ },
345
+ {
346
+ "name": "sites_tenant_id_created_at_idx",
347
+ "columns": [
348
+ "tenant_id",
349
+ "created_at"
350
+ ]
351
+ }
352
+ ],
353
+ "version": "1845042e"
354
+ },
355
+ "importPath": "@happyvertical/smrt-sites"
356
+ },
357
+ "@happyvertical/smrt-sites:SiteAgentBinding": {
358
+ "name": "siteagentbinding",
359
+ "className": "SiteAgentBinding",
360
+ "qualifiedName": "@happyvertical/smrt-sites:SiteAgentBinding",
361
+ "collection": "siteagentbindings",
362
+ "filePath": "/home/runner/work/smrt/smrt/packages/sites/src/models/SiteAgentBinding.ts",
363
+ "packageName": "@happyvertical/smrt-sites",
364
+ "fields": {
365
+ "tenantId": {
366
+ "type": "text",
367
+ "required": true,
368
+ "_meta": {
369
+ "sqlType": "UUID",
370
+ "__tenancy": {
371
+ "isTenantIdField": true,
372
+ "autoFilter": true,
373
+ "required": true,
374
+ "autoPopulate": true,
375
+ "nullable": false,
376
+ "mode": "required",
377
+ "field": "tenantId",
378
+ "allowSuperAdminBypass": false
379
+ }
380
+ }
381
+ },
382
+ "siteId": {
383
+ "type": "foreignKey",
384
+ "required": false,
385
+ "related": "Site"
386
+ },
387
+ "agentClass": {
388
+ "type": "text",
389
+ "required": false,
390
+ "default": ""
391
+ },
392
+ "enabled": {
393
+ "type": "boolean",
394
+ "required": false,
395
+ "default": true
396
+ },
397
+ "config": {
398
+ "type": "json",
399
+ "required": false,
400
+ "default": {}
401
+ },
402
+ "priority": {
403
+ "type": "integer",
404
+ "required": false,
405
+ "default": 0
406
+ }
407
+ },
408
+ "methods": {},
409
+ "decoratorConfig": {
410
+ "tableName": "site_agent_bindings",
411
+ "api": {
412
+ "include": [
413
+ "list",
414
+ "get",
415
+ "create",
416
+ "update",
417
+ "delete"
418
+ ]
419
+ },
420
+ "cli": {
421
+ "include": [
422
+ "list",
423
+ "get"
424
+ ]
425
+ },
426
+ "mcp": {
427
+ "include": [
428
+ "list",
429
+ "get"
430
+ ]
431
+ },
432
+ "conflictColumns": [
433
+ "site_id",
434
+ "agent_class"
435
+ ],
436
+ "tenantScoped": {
437
+ "mode": "required"
438
+ }
439
+ },
440
+ "extends": "SmrtObject",
441
+ "exportName": "SiteAgentBinding",
442
+ "collectionExportName": "SiteAgentBindingCollection",
443
+ "validationRules": [],
85
444
  "schema": {
86
445
  "tableName": "site_agent_bindings",
87
446
  "ddl": "CREATE TABLE IF NOT EXISTS \"site_agent_bindings\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"site_id\" UUID,\n \"agent_class\" TEXT DEFAULT '',\n \"enabled\" BOOLEAN DEFAULT TRUE,\n \"config\" JSON DEFAULT '{}',\n \"priority\" INTEGER DEFAULT 0\n);",
@@ -183,76 +542,87 @@
183
542
  },
184
543
  "importPath": "@happyvertical/smrt-sites"
185
544
  },
186
- "@happyvertical/smrt-sites:SiteCollection": {
187
- "name": "sitecollection",
188
- "className": "SiteCollection",
189
- "qualifiedName": "@happyvertical/smrt-sites:SiteCollection",
190
- "collection": "sites",
191
- "filePath": "/home/runner/work/smrt/smrt/packages/sites/src/collections/SiteCollection.ts",
545
+ "@happyvertical/smrt-sites:SiteAgentBindingCollection": {
546
+ "name": "siteagentbindingcollection",
547
+ "className": "SiteAgentBindingCollection",
548
+ "qualifiedName": "@happyvertical/smrt-sites:SiteAgentBindingCollection",
549
+ "collection": "siteagentbindings",
550
+ "filePath": "/home/runner/work/smrt/smrt/packages/sites/src/collections/SiteAgentBindingCollection.ts",
192
551
  "packageName": "@happyvertical/smrt-sites",
193
552
  "fields": {},
194
553
  "methods": {
195
- "findByDomain": {
196
- "name": "findByDomain",
554
+ "findBySite": {
555
+ "name": "findBySite",
197
556
  "async": true,
198
557
  "parameters": [
199
558
  {
200
- "name": "domain",
559
+ "name": "siteId",
201
560
  "type": "string",
202
561
  "optional": false
203
562
  }
204
563
  ],
205
- "returnType": "Promise<Site | null>",
564
+ "returnType": "Promise<SiteAgentBinding[]>",
206
565
  "isStatic": false,
207
566
  "isPublic": true
208
567
  },
209
- "findByTenant": {
210
- "name": "findByTenant",
568
+ "findByAgent": {
569
+ "name": "findByAgent",
211
570
  "async": true,
212
571
  "parameters": [
213
572
  {
214
- "name": "tenantId",
573
+ "name": "agentClass",
215
574
  "type": "string",
216
575
  "optional": false
217
576
  }
218
577
  ],
219
- "returnType": "Promise<Site[]>",
578
+ "returnType": "Promise<SiteAgentBinding[]>",
220
579
  "isStatic": false,
221
580
  "isPublic": true
222
581
  },
223
- "findByStatus": {
224
- "name": "findByStatus",
582
+ "findEnabled": {
583
+ "name": "findEnabled",
225
584
  "async": true,
226
585
  "parameters": [
227
586
  {
228
- "name": "status",
229
- "type": "SiteStatus",
587
+ "name": "siteId",
588
+ "type": "string",
230
589
  "optional": false
231
590
  }
232
591
  ],
233
- "returnType": "Promise<Site[]>",
592
+ "returnType": "Promise<SiteAgentBinding[]>",
234
593
  "isStatic": false,
235
594
  "isPublic": true
236
595
  },
237
- "findActive": {
238
- "name": "findActive",
596
+ "findBySiteAndAgent": {
597
+ "name": "findBySiteAndAgent",
239
598
  "async": true,
240
- "parameters": [],
241
- "returnType": "Promise<Site[]>",
599
+ "parameters": [
600
+ {
601
+ "name": "siteId",
602
+ "type": "string",
603
+ "optional": false
604
+ },
605
+ {
606
+ "name": "agentClass",
607
+ "type": "string",
608
+ "optional": false
609
+ }
610
+ ],
611
+ "returnType": "Promise<SiteAgentBinding | null>",
242
612
  "isStatic": false,
243
613
  "isPublic": true
244
614
  }
245
615
  },
246
616
  "decoratorConfig": {
247
- "tableName": "sites"
617
+ "tableName": "site_agent_bindings"
248
618
  },
249
619
  "extends": "SmrtCollection",
250
- "extendsTypeArg": "Site",
251
- "exportName": "SiteCollection",
252
- "collectionExportName": "SiteCollectionCollection",
620
+ "extendsTypeArg": "SiteAgentBinding",
621
+ "exportName": "SiteAgentBindingCollection",
622
+ "collectionExportName": "SiteAgentBindingCollectionCollection",
253
623
  "schema": {
254
- "tableName": "sites",
255
- "ddl": "CREATE TABLE IF NOT EXISTS \"sites\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"name\" TEXT DEFAULT '',\n \"domain\" TEXT DEFAULT '',\n \"status\" TEXT DEFAULT 'draft',\n \"tier\" TEXT DEFAULT 'free',\n \"database_url\" TEXT DEFAULT '',\n \"database_type\" TEXT DEFAULT '',\n \"portal_config\" TEXT DEFAULT '',\n \"repository_url\" TEXT DEFAULT '',\n \"template_name\" TEXT DEFAULT '',\n \"provisioning_status\" TEXT DEFAULT '',\n \"provisioned_at\" TIMESTAMP,\n \"provisioning_error\" TEXT DEFAULT '',\n \"metadata\" TEXT DEFAULT ''\n);",
624
+ "tableName": "site_agent_bindings",
625
+ "ddl": "CREATE TABLE IF NOT EXISTS \"site_agent_bindings\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"site_id\" UUID,\n \"agent_class\" TEXT DEFAULT '',\n \"enabled\" BOOLEAN DEFAULT TRUE,\n \"config\" JSON DEFAULT '{}',\n \"priority\" INTEGER DEFAULT 0\n);",
256
626
  "columns": {
257
627
  "id": {
258
628
  "type": "UUID",
@@ -285,321 +655,139 @@
285
655
  "notNull": true,
286
656
  "unique": false
287
657
  },
288
- "name": {
289
- "type": "TEXT",
290
- "notNull": false,
291
- "unique": false,
292
- "default": ""
293
- },
294
- "domain": {
295
- "type": "TEXT",
296
- "notNull": false,
297
- "unique": false,
298
- "default": ""
299
- },
300
- "status": {
301
- "type": "TEXT",
302
- "notNull": false,
303
- "unique": false,
304
- "default": "draft"
305
- },
306
- "tier": {
307
- "type": "TEXT",
308
- "notNull": false,
309
- "unique": false,
310
- "default": "free"
311
- },
312
- "database_url": {
313
- "type": "TEXT",
314
- "notNull": false,
315
- "unique": false,
316
- "default": ""
317
- },
318
- "database_type": {
319
- "type": "TEXT",
320
- "notNull": false,
321
- "unique": false,
322
- "default": ""
323
- },
324
- "portal_config": {
325
- "type": "TEXT",
326
- "notNull": false,
327
- "unique": false,
328
- "default": ""
329
- },
330
- "repository_url": {
331
- "type": "TEXT",
658
+ "site_id": {
659
+ "type": "UUID",
660
+ "referenceKind": "foreignKey",
332
661
  "notNull": false,
333
662
  "unique": false,
334
- "default": ""
663
+ "foreignKey": {
664
+ "table": "sites",
665
+ "column": "id",
666
+ "onDelete": "CASCADE",
667
+ "onUpdate": "CASCADE"
668
+ }
335
669
  },
336
- "template_name": {
670
+ "agent_class": {
337
671
  "type": "TEXT",
338
672
  "notNull": false,
339
673
  "unique": false,
340
674
  "default": ""
341
675
  },
342
- "provisioning_status": {
343
- "type": "TEXT",
676
+ "enabled": {
677
+ "type": "BOOLEAN",
344
678
  "notNull": false,
345
679
  "unique": false,
346
- "default": ""
347
- },
348
- "provisioned_at": {
349
- "type": "TIMESTAMP",
350
- "notNull": false,
351
- "unique": false
680
+ "default": true
352
681
  },
353
- "provisioning_error": {
354
- "type": "TEXT",
682
+ "config": {
683
+ "type": "JSON",
355
684
  "notNull": false,
356
685
  "unique": false,
357
- "default": ""
686
+ "default": {}
358
687
  },
359
- "metadata": {
360
- "type": "TEXT",
688
+ "priority": {
689
+ "type": "INTEGER",
361
690
  "notNull": false,
362
691
  "unique": false,
363
- "default": ""
692
+ "default": 0
364
693
  }
365
694
  },
366
695
  "indexes": [
367
696
  {
368
- "name": "sites_tenant_id_domain_idx",
697
+ "name": "site_agent_bindings_site_id_agent_class_idx",
369
698
  "columns": [
370
- "tenant_id",
371
- "domain"
699
+ "site_id",
700
+ "agent_class"
372
701
  ],
373
702
  "unique": true,
374
703
  "nullsNotDistinct": true
375
704
  },
376
705
  {
377
- "name": "sites_slug_context_idx",
706
+ "name": "site_agent_bindings_slug_context_idx",
378
707
  "columns": [
379
708
  "slug",
380
709
  "context"
381
710
  ]
382
711
  },
383
712
  {
384
- "name": "sites_tenant_id_created_at_idx",
713
+ "name": "site_agent_bindings_tenant_id_created_at_idx",
385
714
  "columns": [
386
715
  "tenant_id",
387
716
  "created_at"
388
717
  ]
389
718
  }
390
719
  ],
391
- "version": "1845042e"
720
+ "version": "dec43c9c"
392
721
  },
393
722
  "importPath": "@happyvertical/smrt-sites"
394
723
  },
395
- "@happyvertical/smrt-sites:Site": {
396
- "name": "site",
397
- "className": "Site",
398
- "qualifiedName": "@happyvertical/smrt-sites:Site",
724
+ "@happyvertical/smrt-sites:SiteCollection": {
725
+ "name": "sitecollection",
726
+ "className": "SiteCollection",
727
+ "qualifiedName": "@happyvertical/smrt-sites:SiteCollection",
399
728
  "collection": "sites",
400
- "filePath": "/home/runner/work/smrt/smrt/packages/sites/src/models/Site.ts",
729
+ "filePath": "/home/runner/work/smrt/smrt/packages/sites/src/collections/SiteCollection.ts",
401
730
  "packageName": "@happyvertical/smrt-sites",
402
- "fields": {
403
- "tenantId": {
404
- "type": "text",
405
- "required": true,
406
- "_meta": {
407
- "sqlType": "UUID",
408
- "__tenancy": {
409
- "isTenantIdField": true,
410
- "autoFilter": true,
411
- "required": true,
412
- "autoPopulate": true,
413
- "nullable": false,
414
- "mode": "required",
415
- "field": "tenantId",
416
- "allowSuperAdminBypass": false
417
- }
418
- }
419
- },
420
- "name": {
421
- "type": "text",
422
- "required": false,
423
- "default": ""
424
- },
425
- "domain": {
426
- "type": "text",
427
- "required": false,
428
- "default": ""
429
- },
430
- "status": {
431
- "type": "text",
432
- "required": false,
433
- "default": "draft"
434
- },
435
- "tier": {
436
- "type": "text",
437
- "required": false,
438
- "default": "free"
439
- },
440
- "databaseUrl": {
441
- "type": "text",
442
- "required": false,
443
- "default": ""
444
- },
445
- "databaseType": {
446
- "type": "text",
447
- "required": false,
448
- "default": ""
449
- },
450
- "portalConfig": {
451
- "type": "text",
452
- "required": false,
453
- "default": ""
454
- },
455
- "repositoryUrl": {
456
- "type": "text",
457
- "required": false,
458
- "default": ""
459
- },
460
- "templateName": {
461
- "type": "text",
462
- "required": false,
463
- "default": ""
464
- },
465
- "provisioningStatus": {
466
- "type": "text",
467
- "required": false,
468
- "default": ""
469
- },
470
- "provisionedAt": {
471
- "type": "datetime",
472
- "required": false
473
- },
474
- "provisioningError": {
475
- "type": "text",
476
- "required": false,
477
- "default": ""
478
- },
479
- "metadata": {
480
- "type": "text",
481
- "required": false,
482
- "default": ""
483
- },
484
- "createdAt": {
485
- "type": "datetime",
486
- "required": false
487
- },
488
- "updatedAt": {
489
- "type": "datetime",
490
- "required": false
491
- }
492
- },
731
+ "fields": {},
493
732
  "methods": {
494
- "isActive": {
495
- "name": "isActive",
496
- "async": false,
497
- "parameters": [],
498
- "returnType": "boolean",
499
- "isStatic": false,
500
- "isPublic": true
501
- },
502
- "isReady": {
503
- "name": "isReady",
504
- "async": false,
505
- "parameters": [],
506
- "returnType": "boolean",
507
- "isStatic": false,
508
- "isPublic": true
509
- },
510
- "getPortalConfig": {
511
- "name": "getPortalConfig",
512
- "async": false,
513
- "parameters": [],
514
- "returnType": "SitePortalConfig",
515
- "isStatic": false,
516
- "isPublic": true
517
- },
518
- "setPortalConfig": {
519
- "name": "setPortalConfig",
520
- "async": false,
733
+ "findByDomain": {
734
+ "name": "findByDomain",
735
+ "async": true,
521
736
  "parameters": [
522
737
  {
523
- "name": "config",
524
- "type": "SitePortalConfig",
738
+ "name": "domain",
739
+ "type": "string",
525
740
  "optional": false
526
741
  }
527
742
  ],
528
- "returnType": "void",
529
- "isStatic": false,
530
- "isPublic": true
531
- },
532
- "getMetadata": {
533
- "name": "getMetadata",
534
- "async": false,
535
- "parameters": [],
536
- "returnType": "Record<string, unknown>",
743
+ "returnType": "Promise<Site | null>",
537
744
  "isStatic": false,
538
- "isPublic": true
539
- },
540
- "setMetadata": {
541
- "name": "setMetadata",
542
- "async": false,
745
+ "isPublic": true
746
+ },
747
+ "findByTenant": {
748
+ "name": "findByTenant",
749
+ "async": true,
543
750
  "parameters": [
544
751
  {
545
- "name": "data",
546
- "type": "Record<string, unknown>",
752
+ "name": "tenantId",
753
+ "type": "string",
547
754
  "optional": false
548
755
  }
549
756
  ],
550
- "returnType": "void",
757
+ "returnType": "Promise<Site[]>",
551
758
  "isStatic": false,
552
759
  "isPublic": true
553
760
  },
554
- "updateMetadata": {
555
- "name": "updateMetadata",
556
- "async": false,
761
+ "findByStatus": {
762
+ "name": "findByStatus",
763
+ "async": true,
557
764
  "parameters": [
558
765
  {
559
- "name": "updates",
560
- "type": "Record<string, unknown>",
766
+ "name": "status",
767
+ "type": "SiteStatus",
561
768
  "optional": false
562
769
  }
563
770
  ],
564
- "returnType": "void",
771
+ "returnType": "Promise<Site[]>",
772
+ "isStatic": false,
773
+ "isPublic": true
774
+ },
775
+ "findActive": {
776
+ "name": "findActive",
777
+ "async": true,
778
+ "parameters": [],
779
+ "returnType": "Promise<Site[]>",
565
780
  "isStatic": false,
566
781
  "isPublic": true
567
782
  }
568
783
  },
569
784
  "decoratorConfig": {
570
- "tableName": "sites",
571
- "api": {
572
- "include": [
573
- "list",
574
- "get",
575
- "create",
576
- "update",
577
- "delete"
578
- ]
579
- },
580
- "mcp": {
581
- "include": [
582
- "list",
583
- "get",
584
- "create",
585
- "update"
586
- ]
587
- },
588
- "cli": {
589
- "skipApiCheck": true
590
- },
591
- "conflictColumns": [
592
- "tenant_id",
593
- "domain"
594
- ],
595
- "tenantScoped": {
596
- "mode": "required"
597
- }
785
+ "tableName": "sites"
598
786
  },
599
- "extends": "SmrtObject",
600
- "exportName": "Site",
601
- "collectionExportName": "SiteCollection",
602
- "validationRules": [],
787
+ "extends": "SmrtCollection",
788
+ "extendsTypeArg": "Site",
789
+ "exportName": "SiteCollection",
790
+ "collectionExportName": "SiteCollectionCollection",
603
791
  "schema": {
604
792
  "tableName": "sites",
605
793
  "ddl": "CREATE TABLE IF NOT EXISTS \"sites\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"name\" TEXT DEFAULT '',\n \"domain\" TEXT DEFAULT '',\n \"status\" TEXT DEFAULT 'draft',\n \"tier\" TEXT DEFAULT 'free',\n \"database_url\" TEXT DEFAULT '',\n \"database_type\" TEXT DEFAULT '',\n \"portal_config\" TEXT DEFAULT '',\n \"repository_url\" TEXT DEFAULT '',\n \"template_name\" TEXT DEFAULT '',\n \"provisioning_status\" TEXT DEFAULT '',\n \"provisioned_at\" TIMESTAMP,\n \"provisioning_error\" TEXT DEFAULT '',\n \"metadata\" TEXT DEFAULT ''\n);",
@@ -741,194 +929,6 @@
741
929
  "version": "1845042e"
742
930
  },
743
931
  "importPath": "@happyvertical/smrt-sites"
744
- },
745
- "@happyvertical/smrt-sites:SiteAgentBinding": {
746
- "name": "siteagentbinding",
747
- "className": "SiteAgentBinding",
748
- "qualifiedName": "@happyvertical/smrt-sites:SiteAgentBinding",
749
- "collection": "siteagentbindings",
750
- "filePath": "/home/runner/work/smrt/smrt/packages/sites/src/models/SiteAgentBinding.ts",
751
- "packageName": "@happyvertical/smrt-sites",
752
- "fields": {
753
- "tenantId": {
754
- "type": "text",
755
- "required": true,
756
- "_meta": {
757
- "sqlType": "UUID",
758
- "__tenancy": {
759
- "isTenantIdField": true,
760
- "autoFilter": true,
761
- "required": true,
762
- "autoPopulate": true,
763
- "nullable": false,
764
- "mode": "required",
765
- "field": "tenantId",
766
- "allowSuperAdminBypass": false
767
- }
768
- }
769
- },
770
- "siteId": {
771
- "type": "foreignKey",
772
- "required": false,
773
- "related": "Site"
774
- },
775
- "agentClass": {
776
- "type": "text",
777
- "required": false,
778
- "default": ""
779
- },
780
- "enabled": {
781
- "type": "boolean",
782
- "required": false,
783
- "default": true
784
- },
785
- "config": {
786
- "type": "json",
787
- "required": false,
788
- "default": {}
789
- },
790
- "priority": {
791
- "type": "integer",
792
- "required": false,
793
- "default": 0
794
- }
795
- },
796
- "methods": {},
797
- "decoratorConfig": {
798
- "tableName": "site_agent_bindings",
799
- "api": {
800
- "include": [
801
- "list",
802
- "get",
803
- "create",
804
- "update",
805
- "delete"
806
- ]
807
- },
808
- "cli": {
809
- "include": [
810
- "list",
811
- "get"
812
- ]
813
- },
814
- "mcp": {
815
- "include": [
816
- "list",
817
- "get"
818
- ]
819
- },
820
- "conflictColumns": [
821
- "site_id",
822
- "agent_class"
823
- ],
824
- "tenantScoped": {
825
- "mode": "required"
826
- }
827
- },
828
- "extends": "SmrtObject",
829
- "exportName": "SiteAgentBinding",
830
- "collectionExportName": "SiteAgentBindingCollection",
831
- "validationRules": [],
832
- "schema": {
833
- "tableName": "site_agent_bindings",
834
- "ddl": "CREATE TABLE IF NOT EXISTS \"site_agent_bindings\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"site_id\" UUID,\n \"agent_class\" TEXT DEFAULT '',\n \"enabled\" BOOLEAN DEFAULT TRUE,\n \"config\" JSON DEFAULT '{}',\n \"priority\" INTEGER DEFAULT 0\n);",
835
- "columns": {
836
- "id": {
837
- "type": "UUID",
838
- "primaryKey": true,
839
- "referenceKind": "id",
840
- "notNull": true
841
- },
842
- "slug": {
843
- "type": "TEXT",
844
- "notNull": true
845
- },
846
- "context": {
847
- "type": "TEXT",
848
- "notNull": true,
849
- "default": ""
850
- },
851
- "created_at": {
852
- "type": "TIMESTAMP",
853
- "notNull": true,
854
- "default": "current_timestamp"
855
- },
856
- "updated_at": {
857
- "type": "TIMESTAMP",
858
- "notNull": true,
859
- "default": "current_timestamp"
860
- },
861
- "tenant_id": {
862
- "type": "UUID",
863
- "referenceKind": "tenantId",
864
- "notNull": true,
865
- "unique": false
866
- },
867
- "site_id": {
868
- "type": "UUID",
869
- "referenceKind": "foreignKey",
870
- "notNull": false,
871
- "unique": false,
872
- "foreignKey": {
873
- "table": "sites",
874
- "column": "id",
875
- "onDelete": "CASCADE",
876
- "onUpdate": "CASCADE"
877
- }
878
- },
879
- "agent_class": {
880
- "type": "TEXT",
881
- "notNull": false,
882
- "unique": false,
883
- "default": ""
884
- },
885
- "enabled": {
886
- "type": "BOOLEAN",
887
- "notNull": false,
888
- "unique": false,
889
- "default": true
890
- },
891
- "config": {
892
- "type": "JSON",
893
- "notNull": false,
894
- "unique": false,
895
- "default": {}
896
- },
897
- "priority": {
898
- "type": "INTEGER",
899
- "notNull": false,
900
- "unique": false,
901
- "default": 0
902
- }
903
- },
904
- "indexes": [
905
- {
906
- "name": "site_agent_bindings_site_id_agent_class_idx",
907
- "columns": [
908
- "site_id",
909
- "agent_class"
910
- ],
911
- "unique": true,
912
- "nullsNotDistinct": true
913
- },
914
- {
915
- "name": "site_agent_bindings_slug_context_idx",
916
- "columns": [
917
- "slug",
918
- "context"
919
- ]
920
- },
921
- {
922
- "name": "site_agent_bindings_tenant_id_created_at_idx",
923
- "columns": [
924
- "tenant_id",
925
- "created_at"
926
- ]
927
- }
928
- ],
929
- "version": "dec43c9c"
930
- },
931
- "importPath": "@happyvertical/smrt-sites"
932
932
  }
933
933
  },
934
934
  "moduleType": "smrt",