@happyvertical/smrt-reports 0.55.7 → 0.55.9
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/AGENTS.md +34 -0
- package/README.md +16 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +995 -4
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +443 -14
- package/dist/recipes.d.ts +28 -0
- package/dist/recipes.d.ts.map +1 -0
- package/dist/refresh.d.ts +3 -0
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +1 -1
- package/dist/refresh.js.map +1 -1
- package/dist/runtime-compiler.d.ts +142 -0
- package/dist/runtime-compiler.d.ts.map +1 -0
- package/dist/runtime-report.d.ts +105 -0
- package/dist/runtime-report.d.ts.map +1 -0
- package/dist/runtime-spec.d.ts +126 -0
- package/dist/runtime-spec.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +327 -19
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +26 -13
- package/dist/state.js.map +1 -1
- package/package.json +8 -7
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.55.
|
|
5
|
+
"packageVersion": "0.55.9",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-reports:SmrtReport": {
|
|
8
8
|
"name": "smrtreport",
|
|
@@ -119,6 +119,347 @@
|
|
|
119
119
|
"collectionExportName": "SmrtReportCollectionCollection",
|
|
120
120
|
"importPath": "@happyvertical/smrt-reports"
|
|
121
121
|
},
|
|
122
|
+
"@happyvertical/smrt-reports:RuntimeReport": {
|
|
123
|
+
"name": "runtimereport",
|
|
124
|
+
"className": "RuntimeReport",
|
|
125
|
+
"qualifiedName": "@happyvertical/smrt-reports:RuntimeReport",
|
|
126
|
+
"collection": "runtimereports",
|
|
127
|
+
"filePath": "/home/runner/work/smrt/smrt/packages/reports/src/runtime-report.ts",
|
|
128
|
+
"packageName": "@happyvertical/smrt-reports",
|
|
129
|
+
"fields": {
|
|
130
|
+
"tenantId": {
|
|
131
|
+
"type": "text",
|
|
132
|
+
"required": true,
|
|
133
|
+
"_meta": {
|
|
134
|
+
"sqlType": "UUID",
|
|
135
|
+
"__tenancy": {
|
|
136
|
+
"isTenantIdField": true,
|
|
137
|
+
"autoFilter": true,
|
|
138
|
+
"required": true,
|
|
139
|
+
"autoPopulate": true,
|
|
140
|
+
"nullable": false,
|
|
141
|
+
"mode": "required",
|
|
142
|
+
"field": "tenantId",
|
|
143
|
+
"allowSuperAdminBypass": false
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"title": {
|
|
148
|
+
"type": "text",
|
|
149
|
+
"required": false,
|
|
150
|
+
"_meta": {}
|
|
151
|
+
},
|
|
152
|
+
"description": {
|
|
153
|
+
"type": "text",
|
|
154
|
+
"required": false,
|
|
155
|
+
"_meta": {}
|
|
156
|
+
},
|
|
157
|
+
"sourceId": {
|
|
158
|
+
"type": "text",
|
|
159
|
+
"required": false,
|
|
160
|
+
"_meta": {}
|
|
161
|
+
},
|
|
162
|
+
"spec": {
|
|
163
|
+
"type": "text",
|
|
164
|
+
"required": true,
|
|
165
|
+
"_meta": {
|
|
166
|
+
"required": true
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"specHash": {
|
|
170
|
+
"type": "text",
|
|
171
|
+
"required": false,
|
|
172
|
+
"_meta": {}
|
|
173
|
+
},
|
|
174
|
+
"status": {
|
|
175
|
+
"type": "text",
|
|
176
|
+
"required": true,
|
|
177
|
+
"_meta": {
|
|
178
|
+
"required": true
|
|
179
|
+
},
|
|
180
|
+
"enum": [
|
|
181
|
+
"active",
|
|
182
|
+
"archived"
|
|
183
|
+
]
|
|
184
|
+
},
|
|
185
|
+
"createdByUserId": {
|
|
186
|
+
"type": "text",
|
|
187
|
+
"required": false,
|
|
188
|
+
"_meta": {}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"methods": {
|
|
192
|
+
"getSpec": {
|
|
193
|
+
"name": "getSpec",
|
|
194
|
+
"async": false,
|
|
195
|
+
"parameters": [],
|
|
196
|
+
"returnType": "RuntimeReportSpec",
|
|
197
|
+
"isStatic": false,
|
|
198
|
+
"isPublic": true
|
|
199
|
+
},
|
|
200
|
+
"setSpec": {
|
|
201
|
+
"name": "setSpec",
|
|
202
|
+
"async": false,
|
|
203
|
+
"parameters": [
|
|
204
|
+
{
|
|
205
|
+
"name": "spec",
|
|
206
|
+
"type": "RuntimeReportSpec",
|
|
207
|
+
"optional": false
|
|
208
|
+
}
|
|
209
|
+
],
|
|
210
|
+
"returnType": "void",
|
|
211
|
+
"isStatic": false,
|
|
212
|
+
"isPublic": true
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"decoratorConfig": {
|
|
216
|
+
"tableName": "runtime_reports",
|
|
217
|
+
"api": {
|
|
218
|
+
"include": [
|
|
219
|
+
"list",
|
|
220
|
+
"get",
|
|
221
|
+
"create"
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
"mcp": {
|
|
225
|
+
"include": [
|
|
226
|
+
"list",
|
|
227
|
+
"get"
|
|
228
|
+
]
|
|
229
|
+
},
|
|
230
|
+
"cli": {
|
|
231
|
+
"include": [
|
|
232
|
+
"list",
|
|
233
|
+
"get"
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
"tenantScoped": {
|
|
237
|
+
"mode": "required"
|
|
238
|
+
},
|
|
239
|
+
"conflictColumns": [
|
|
240
|
+
"tenant_id",
|
|
241
|
+
"slug",
|
|
242
|
+
"context"
|
|
243
|
+
]
|
|
244
|
+
},
|
|
245
|
+
"extends": "SmrtObject",
|
|
246
|
+
"exportName": "RuntimeReport",
|
|
247
|
+
"collectionExportName": "RuntimeReportCollection",
|
|
248
|
+
"displayLabelField": "title",
|
|
249
|
+
"validationRules": [
|
|
250
|
+
{
|
|
251
|
+
"field": "spec",
|
|
252
|
+
"rule": "required",
|
|
253
|
+
"fieldType": "text"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"field": "status",
|
|
257
|
+
"rule": "required",
|
|
258
|
+
"fieldType": "text"
|
|
259
|
+
}
|
|
260
|
+
],
|
|
261
|
+
"schema": {
|
|
262
|
+
"tableName": "runtime_reports",
|
|
263
|
+
"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);",
|
|
264
|
+
"columns": {
|
|
265
|
+
"id": {
|
|
266
|
+
"type": "UUID",
|
|
267
|
+
"primaryKey": true,
|
|
268
|
+
"referenceKind": "id",
|
|
269
|
+
"notNull": true
|
|
270
|
+
},
|
|
271
|
+
"slug": {
|
|
272
|
+
"type": "TEXT",
|
|
273
|
+
"notNull": true
|
|
274
|
+
},
|
|
275
|
+
"context": {
|
|
276
|
+
"type": "TEXT",
|
|
277
|
+
"notNull": true,
|
|
278
|
+
"default": ""
|
|
279
|
+
},
|
|
280
|
+
"created_at": {
|
|
281
|
+
"type": "TIMESTAMP",
|
|
282
|
+
"notNull": true,
|
|
283
|
+
"default": "current_timestamp"
|
|
284
|
+
},
|
|
285
|
+
"updated_at": {
|
|
286
|
+
"type": "TIMESTAMP",
|
|
287
|
+
"notNull": true,
|
|
288
|
+
"default": "current_timestamp"
|
|
289
|
+
},
|
|
290
|
+
"tenant_id": {
|
|
291
|
+
"type": "UUID",
|
|
292
|
+
"referenceKind": "tenantId",
|
|
293
|
+
"notNull": true,
|
|
294
|
+
"unique": false
|
|
295
|
+
},
|
|
296
|
+
"title": {
|
|
297
|
+
"type": "TEXT",
|
|
298
|
+
"notNull": false,
|
|
299
|
+
"unique": false
|
|
300
|
+
},
|
|
301
|
+
"description": {
|
|
302
|
+
"type": "TEXT",
|
|
303
|
+
"notNull": false,
|
|
304
|
+
"unique": false
|
|
305
|
+
},
|
|
306
|
+
"source_id": {
|
|
307
|
+
"type": "TEXT",
|
|
308
|
+
"notNull": false,
|
|
309
|
+
"unique": false
|
|
310
|
+
},
|
|
311
|
+
"spec": {
|
|
312
|
+
"type": "TEXT",
|
|
313
|
+
"notNull": true,
|
|
314
|
+
"unique": false
|
|
315
|
+
},
|
|
316
|
+
"spec_hash": {
|
|
317
|
+
"type": "TEXT",
|
|
318
|
+
"notNull": false,
|
|
319
|
+
"unique": false
|
|
320
|
+
},
|
|
321
|
+
"status": {
|
|
322
|
+
"type": "TEXT",
|
|
323
|
+
"notNull": true,
|
|
324
|
+
"unique": false
|
|
325
|
+
},
|
|
326
|
+
"created_by_user_id": {
|
|
327
|
+
"type": "TEXT",
|
|
328
|
+
"notNull": false,
|
|
329
|
+
"unique": false
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
"indexes": [
|
|
333
|
+
{
|
|
334
|
+
"name": "runtime_reports_slug_context_idx",
|
|
335
|
+
"columns": [
|
|
336
|
+
"tenant_id",
|
|
337
|
+
"slug",
|
|
338
|
+
"context"
|
|
339
|
+
],
|
|
340
|
+
"unique": true
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"name": "runtime_reports_tenant_id_created_at_idx",
|
|
344
|
+
"columns": [
|
|
345
|
+
"tenant_id",
|
|
346
|
+
"created_at"
|
|
347
|
+
]
|
|
348
|
+
}
|
|
349
|
+
],
|
|
350
|
+
"version": "04a92513"
|
|
351
|
+
},
|
|
352
|
+
"importPath": "@happyvertical/smrt-reports"
|
|
353
|
+
},
|
|
354
|
+
"@happyvertical/smrt-reports:RuntimeReportCollection": {
|
|
355
|
+
"name": "runtimereportcollection",
|
|
356
|
+
"className": "RuntimeReportCollection",
|
|
357
|
+
"qualifiedName": "@happyvertical/smrt-reports:RuntimeReportCollection",
|
|
358
|
+
"collection": "runtimereports",
|
|
359
|
+
"filePath": "/home/runner/work/smrt/smrt/packages/reports/src/runtime-report.ts",
|
|
360
|
+
"packageName": "@happyvertical/smrt-reports",
|
|
361
|
+
"fields": {},
|
|
362
|
+
"methods": {},
|
|
363
|
+
"decoratorConfig": {
|
|
364
|
+
"tableName": "runtime_reports"
|
|
365
|
+
},
|
|
366
|
+
"extends": "SmrtCollection",
|
|
367
|
+
"extendsTypeArg": "RuntimeReport",
|
|
368
|
+
"exportName": "RuntimeReportCollection",
|
|
369
|
+
"collectionExportName": "RuntimeReportCollectionCollection",
|
|
370
|
+
"schema": {
|
|
371
|
+
"tableName": "runtime_reports",
|
|
372
|
+
"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);",
|
|
373
|
+
"columns": {
|
|
374
|
+
"id": {
|
|
375
|
+
"type": "UUID",
|
|
376
|
+
"primaryKey": true,
|
|
377
|
+
"referenceKind": "id",
|
|
378
|
+
"notNull": true
|
|
379
|
+
},
|
|
380
|
+
"slug": {
|
|
381
|
+
"type": "TEXT",
|
|
382
|
+
"notNull": true
|
|
383
|
+
},
|
|
384
|
+
"context": {
|
|
385
|
+
"type": "TEXT",
|
|
386
|
+
"notNull": true,
|
|
387
|
+
"default": ""
|
|
388
|
+
},
|
|
389
|
+
"created_at": {
|
|
390
|
+
"type": "TIMESTAMP",
|
|
391
|
+
"notNull": true,
|
|
392
|
+
"default": "current_timestamp"
|
|
393
|
+
},
|
|
394
|
+
"updated_at": {
|
|
395
|
+
"type": "TIMESTAMP",
|
|
396
|
+
"notNull": true,
|
|
397
|
+
"default": "current_timestamp"
|
|
398
|
+
},
|
|
399
|
+
"tenant_id": {
|
|
400
|
+
"type": "UUID",
|
|
401
|
+
"referenceKind": "tenantId",
|
|
402
|
+
"notNull": true,
|
|
403
|
+
"unique": false
|
|
404
|
+
},
|
|
405
|
+
"title": {
|
|
406
|
+
"type": "TEXT",
|
|
407
|
+
"notNull": false,
|
|
408
|
+
"unique": false
|
|
409
|
+
},
|
|
410
|
+
"description": {
|
|
411
|
+
"type": "TEXT",
|
|
412
|
+
"notNull": false,
|
|
413
|
+
"unique": false
|
|
414
|
+
},
|
|
415
|
+
"source_id": {
|
|
416
|
+
"type": "TEXT",
|
|
417
|
+
"notNull": false,
|
|
418
|
+
"unique": false
|
|
419
|
+
},
|
|
420
|
+
"spec": {
|
|
421
|
+
"type": "TEXT",
|
|
422
|
+
"notNull": true,
|
|
423
|
+
"unique": false
|
|
424
|
+
},
|
|
425
|
+
"spec_hash": {
|
|
426
|
+
"type": "TEXT",
|
|
427
|
+
"notNull": false,
|
|
428
|
+
"unique": false
|
|
429
|
+
},
|
|
430
|
+
"status": {
|
|
431
|
+
"type": "TEXT",
|
|
432
|
+
"notNull": true,
|
|
433
|
+
"unique": false
|
|
434
|
+
},
|
|
435
|
+
"created_by_user_id": {
|
|
436
|
+
"type": "TEXT",
|
|
437
|
+
"notNull": false,
|
|
438
|
+
"unique": false
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
"indexes": [
|
|
442
|
+
{
|
|
443
|
+
"name": "runtime_reports_slug_context_idx",
|
|
444
|
+
"columns": [
|
|
445
|
+
"tenant_id",
|
|
446
|
+
"slug",
|
|
447
|
+
"context"
|
|
448
|
+
],
|
|
449
|
+
"unique": true
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"name": "runtime_reports_tenant_id_created_at_idx",
|
|
453
|
+
"columns": [
|
|
454
|
+
"tenant_id",
|
|
455
|
+
"created_at"
|
|
456
|
+
]
|
|
457
|
+
}
|
|
458
|
+
],
|
|
459
|
+
"version": "04a92513"
|
|
460
|
+
},
|
|
461
|
+
"importPath": "@happyvertical/smrt-reports"
|
|
462
|
+
},
|
|
122
463
|
"@happyvertical/smrt-reports:SmrtReportRefreshTask": {
|
|
123
464
|
"name": "smrtreportrefreshtask",
|
|
124
465
|
"className": "SmrtReportRefreshTask",
|
|
@@ -530,8 +871,10 @@
|
|
|
530
871
|
"status": {
|
|
531
872
|
"type": "text",
|
|
532
873
|
"required": true,
|
|
874
|
+
"description": "Whether the refresh is running, finished, failed or was skipped.",
|
|
533
875
|
"_meta": {
|
|
534
|
-
"required": true
|
|
876
|
+
"required": true,
|
|
877
|
+
"description": "Whether the refresh is running, finished, failed or was skipped."
|
|
535
878
|
},
|
|
536
879
|
"enum": [
|
|
537
880
|
"running",
|
|
@@ -543,22 +886,28 @@
|
|
|
543
886
|
"startedAt": {
|
|
544
887
|
"type": "datetime",
|
|
545
888
|
"required": true,
|
|
889
|
+
"description": "When the refresh began.",
|
|
546
890
|
"_meta": {
|
|
547
|
-
"required": true
|
|
891
|
+
"required": true,
|
|
892
|
+
"description": "When the refresh began."
|
|
548
893
|
}
|
|
549
894
|
},
|
|
550
895
|
"completedAt": {
|
|
551
896
|
"type": "datetime",
|
|
552
897
|
"required": false,
|
|
898
|
+
"description": "When the refresh finished. Empty while it is still running.",
|
|
553
899
|
"_meta": {
|
|
554
|
-
"nullable": true
|
|
900
|
+
"nullable": true,
|
|
901
|
+
"description": "When the refresh finished. Empty while it is still running."
|
|
555
902
|
}
|
|
556
903
|
},
|
|
557
904
|
"rowCount": {
|
|
558
905
|
"type": "integer",
|
|
559
906
|
"required": true,
|
|
907
|
+
"description": "How many rows the report held after the refresh.",
|
|
560
908
|
"_meta": {
|
|
561
|
-
"required": true
|
|
909
|
+
"required": true,
|
|
910
|
+
"description": "How many rows the report held after the refresh."
|
|
562
911
|
}
|
|
563
912
|
},
|
|
564
913
|
"changedGroupCount": {
|
|
@@ -585,8 +934,10 @@
|
|
|
585
934
|
"error": {
|
|
586
935
|
"type": "text",
|
|
587
936
|
"required": false,
|
|
937
|
+
"description": "Why the refresh failed. Empty when it worked.",
|
|
588
938
|
"_meta": {
|
|
589
|
-
"nullable": true
|
|
939
|
+
"nullable": true,
|
|
940
|
+
"description": "Why the refresh failed. Empty when it worked."
|
|
590
941
|
}
|
|
591
942
|
},
|
|
592
943
|
"metadata": {
|
|
@@ -1624,8 +1975,10 @@
|
|
|
1624
1975
|
"cron": {
|
|
1625
1976
|
"type": "text",
|
|
1626
1977
|
"required": true,
|
|
1978
|
+
"description": "When the report refreshes, as a cron schedule such as 0 6 * * * for 6 am daily.",
|
|
1627
1979
|
"_meta": {
|
|
1628
|
-
"required": true
|
|
1980
|
+
"required": true,
|
|
1981
|
+
"description": "When the report refreshes, as a cron schedule such as 0 6 * * * for 6 am daily."
|
|
1629
1982
|
}
|
|
1630
1983
|
},
|
|
1631
1984
|
"trigger": {
|
|
@@ -1645,8 +1998,10 @@
|
|
|
1645
1998
|
"mode": {
|
|
1646
1999
|
"type": "text",
|
|
1647
2000
|
"required": true,
|
|
2001
|
+
"description": "Rebuild recomputes the whole report. Incremental updates only what changed.",
|
|
1648
2002
|
"_meta": {
|
|
1649
|
-
"required": true
|
|
2003
|
+
"required": true,
|
|
2004
|
+
"description": "Rebuild recomputes the whole report. Incremental updates only what changed."
|
|
1650
2005
|
},
|
|
1651
2006
|
"enum": [
|
|
1652
2007
|
"rebuild",
|
|
@@ -1656,15 +2011,19 @@
|
|
|
1656
2011
|
"enabled": {
|
|
1657
2012
|
"type": "boolean",
|
|
1658
2013
|
"required": true,
|
|
2014
|
+
"description": "Turn off to stop refreshing without deleting the schedule.",
|
|
1659
2015
|
"_meta": {
|
|
1660
|
-
"required": true
|
|
2016
|
+
"required": true,
|
|
2017
|
+
"description": "Turn off to stop refreshing without deleting the schedule."
|
|
1661
2018
|
}
|
|
1662
2019
|
},
|
|
1663
2020
|
"status": {
|
|
1664
2021
|
"type": "text",
|
|
1665
2022
|
"required": true,
|
|
2023
|
+
"description": "Whether the schedule is active, paused, disabled or in error.",
|
|
1666
2024
|
"_meta": {
|
|
1667
|
-
"required": true
|
|
2025
|
+
"required": true,
|
|
2026
|
+
"description": "Whether the schedule is active, paused, disabled or in error."
|
|
1668
2027
|
},
|
|
1669
2028
|
"enum": [
|
|
1670
2029
|
"active",
|
|
@@ -1676,22 +2035,28 @@
|
|
|
1676
2035
|
"nextRun": {
|
|
1677
2036
|
"type": "datetime",
|
|
1678
2037
|
"required": false,
|
|
2038
|
+
"description": "When the report is next due to refresh.",
|
|
1679
2039
|
"_meta": {
|
|
1680
|
-
"nullable": true
|
|
2040
|
+
"nullable": true,
|
|
2041
|
+
"description": "When the report is next due to refresh."
|
|
1681
2042
|
}
|
|
1682
2043
|
},
|
|
1683
2044
|
"lastRun": {
|
|
1684
2045
|
"type": "datetime",
|
|
1685
2046
|
"required": false,
|
|
2047
|
+
"description": "When the report last started a scheduled refresh.",
|
|
1686
2048
|
"_meta": {
|
|
1687
|
-
"nullable": true
|
|
2049
|
+
"nullable": true,
|
|
2050
|
+
"description": "When the report last started a scheduled refresh."
|
|
1688
2051
|
}
|
|
1689
2052
|
},
|
|
1690
2053
|
"lastStatus": {
|
|
1691
2054
|
"type": "text",
|
|
1692
2055
|
"required": false,
|
|
2056
|
+
"description": "Whether the last scheduled refresh worked or failed.",
|
|
1693
2057
|
"_meta": {
|
|
1694
|
-
"nullable": true
|
|
2058
|
+
"nullable": true,
|
|
2059
|
+
"description": "Whether the last scheduled refresh worked or failed."
|
|
1695
2060
|
},
|
|
1696
2061
|
"enum": [
|
|
1697
2062
|
"success",
|
|
@@ -1701,8 +2066,10 @@
|
|
|
1701
2066
|
"lastError": {
|
|
1702
2067
|
"type": "text",
|
|
1703
2068
|
"required": false,
|
|
2069
|
+
"description": "Why the last scheduled refresh failed. Empty when it worked.",
|
|
1704
2070
|
"_meta": {
|
|
1705
|
-
"nullable": true
|
|
2071
|
+
"nullable": true,
|
|
2072
|
+
"description": "Why the last scheduled refresh failed. Empty when it worked."
|
|
1706
2073
|
}
|
|
1707
2074
|
},
|
|
1708
2075
|
"runCount": {
|
|
@@ -2207,10 +2574,72 @@
|
|
|
2207
2574
|
}
|
|
2208
2575
|
},
|
|
2209
2576
|
"moduleType": "smrt",
|
|
2577
|
+
"recipes": [
|
|
2578
|
+
{
|
|
2579
|
+
"id": "reports.materialized",
|
|
2580
|
+
"className": "MaterializedReportsRecipe",
|
|
2581
|
+
"label": "Reports",
|
|
2582
|
+
"summary": "Keep totals and trends ready to read, refreshed on a schedule and open to the assistant.",
|
|
2583
|
+
"synonyms": [
|
|
2584
|
+
"reports",
|
|
2585
|
+
"totals",
|
|
2586
|
+
"summaries",
|
|
2587
|
+
"rollups",
|
|
2588
|
+
"kpis",
|
|
2589
|
+
"trends",
|
|
2590
|
+
"dashboards"
|
|
2591
|
+
],
|
|
2592
|
+
"models": [
|
|
2593
|
+
"@happyvertical/smrt-reports:SmrtReportRun",
|
|
2594
|
+
"@happyvertical/smrt-reports:SmrtReportWatermark",
|
|
2595
|
+
"@happyvertical/smrt-reports:SmrtReportLock",
|
|
2596
|
+
"@happyvertical/smrt-reports:SmrtReportSchedule",
|
|
2597
|
+
"@happyvertical/smrt-reports:SmrtReportRefreshTask",
|
|
2598
|
+
"@happyvertical/smrt-reports:SmrtPrincipalReportRefreshTask"
|
|
2599
|
+
],
|
|
2600
|
+
"nav": [],
|
|
2601
|
+
"requires": [],
|
|
2602
|
+
"help": {
|
|
2603
|
+
"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",
|
|
2604
|
+
"fieldRefs": [
|
|
2605
|
+
"SmrtReportRun.completedAt",
|
|
2606
|
+
"SmrtReportRun.error",
|
|
2607
|
+
"SmrtReportRun.rowCount",
|
|
2608
|
+
"SmrtReportRun.status",
|
|
2609
|
+
"SmrtReportSchedule.cron",
|
|
2610
|
+
"SmrtReportSchedule.enabled",
|
|
2611
|
+
"SmrtReportSchedule.mode",
|
|
2612
|
+
"SmrtReportSchedule.nextRun"
|
|
2613
|
+
]
|
|
2614
|
+
},
|
|
2615
|
+
"runtime": "server",
|
|
2616
|
+
"demo": {
|
|
2617
|
+
"mode": "server",
|
|
2618
|
+
"reasons": [
|
|
2619
|
+
"The recipe declares runtime \"server\".",
|
|
2620
|
+
"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)."
|
|
2621
|
+
]
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2624
|
+
],
|
|
2210
2625
|
"smrtDependencies": [
|
|
2211
2626
|
"@happyvertical/smrt-core",
|
|
2212
2627
|
"@happyvertical/smrt-jobs",
|
|
2213
2628
|
"@happyvertical/smrt-tenancy"
|
|
2214
2629
|
],
|
|
2630
|
+
"browser": {
|
|
2631
|
+
"status": "server-only",
|
|
2632
|
+
"issues": [
|
|
2633
|
+
"#3615",
|
|
2634
|
+
"#3624",
|
|
2635
|
+
"#3625",
|
|
2636
|
+
"#3627"
|
|
2637
|
+
],
|
|
2638
|
+
"reason": "node:crypto/events; @happyvertical/sql root: the sync query builders it needs (validateColumnName, buildWhere, buildAggregate, bucketExpr, tableExists) have no browser-safe SDK entry",
|
|
2639
|
+
"via": [
|
|
2640
|
+
"@happyvertical/smrt-jobs",
|
|
2641
|
+
"@happyvertical/smrt-tenancy"
|
|
2642
|
+
]
|
|
2643
|
+
},
|
|
2215
2644
|
"stampsConstructors": true
|
|
2216
2645
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declared recipes for smrt-reports (#3719): user-facing units of
|
|
3
|
+
* functionality an app or agent can pick instead of the whole package.
|
|
4
|
+
* The scanner reads these statics into the `recipes` array of `manifest.json`
|
|
5
|
+
* and `smrt-knowledge.json`; nothing here runs at that point.
|
|
6
|
+
*
|
|
7
|
+
* `reports.materialized` brings the refresh bookkeeping tables a declared
|
|
8
|
+
* (`@report`) report needs. The report classes themselves belong to the app, so
|
|
9
|
+
* they are not listed here. It declares no surfaces: this package ships no
|
|
10
|
+
* Svelte components, and the assistant reaches declared reports through the
|
|
11
|
+
* `reports.query` tools in `@happyvertical/smrt-agents`.
|
|
12
|
+
*
|
|
13
|
+
* @packageDocumentation
|
|
14
|
+
*/
|
|
15
|
+
import { SmrtRecipe } from '@happyvertical/smrt-core';
|
|
16
|
+
import { SmrtPrincipalReportRefreshTask } from './scheduler.js';
|
|
17
|
+
import { SmrtReportLock, SmrtReportRun, SmrtReportSchedule, SmrtReportWatermark } from './state.js';
|
|
18
|
+
/** Reports: totals and trends kept ready to read, refreshed on a schedule. */
|
|
19
|
+
export declare class MaterializedReportsRecipe extends SmrtRecipe {
|
|
20
|
+
static id: string;
|
|
21
|
+
static help: string;
|
|
22
|
+
static label: string;
|
|
23
|
+
static summary: string;
|
|
24
|
+
static synonyms: string[];
|
|
25
|
+
static models: (typeof SmrtReportRun | typeof SmrtReportWatermark | typeof SmrtReportLock | typeof SmrtReportSchedule | typeof SmrtPrincipalReportRefreshTask)[];
|
|
26
|
+
static runtime: "server";
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=recipes.d.ts.map
|
|
@@ -0,0 +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,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;IACzC,MAAM,CAAC,KAAK,SAAa;IACzB,MAAM,CAAC,OAAO,SAC+E;IAC7F,MAAM,CAAC,QAAQ,WAQb;IAIF,MAAM,CAAC,MAAM,oJAOX;IAGF,MAAM,CAAC,OAAO,EAAG,QAAQ,CAAU;CACpC"}
|
package/dist/refresh.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type SmrtObject } from '@happyvertical/smrt-core';
|
|
2
|
+
import { type DatabaseInterface, type SqlAdapterType } from '@happyvertical/sql';
|
|
2
3
|
import type { ReportDefinition, ReportRefreshOptions, ReportRefreshResult, ReportSource } from './types.js';
|
|
3
4
|
type ReportCtor = new (...args: any[]) => SmrtObject;
|
|
5
|
+
export declare function adapterTypeFromDb(db: DatabaseInterface, fallback?: SqlAdapterType): SqlAdapterType;
|
|
6
|
+
export declare function tenantColumn(className: string): Promise<string | null>;
|
|
4
7
|
export declare function refreshReport(reportCtor: ReportCtor, options?: ReportRefreshOptions): Promise<ReportRefreshResult>;
|
|
5
8
|
export declare function reportRowIdentity(row: Record<string, any>, definition: ReportDefinition): string;
|
|
6
9
|
export declare function reportSourceClassName(source: ReportSource): string;
|
package/dist/refresh.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../src/refresh.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../src/refresh.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3E,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAGpB,MAAM,oBAAoB,CAAC;AAa5B,OAAO,KAAK,EAGV,gBAAgB,EAEhB,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,KAAK,UAAU,GAAG,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,UAAU,CAAC;AAoCrD,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,iBAAiB,EACrB,QAAQ,CAAC,EAAE,cAAc,GACxB,cAAc,CAgBhB;AAiGD,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAgB5E;AA+0BD,wBAAsB,aAAa,CACjC,UAAU,EAAE,UAAU,EACtB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,mBAAmB,CAAC,CA8B9B;AAED,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACxB,UAAU,EAAE,gBAAgB,GAC3B,MAAM,CAKR;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAElE"}
|
package/dist/refresh.js
CHANGED
|
@@ -529,6 +529,6 @@ function reportSourceClassName(source) {
|
|
|
529
529
|
return sourceClassName(source);
|
|
530
530
|
}
|
|
531
531
|
//#endregion
|
|
532
|
-
export { refreshReport, reportRowIdentity, reportSourceClassName };
|
|
532
|
+
export { adapterTypeFromDb, refreshReport, reportRowIdentity, reportSourceClassName, tenantColumn };
|
|
533
533
|
|
|
534
534
|
//# sourceMappingURL=refresh.js.map
|