@happyvertical/smrt-reports 0.57.3 → 0.57.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -7
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +13 -9
- package/dist/recipes.d.ts +1 -0
- package/dist/recipes.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +15 -11
- package/dist/state.js +1 -1
- package/dist/state.js.map +1 -1
- package/package.json +10 -10
package/dist/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": "1.0.0",
|
|
3
3
|
"timestamp": 0,
|
|
4
4
|
"packageName": "@happyvertical/smrt-reports",
|
|
5
|
-
"packageVersion": "0.57.
|
|
5
|
+
"packageVersion": "0.57.4",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-reports:SmrtReport": {
|
|
8
8
|
"name": "smrtreport",
|
|
@@ -2714,16 +2714,13 @@
|
|
|
2714
2714
|
{
|
|
2715
2715
|
"id": "reports.materialized",
|
|
2716
2716
|
"className": "MaterializedReportsRecipe",
|
|
2717
|
-
"label": "
|
|
2717
|
+
"label": "Scheduled reports",
|
|
2718
2718
|
"summary": "Keep totals and trends ready to read, refreshed on a schedule and open to the assistant.",
|
|
2719
2719
|
"synonyms": [
|
|
2720
|
-
"reports",
|
|
2721
|
-
"totals",
|
|
2722
|
-
"summaries",
|
|
2723
2720
|
"rollups",
|
|
2724
2721
|
"kpis",
|
|
2725
|
-
"
|
|
2726
|
-
"
|
|
2722
|
+
"refresh schedule",
|
|
2723
|
+
"materialized"
|
|
2727
2724
|
],
|
|
2728
2725
|
"models": [
|
|
2729
2726
|
"@happyvertical/smrt-reports:SmrtReportRun",
|
|
@@ -2762,13 +2759,20 @@
|
|
|
2762
2759
|
"className": "RuntimeReportsRecipe",
|
|
2763
2760
|
"label": "Reports",
|
|
2764
2761
|
"summary": "Ask for a report, approve it, and share its live totals with your team.",
|
|
2765
|
-
"synonyms": [
|
|
2762
|
+
"synonyms": [
|
|
2763
|
+
"report",
|
|
2764
|
+
"summary",
|
|
2765
|
+
"summaries",
|
|
2766
|
+
"totals",
|
|
2767
|
+
"trends",
|
|
2768
|
+
"dashboards"
|
|
2769
|
+
],
|
|
2766
2770
|
"models": [
|
|
2767
2771
|
"@happyvertical/smrt-reports:RuntimeReport"
|
|
2768
2772
|
],
|
|
2769
2773
|
"nav": [
|
|
2770
2774
|
{
|
|
2771
|
-
"label": "
|
|
2775
|
+
"label": "Shared reports",
|
|
2772
2776
|
"model": "@happyvertical/smrt-reports:RuntimeReport",
|
|
2773
2777
|
"icon": "fileText"
|
|
2774
2778
|
}
|
package/dist/recipes.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export declare class MaterializedReportsRecipe extends SmrtRecipe {
|
|
|
30
30
|
export declare class RuntimeReportsRecipe extends SmrtRecipe {
|
|
31
31
|
static id: string;
|
|
32
32
|
static label: string;
|
|
33
|
+
static synonyms: string[];
|
|
33
34
|
static summary: string;
|
|
34
35
|
static help: string;
|
|
35
36
|
static models: (typeof RuntimeReport)[];
|
package/dist/recipes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../src/recipes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACL,8BAA8B,EAE/B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAEpB,8EAA8E;AAC9E,qBAAa,yBAA0B,SAAQ,UAAU;IACvD,MAAM,CAAC,EAAE,SAA0B;IACnC,MAAM,CAAC,IAAI,SAA8B;
|
|
1
|
+
{"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../src/recipes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACL,8BAA8B,EAE/B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAEpB,8EAA8E;AAC9E,qBAAa,yBAA0B,SAAQ,UAAU;IACvD,MAAM,CAAC,EAAE,SAA0B;IACnC,MAAM,CAAC,IAAI,SAA8B;IAIzC,MAAM,CAAC,KAAK,SAAuB;IACnC,MAAM,CAAC,OAAO,SAC+E;IAC7F,MAAM,CAAC,QAAQ,WAA2D;IAI1E,MAAM,CAAC,MAAM,oJAOX;IAGF,MAAM,CAAC,OAAO,EAAG,QAAQ,CAAU;CACpC;AAED,gFAAgF;AAChF,qBAAa,oBAAqB,SAAQ,UAAU;IAClD,MAAM,CAAC,EAAE,SAAqB;IAC9B,MAAM,CAAC,KAAK,SAAa;IACzB,MAAM,CAAC,QAAQ,WAOb;IACF,MAAM,CAAC,OAAO,SAC8D;IAC5E,MAAM,CAAC,IAAI,SAAyB;IACpC,MAAM,CAAC,MAAM,2BAAmB;IAEhC,MAAM,CAAC,GAAG;;;;QAER;IACF,MAAM,CAAC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCJ;IACX,MAAM,CAAC,OAAO,EAAG,QAAQ,CAAU;CACpC"}
|
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-reports",
|
|
6
|
-
"packageVersion": "0.57.
|
|
6
|
+
"packageVersion": "0.57.4",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "356fcbd5fb45ea7685ca31f89335e830fdfc55440a5314954e52a496623acc0e",
|
|
11
|
+
"packageJson": "3c6a255946abc9f46b4fe1ac1fd9cbfded0cadc7fa4d06f42d4f4648344a005b",
|
|
12
12
|
"agents": "c134555effb7869d3fbd3b5fb2be79bca10d0644425aacd9654869a517cc78a3",
|
|
13
13
|
"moduleDoc:agents/runtime-report-browser.md": "7b35c4b84c8a7dfc733198f793c701743ba6d7cb586ec9b671bddd645ecf0e8d",
|
|
14
14
|
"moduleDoc:agents/runtime-reports.md": "04cc898425ae1af4541056e6abd2f48c381ba20b7322b87cc45fd1afb1392313",
|
|
@@ -1284,16 +1284,13 @@
|
|
|
1284
1284
|
{
|
|
1285
1285
|
"id": "reports.materialized",
|
|
1286
1286
|
"className": "MaterializedReportsRecipe",
|
|
1287
|
-
"label": "
|
|
1287
|
+
"label": "Scheduled reports",
|
|
1288
1288
|
"summary": "Keep totals and trends ready to read, refreshed on a schedule and open to the assistant.",
|
|
1289
1289
|
"synonyms": [
|
|
1290
|
-
"reports",
|
|
1291
|
-
"totals",
|
|
1292
|
-
"summaries",
|
|
1293
1290
|
"rollups",
|
|
1294
1291
|
"kpis",
|
|
1295
|
-
"
|
|
1296
|
-
"
|
|
1292
|
+
"refresh schedule",
|
|
1293
|
+
"materialized"
|
|
1297
1294
|
],
|
|
1298
1295
|
"models": [
|
|
1299
1296
|
"@happyvertical/smrt-reports:SmrtReportRun",
|
|
@@ -1332,13 +1329,20 @@
|
|
|
1332
1329
|
"className": "RuntimeReportsRecipe",
|
|
1333
1330
|
"label": "Reports",
|
|
1334
1331
|
"summary": "Ask for a report, approve it, and share its live totals with your team.",
|
|
1335
|
-
"synonyms": [
|
|
1332
|
+
"synonyms": [
|
|
1333
|
+
"report",
|
|
1334
|
+
"summary",
|
|
1335
|
+
"summaries",
|
|
1336
|
+
"totals",
|
|
1337
|
+
"trends",
|
|
1338
|
+
"dashboards"
|
|
1339
|
+
],
|
|
1336
1340
|
"models": [
|
|
1337
1341
|
"@happyvertical/smrt-reports:RuntimeReport"
|
|
1338
1342
|
],
|
|
1339
1343
|
"nav": [
|
|
1340
1344
|
{
|
|
1341
|
-
"label": "
|
|
1345
|
+
"label": "Shared reports",
|
|
1342
1346
|
"model": "@happyvertical/smrt-reports:RuntimeReport",
|
|
1343
1347
|
"icon": "fileText"
|
|
1344
1348
|
}
|
package/dist/state.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ObjectRegistry, SmrtCollection, SmrtObject, field, smrt } from "@happyvertical/smrt-core";
|
|
2
2
|
import { TenantScoped, tenantId } from "@happyvertical/smrt-tenancy";
|
|
3
3
|
//#region src/__smrt-register__.ts
|
|
4
|
-
ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-reports","packageVersion":"0.57.3","objects":{"@happyvertical/smrt-reports:SmrtReport":{"name":"smrtreport","className":"SmrtReport","qualifiedName":"@happyvertical/smrt-reports:SmrtReport","collection":"smrtreports","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/report.ts","packageName":"@happyvertical/smrt-reports","fields":{"refreshedAt":{"type":"datetime","required":false}},"methods":{"isStale":{"name":"isStale","async":false,"parameters":[{"name":"ttlMs","type":"number","optional":true}],"returnType":"boolean","isStatic":false,"isPublic":true},"refresh":{"name":"refresh","async":true,"parameters":[{"name":"options","type":"Omit<ReportRefreshOptions, 'db'>","optional":true}],"returnType":"Promise<ReportRefreshResult>","isStatic":false,"isPublic":true}},"decoratorConfig":{},"extends":"SmrtObject","exportName":"SmrtReport","collectionExportName":"SmrtReportCollection","importPath":"@happyvertical/smrt-reports"},"@happyvertical/smrt-reports:SmrtReportCollection":{"name":"smrtreportcollection","className":"SmrtReportCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportCollection","collection":"smrtreports","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/report.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{"refresh":{"name":"refresh","async":true,"parameters":[{"name":"options","type":"Omit<ReportRefreshOptions, 'db'>","optional":true}],"returnType":"Promise<ReportRefreshResult>","isStatic":false,"isPublic":true},"list":{"name":"list","async":true,"parameters":[{"name":"options","type":"SmrtListOptions<ModelType>","optional":true}],"returnType":"Promise<SmrtObject[] | Record<string, unknown>[]>","isStatic":false,"isPublic":true},"get":{"name":"get","async":true,"parameters":[{"name":"filter","type":"any","optional":false,"typeUnresolved":true},{"name":"options","type":"any","optional":true,"typeUnresolved":true}],"returnType":"Promise<ModelType | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{},"extends":"SmrtCollection","extendsTypeArg":"ModelType","exportName":"SmrtReportCollection","collectionExportName":"SmrtReportCollectionCollection","importPath":"@happyvertical/smrt-reports"},"@happyvertical/smrt-reports:RuntimeReport":{"name":"runtimereport","className":"RuntimeReport","qualifiedName":"@happyvertical/smrt-reports:RuntimeReport","collection":"runtimereports","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/runtime-report.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","required":true,"_meta":{"sqlType":"UUID","__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false}}},"title":{"type":"text","required":false,"_meta":{}},"description":{"type":"text","required":false,"_meta":{}},"sourceId":{"type":"text","required":false,"_meta":{}},"spec":{"type":"text","required":true,"_meta":{"required":true}},"specHash":{"type":"text","required":false,"_meta":{}},"status":{"type":"text","required":true,"_meta":{"required":true},"enum":["active","archived"]},"createdByUserId":{"type":"text","required":false,"_meta":{}}},"methods":{"run":{"name":"run","async":true,"parameters":[],"returnType":"Promise<RuntimeReportResult>","isStatic":false,"isPublic":true},"archive":{"name":"archive","async":true,"parameters":[{"name":"options","type":"object","optional":false,"memberTypes":["boolean"]}],"returnType":"Promise<object>","isStatic":false,"isPublic":true},"getSpec":{"name":"getSpec","async":false,"parameters":[],"returnType":"RuntimeReportSpec","isStatic":false,"isPublic":true},"setSpec":{"name":"setSpec","async":false,"parameters":[{"name":"spec","type":"RuntimeReportSpec","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"runtime_reports","indexes":[{"name":"idx_runtime_reports_confirm","columns":["tenantId","createdByUserId","specHash","status"]}],"operationPermissions":{"run":{"action":"read"},"archive":{"action":"create","databaseActions":["SELECT","UPDATE"]}},"api":{"include":["list","get","create","run","archive"],"principalContext":true,"routes":{"run":{"method":"POST","scope":"item","effect":"read","idempotent":true,"openWorld":false},"archive":{"method":"POST","scope":"item","effect":"write","idempotent":true,"openWorld":false}}},"mcp":{"include":["list","get","run","archive"]},"cli":{"include":["list","get","run","archive"]},"tenantScoped":{"mode":"required"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"RuntimeReport","collectionExportName":"RuntimeReportCollection","displayLabelField":"title","validationRules":[{"field":"spec","rule":"required","fieldType":"text"},{"field":"status","rule":"required","fieldType":"text"}],"schema":{"tableName":"runtime_reports","ddl":"CREATE TABLE IF NOT EXISTS \\"runtime_reports\\" (\\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 \\"title\\" TEXT,\\n \\"description\\" TEXT,\\n \\"source_id\\" TEXT,\\n \\"spec\\" TEXT NOT NULL,\\n \\"spec_hash\\" TEXT,\\n \\"status\\" TEXT NOT NULL,\\n \\"created_by_user_id\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"title":{"type":"TEXT","notNull":false,"unique":false},"description":{"type":"TEXT","notNull":false,"unique":false},"source_id":{"type":"TEXT","notNull":false,"unique":false},"spec":{"type":"TEXT","notNull":true,"unique":false},"spec_hash":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"created_by_user_id":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"runtime_reports_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"idx_runtime_reports_confirm","columns":["tenant_id","created_by_user_id","spec_hash","status"]},{"name":"runtime_reports_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"04a92513"},"importPath":"@happyvertical/smrt-reports"},"@happyvertical/smrt-reports:RuntimeReportCollection":{"name":"runtimereportcollection","className":"RuntimeReportCollection","qualifiedName":"@happyvertical/smrt-reports:RuntimeReportCollection","collection":"runtimereports","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/runtime-report.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"runtime_reports","api":{"include":["list","get","create"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"RuntimeReport","exportName":"RuntimeReportCollection","collectionExportName":"RuntimeReportCollectionCollection","schema":{"tableName":"runtime_reports","ddl":"CREATE TABLE IF NOT EXISTS \\"runtime_reports\\" (\\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 \\"title\\" TEXT,\\n \\"description\\" TEXT,\\n \\"source_id\\" TEXT,\\n \\"spec\\" TEXT NOT NULL,\\n \\"spec_hash\\" TEXT,\\n \\"status\\" TEXT NOT NULL,\\n \\"created_by_user_id\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"title":{"type":"TEXT","notNull":false,"unique":false},"description":{"type":"TEXT","notNull":false,"unique":false},"source_id":{"type":"TEXT","notNull":false,"unique":false},"spec":{"type":"TEXT","notNull":true,"unique":false},"spec_hash":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"created_by_user_id":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"runtime_reports_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"idx_runtime_reports_confirm","columns":["tenant_id","created_by_user_id","spec_hash","status"]},{"name":"runtime_reports_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"04a92513"},"importPath":"@happyvertical/smrt-reports"},"@happyvertical/smrt-reports:SmrtReportRefreshTask":{"name":"smrtreportrefreshtask","className":"SmrtReportRefreshTask","qualifiedName":"@happyvertical/smrt-reports:SmrtReportRefreshTask","collection":"smrtreportrefreshtasks","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/scheduler.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"reportClass":{"type":"text","required":true,"_meta":{"required":true}},"mode":{"type":"text","required":true,"_meta":{"required":true},"enum":["rebuild","incremental"]},"trigger":{"type":"text","required":true,"_meta":{"required":true},"enum":["manual","schedule","change","ttl","job"]},"args":{"type":"json","required":false,"_meta":{}}},"methods":{"run":{"name":"run","async":true,"parameters":[{"name":"args","type":"ReportRefreshJobArgs","optional":true},{"name":"context","type":"JobExecutionContext","optional":true}],"returnType":"Promise<unknown>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"_smrt_report_refresh_tasks","api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SmrtReportRefreshTask","collectionExportName":"SmrtReportRefreshTaskCollection","validationRules":[{"field":"reportClass","rule":"required","fieldType":"text"},{"field":"mode","rule":"required","fieldType":"text"},{"field":"trigger","rule":"required","fieldType":"text"}],"schema":{"tableName":"_smrt_report_refresh_tasks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_refresh_tasks\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"mode\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"args\\" JSON\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"args":{"type":"JSON","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_refresh_tasks_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"_smrt_report_refresh_tasks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"c9142042"},"importPath":"@happyvertical/smrt-reports/scheduler"},"@happyvertical/smrt-reports:SmrtPrincipalReportRefreshTask":{"name":"smrtprincipalreportrefreshtask","className":"SmrtPrincipalReportRefreshTask","qualifiedName":"@happyvertical/smrt-reports:SmrtPrincipalReportRefreshTask","collection":"smrtprincipalreportrefreshtasks","description":"Worker target whose authority requirement cannot be downgraded by job args.","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/scheduler.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","required":false,"_meta":{"generated":true,"source":"tenantScoped_decorator","sqlType":"UUID","__tenancy":{"isTenantIdField":true,"mode":"optional","field":"tenantId","autoFilter":true,"autoPopulate":true,"allowSuperAdminBypass":false}}}},"methods":{"run":{"name":"run","async":true,"parameters":[{"name":"args","type":"ReportRefreshJobArgs","optional":true},{"name":"context","type":"JobExecutionContext","optional":true}],"returnType":"Promise<unknown>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"_smrt_principal_report_refresh_tasks","api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtReportRefreshTask","exportName":"SmrtPrincipalReportRefreshTask","collectionExportName":"SmrtPrincipalReportRefreshTaskCollection","schema":{"tableName":"_smrt_principal_report_refresh_tasks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_principal_report_refresh_tasks\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_principal_report_refresh_tasks_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"_smrt_principal_report_refresh_tasks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"226a3b97"},"importPath":"@happyvertical/smrt-reports/scheduler"},"@happyvertical/smrt-reports:SmrtReportRun":{"name":"smrtreportrun","className":"SmrtReportRun","qualifiedName":"@happyvertical/smrt-reports:SmrtReportRun","collection":"smrtreportruns","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"scopeKey":{"type":"text","required":true,"_meta":{"required":true}},"reportClass":{"type":"text","required":true,"_meta":{"required":true}},"sourceClass":{"type":"text","required":true,"_meta":{"required":true}},"mode":{"type":"text","required":true,"_meta":{"required":true},"enum":["rebuild","incremental"]},"trigger":{"type":"text","required":true,"_meta":{"required":true},"enum":["manual","schedule","change","ttl","job"]},"status":{"type":"text","required":true,"description":"Whether the refresh is running, finished, failed or was skipped.","_meta":{"required":true,"description":"Whether the refresh is running, finished, failed or was skipped."},"enum":["running","success","failed","skipped"]},"startedAt":{"type":"datetime","required":true,"description":"When the refresh began.","_meta":{"required":true,"description":"When the refresh began."}},"completedAt":{"type":"datetime","required":false,"description":"When the refresh finished. Empty while it is still running.","_meta":{"nullable":true,"description":"When the refresh finished. Empty while it is still running."}},"rowCount":{"type":"integer","required":true,"description":"How many rows the report held after the refresh.","_meta":{"required":true,"description":"How many rows the report held after the refresh."}},"changedGroupCount":{"type":"integer","required":true,"_meta":{"required":true}},"watermarkBefore":{"type":"text","required":false,"_meta":{"nullable":true}},"watermarkAfter":{"type":"text","required":false,"_meta":{"nullable":true}},"error":{"type":"text","required":false,"description":"Why the refresh failed. Empty when it worked.","_meta":{"nullable":true,"description":"Why the refresh failed. Empty when it worked."}},"metadata":{"type":"json","required":false,"_meta":{}}},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_runs","api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SmrtReportRun","collectionExportName":"SmrtReportRunCollection","validationRules":[{"field":"scopeKey","rule":"required","fieldType":"text"},{"field":"reportClass","rule":"required","fieldType":"text"},{"field":"sourceClass","rule":"required","fieldType":"text"},{"field":"mode","rule":"required","fieldType":"text"},{"field":"trigger","rule":"required","fieldType":"text"},{"field":"status","rule":"required","fieldType":"text"},{"field":"startedAt","rule":"required","fieldType":"datetime"},{"field":"rowCount","rule":"required","fieldType":"integer"},{"field":"changedGroupCount","rule":"required","fieldType":"integer"}],"schema":{"tableName":"_smrt_report_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_runs\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"source_class\\" TEXT NOT NULL,\\n \\"mode\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"status\\" TEXT NOT NULL,\\n \\"started_at\\" TIMESTAMP NOT NULL,\\n \\"completed_at\\" TIMESTAMP,\\n \\"row_count\\" INTEGER NOT NULL,\\n \\"changed_group_count\\" INTEGER NOT NULL,\\n \\"watermark_before\\" TEXT,\\n \\"watermark_after\\" TEXT,\\n \\"error\\" TEXT,\\n \\"metadata\\" JSON\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"source_class":{"type":"TEXT","notNull":true,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"started_at":{"type":"TIMESTAMP","notNull":true,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"row_count":{"type":"INTEGER","notNull":true,"unique":false},"changed_group_count":{"type":"INTEGER","notNull":true,"unique":false},"watermark_before":{"type":"TEXT","notNull":false,"unique":false},"watermark_after":{"type":"TEXT","notNull":false,"unique":false},"error":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"JSON","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"_smrt_report_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"54ff5048"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportRunCollection":{"name":"smrtreportruncollection","className":"SmrtReportRunCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportRunCollection","collection":"smrtreportruns","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_runs","api":false,"mcp":false,"cli":{"include":["list","get"],"skipApiCheck":true}},"extends":"SmrtCollection","extendsTypeArg":"SmrtReportRun","exportName":"SmrtReportRunCollection","collectionExportName":"SmrtReportRunCollectionCollection","schema":{"tableName":"_smrt_report_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_runs\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"source_class\\" TEXT NOT NULL,\\n \\"mode\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"status\\" TEXT NOT NULL,\\n \\"started_at\\" TIMESTAMP NOT NULL,\\n \\"completed_at\\" TIMESTAMP,\\n \\"row_count\\" INTEGER NOT NULL,\\n \\"changed_group_count\\" INTEGER NOT NULL,\\n \\"watermark_before\\" TEXT,\\n \\"watermark_after\\" TEXT,\\n \\"error\\" TEXT,\\n \\"metadata\\" JSON\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"source_class":{"type":"TEXT","notNull":true,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"started_at":{"type":"TIMESTAMP","notNull":true,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"row_count":{"type":"INTEGER","notNull":true,"unique":false},"changed_group_count":{"type":"INTEGER","notNull":true,"unique":false},"watermark_before":{"type":"TEXT","notNull":false,"unique":false},"watermark_after":{"type":"TEXT","notNull":false,"unique":false},"error":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"JSON","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"_smrt_report_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"54ff5048"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportWatermark":{"name":"smrtreportwatermark","className":"SmrtReportWatermark","qualifiedName":"@happyvertical/smrt-reports:SmrtReportWatermark","collection":"smrtreportwatermarks","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"scopeKey":{"type":"text","required":true,"_meta":{"required":true}},"reportClass":{"type":"text","required":true,"_meta":{"required":true}},"sourceClass":{"type":"text","required":true,"_meta":{"required":true}},"watermarkColumn":{"type":"text","required":true,"_meta":{"required":true}},"watermarkValue":{"type":"text","required":false,"_meta":{"nullable":true}},"lastRunId":{"type":"text","required":false,"_meta":{"nullable":true}}},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_watermarks","conflictColumns":["report_class","scope_key","source_class","watermark_column"],"api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SmrtReportWatermark","collectionExportName":"SmrtReportWatermarkCollection","validationRules":[{"field":"scopeKey","rule":"required","fieldType":"text"},{"field":"reportClass","rule":"required","fieldType":"text"},{"field":"sourceClass","rule":"required","fieldType":"text"},{"field":"watermarkColumn","rule":"required","fieldType":"text"}],"schema":{"tableName":"_smrt_report_watermarks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_watermarks\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"source_class\\" TEXT NOT NULL,\\n \\"watermark_column\\" TEXT NOT NULL,\\n \\"watermark_value\\" TEXT,\\n \\"last_run_id\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"source_class":{"type":"TEXT","notNull":true,"unique":false},"watermark_column":{"type":"TEXT","notNull":true,"unique":false},"watermark_value":{"type":"TEXT","notNull":false,"unique":false},"last_run_id":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_watermarks_report_class_scope_key_idx","columns":["report_class","scope_key","source_class","watermark_column"],"unique":true},{"name":"_smrt_report_watermarks_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_watermarks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"dac9d57a"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportWatermarkCollection":{"name":"smrtreportwatermarkcollection","className":"SmrtReportWatermarkCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportWatermarkCollection","collection":"smrtreportwatermarks","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_watermarks","api":false,"mcp":false,"cli":{"include":["list","get"],"skipApiCheck":true}},"extends":"SmrtCollection","extendsTypeArg":"SmrtReportWatermark","exportName":"SmrtReportWatermarkCollection","collectionExportName":"SmrtReportWatermarkCollectionCollection","schema":{"tableName":"_smrt_report_watermarks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_watermarks\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"source_class\\" TEXT NOT NULL,\\n \\"watermark_column\\" TEXT NOT NULL,\\n \\"watermark_value\\" TEXT,\\n \\"last_run_id\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"source_class":{"type":"TEXT","notNull":true,"unique":false},"watermark_column":{"type":"TEXT","notNull":true,"unique":false},"watermark_value":{"type":"TEXT","notNull":false,"unique":false},"last_run_id":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_watermarks_report_class_scope_key_idx","columns":["report_class","scope_key","source_class","watermark_column"],"unique":true},{"name":"_smrt_report_watermarks_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_watermarks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"dac9d57a"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportLock":{"name":"smrtreportlock","className":"SmrtReportLock","qualifiedName":"@happyvertical/smrt-reports:SmrtReportLock","collection":"smrtreportlocks","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"scopeKey":{"type":"text","required":true,"_meta":{"required":true}},"reportClass":{"type":"text","required":true,"_meta":{"required":true}},"ownerId":{"type":"text","required":false,"_meta":{"nullable":true}},"acquiredAt":{"type":"datetime","required":false,"_meta":{"nullable":true}},"heartbeatAt":{"type":"datetime","required":false,"_meta":{"nullable":true}},"expiresAt":{"type":"datetime","required":false,"_meta":{"nullable":true}}},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_locks","conflictColumns":["report_class","scope_key"],"api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SmrtReportLock","collectionExportName":"SmrtReportLockCollection","validationRules":[{"field":"scopeKey","rule":"required","fieldType":"text"},{"field":"reportClass","rule":"required","fieldType":"text"}],"schema":{"tableName":"_smrt_report_locks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_locks\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"owner_id\\" TEXT,\\n \\"acquired_at\\" TIMESTAMP,\\n \\"heartbeat_at\\" TIMESTAMP,\\n \\"expires_at\\" TIMESTAMP\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"owner_id":{"type":"TEXT","notNull":false,"unique":false},"acquired_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"heartbeat_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"expires_at":{"type":"TIMESTAMP","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_locks_report_class_scope_key_idx","columns":["report_class","scope_key"],"unique":true},{"name":"_smrt_report_locks_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_locks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"4a2043f9"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportLockCollection":{"name":"smrtreportlockcollection","className":"SmrtReportLockCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportLockCollection","collection":"smrtreportlocks","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_locks","api":false,"mcp":false,"cli":{"include":["list","get"],"skipApiCheck":true}},"extends":"SmrtCollection","extendsTypeArg":"SmrtReportLock","exportName":"SmrtReportLockCollection","collectionExportName":"SmrtReportLockCollectionCollection","schema":{"tableName":"_smrt_report_locks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_locks\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"owner_id\\" TEXT,\\n \\"acquired_at\\" TIMESTAMP,\\n \\"heartbeat_at\\" TIMESTAMP,\\n \\"expires_at\\" TIMESTAMP\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"owner_id":{"type":"TEXT","notNull":false,"unique":false},"acquired_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"heartbeat_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"expires_at":{"type":"TIMESTAMP","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_locks_report_class_scope_key_idx","columns":["report_class","scope_key"],"unique":true},{"name":"_smrt_report_locks_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_locks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"4a2043f9"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportSchedule":{"name":"smrtreportschedule","className":"SmrtReportSchedule","qualifiedName":"@happyvertical/smrt-reports:SmrtReportSchedule","collection":"smrtreportschedules","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"scopeKey":{"type":"text","required":true,"_meta":{"required":true}},"reportClass":{"type":"text","required":true,"_meta":{"required":true}},"cron":{"type":"text","required":true,"description":"When the report refreshes, as a cron schedule such as 0 6 * * * for 6 am daily.","_meta":{"required":true,"description":"When the report refreshes, as a cron schedule such as 0 6 * * * for 6 am daily."}},"trigger":{"type":"text","required":true,"_meta":{"required":true},"enum":["manual","schedule","change","ttl","job"]},"mode":{"type":"text","required":true,"description":"Rebuild recomputes the whole report. Incremental updates only what changed.","_meta":{"required":true,"description":"Rebuild recomputes the whole report. Incremental updates only what changed."},"enum":["rebuild","incremental"]},"enabled":{"type":"boolean","required":true,"description":"Turn off to stop refreshing without deleting the schedule.","_meta":{"required":true,"description":"Turn off to stop refreshing without deleting the schedule."}},"status":{"type":"text","required":true,"description":"Whether the schedule is active, paused, disabled or in error.","_meta":{"required":true,"description":"Whether the schedule is active, paused, disabled or in error."},"enum":["active","paused","disabled","error"]},"nextRun":{"type":"datetime","required":false,"description":"When the report is next due to refresh.","_meta":{"nullable":true,"description":"When the report is next due to refresh."}},"lastRun":{"type":"datetime","required":false,"description":"When the report last started a scheduled refresh.","_meta":{"nullable":true,"description":"When the report last started a scheduled refresh."}},"lastStatus":{"type":"text","required":false,"description":"Whether the last scheduled refresh worked or failed.","_meta":{"nullable":true,"description":"Whether the last scheduled refresh worked or failed."},"enum":["success","failed"]},"lastError":{"type":"text","required":false,"description":"Why the last scheduled refresh failed. Empty when it worked.","_meta":{"nullable":true,"description":"Why the last scheduled refresh failed. Empty when it worked."}},"runCount":{"type":"integer","required":true,"_meta":{"required":true}},"successCount":{"type":"integer","required":true,"_meta":{"required":true}},"failureCount":{"type":"integer","required":true,"_meta":{"required":true}},"runningCount":{"type":"integer","required":true,"_meta":{"required":true}},"maxConcurrent":{"type":"integer","required":true,"_meta":{"required":true}},"queue":{"type":"text","required":true,"_meta":{"required":true}},"priority":{"type":"integer","required":true,"_meta":{"required":true}},"timeout":{"type":"integer","required":true,"_meta":{"required":true}}},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_schedules","conflictColumns":["report_class","scope_key","cron","mode"],"api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SmrtReportSchedule","collectionExportName":"SmrtReportScheduleCollection","validationRules":[{"field":"scopeKey","rule":"required","fieldType":"text"},{"field":"reportClass","rule":"required","fieldType":"text"},{"field":"cron","rule":"required","fieldType":"text"},{"field":"trigger","rule":"required","fieldType":"text"},{"field":"mode","rule":"required","fieldType":"text"},{"field":"enabled","rule":"required","fieldType":"boolean"},{"field":"status","rule":"required","fieldType":"text"},{"field":"runCount","rule":"required","fieldType":"integer"},{"field":"successCount","rule":"required","fieldType":"integer"},{"field":"failureCount","rule":"required","fieldType":"integer"},{"field":"runningCount","rule":"required","fieldType":"integer"},{"field":"maxConcurrent","rule":"required","fieldType":"integer"},{"field":"queue","rule":"required","fieldType":"text"},{"field":"priority","rule":"required","fieldType":"integer"},{"field":"timeout","rule":"required","fieldType":"integer"}],"schema":{"tableName":"_smrt_report_schedules","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_schedules\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"cron\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"mode\\" TEXT NOT NULL,\\n \\"enabled\\" BOOLEAN NOT NULL,\\n \\"status\\" TEXT NOT NULL,\\n \\"next_run\\" TIMESTAMP,\\n \\"last_run\\" TIMESTAMP,\\n \\"last_status\\" TEXT,\\n \\"last_error\\" TEXT,\\n \\"run_count\\" INTEGER NOT NULL,\\n \\"success_count\\" INTEGER NOT NULL,\\n \\"failure_count\\" INTEGER NOT NULL,\\n \\"running_count\\" INTEGER NOT NULL,\\n \\"max_concurrent\\" INTEGER NOT NULL,\\n \\"queue\\" TEXT NOT NULL,\\n \\"priority\\" INTEGER NOT NULL,\\n \\"timeout\\" INTEGER NOT NULL\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"cron":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"enabled":{"type":"BOOLEAN","notNull":true,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"next_run":{"type":"TIMESTAMP","notNull":false,"unique":false},"last_run":{"type":"TIMESTAMP","notNull":false,"unique":false},"last_status":{"type":"TEXT","notNull":false,"unique":false},"last_error":{"type":"TEXT","notNull":false,"unique":false},"run_count":{"type":"INTEGER","notNull":true,"unique":false},"success_count":{"type":"INTEGER","notNull":true,"unique":false},"failure_count":{"type":"INTEGER","notNull":true,"unique":false},"running_count":{"type":"INTEGER","notNull":true,"unique":false},"max_concurrent":{"type":"INTEGER","notNull":true,"unique":false},"queue":{"type":"TEXT","notNull":true,"unique":false},"priority":{"type":"INTEGER","notNull":true,"unique":false},"timeout":{"type":"INTEGER","notNull":true,"unique":false}},"indexes":[{"name":"_smrt_report_schedules_report_class_scope_key_idx","columns":["report_class","scope_key","cron","mode"],"unique":true},{"name":"_smrt_report_schedules_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_schedules_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"4b9f0e69"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportScheduleCollection":{"name":"smrtreportschedulecollection","className":"SmrtReportScheduleCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportScheduleCollection","collection":"smrtreportschedules","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_schedules","api":false,"mcp":false,"cli":{"include":["list","get"],"skipApiCheck":true}},"extends":"SmrtCollection","extendsTypeArg":"SmrtReportSchedule","exportName":"SmrtReportScheduleCollection","collectionExportName":"SmrtReportScheduleCollectionCollection","schema":{"tableName":"_smrt_report_schedules","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_schedules\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"cron\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"mode\\" TEXT NOT NULL,\\n \\"enabled\\" BOOLEAN NOT NULL,\\n \\"status\\" TEXT NOT NULL,\\n \\"next_run\\" TIMESTAMP,\\n \\"last_run\\" TIMESTAMP,\\n \\"last_status\\" TEXT,\\n \\"last_error\\" TEXT,\\n \\"run_count\\" INTEGER NOT NULL,\\n \\"success_count\\" INTEGER NOT NULL,\\n \\"failure_count\\" INTEGER NOT NULL,\\n \\"running_count\\" INTEGER NOT NULL,\\n \\"max_concurrent\\" INTEGER NOT NULL,\\n \\"queue\\" TEXT NOT NULL,\\n \\"priority\\" INTEGER NOT NULL,\\n \\"timeout\\" INTEGER NOT NULL\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"cron":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"enabled":{"type":"BOOLEAN","notNull":true,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"next_run":{"type":"TIMESTAMP","notNull":false,"unique":false},"last_run":{"type":"TIMESTAMP","notNull":false,"unique":false},"last_status":{"type":"TEXT","notNull":false,"unique":false},"last_error":{"type":"TEXT","notNull":false,"unique":false},"run_count":{"type":"INTEGER","notNull":true,"unique":false},"success_count":{"type":"INTEGER","notNull":true,"unique":false},"failure_count":{"type":"INTEGER","notNull":true,"unique":false},"running_count":{"type":"INTEGER","notNull":true,"unique":false},"max_concurrent":{"type":"INTEGER","notNull":true,"unique":false},"queue":{"type":"TEXT","notNull":true,"unique":false},"priority":{"type":"INTEGER","notNull":true,"unique":false},"timeout":{"type":"INTEGER","notNull":true,"unique":false}},"indexes":[{"name":"_smrt_report_schedules_report_class_scope_key_idx","columns":["report_class","scope_key","cron","mode"],"unique":true},{"name":"_smrt_report_schedules_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_schedules_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"4b9f0e69"},"importPath":"@happyvertical/smrt-reports/state"}},"moduleType":"smrt","recipes":[{"id":"reports.materialized","className":"MaterializedReportsRecipe","label":"Reports","summary":"Keep totals and trends ready to read, refreshed on a schedule and open to the assistant.","synonyms":["reports","totals","summaries","rollups","kpis","trends","dashboards"],"models":["@happyvertical/smrt-reports:SmrtReportRun","@happyvertical/smrt-reports:SmrtReportWatermark","@happyvertical/smrt-reports:SmrtReportLock","@happyvertical/smrt-reports:SmrtReportSchedule","@happyvertical/smrt-reports:SmrtReportRefreshTask","@happyvertical/smrt-reports:SmrtPrincipalReportRefreshTask"],"nav":[],"requires":[],"help":{"markdown":"## Overview\\n\\nReports keep totals and trends, such as revenue by month or signups by week,\\nworked out ahead of time so they open instantly. Someone on your team sets up\\neach report once. This feature then records when each report was last\\nrefreshed, how that went, and when it runs next.\\n\\nReports are calculated on your server, never in the browser, so this feature\\nneeds your app's database.\\n\\n## Tasks\\n\\n### Ask the assistant about a report\\n\\n1. Ask in plain words, for example \\"what was revenue last month?\\".\\n2. The assistant looks up the reports your account may see\\n (\`data.discover\`, \`data.inspect\`), then reads rows with \`reports.query\`.\\n It only ever sees the columns and the customer data you are allowed to see.\\n3. If the numbers look old, ask how fresh the report is. The answer says when\\n it was last refreshed.\\n4. Ask the assistant to refresh a stale report. It previews the refresh with\\n \`reports.refresh\` and your app decides who may apply it.\\n\\nThe assistant offers these tools only when your app has switched them on.\\n\\n### Ask a question no report covers\\n\\n1. Describe what you want to see, for example \\"orders by status this quarter\\".\\n2. The assistant checks what it may report on (\`reports.runtime.sources\`) and\\n shows a preview of the report it would save (\`reports.runtime.define\`).\\n3. Nothing is saved until you confirm that exact report.\\n4. Open it again later with \`reports.runtime.list\` and \`reports.runtime.run\`.\\n\\nThese reports are worked out live each time and their rows are never stored.\\nThey are not refreshed in the background. A report that people open every day\\nis worth asking your team to set up as a refreshed report instead.\\n\\n### Keep a report fresh\\n\\n1. Ask your team how the report refreshes: by hand, on a schedule, after the\\n data changes, or when it goes out of date.\\n2. A scheduled report repeats on its **{field:SmrtReportSchedule.cron}**, either\\n rebuilding everything or updating only what changed, per its\\n **{field:SmrtReportSchedule.mode}**.\\n3. Turn **{field:SmrtReportSchedule.enabled}** off to pause a schedule without\\n losing it.\\n4. **{field:SmrtReportSchedule.nextRun}** shows when it is next due.\\n\\n### Check that a refresh worked\\n\\n1. Look at the latest run for the report. **{field:SmrtReportRun.status}**\\n says whether it is running, finished, failed or skipped.\\n2. **{field:SmrtReportRun.completedAt}** and **{field:SmrtReportRun.rowCount}**\\n show when it finished and how many rows it holds.\\n3. If it failed, **{field:SmrtReportRun.error}** says why.\\n","fieldRefs":["SmrtReportRun.completedAt","SmrtReportRun.error","SmrtReportRun.rowCount","SmrtReportRun.status","SmrtReportSchedule.cron","SmrtReportSchedule.enabled","SmrtReportSchedule.mode","SmrtReportSchedule.nextRun"]},"runtime":"server","demo":{"mode":"server","reasons":["The recipe declares runtime \\"server\\".","Needs a server because its package does not build for a browser: node:crypto/events; @happyvertical/sql root: the sync query builders it needs (validateColumnName, buildWhere, buildAggregate, bucketExpr, tableExists) have no browser-safe SDK entry; and its package depends on @happyvertical/smrt-jobs, @happyvertical/smrt-tenancy, which do not build for a browser (#3615, #3624, #3625, #3627)."]}},{"id":"reports.runtime","className":"RuntimeReportsRecipe","label":"Reports","summary":"Ask for a report, approve it, and share its live totals with your team.","synonyms":[],"models":["@happyvertical/smrt-reports:RuntimeReport"],"nav":[{"label":"Reports","model":"@happyvertical/smrt-reports:RuntimeReport","icon":"fileText"}],"requires":[],"help":{"markdown":"# Reports\\n\\nAsk the assistant for a total, comparison, or trend. Review the proposed report\\nand approve it to save it. Your saved reports are shared with your team; each\\nperson sees results using their own access to the underlying information.\\n\\nReports run fresh when opened. You can archive a report to hide it from the\\nactive list and restore it later. Creating and restoring reports needs report\\nwriting access. Reports need a connected server and are unavailable in offline\\npreviews. Scheduling, renaming, and exporting reports are not available yet.\\n","fieldRefs":[]},"surfaces":[{"kind":"route","path":"/reports","export":"@happyvertical/smrt-reports/svelte#RuntimeReportsRoute","label":"Reports"},{"kind":"route","path":"/reports/:id","export":"@happyvertical/smrt-reports/svelte#RuntimeReportDetailRoute","label":"Report detail"},{"kind":"widget","type":"runtime-report-chart","export":"@happyvertical/smrt-reports/svelte#RuntimeReportChartWidget","label":"Report chart","description":"Chart a measure from a saved report.","icon":"chart","optionsEditor":"@happyvertical/smrt-reports/svelte#RuntimeReportWidgetOptions","options":[{"key":"reportId","type":"text","label":"Report","required":true},{"key":"measure","type":"identifier","label":"Measure","required":true},{"key":"dimension","type":"identifier","label":"Dimension"}],"data":{"load":"@happyvertical/smrt-reports#loadRuntimeReportChart","models":["@happyvertical/smrt-reports:RuntimeReport"]},"defaultSpan":2,"maxSpan":4}],"runtime":"server","demo":{"mode":"server","reasons":["The recipe declares runtime \\"server\\".","Needs a server because its package does not build for a browser: node:crypto/events; @happyvertical/sql root: the sync query builders it needs (validateColumnName, buildWhere, buildAggregate, bucketExpr, tableExists) have no browser-safe SDK entry; and its package depends on @happyvertical/smrt-jobs, @happyvertical/smrt-tenancy, which do not build for a browser (#3615, #3624, #3625, #3627)."]}}],"smrtDependencies":["@happyvertical/smrt-core","@happyvertical/smrt-jobs","@happyvertical/smrt-tenancy"],"browser":{"status":"server-only","issues":["#3615","#3624","#3625","#3627"],"reason":"node:crypto/events; @happyvertical/sql root: the sync query builders it needs (validateColumnName, buildWhere, buildAggregate, bucketExpr, tableExists) have no browser-safe SDK entry","via":["@happyvertical/smrt-jobs","@happyvertical/smrt-tenancy"]},"stampsConstructors":true}`));
|
|
4
|
+
ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-reports","packageVersion":"0.57.4","objects":{"@happyvertical/smrt-reports:SmrtReport":{"name":"smrtreport","className":"SmrtReport","qualifiedName":"@happyvertical/smrt-reports:SmrtReport","collection":"smrtreports","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/report.ts","packageName":"@happyvertical/smrt-reports","fields":{"refreshedAt":{"type":"datetime","required":false}},"methods":{"isStale":{"name":"isStale","async":false,"parameters":[{"name":"ttlMs","type":"number","optional":true}],"returnType":"boolean","isStatic":false,"isPublic":true},"refresh":{"name":"refresh","async":true,"parameters":[{"name":"options","type":"Omit<ReportRefreshOptions, 'db'>","optional":true}],"returnType":"Promise<ReportRefreshResult>","isStatic":false,"isPublic":true}},"decoratorConfig":{},"extends":"SmrtObject","exportName":"SmrtReport","collectionExportName":"SmrtReportCollection","importPath":"@happyvertical/smrt-reports"},"@happyvertical/smrt-reports:SmrtReportCollection":{"name":"smrtreportcollection","className":"SmrtReportCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportCollection","collection":"smrtreports","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/report.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{"refresh":{"name":"refresh","async":true,"parameters":[{"name":"options","type":"Omit<ReportRefreshOptions, 'db'>","optional":true}],"returnType":"Promise<ReportRefreshResult>","isStatic":false,"isPublic":true},"list":{"name":"list","async":true,"parameters":[{"name":"options","type":"SmrtListOptions<ModelType>","optional":true}],"returnType":"Promise<SmrtObject[] | Record<string, unknown>[]>","isStatic":false,"isPublic":true},"get":{"name":"get","async":true,"parameters":[{"name":"filter","type":"any","optional":false,"typeUnresolved":true},{"name":"options","type":"any","optional":true,"typeUnresolved":true}],"returnType":"Promise<ModelType | null>","isStatic":false,"isPublic":true}},"decoratorConfig":{},"extends":"SmrtCollection","extendsTypeArg":"ModelType","exportName":"SmrtReportCollection","collectionExportName":"SmrtReportCollectionCollection","importPath":"@happyvertical/smrt-reports"},"@happyvertical/smrt-reports:RuntimeReport":{"name":"runtimereport","className":"RuntimeReport","qualifiedName":"@happyvertical/smrt-reports:RuntimeReport","collection":"runtimereports","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/runtime-report.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","required":true,"_meta":{"sqlType":"UUID","__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false}}},"title":{"type":"text","required":false,"_meta":{}},"description":{"type":"text","required":false,"_meta":{}},"sourceId":{"type":"text","required":false,"_meta":{}},"spec":{"type":"text","required":true,"_meta":{"required":true}},"specHash":{"type":"text","required":false,"_meta":{}},"status":{"type":"text","required":true,"_meta":{"required":true},"enum":["active","archived"]},"createdByUserId":{"type":"text","required":false,"_meta":{}}},"methods":{"run":{"name":"run","async":true,"parameters":[],"returnType":"Promise<RuntimeReportResult>","isStatic":false,"isPublic":true},"archive":{"name":"archive","async":true,"parameters":[{"name":"options","type":"object","optional":false,"memberTypes":["boolean"]}],"returnType":"Promise<object>","isStatic":false,"isPublic":true},"getSpec":{"name":"getSpec","async":false,"parameters":[],"returnType":"RuntimeReportSpec","isStatic":false,"isPublic":true},"setSpec":{"name":"setSpec","async":false,"parameters":[{"name":"spec","type":"RuntimeReportSpec","optional":false}],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"runtime_reports","indexes":[{"name":"idx_runtime_reports_confirm","columns":["tenantId","createdByUserId","specHash","status"]}],"operationPermissions":{"run":{"action":"read"},"archive":{"action":"create","databaseActions":["SELECT","UPDATE"]}},"api":{"include":["list","get","create","run","archive"],"principalContext":true,"routes":{"run":{"method":"POST","scope":"item","effect":"read","idempotent":true,"openWorld":false},"archive":{"method":"POST","scope":"item","effect":"write","idempotent":true,"openWorld":false}}},"mcp":{"include":["list","get","run","archive"]},"cli":{"include":["list","get","run","archive"]},"tenantScoped":{"mode":"required"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"RuntimeReport","collectionExportName":"RuntimeReportCollection","displayLabelField":"title","validationRules":[{"field":"spec","rule":"required","fieldType":"text"},{"field":"status","rule":"required","fieldType":"text"}],"schema":{"tableName":"runtime_reports","ddl":"CREATE TABLE IF NOT EXISTS \\"runtime_reports\\" (\\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 \\"title\\" TEXT,\\n \\"description\\" TEXT,\\n \\"source_id\\" TEXT,\\n \\"spec\\" TEXT NOT NULL,\\n \\"spec_hash\\" TEXT,\\n \\"status\\" TEXT NOT NULL,\\n \\"created_by_user_id\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"title":{"type":"TEXT","notNull":false,"unique":false},"description":{"type":"TEXT","notNull":false,"unique":false},"source_id":{"type":"TEXT","notNull":false,"unique":false},"spec":{"type":"TEXT","notNull":true,"unique":false},"spec_hash":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"created_by_user_id":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"runtime_reports_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"idx_runtime_reports_confirm","columns":["tenant_id","created_by_user_id","spec_hash","status"]},{"name":"runtime_reports_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"04a92513"},"importPath":"@happyvertical/smrt-reports"},"@happyvertical/smrt-reports:RuntimeReportCollection":{"name":"runtimereportcollection","className":"RuntimeReportCollection","qualifiedName":"@happyvertical/smrt-reports:RuntimeReportCollection","collection":"runtimereports","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/runtime-report.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"runtime_reports","api":{"include":["list","get","create"]},"mcp":{"include":["list","get"]},"cli":{"include":["list","get"]}},"extends":"SmrtCollection","extendsTypeArg":"RuntimeReport","exportName":"RuntimeReportCollection","collectionExportName":"RuntimeReportCollectionCollection","schema":{"tableName":"runtime_reports","ddl":"CREATE TABLE IF NOT EXISTS \\"runtime_reports\\" (\\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 \\"title\\" TEXT,\\n \\"description\\" TEXT,\\n \\"source_id\\" TEXT,\\n \\"spec\\" TEXT NOT NULL,\\n \\"spec_hash\\" TEXT,\\n \\"status\\" TEXT NOT NULL,\\n \\"created_by_user_id\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"title":{"type":"TEXT","notNull":false,"unique":false},"description":{"type":"TEXT","notNull":false,"unique":false},"source_id":{"type":"TEXT","notNull":false,"unique":false},"spec":{"type":"TEXT","notNull":true,"unique":false},"spec_hash":{"type":"TEXT","notNull":false,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"created_by_user_id":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"runtime_reports_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"idx_runtime_reports_confirm","columns":["tenant_id","created_by_user_id","spec_hash","status"]},{"name":"runtime_reports_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"04a92513"},"importPath":"@happyvertical/smrt-reports"},"@happyvertical/smrt-reports:SmrtReportRefreshTask":{"name":"smrtreportrefreshtask","className":"SmrtReportRefreshTask","qualifiedName":"@happyvertical/smrt-reports:SmrtReportRefreshTask","collection":"smrtreportrefreshtasks","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/scheduler.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"reportClass":{"type":"text","required":true,"_meta":{"required":true}},"mode":{"type":"text","required":true,"_meta":{"required":true},"enum":["rebuild","incremental"]},"trigger":{"type":"text","required":true,"_meta":{"required":true},"enum":["manual","schedule","change","ttl","job"]},"args":{"type":"json","required":false,"_meta":{}}},"methods":{"run":{"name":"run","async":true,"parameters":[{"name":"args","type":"ReportRefreshJobArgs","optional":true},{"name":"context","type":"JobExecutionContext","optional":true}],"returnType":"Promise<unknown>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"_smrt_report_refresh_tasks","api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SmrtReportRefreshTask","collectionExportName":"SmrtReportRefreshTaskCollection","validationRules":[{"field":"reportClass","rule":"required","fieldType":"text"},{"field":"mode","rule":"required","fieldType":"text"},{"field":"trigger","rule":"required","fieldType":"text"}],"schema":{"tableName":"_smrt_report_refresh_tasks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_refresh_tasks\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"mode\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"args\\" JSON\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"args":{"type":"JSON","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_refresh_tasks_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"_smrt_report_refresh_tasks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"c9142042"},"importPath":"@happyvertical/smrt-reports/scheduler"},"@happyvertical/smrt-reports:SmrtPrincipalReportRefreshTask":{"name":"smrtprincipalreportrefreshtask","className":"SmrtPrincipalReportRefreshTask","qualifiedName":"@happyvertical/smrt-reports:SmrtPrincipalReportRefreshTask","collection":"smrtprincipalreportrefreshtasks","description":"Worker target whose authority requirement cannot be downgraded by job args.","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/scheduler.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","required":false,"_meta":{"generated":true,"source":"tenantScoped_decorator","sqlType":"UUID","__tenancy":{"isTenantIdField":true,"mode":"optional","field":"tenantId","autoFilter":true,"autoPopulate":true,"allowSuperAdminBypass":false}}}},"methods":{"run":{"name":"run","async":true,"parameters":[{"name":"args","type":"ReportRefreshJobArgs","optional":true},{"name":"context","type":"JobExecutionContext","optional":true}],"returnType":"Promise<unknown>","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"_smrt_principal_report_refresh_tasks","api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtReportRefreshTask","exportName":"SmrtPrincipalReportRefreshTask","collectionExportName":"SmrtPrincipalReportRefreshTaskCollection","schema":{"tableName":"_smrt_principal_report_refresh_tasks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_principal_report_refresh_tasks\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_principal_report_refresh_tasks_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"_smrt_principal_report_refresh_tasks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"226a3b97"},"importPath":"@happyvertical/smrt-reports/scheduler"},"@happyvertical/smrt-reports:SmrtReportRun":{"name":"smrtreportrun","className":"SmrtReportRun","qualifiedName":"@happyvertical/smrt-reports:SmrtReportRun","collection":"smrtreportruns","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"scopeKey":{"type":"text","required":true,"_meta":{"required":true}},"reportClass":{"type":"text","required":true,"_meta":{"required":true}},"sourceClass":{"type":"text","required":true,"_meta":{"required":true}},"mode":{"type":"text","required":true,"_meta":{"required":true},"enum":["rebuild","incremental"]},"trigger":{"type":"text","required":true,"_meta":{"required":true},"enum":["manual","schedule","change","ttl","job"]},"status":{"type":"text","required":true,"description":"Whether the refresh is running, finished, failed or was skipped.","_meta":{"required":true,"description":"Whether the refresh is running, finished, failed or was skipped."},"enum":["running","success","failed","skipped"]},"startedAt":{"type":"datetime","required":true,"description":"When the refresh began.","_meta":{"required":true,"description":"When the refresh began."}},"completedAt":{"type":"datetime","required":false,"description":"When the refresh finished. Empty while it is still running.","_meta":{"nullable":true,"description":"When the refresh finished. Empty while it is still running."}},"rowCount":{"type":"integer","required":true,"description":"How many rows the report held after the refresh.","_meta":{"required":true,"description":"How many rows the report held after the refresh."}},"changedGroupCount":{"type":"integer","required":true,"_meta":{"required":true}},"watermarkBefore":{"type":"text","required":false,"_meta":{"nullable":true}},"watermarkAfter":{"type":"text","required":false,"_meta":{"nullable":true}},"error":{"type":"text","required":false,"description":"Why the refresh failed. Empty when it worked.","_meta":{"nullable":true,"description":"Why the refresh failed. Empty when it worked."}},"metadata":{"type":"json","required":false,"_meta":{}}},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_runs","api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"SmrtReportRun","collectionExportName":"SmrtReportRunCollection","validationRules":[{"field":"scopeKey","rule":"required","fieldType":"text"},{"field":"reportClass","rule":"required","fieldType":"text"},{"field":"sourceClass","rule":"required","fieldType":"text"},{"field":"mode","rule":"required","fieldType":"text"},{"field":"trigger","rule":"required","fieldType":"text"},{"field":"status","rule":"required","fieldType":"text"},{"field":"startedAt","rule":"required","fieldType":"datetime"},{"field":"rowCount","rule":"required","fieldType":"integer"},{"field":"changedGroupCount","rule":"required","fieldType":"integer"}],"schema":{"tableName":"_smrt_report_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_runs\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"source_class\\" TEXT NOT NULL,\\n \\"mode\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"status\\" TEXT NOT NULL,\\n \\"started_at\\" TIMESTAMP NOT NULL,\\n \\"completed_at\\" TIMESTAMP,\\n \\"row_count\\" INTEGER NOT NULL,\\n \\"changed_group_count\\" INTEGER NOT NULL,\\n \\"watermark_before\\" TEXT,\\n \\"watermark_after\\" TEXT,\\n \\"error\\" TEXT,\\n \\"metadata\\" JSON\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"source_class":{"type":"TEXT","notNull":true,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"started_at":{"type":"TIMESTAMP","notNull":true,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"row_count":{"type":"INTEGER","notNull":true,"unique":false},"changed_group_count":{"type":"INTEGER","notNull":true,"unique":false},"watermark_before":{"type":"TEXT","notNull":false,"unique":false},"watermark_after":{"type":"TEXT","notNull":false,"unique":false},"error":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"JSON","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"_smrt_report_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"54ff5048"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportRunCollection":{"name":"smrtreportruncollection","className":"SmrtReportRunCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportRunCollection","collection":"smrtreportruns","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_runs","api":false,"mcp":false,"cli":{"include":["list","get"],"skipApiCheck":true}},"extends":"SmrtCollection","extendsTypeArg":"SmrtReportRun","exportName":"SmrtReportRunCollection","collectionExportName":"SmrtReportRunCollectionCollection","schema":{"tableName":"_smrt_report_runs","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_runs\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"source_class\\" TEXT NOT NULL,\\n \\"mode\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"status\\" TEXT NOT NULL,\\n \\"started_at\\" TIMESTAMP NOT NULL,\\n \\"completed_at\\" TIMESTAMP,\\n \\"row_count\\" INTEGER NOT NULL,\\n \\"changed_group_count\\" INTEGER NOT NULL,\\n \\"watermark_before\\" TEXT,\\n \\"watermark_after\\" TEXT,\\n \\"error\\" TEXT,\\n \\"metadata\\" JSON\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"source_class":{"type":"TEXT","notNull":true,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"started_at":{"type":"TIMESTAMP","notNull":true,"unique":false},"completed_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"row_count":{"type":"INTEGER","notNull":true,"unique":false},"changed_group_count":{"type":"INTEGER","notNull":true,"unique":false},"watermark_before":{"type":"TEXT","notNull":false,"unique":false},"watermark_after":{"type":"TEXT","notNull":false,"unique":false},"error":{"type":"TEXT","notNull":false,"unique":false},"metadata":{"type":"JSON","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_runs_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true,"nullsNotDistinct":true},{"name":"_smrt_report_runs_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"54ff5048"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportWatermark":{"name":"smrtreportwatermark","className":"SmrtReportWatermark","qualifiedName":"@happyvertical/smrt-reports:SmrtReportWatermark","collection":"smrtreportwatermarks","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"scopeKey":{"type":"text","required":true,"_meta":{"required":true}},"reportClass":{"type":"text","required":true,"_meta":{"required":true}},"sourceClass":{"type":"text","required":true,"_meta":{"required":true}},"watermarkColumn":{"type":"text","required":true,"_meta":{"required":true}},"watermarkValue":{"type":"text","required":false,"_meta":{"nullable":true}},"lastRunId":{"type":"text","required":false,"_meta":{"nullable":true}}},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_watermarks","conflictColumns":["report_class","scope_key","source_class","watermark_column"],"api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SmrtReportWatermark","collectionExportName":"SmrtReportWatermarkCollection","validationRules":[{"field":"scopeKey","rule":"required","fieldType":"text"},{"field":"reportClass","rule":"required","fieldType":"text"},{"field":"sourceClass","rule":"required","fieldType":"text"},{"field":"watermarkColumn","rule":"required","fieldType":"text"}],"schema":{"tableName":"_smrt_report_watermarks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_watermarks\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"source_class\\" TEXT NOT NULL,\\n \\"watermark_column\\" TEXT NOT NULL,\\n \\"watermark_value\\" TEXT,\\n \\"last_run_id\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"source_class":{"type":"TEXT","notNull":true,"unique":false},"watermark_column":{"type":"TEXT","notNull":true,"unique":false},"watermark_value":{"type":"TEXT","notNull":false,"unique":false},"last_run_id":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_watermarks_report_class_scope_key_idx","columns":["report_class","scope_key","source_class","watermark_column"],"unique":true},{"name":"_smrt_report_watermarks_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_watermarks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"dac9d57a"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportWatermarkCollection":{"name":"smrtreportwatermarkcollection","className":"SmrtReportWatermarkCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportWatermarkCollection","collection":"smrtreportwatermarks","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_watermarks","api":false,"mcp":false,"cli":{"include":["list","get"],"skipApiCheck":true}},"extends":"SmrtCollection","extendsTypeArg":"SmrtReportWatermark","exportName":"SmrtReportWatermarkCollection","collectionExportName":"SmrtReportWatermarkCollectionCollection","schema":{"tableName":"_smrt_report_watermarks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_watermarks\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"source_class\\" TEXT NOT NULL,\\n \\"watermark_column\\" TEXT NOT NULL,\\n \\"watermark_value\\" TEXT,\\n \\"last_run_id\\" TEXT\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"source_class":{"type":"TEXT","notNull":true,"unique":false},"watermark_column":{"type":"TEXT","notNull":true,"unique":false},"watermark_value":{"type":"TEXT","notNull":false,"unique":false},"last_run_id":{"type":"TEXT","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_watermarks_report_class_scope_key_idx","columns":["report_class","scope_key","source_class","watermark_column"],"unique":true},{"name":"_smrt_report_watermarks_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_watermarks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"dac9d57a"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportLock":{"name":"smrtreportlock","className":"SmrtReportLock","qualifiedName":"@happyvertical/smrt-reports:SmrtReportLock","collection":"smrtreportlocks","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"scopeKey":{"type":"text","required":true,"_meta":{"required":true}},"reportClass":{"type":"text","required":true,"_meta":{"required":true}},"ownerId":{"type":"text","required":false,"_meta":{"nullable":true}},"acquiredAt":{"type":"datetime","required":false,"_meta":{"nullable":true}},"heartbeatAt":{"type":"datetime","required":false,"_meta":{"nullable":true}},"expiresAt":{"type":"datetime","required":false,"_meta":{"nullable":true}}},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_locks","conflictColumns":["report_class","scope_key"],"api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SmrtReportLock","collectionExportName":"SmrtReportLockCollection","validationRules":[{"field":"scopeKey","rule":"required","fieldType":"text"},{"field":"reportClass","rule":"required","fieldType":"text"}],"schema":{"tableName":"_smrt_report_locks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_locks\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"owner_id\\" TEXT,\\n \\"acquired_at\\" TIMESTAMP,\\n \\"heartbeat_at\\" TIMESTAMP,\\n \\"expires_at\\" TIMESTAMP\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"owner_id":{"type":"TEXT","notNull":false,"unique":false},"acquired_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"heartbeat_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"expires_at":{"type":"TIMESTAMP","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_locks_report_class_scope_key_idx","columns":["report_class","scope_key"],"unique":true},{"name":"_smrt_report_locks_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_locks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"4a2043f9"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportLockCollection":{"name":"smrtreportlockcollection","className":"SmrtReportLockCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportLockCollection","collection":"smrtreportlocks","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_locks","api":false,"mcp":false,"cli":{"include":["list","get"],"skipApiCheck":true}},"extends":"SmrtCollection","extendsTypeArg":"SmrtReportLock","exportName":"SmrtReportLockCollection","collectionExportName":"SmrtReportLockCollectionCollection","schema":{"tableName":"_smrt_report_locks","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_locks\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"owner_id\\" TEXT,\\n \\"acquired_at\\" TIMESTAMP,\\n \\"heartbeat_at\\" TIMESTAMP,\\n \\"expires_at\\" TIMESTAMP\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"owner_id":{"type":"TEXT","notNull":false,"unique":false},"acquired_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"heartbeat_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"expires_at":{"type":"TIMESTAMP","notNull":false,"unique":false}},"indexes":[{"name":"_smrt_report_locks_report_class_scope_key_idx","columns":["report_class","scope_key"],"unique":true},{"name":"_smrt_report_locks_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_locks_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"4a2043f9"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportSchedule":{"name":"smrtreportschedule","className":"SmrtReportSchedule","qualifiedName":"@happyvertical/smrt-reports:SmrtReportSchedule","collection":"smrtreportschedules","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{"tenantId":{"type":"text","required":false,"_meta":{"sqlType":"UUID","nullable":true,"__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":false,"autoPopulate":true,"nullable":true,"mode":"optional","field":"tenantId","allowSuperAdminBypass":false}}},"scopeKey":{"type":"text","required":true,"_meta":{"required":true}},"reportClass":{"type":"text","required":true,"_meta":{"required":true}},"cron":{"type":"text","required":true,"description":"When the report refreshes, as a cron schedule such as 0 6 * * * for 6 am daily.","_meta":{"required":true,"description":"When the report refreshes, as a cron schedule such as 0 6 * * * for 6 am daily."}},"trigger":{"type":"text","required":true,"_meta":{"required":true},"enum":["manual","schedule","change","ttl","job"]},"mode":{"type":"text","required":true,"description":"Rebuild recomputes the whole report. Incremental updates only what changed.","_meta":{"required":true,"description":"Rebuild recomputes the whole report. Incremental updates only what changed."},"enum":["rebuild","incremental"]},"enabled":{"type":"boolean","required":true,"description":"Turn off to stop refreshing without deleting the schedule.","_meta":{"required":true,"description":"Turn off to stop refreshing without deleting the schedule."}},"status":{"type":"text","required":true,"description":"Whether the schedule is active, paused, disabled or in error.","_meta":{"required":true,"description":"Whether the schedule is active, paused, disabled or in error."},"enum":["active","paused","disabled","error"]},"nextRun":{"type":"datetime","required":false,"description":"When the report is next due to refresh.","_meta":{"nullable":true,"description":"When the report is next due to refresh."}},"lastRun":{"type":"datetime","required":false,"description":"When the report last started a scheduled refresh.","_meta":{"nullable":true,"description":"When the report last started a scheduled refresh."}},"lastStatus":{"type":"text","required":false,"description":"Whether the last scheduled refresh worked or failed.","_meta":{"nullable":true,"description":"Whether the last scheduled refresh worked or failed."},"enum":["success","failed"]},"lastError":{"type":"text","required":false,"description":"Why the last scheduled refresh failed. Empty when it worked.","_meta":{"nullable":true,"description":"Why the last scheduled refresh failed. Empty when it worked."}},"runCount":{"type":"integer","required":true,"_meta":{"required":true}},"successCount":{"type":"integer","required":true,"_meta":{"required":true}},"failureCount":{"type":"integer","required":true,"_meta":{"required":true}},"runningCount":{"type":"integer","required":true,"_meta":{"required":true}},"maxConcurrent":{"type":"integer","required":true,"_meta":{"required":true}},"queue":{"type":"text","required":true,"_meta":{"required":true}},"priority":{"type":"integer","required":true,"_meta":{"required":true}},"timeout":{"type":"integer","required":true,"_meta":{"required":true}}},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_schedules","conflictColumns":["report_class","scope_key","cron","mode"],"api":false,"cli":{"include":["list","get"],"skipApiCheck":true,"http":false},"mcp":false,"tenantScoped":{"mode":"optional"}},"extends":"SmrtObject","exportName":"SmrtReportSchedule","collectionExportName":"SmrtReportScheduleCollection","validationRules":[{"field":"scopeKey","rule":"required","fieldType":"text"},{"field":"reportClass","rule":"required","fieldType":"text"},{"field":"cron","rule":"required","fieldType":"text"},{"field":"trigger","rule":"required","fieldType":"text"},{"field":"mode","rule":"required","fieldType":"text"},{"field":"enabled","rule":"required","fieldType":"boolean"},{"field":"status","rule":"required","fieldType":"text"},{"field":"runCount","rule":"required","fieldType":"integer"},{"field":"successCount","rule":"required","fieldType":"integer"},{"field":"failureCount","rule":"required","fieldType":"integer"},{"field":"runningCount","rule":"required","fieldType":"integer"},{"field":"maxConcurrent","rule":"required","fieldType":"integer"},{"field":"queue","rule":"required","fieldType":"text"},{"field":"priority","rule":"required","fieldType":"integer"},{"field":"timeout","rule":"required","fieldType":"integer"}],"schema":{"tableName":"_smrt_report_schedules","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_schedules\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"cron\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"mode\\" TEXT NOT NULL,\\n \\"enabled\\" BOOLEAN NOT NULL,\\n \\"status\\" TEXT NOT NULL,\\n \\"next_run\\" TIMESTAMP,\\n \\"last_run\\" TIMESTAMP,\\n \\"last_status\\" TEXT,\\n \\"last_error\\" TEXT,\\n \\"run_count\\" INTEGER NOT NULL,\\n \\"success_count\\" INTEGER NOT NULL,\\n \\"failure_count\\" INTEGER NOT NULL,\\n \\"running_count\\" INTEGER NOT NULL,\\n \\"max_concurrent\\" INTEGER NOT NULL,\\n \\"queue\\" TEXT NOT NULL,\\n \\"priority\\" INTEGER NOT NULL,\\n \\"timeout\\" INTEGER NOT NULL\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"cron":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"enabled":{"type":"BOOLEAN","notNull":true,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"next_run":{"type":"TIMESTAMP","notNull":false,"unique":false},"last_run":{"type":"TIMESTAMP","notNull":false,"unique":false},"last_status":{"type":"TEXT","notNull":false,"unique":false},"last_error":{"type":"TEXT","notNull":false,"unique":false},"run_count":{"type":"INTEGER","notNull":true,"unique":false},"success_count":{"type":"INTEGER","notNull":true,"unique":false},"failure_count":{"type":"INTEGER","notNull":true,"unique":false},"running_count":{"type":"INTEGER","notNull":true,"unique":false},"max_concurrent":{"type":"INTEGER","notNull":true,"unique":false},"queue":{"type":"TEXT","notNull":true,"unique":false},"priority":{"type":"INTEGER","notNull":true,"unique":false},"timeout":{"type":"INTEGER","notNull":true,"unique":false}},"indexes":[{"name":"_smrt_report_schedules_report_class_scope_key_idx","columns":["report_class","scope_key","cron","mode"],"unique":true},{"name":"_smrt_report_schedules_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_schedules_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"4b9f0e69"},"importPath":"@happyvertical/smrt-reports/state"},"@happyvertical/smrt-reports:SmrtReportScheduleCollection":{"name":"smrtreportschedulecollection","className":"SmrtReportScheduleCollection","qualifiedName":"@happyvertical/smrt-reports:SmrtReportScheduleCollection","collection":"smrtreportschedules","filePath":"/home/runner/work/smrt/smrt/packages/reports/src/state.ts","packageName":"@happyvertical/smrt-reports","fields":{},"methods":{},"decoratorConfig":{"tableName":"_smrt_report_schedules","api":false,"mcp":false,"cli":{"include":["list","get"],"skipApiCheck":true}},"extends":"SmrtCollection","extendsTypeArg":"SmrtReportSchedule","exportName":"SmrtReportScheduleCollection","collectionExportName":"SmrtReportScheduleCollectionCollection","schema":{"tableName":"_smrt_report_schedules","ddl":"CREATE TABLE IF NOT EXISTS \\"_smrt_report_schedules\\" (\\n \\"id\\" UUID PRIMARY KEY NOT NULL,\\n \\"slug\\" TEXT NOT NULL,\\n \\"context\\" TEXT NOT NULL DEFAULT '',\\n \\"created_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"updated_at\\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\\n \\"tenant_id\\" UUID,\\n \\"scope_key\\" TEXT NOT NULL,\\n \\"report_class\\" TEXT NOT NULL,\\n \\"cron\\" TEXT NOT NULL,\\n \\"trigger\\" TEXT NOT NULL,\\n \\"mode\\" TEXT NOT NULL,\\n \\"enabled\\" BOOLEAN NOT NULL,\\n \\"status\\" TEXT NOT NULL,\\n \\"next_run\\" TIMESTAMP,\\n \\"last_run\\" TIMESTAMP,\\n \\"last_status\\" TEXT,\\n \\"last_error\\" TEXT,\\n \\"run_count\\" INTEGER NOT NULL,\\n \\"success_count\\" INTEGER NOT NULL,\\n \\"failure_count\\" INTEGER NOT NULL,\\n \\"running_count\\" INTEGER NOT NULL,\\n \\"max_concurrent\\" INTEGER NOT NULL,\\n \\"queue\\" TEXT NOT NULL,\\n \\"priority\\" INTEGER NOT NULL,\\n \\"timeout\\" INTEGER NOT NULL\\n);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":false,"unique":false},"scope_key":{"type":"TEXT","notNull":true,"unique":false},"report_class":{"type":"TEXT","notNull":true,"unique":false},"cron":{"type":"TEXT","notNull":true,"unique":false},"trigger":{"type":"TEXT","notNull":true,"unique":false},"mode":{"type":"TEXT","notNull":true,"unique":false},"enabled":{"type":"BOOLEAN","notNull":true,"unique":false},"status":{"type":"TEXT","notNull":true,"unique":false},"next_run":{"type":"TIMESTAMP","notNull":false,"unique":false},"last_run":{"type":"TIMESTAMP","notNull":false,"unique":false},"last_status":{"type":"TEXT","notNull":false,"unique":false},"last_error":{"type":"TEXT","notNull":false,"unique":false},"run_count":{"type":"INTEGER","notNull":true,"unique":false},"success_count":{"type":"INTEGER","notNull":true,"unique":false},"failure_count":{"type":"INTEGER","notNull":true,"unique":false},"running_count":{"type":"INTEGER","notNull":true,"unique":false},"max_concurrent":{"type":"INTEGER","notNull":true,"unique":false},"queue":{"type":"TEXT","notNull":true,"unique":false},"priority":{"type":"INTEGER","notNull":true,"unique":false},"timeout":{"type":"INTEGER","notNull":true,"unique":false}},"indexes":[{"name":"_smrt_report_schedules_report_class_scope_key_idx","columns":["report_class","scope_key","cron","mode"],"unique":true},{"name":"_smrt_report_schedules_slug_context_idx","columns":["slug","context"]},{"name":"_smrt_report_schedules_tenant_id_created_at_idx","columns":["tenant_id","created_at"]}],"version":"4b9f0e69"},"importPath":"@happyvertical/smrt-reports/state"}},"moduleType":"smrt","recipes":[{"id":"reports.materialized","className":"MaterializedReportsRecipe","label":"Scheduled reports","summary":"Keep totals and trends ready to read, refreshed on a schedule and open to the assistant.","synonyms":["rollups","kpis","refresh schedule","materialized"],"models":["@happyvertical/smrt-reports:SmrtReportRun","@happyvertical/smrt-reports:SmrtReportWatermark","@happyvertical/smrt-reports:SmrtReportLock","@happyvertical/smrt-reports:SmrtReportSchedule","@happyvertical/smrt-reports:SmrtReportRefreshTask","@happyvertical/smrt-reports:SmrtPrincipalReportRefreshTask"],"nav":[],"requires":[],"help":{"markdown":"## Overview\\n\\nReports keep totals and trends, such as revenue by month or signups by week,\\nworked out ahead of time so they open instantly. Someone on your team sets up\\neach report once. This feature then records when each report was last\\nrefreshed, how that went, and when it runs next.\\n\\nReports are calculated on your server, never in the browser, so this feature\\nneeds your app's database.\\n\\n## Tasks\\n\\n### Ask the assistant about a report\\n\\n1. Ask in plain words, for example \\"what was revenue last month?\\".\\n2. The assistant looks up the reports your account may see\\n (\`data.discover\`, \`data.inspect\`), then reads rows with \`reports.query\`.\\n It only ever sees the columns and the customer data you are allowed to see.\\n3. If the numbers look old, ask how fresh the report is. The answer says when\\n it was last refreshed.\\n4. Ask the assistant to refresh a stale report. It previews the refresh with\\n \`reports.refresh\` and your app decides who may apply it.\\n\\nThe assistant offers these tools only when your app has switched them on.\\n\\n### Ask a question no report covers\\n\\n1. Describe what you want to see, for example \\"orders by status this quarter\\".\\n2. The assistant checks what it may report on (\`reports.runtime.sources\`) and\\n shows a preview of the report it would save (\`reports.runtime.define\`).\\n3. Nothing is saved until you confirm that exact report.\\n4. Open it again later with \`reports.runtime.list\` and \`reports.runtime.run\`.\\n\\nThese reports are worked out live each time and their rows are never stored.\\nThey are not refreshed in the background. A report that people open every day\\nis worth asking your team to set up as a refreshed report instead.\\n\\n### Keep a report fresh\\n\\n1. Ask your team how the report refreshes: by hand, on a schedule, after the\\n data changes, or when it goes out of date.\\n2. A scheduled report repeats on its **{field:SmrtReportSchedule.cron}**, either\\n rebuilding everything or updating only what changed, per its\\n **{field:SmrtReportSchedule.mode}**.\\n3. Turn **{field:SmrtReportSchedule.enabled}** off to pause a schedule without\\n losing it.\\n4. **{field:SmrtReportSchedule.nextRun}** shows when it is next due.\\n\\n### Check that a refresh worked\\n\\n1. Look at the latest run for the report. **{field:SmrtReportRun.status}**\\n says whether it is running, finished, failed or skipped.\\n2. **{field:SmrtReportRun.completedAt}** and **{field:SmrtReportRun.rowCount}**\\n show when it finished and how many rows it holds.\\n3. If it failed, **{field:SmrtReportRun.error}** says why.\\n","fieldRefs":["SmrtReportRun.completedAt","SmrtReportRun.error","SmrtReportRun.rowCount","SmrtReportRun.status","SmrtReportSchedule.cron","SmrtReportSchedule.enabled","SmrtReportSchedule.mode","SmrtReportSchedule.nextRun"]},"runtime":"server","demo":{"mode":"server","reasons":["The recipe declares runtime \\"server\\".","Needs a server because its package does not build for a browser: node:crypto/events; @happyvertical/sql root: the sync query builders it needs (validateColumnName, buildWhere, buildAggregate, bucketExpr, tableExists) have no browser-safe SDK entry; and its package depends on @happyvertical/smrt-jobs, @happyvertical/smrt-tenancy, which do not build for a browser (#3615, #3624, #3625, #3627)."]}},{"id":"reports.runtime","className":"RuntimeReportsRecipe","label":"Reports","summary":"Ask for a report, approve it, and share its live totals with your team.","synonyms":["report","summary","summaries","totals","trends","dashboards"],"models":["@happyvertical/smrt-reports:RuntimeReport"],"nav":[{"label":"Shared reports","model":"@happyvertical/smrt-reports:RuntimeReport","icon":"fileText"}],"requires":[],"help":{"markdown":"# Reports\\n\\nAsk the assistant for a total, comparison, or trend. Review the proposed report\\nand approve it to save it. Your saved reports are shared with your team; each\\nperson sees results using their own access to the underlying information.\\n\\nReports run fresh when opened. You can archive a report to hide it from the\\nactive list and restore it later. Creating and restoring reports needs report\\nwriting access. Reports need a connected server and are unavailable in offline\\npreviews. Scheduling, renaming, and exporting reports are not available yet.\\n","fieldRefs":[]},"surfaces":[{"kind":"route","path":"/reports","export":"@happyvertical/smrt-reports/svelte#RuntimeReportsRoute","label":"Reports"},{"kind":"route","path":"/reports/:id","export":"@happyvertical/smrt-reports/svelte#RuntimeReportDetailRoute","label":"Report detail"},{"kind":"widget","type":"runtime-report-chart","export":"@happyvertical/smrt-reports/svelte#RuntimeReportChartWidget","label":"Report chart","description":"Chart a measure from a saved report.","icon":"chart","optionsEditor":"@happyvertical/smrt-reports/svelte#RuntimeReportWidgetOptions","options":[{"key":"reportId","type":"text","label":"Report","required":true},{"key":"measure","type":"identifier","label":"Measure","required":true},{"key":"dimension","type":"identifier","label":"Dimension"}],"data":{"load":"@happyvertical/smrt-reports#loadRuntimeReportChart","models":["@happyvertical/smrt-reports:RuntimeReport"]},"defaultSpan":2,"maxSpan":4}],"runtime":"server","demo":{"mode":"server","reasons":["The recipe declares runtime \\"server\\".","Needs a server because its package does not build for a browser: node:crypto/events; @happyvertical/sql root: the sync query builders it needs (validateColumnName, buildWhere, buildAggregate, bucketExpr, tableExists) have no browser-safe SDK entry; and its package depends on @happyvertical/smrt-jobs, @happyvertical/smrt-tenancy, which do not build for a browser (#3615, #3624, #3625, #3627)."]}}],"smrtDependencies":["@happyvertical/smrt-core","@happyvertical/smrt-jobs","@happyvertical/smrt-tenancy"],"browser":{"status":"server-only","issues":["#3615","#3624","#3625","#3627"],"reason":"node:crypto/events; @happyvertical/sql root: the sync query builders it needs (validateColumnName, buildWhere, buildAggregate, bucketExpr, tableExists) have no browser-safe SDK entry","via":["@happyvertical/smrt-jobs","@happyvertical/smrt-tenancy"]},"stampsConstructors":true}`));
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/state.ts
|
|
7
7
|
var __defProp = Object.defineProperty;
|