@happyvertical/smrt-reports 0.36.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,108 @@
1
+ import { DatabaseInterface } from '@happyvertical/sql';
2
+ import { SmrtCollection } from '@happyvertical/smrt-core';
3
+ import { SmrtObject } from '@happyvertical/smrt-core';
4
+
5
+ export declare function assertReportTablesReady(db: DatabaseInterface, tables?: readonly string[]): Promise<void>;
6
+
7
+ export declare const REPORT_LOCKS_TABLE = "_smrt_report_locks";
8
+
9
+ export declare const REPORT_REFRESH_TASKS_TABLE = "_smrt_report_refresh_tasks";
10
+
11
+ export declare const REPORT_RUNS_TABLE = "_smrt_report_runs";
12
+
13
+ export declare const REPORT_RUNTIME_TABLES: readonly ["_smrt_report_runs", "_smrt_report_watermarks", "_smrt_report_locks"];
14
+
15
+ export declare const REPORT_SCHEDULER_TABLES: readonly ["_smrt_report_schedules", "_smrt_report_refresh_tasks"];
16
+
17
+ export declare const REPORT_SCHEDULES_TABLE = "_smrt_report_schedules";
18
+
19
+ export declare const REPORT_WATERMARKS_TABLE = "_smrt_report_watermarks";
20
+
21
+ declare type ReportRefreshMode = 'rebuild' | 'incremental';
22
+
23
+ declare type ReportRefreshTrigger = 'manual' | 'schedule' | 'change' | 'ttl' | 'job';
24
+
25
+ export declare type ReportRunStatus = 'running' | 'success' | 'failed' | 'skipped';
26
+
27
+ export declare type ReportScheduleStatus = 'active' | 'paused' | 'disabled' | 'error';
28
+
29
+ export declare function scopeKeyForTenant(tenantId: string | null | undefined): string;
30
+
31
+ export declare class SmrtReportLock extends SmrtObject {
32
+ tenantId: string | null;
33
+ scopeKey: string;
34
+ reportClass: string;
35
+ ownerId: string | null;
36
+ acquiredAt: Date | null;
37
+ heartbeatAt: Date | null;
38
+ expiresAt: Date | null;
39
+ }
40
+
41
+ export declare class SmrtReportLockCollection extends SmrtCollection<SmrtReportLock> {
42
+ static readonly _itemClass: typeof SmrtReportLock;
43
+ }
44
+
45
+ export declare class SmrtReportRun extends SmrtObject {
46
+ tenantId: string | null;
47
+ scopeKey: string;
48
+ reportClass: string;
49
+ sourceClass: string;
50
+ mode: ReportRefreshMode;
51
+ trigger: ReportRefreshTrigger;
52
+ status: ReportRunStatus;
53
+ startedAt: Date;
54
+ completedAt: Date | null;
55
+ rowCount: number;
56
+ changedGroupCount: number;
57
+ watermarkBefore: string | null;
58
+ watermarkAfter: string | null;
59
+ error: string | null;
60
+ metadata: Record<string, unknown>;
61
+ }
62
+
63
+ export declare class SmrtReportRunCollection extends SmrtCollection<SmrtReportRun> {
64
+ static readonly _itemClass: typeof SmrtReportRun;
65
+ }
66
+
67
+ export declare class SmrtReportSchedule extends SmrtObject {
68
+ tenantId: string | null;
69
+ scopeKey: string;
70
+ reportClass: string;
71
+ cron: string;
72
+ trigger: ReportRefreshTrigger;
73
+ mode: ReportRefreshMode;
74
+ enabled: boolean;
75
+ status: ReportScheduleStatus;
76
+ nextRun: Date | null;
77
+ lastRun: Date | null;
78
+ lastStatus: 'success' | 'failed' | null;
79
+ lastError: string | null;
80
+ runCount: number;
81
+ successCount: number;
82
+ failureCount: number;
83
+ runningCount: number;
84
+ maxConcurrent: number;
85
+ queue: string;
86
+ priority: number;
87
+ timeout: number;
88
+ }
89
+
90
+ export declare class SmrtReportScheduleCollection extends SmrtCollection<SmrtReportSchedule> {
91
+ static readonly _itemClass: typeof SmrtReportSchedule;
92
+ }
93
+
94
+ export declare class SmrtReportWatermark extends SmrtObject {
95
+ tenantId: string | null;
96
+ scopeKey: string;
97
+ reportClass: string;
98
+ sourceClass: string;
99
+ watermarkColumn: string;
100
+ watermarkValue: string | null;
101
+ lastRunId: string | null;
102
+ }
103
+
104
+ export declare class SmrtReportWatermarkCollection extends SmrtCollection<SmrtReportWatermark> {
105
+ static readonly _itemClass: typeof SmrtReportWatermark;
106
+ }
107
+
108
+ export { }
package/dist/state.js ADDED
@@ -0,0 +1,320 @@
1
+ import { field, smrt, SmrtObject, SmrtCollection } from "@happyvertical/smrt-core";
2
+ import { tenantId, TenantScoped } from "@happyvertical/smrt-tenancy";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __decorateClass = (decorators, target, key, kind) => {
6
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
7
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
8
+ if (decorator = decorators[i])
9
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
10
+ if (kind && result) __defProp(target, key, result);
11
+ return result;
12
+ };
13
+ const REPORT_RUNS_TABLE = "_smrt_report_runs";
14
+ const REPORT_WATERMARKS_TABLE = "_smrt_report_watermarks";
15
+ const REPORT_LOCKS_TABLE = "_smrt_report_locks";
16
+ const REPORT_SCHEDULES_TABLE = "_smrt_report_schedules";
17
+ const REPORT_REFRESH_TASKS_TABLE = "_smrt_report_refresh_tasks";
18
+ const REPORT_RUNTIME_TABLES = [
19
+ REPORT_RUNS_TABLE,
20
+ REPORT_WATERMARKS_TABLE,
21
+ REPORT_LOCKS_TABLE
22
+ ];
23
+ const REPORT_SCHEDULER_TABLES = [
24
+ REPORT_SCHEDULES_TABLE,
25
+ REPORT_REFRESH_TASKS_TABLE
26
+ ];
27
+ function scopeKeyForTenant(tenantId2) {
28
+ return tenantId2 ? `tenant:${tenantId2}` : "global";
29
+ }
30
+ async function assertReportTablesReady(db, tables = REPORT_RUNTIME_TABLES) {
31
+ for (const table of tables) {
32
+ const ready = await db.tableExists(table);
33
+ if (!ready) {
34
+ throw new Error(
35
+ `Report runtime table '${table}' does not exist. Run smrt db:migrate before refreshing reports.`
36
+ );
37
+ }
38
+ }
39
+ }
40
+ const INTERNAL_SURFACE = {
41
+ api: false,
42
+ cli: {
43
+ include: ["list", "get"],
44
+ skipApiCheck: true,
45
+ http: false
46
+ },
47
+ mcp: false
48
+ };
49
+ let SmrtReportRun = class extends SmrtObject {
50
+ tenantId = null;
51
+ scopeKey = "global";
52
+ reportClass = "";
53
+ sourceClass = "";
54
+ mode = "rebuild";
55
+ trigger = "manual";
56
+ status = "running";
57
+ startedAt = /* @__PURE__ */ new Date();
58
+ completedAt = null;
59
+ rowCount = 0;
60
+ changedGroupCount = 0;
61
+ watermarkBefore = null;
62
+ watermarkAfter = null;
63
+ error = null;
64
+ metadata = {};
65
+ };
66
+ __decorateClass([
67
+ tenantId({ nullable: true })
68
+ ], SmrtReportRun.prototype, "tenantId", 2);
69
+ __decorateClass([
70
+ field({ type: "text", required: true })
71
+ ], SmrtReportRun.prototype, "scopeKey", 2);
72
+ __decorateClass([
73
+ field({ type: "text", required: true })
74
+ ], SmrtReportRun.prototype, "reportClass", 2);
75
+ __decorateClass([
76
+ field({ type: "text", required: true })
77
+ ], SmrtReportRun.prototype, "sourceClass", 2);
78
+ __decorateClass([
79
+ field({ type: "text", required: true })
80
+ ], SmrtReportRun.prototype, "mode", 2);
81
+ __decorateClass([
82
+ field({ type: "text", required: true })
83
+ ], SmrtReportRun.prototype, "trigger", 2);
84
+ __decorateClass([
85
+ field({ type: "text", required: true })
86
+ ], SmrtReportRun.prototype, "status", 2);
87
+ __decorateClass([
88
+ field({ type: "datetime", required: true })
89
+ ], SmrtReportRun.prototype, "startedAt", 2);
90
+ __decorateClass([
91
+ field({ type: "datetime", nullable: true })
92
+ ], SmrtReportRun.prototype, "completedAt", 2);
93
+ __decorateClass([
94
+ field({ type: "integer", required: true })
95
+ ], SmrtReportRun.prototype, "rowCount", 2);
96
+ __decorateClass([
97
+ field({ type: "integer", required: true })
98
+ ], SmrtReportRun.prototype, "changedGroupCount", 2);
99
+ __decorateClass([
100
+ field({ type: "text", nullable: true })
101
+ ], SmrtReportRun.prototype, "watermarkBefore", 2);
102
+ __decorateClass([
103
+ field({ type: "text", nullable: true })
104
+ ], SmrtReportRun.prototype, "watermarkAfter", 2);
105
+ __decorateClass([
106
+ field({ type: "text", nullable: true })
107
+ ], SmrtReportRun.prototype, "error", 2);
108
+ __decorateClass([
109
+ field({ type: "json" })
110
+ ], SmrtReportRun.prototype, "metadata", 2);
111
+ SmrtReportRun = __decorateClass([
112
+ TenantScoped({ mode: "optional" }),
113
+ smrt({
114
+ tableName: "_smrt_report_runs",
115
+ ...INTERNAL_SURFACE
116
+ })
117
+ ], SmrtReportRun);
118
+ class SmrtReportRunCollection extends SmrtCollection {
119
+ static _itemClass = SmrtReportRun;
120
+ }
121
+ let SmrtReportWatermark = class extends SmrtObject {
122
+ tenantId = null;
123
+ scopeKey = "global";
124
+ reportClass = "";
125
+ sourceClass = "";
126
+ watermarkColumn = "";
127
+ watermarkValue = null;
128
+ lastRunId = null;
129
+ };
130
+ __decorateClass([
131
+ tenantId({ nullable: true })
132
+ ], SmrtReportWatermark.prototype, "tenantId", 2);
133
+ __decorateClass([
134
+ field({ type: "text", required: true })
135
+ ], SmrtReportWatermark.prototype, "scopeKey", 2);
136
+ __decorateClass([
137
+ field({ type: "text", required: true })
138
+ ], SmrtReportWatermark.prototype, "reportClass", 2);
139
+ __decorateClass([
140
+ field({ type: "text", required: true })
141
+ ], SmrtReportWatermark.prototype, "sourceClass", 2);
142
+ __decorateClass([
143
+ field({ type: "text", required: true })
144
+ ], SmrtReportWatermark.prototype, "watermarkColumn", 2);
145
+ __decorateClass([
146
+ field({ type: "text", nullable: true })
147
+ ], SmrtReportWatermark.prototype, "watermarkValue", 2);
148
+ __decorateClass([
149
+ field({ type: "text", nullable: true })
150
+ ], SmrtReportWatermark.prototype, "lastRunId", 2);
151
+ SmrtReportWatermark = __decorateClass([
152
+ TenantScoped({ mode: "optional" }),
153
+ smrt({
154
+ tableName: "_smrt_report_watermarks",
155
+ conflictColumns: [
156
+ "report_class",
157
+ "scope_key",
158
+ "source_class",
159
+ "watermark_column"
160
+ ],
161
+ ...INTERNAL_SURFACE
162
+ })
163
+ ], SmrtReportWatermark);
164
+ class SmrtReportWatermarkCollection extends SmrtCollection {
165
+ static _itemClass = SmrtReportWatermark;
166
+ }
167
+ let SmrtReportLock = class extends SmrtObject {
168
+ tenantId = null;
169
+ scopeKey = "global";
170
+ reportClass = "";
171
+ ownerId = null;
172
+ acquiredAt = null;
173
+ heartbeatAt = null;
174
+ expiresAt = null;
175
+ };
176
+ __decorateClass([
177
+ tenantId({ nullable: true })
178
+ ], SmrtReportLock.prototype, "tenantId", 2);
179
+ __decorateClass([
180
+ field({ type: "text", required: true })
181
+ ], SmrtReportLock.prototype, "scopeKey", 2);
182
+ __decorateClass([
183
+ field({ type: "text", required: true })
184
+ ], SmrtReportLock.prototype, "reportClass", 2);
185
+ __decorateClass([
186
+ field({ type: "text", nullable: true })
187
+ ], SmrtReportLock.prototype, "ownerId", 2);
188
+ __decorateClass([
189
+ field({ type: "datetime", nullable: true })
190
+ ], SmrtReportLock.prototype, "acquiredAt", 2);
191
+ __decorateClass([
192
+ field({ type: "datetime", nullable: true })
193
+ ], SmrtReportLock.prototype, "heartbeatAt", 2);
194
+ __decorateClass([
195
+ field({ type: "datetime", nullable: true })
196
+ ], SmrtReportLock.prototype, "expiresAt", 2);
197
+ SmrtReportLock = __decorateClass([
198
+ TenantScoped({ mode: "optional" }),
199
+ smrt({
200
+ tableName: "_smrt_report_locks",
201
+ conflictColumns: ["report_class", "scope_key"],
202
+ ...INTERNAL_SURFACE
203
+ })
204
+ ], SmrtReportLock);
205
+ class SmrtReportLockCollection extends SmrtCollection {
206
+ static _itemClass = SmrtReportLock;
207
+ }
208
+ let SmrtReportSchedule = class extends SmrtObject {
209
+ tenantId = null;
210
+ scopeKey = "global";
211
+ reportClass = "";
212
+ cron = "";
213
+ trigger = "schedule";
214
+ mode = "incremental";
215
+ enabled = true;
216
+ status = "active";
217
+ nextRun = null;
218
+ lastRun = null;
219
+ lastStatus = null;
220
+ lastError = null;
221
+ runCount = 0;
222
+ successCount = 0;
223
+ failureCount = 0;
224
+ runningCount = 0;
225
+ maxConcurrent = 1;
226
+ queue = "reports";
227
+ priority = 70;
228
+ timeout = 36e5;
229
+ };
230
+ __decorateClass([
231
+ tenantId({ nullable: true })
232
+ ], SmrtReportSchedule.prototype, "tenantId", 2);
233
+ __decorateClass([
234
+ field({ type: "text", required: true })
235
+ ], SmrtReportSchedule.prototype, "scopeKey", 2);
236
+ __decorateClass([
237
+ field({ type: "text", required: true })
238
+ ], SmrtReportSchedule.prototype, "reportClass", 2);
239
+ __decorateClass([
240
+ field({ type: "text", required: true })
241
+ ], SmrtReportSchedule.prototype, "cron", 2);
242
+ __decorateClass([
243
+ field({ type: "text", required: true })
244
+ ], SmrtReportSchedule.prototype, "trigger", 2);
245
+ __decorateClass([
246
+ field({ type: "text", required: true })
247
+ ], SmrtReportSchedule.prototype, "mode", 2);
248
+ __decorateClass([
249
+ field({ type: "boolean", required: true })
250
+ ], SmrtReportSchedule.prototype, "enabled", 2);
251
+ __decorateClass([
252
+ field({ type: "text", required: true })
253
+ ], SmrtReportSchedule.prototype, "status", 2);
254
+ __decorateClass([
255
+ field({ type: "datetime", nullable: true })
256
+ ], SmrtReportSchedule.prototype, "nextRun", 2);
257
+ __decorateClass([
258
+ field({ type: "datetime", nullable: true })
259
+ ], SmrtReportSchedule.prototype, "lastRun", 2);
260
+ __decorateClass([
261
+ field({ type: "text", nullable: true })
262
+ ], SmrtReportSchedule.prototype, "lastStatus", 2);
263
+ __decorateClass([
264
+ field({ type: "text", nullable: true })
265
+ ], SmrtReportSchedule.prototype, "lastError", 2);
266
+ __decorateClass([
267
+ field({ type: "integer", required: true })
268
+ ], SmrtReportSchedule.prototype, "runCount", 2);
269
+ __decorateClass([
270
+ field({ type: "integer", required: true })
271
+ ], SmrtReportSchedule.prototype, "successCount", 2);
272
+ __decorateClass([
273
+ field({ type: "integer", required: true })
274
+ ], SmrtReportSchedule.prototype, "failureCount", 2);
275
+ __decorateClass([
276
+ field({ type: "integer", required: true })
277
+ ], SmrtReportSchedule.prototype, "runningCount", 2);
278
+ __decorateClass([
279
+ field({ type: "integer", required: true })
280
+ ], SmrtReportSchedule.prototype, "maxConcurrent", 2);
281
+ __decorateClass([
282
+ field({ type: "text", required: true })
283
+ ], SmrtReportSchedule.prototype, "queue", 2);
284
+ __decorateClass([
285
+ field({ type: "integer", required: true })
286
+ ], SmrtReportSchedule.prototype, "priority", 2);
287
+ __decorateClass([
288
+ field({ type: "integer", required: true })
289
+ ], SmrtReportSchedule.prototype, "timeout", 2);
290
+ SmrtReportSchedule = __decorateClass([
291
+ TenantScoped({ mode: "optional" }),
292
+ smrt({
293
+ tableName: "_smrt_report_schedules",
294
+ conflictColumns: ["report_class", "scope_key", "cron", "mode"],
295
+ ...INTERNAL_SURFACE
296
+ })
297
+ ], SmrtReportSchedule);
298
+ class SmrtReportScheduleCollection extends SmrtCollection {
299
+ static _itemClass = SmrtReportSchedule;
300
+ }
301
+ export {
302
+ REPORT_LOCKS_TABLE,
303
+ REPORT_REFRESH_TASKS_TABLE,
304
+ REPORT_RUNS_TABLE,
305
+ REPORT_RUNTIME_TABLES,
306
+ REPORT_SCHEDULER_TABLES,
307
+ REPORT_SCHEDULES_TABLE,
308
+ REPORT_WATERMARKS_TABLE,
309
+ SmrtReportLock,
310
+ SmrtReportLockCollection,
311
+ SmrtReportRun,
312
+ SmrtReportRunCollection,
313
+ SmrtReportSchedule,
314
+ SmrtReportScheduleCollection,
315
+ SmrtReportWatermark,
316
+ SmrtReportWatermarkCollection,
317
+ assertReportTablesReady,
318
+ scopeKeyForTenant
319
+ };
320
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sources":["../src/state.ts"],"sourcesContent":["import {\n field,\n SmrtCollection,\n SmrtObject,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { DatabaseInterface } from '@happyvertical/sql';\nimport type { ReportRefreshMode, ReportRefreshTrigger } from './types.js';\n\nexport const REPORT_RUNS_TABLE = '_smrt_report_runs';\nexport const REPORT_WATERMARKS_TABLE = '_smrt_report_watermarks';\nexport const REPORT_LOCKS_TABLE = '_smrt_report_locks';\nexport const REPORT_SCHEDULES_TABLE = '_smrt_report_schedules';\nexport const REPORT_REFRESH_TASKS_TABLE = '_smrt_report_refresh_tasks';\n\nexport const REPORT_RUNTIME_TABLES = [\n REPORT_RUNS_TABLE,\n REPORT_WATERMARKS_TABLE,\n REPORT_LOCKS_TABLE,\n] as const;\n\nexport const REPORT_SCHEDULER_TABLES = [\n REPORT_SCHEDULES_TABLE,\n REPORT_REFRESH_TASKS_TABLE,\n] as const;\n\nexport type ReportRunStatus = 'running' | 'success' | 'failed' | 'skipped';\nexport type ReportScheduleStatus = 'active' | 'paused' | 'disabled' | 'error';\n\nexport function scopeKeyForTenant(tenantId: string | null | undefined): string {\n return tenantId ? `tenant:${tenantId}` : 'global';\n}\n\nexport async function assertReportTablesReady(\n db: DatabaseInterface,\n tables: readonly string[] = REPORT_RUNTIME_TABLES,\n): Promise<void> {\n for (const table of tables) {\n const ready = await db.tableExists(table);\n if (!ready) {\n throw new Error(\n `Report runtime table '${table}' does not exist. ` +\n 'Run smrt db:migrate before refreshing reports.',\n );\n }\n }\n}\n\nconst INTERNAL_SURFACE = {\n api: false,\n cli: {\n include: ['list', 'get'],\n skipApiCheck: true,\n http: false,\n },\n mcp: false,\n};\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableName: '_smrt_report_runs',\n ...INTERNAL_SURFACE,\n})\nexport class SmrtReportRun extends SmrtObject {\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n @field({ type: 'text', required: true })\n scopeKey: string = 'global';\n\n @field({ type: 'text', required: true })\n reportClass: string = '';\n\n @field({ type: 'text', required: true })\n sourceClass: string = '';\n\n @field({ type: 'text', required: true })\n mode: ReportRefreshMode = 'rebuild';\n\n @field({ type: 'text', required: true })\n trigger: ReportRefreshTrigger = 'manual';\n\n @field({ type: 'text', required: true })\n status: ReportRunStatus = 'running';\n\n @field({ type: 'datetime', required: true })\n startedAt: Date = new Date();\n\n @field({ type: 'datetime', nullable: true })\n completedAt: Date | null = null;\n\n @field({ type: 'integer', required: true })\n rowCount: number = 0;\n\n @field({ type: 'integer', required: true })\n changedGroupCount: number = 0;\n\n @field({ type: 'text', nullable: true })\n watermarkBefore: string | null = null;\n\n @field({ type: 'text', nullable: true })\n watermarkAfter: string | null = null;\n\n @field({ type: 'text', nullable: true })\n error: string | null = null;\n\n @field({ type: 'json' })\n metadata: Record<string, unknown> = {};\n}\n\nexport class SmrtReportRunCollection extends SmrtCollection<SmrtReportRun> {\n static readonly _itemClass = SmrtReportRun;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableName: '_smrt_report_watermarks',\n conflictColumns: [\n 'report_class',\n 'scope_key',\n 'source_class',\n 'watermark_column',\n ],\n ...INTERNAL_SURFACE,\n})\nexport class SmrtReportWatermark extends SmrtObject {\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n @field({ type: 'text', required: true })\n scopeKey: string = 'global';\n\n @field({ type: 'text', required: true })\n reportClass: string = '';\n\n @field({ type: 'text', required: true })\n sourceClass: string = '';\n\n @field({ type: 'text', required: true })\n watermarkColumn: string = '';\n\n @field({ type: 'text', nullable: true })\n watermarkValue: string | null = null;\n\n @field({ type: 'text', nullable: true })\n lastRunId: string | null = null;\n}\n\nexport class SmrtReportWatermarkCollection extends SmrtCollection<SmrtReportWatermark> {\n static readonly _itemClass = SmrtReportWatermark;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableName: '_smrt_report_locks',\n conflictColumns: ['report_class', 'scope_key'],\n ...INTERNAL_SURFACE,\n})\nexport class SmrtReportLock extends SmrtObject {\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n @field({ type: 'text', required: true })\n scopeKey: string = 'global';\n\n @field({ type: 'text', required: true })\n reportClass: string = '';\n\n @field({ type: 'text', nullable: true })\n ownerId: string | null = null;\n\n @field({ type: 'datetime', nullable: true })\n acquiredAt: Date | null = null;\n\n @field({ type: 'datetime', nullable: true })\n heartbeatAt: Date | null = null;\n\n @field({ type: 'datetime', nullable: true })\n expiresAt: Date | null = null;\n}\n\nexport class SmrtReportLockCollection extends SmrtCollection<SmrtReportLock> {\n static readonly _itemClass = SmrtReportLock;\n}\n\n@TenantScoped({ mode: 'optional' })\n@smrt({\n tableName: '_smrt_report_schedules',\n conflictColumns: ['report_class', 'scope_key', 'cron', 'mode'],\n ...INTERNAL_SURFACE,\n})\nexport class SmrtReportSchedule extends SmrtObject {\n @tenantId({ nullable: true })\n tenantId: string | null = null;\n\n @field({ type: 'text', required: true })\n scopeKey: string = 'global';\n\n @field({ type: 'text', required: true })\n reportClass: string = '';\n\n @field({ type: 'text', required: true })\n cron: string = '';\n\n @field({ type: 'text', required: true })\n trigger: ReportRefreshTrigger = 'schedule';\n\n @field({ type: 'text', required: true })\n mode: ReportRefreshMode = 'incremental';\n\n @field({ type: 'boolean', required: true })\n enabled: boolean = true;\n\n @field({ type: 'text', required: true })\n status: ReportScheduleStatus = 'active';\n\n @field({ type: 'datetime', nullable: true })\n nextRun: Date | null = null;\n\n @field({ type: 'datetime', nullable: true })\n lastRun: Date | null = null;\n\n @field({ type: 'text', nullable: true })\n lastStatus: 'success' | 'failed' | null = null;\n\n @field({ type: 'text', nullable: true })\n lastError: string | null = null;\n\n @field({ type: 'integer', required: true })\n runCount: number = 0;\n\n @field({ type: 'integer', required: true })\n successCount: number = 0;\n\n @field({ type: 'integer', required: true })\n failureCount: number = 0;\n\n @field({ type: 'integer', required: true })\n runningCount: number = 0;\n\n @field({ type: 'integer', required: true })\n maxConcurrent: number = 1;\n\n @field({ type: 'text', required: true })\n queue: string = 'reports';\n\n @field({ type: 'integer', required: true })\n priority: number = 70;\n\n @field({ type: 'integer', required: true })\n timeout: number = 3600000;\n}\n\nexport class SmrtReportScheduleCollection extends SmrtCollection<SmrtReportSchedule> {\n static readonly _itemClass = SmrtReportSchedule;\n}\n"],"names":["tenantId"],"mappings":";;;;;;;;;;;;AAUO,MAAM,oBAAoB;AAC1B,MAAM,0BAA0B;AAChC,MAAM,qB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DX,WAAA,WAAA,CAAA;AA3DW,qBAAN,gBAAA;AAAA,EANN,aAAa,EAAE,MAAM,YAAY;AAAA,EACjC,KAAK;AAAA,IACJ,WAAW;AAAA,IACX,iBAAiB,CAAC,gBAAgB,aAAa,QAAQ,MAAM;AAAA,IAC7D,GAAG;AAAA,EAAA,CACJ;AAAA,GACY,kBAAA;AA8DN,MAAM,qCAAqC,eAAmC;AAAA,EACnF,OAAgB,aAAa;AAC/B;"}
@@ -0,0 +1,114 @@
1
+ import { AggregateBuildResult } from '@happyvertical/sql';
2
+ import { AggregateFunction } from '@happyvertical/sql';
3
+ import { AggregateSelectExpr } from '@happyvertical/sql';
4
+ import { AggregateSpec } from '@happyvertical/sql';
5
+ import { AggregateTimeBucketUnit } from '@happyvertical/sql';
6
+ import { DatabaseInterface } from '@happyvertical/sql';
7
+ import { SmrtObject } from '@happyvertical/smrt-core';
8
+ import { SqlAdapterType } from '@happyvertical/sql';
9
+ import { WhereClause } from '@happyvertical/sql';
10
+
11
+ export { AggregateBuildResult }
12
+
13
+ export { AggregateSelectExpr }
14
+
15
+ export { AggregateSpec }
16
+
17
+ export declare interface ReportAggregateFieldMetadata {
18
+ kind: 'aggregate';
19
+ fn: ReportAggregateFn;
20
+ column?: string;
21
+ distinct?: boolean;
22
+ }
23
+
24
+ export declare type ReportAggregateFn = AggregateFunction;
25
+
26
+ export declare interface ReportBucketFieldMetadata {
27
+ kind: 'bucket';
28
+ unit: ReportTimeBucketUnit;
29
+ sourceColumn: string;
30
+ }
31
+
32
+ export declare interface ReportDefinition {
33
+ reportClassName: string;
34
+ sourceClassName: string;
35
+ sourceTable: string;
36
+ fields: ReportFieldDefinition[];
37
+ where?: WhereClause;
38
+ having?: WhereClause;
39
+ refresh?: ReportRefreshConfig;
40
+ }
41
+
42
+ export declare interface ReportFieldDefinition {
43
+ fieldName: string;
44
+ columnName?: string;
45
+ type?: string;
46
+ report?: ReportFieldMetadata;
47
+ }
48
+
49
+ export declare type ReportFieldMetadata = ReportGroupFieldMetadata | ReportBucketFieldMetadata | ReportAggregateFieldMetadata;
50
+
51
+ export declare interface ReportGroupFieldMetadata {
52
+ kind: 'group';
53
+ sourceColumn?: string;
54
+ }
55
+
56
+ export declare interface ReportOptions {
57
+ source: ReportSource;
58
+ where?: WhereClause;
59
+ having?: WhereClause;
60
+ refresh?: ReportRefreshConfig;
61
+ }
62
+
63
+ export declare interface ReportRefreshConfig {
64
+ mode?: ReportRefreshMode;
65
+ schedule?: string;
66
+ onChange?: ReportSource[];
67
+ /**
68
+ * Milliseconds before collection reads trigger a synchronous refresh.
69
+ *
70
+ * TTL refresh checks add a read-time MAX(refreshedAt) query, and stale reads
71
+ * perform the refresh before returning list/get results.
72
+ */
73
+ ttl?: number;
74
+ manual?: boolean;
75
+ watermarkColumn?: string;
76
+ softDeleteColumn?: string;
77
+ fullRebuildSchedule?: string;
78
+ tenantFanout?: boolean;
79
+ }
80
+
81
+ export declare type ReportRefreshMode = 'rebuild' | 'incremental';
82
+
83
+ export declare interface ReportRefreshOptions {
84
+ db?: DatabaseInterface;
85
+ mode?: ReportRefreshMode;
86
+ adapterType?: SqlAdapterType;
87
+ trigger?: ReportRefreshTrigger;
88
+ tenantId?: string | null;
89
+ tenantIds?: string[];
90
+ lock?: boolean;
91
+ lockTtlMs?: number;
92
+ trackRuns?: boolean;
93
+ scheduleId?: string;
94
+ changedRows?: Record<string, unknown>[];
95
+ }
96
+
97
+ export declare interface ReportRefreshResult {
98
+ rowCount: number;
99
+ refreshedAt: Date;
100
+ mode: ReportRefreshMode;
101
+ tenantId?: string | null;
102
+ runId?: string;
103
+ changedGroupCount?: number;
104
+ skipped?: boolean;
105
+ tenantResults?: ReportRefreshResult[];
106
+ }
107
+
108
+ export declare type ReportRefreshTrigger = 'manual' | 'schedule' | 'change' | 'ttl' | 'job';
109
+
110
+ export declare type ReportSource = string | (new (...args: any[]) => SmrtObject) | (abstract new (...args: any[]) => SmrtObject);
111
+
112
+ export declare type ReportTimeBucketUnit = AggregateTimeBucketUnit;
113
+
114
+ export { }
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,87 @@
1
+ {
2
+ "name": "@happyvertical/smrt-reports",
3
+ "version": "0.36.5",
4
+ "description": "Materialized aggregate report models for SMRT",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "files": [
9
+ "dist",
10
+ "CLAUDE.md",
11
+ "AGENTS.md"
12
+ ],
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.js"
17
+ },
18
+ "./aggregate": {
19
+ "types": "./dist/aggregate.d.ts",
20
+ "import": "./dist/aggregate.js"
21
+ },
22
+ "./compiler": {
23
+ "types": "./dist/compiler.d.ts",
24
+ "import": "./dist/compiler.js"
25
+ },
26
+ "./decorators": {
27
+ "types": "./dist/decorators.d.ts",
28
+ "import": "./dist/decorators.js"
29
+ },
30
+ "./refresh": {
31
+ "types": "./dist/refresh.d.ts",
32
+ "import": "./dist/refresh.js"
33
+ },
34
+ "./scheduler": {
35
+ "types": "./dist/scheduler.d.ts",
36
+ "import": "./dist/scheduler.js"
37
+ },
38
+ "./state": {
39
+ "types": "./dist/state.d.ts",
40
+ "import": "./dist/state.js"
41
+ },
42
+ "./manifest": "./dist/manifest.json",
43
+ "./manifest.json": "./dist/manifest.json"
44
+ },
45
+ "dependencies": {
46
+ "@happyvertical/sql": "^0.74.10",
47
+ "@happyvertical/smrt-core": "0.36.5",
48
+ "@happyvertical/smrt-tenancy": "0.36.5",
49
+ "@happyvertical/smrt-jobs": "0.36.5"
50
+ },
51
+ "devDependencies": {
52
+ "@types/node": "25.0.9",
53
+ "typescript": "^5.9.3",
54
+ "vite": "^7.3.1",
55
+ "vitest": "^4.0.17",
56
+ "@happyvertical/smrt-vitest": "0.36.5"
57
+ },
58
+ "keywords": [
59
+ "ai",
60
+ "agents",
61
+ "reports",
62
+ "materialized-views",
63
+ "smrt"
64
+ ],
65
+ "author": "HappyVertical",
66
+ "license": "MIT",
67
+ "publishConfig": {
68
+ "registry": "https://registry.npmjs.org",
69
+ "access": "public"
70
+ },
71
+ "repository": {
72
+ "type": "git",
73
+ "url": "https://github.com/happyvertical/smrt.git",
74
+ "directory": "packages/reports"
75
+ },
76
+ "scripts": {
77
+ "build": "vite build --mode library",
78
+ "build:watch": "vite build --mode library --watch",
79
+ "clean": "rm -rf dist",
80
+ "dev": "vite dev",
81
+ "pretest": "[ -f ../cli/dist/index.js ] && node ../cli/dist/index.js test --manifest-only || true",
82
+ "test": "vitest run",
83
+ "test:watch": "vitest",
84
+ "typecheck": "tsc --noEmit -p tsconfig.json",
85
+ "verify:pack": "node ../../scripts/verify-package-types-exports.js ."
86
+ }
87
+ }