@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.
- package/AGENTS.md +26 -0
- package/CLAUDE.md +1 -0
- package/LICENSE +7 -0
- package/dist/aggregate.d.ts +25 -0
- package/dist/aggregate.js +6 -0
- package/dist/aggregate.js.map +1 -0
- package/dist/compiler.d.ts +78 -0
- package/dist/compiler.js +218 -0
- package/dist/compiler.js.map +1 -0
- package/dist/decorators.d.ts +90 -0
- package/dist/decorators.js +84 -0
- package/dist/decorators.js.map +1 -0
- package/dist/index.d.ts +407 -0
- package/dist/index.js +162 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.json +1639 -0
- package/dist/refresh.d.ts +106 -0
- package/dist/refresh.js +778 -0
- package/dist/refresh.js.map +1 -0
- package/dist/scheduler.d.ts +112 -0
- package/dist/scheduler.js +449 -0
- package/dist/scheduler.js.map +1 -0
- package/dist/smrt-knowledge.json +584 -0
- package/dist/state.d.ts +108 -0
- package/dist/state.js +320 -0
- package/dist/state.js.map +1 -0
- package/dist/types.d.ts +114 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { AggregateFunction } from '@happyvertical/sql';
|
|
2
|
+
import { AggregateTimeBucketUnit } from '@happyvertical/sql';
|
|
3
|
+
import { DatabaseInterface } from '@happyvertical/sql';
|
|
4
|
+
import { SmrtObject } from '@happyvertical/smrt-core';
|
|
5
|
+
import { SqlAdapterType } from '@happyvertical/sql';
|
|
6
|
+
import { WhereClause } from '@happyvertical/sql';
|
|
7
|
+
|
|
8
|
+
export declare function refreshReport(reportCtor: ReportCtor, options?: ReportRefreshOptions): Promise<ReportRefreshResult>;
|
|
9
|
+
|
|
10
|
+
declare interface ReportAggregateFieldMetadata {
|
|
11
|
+
kind: 'aggregate';
|
|
12
|
+
fn: ReportAggregateFn;
|
|
13
|
+
column?: string;
|
|
14
|
+
distinct?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare type ReportAggregateFn = AggregateFunction;
|
|
18
|
+
|
|
19
|
+
declare interface ReportBucketFieldMetadata {
|
|
20
|
+
kind: 'bucket';
|
|
21
|
+
unit: ReportTimeBucketUnit;
|
|
22
|
+
sourceColumn: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare type ReportCtor = new (...args: any[]) => SmrtObject;
|
|
26
|
+
|
|
27
|
+
declare interface ReportDefinition {
|
|
28
|
+
reportClassName: string;
|
|
29
|
+
sourceClassName: string;
|
|
30
|
+
sourceTable: string;
|
|
31
|
+
fields: ReportFieldDefinition[];
|
|
32
|
+
where?: WhereClause;
|
|
33
|
+
having?: WhereClause;
|
|
34
|
+
refresh?: ReportRefreshConfig;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare interface ReportFieldDefinition {
|
|
38
|
+
fieldName: string;
|
|
39
|
+
columnName?: string;
|
|
40
|
+
type?: string;
|
|
41
|
+
report?: ReportFieldMetadata;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare type ReportFieldMetadata = ReportGroupFieldMetadata | ReportBucketFieldMetadata | ReportAggregateFieldMetadata;
|
|
45
|
+
|
|
46
|
+
declare interface ReportGroupFieldMetadata {
|
|
47
|
+
kind: 'group';
|
|
48
|
+
sourceColumn?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
declare interface ReportRefreshConfig {
|
|
52
|
+
mode?: ReportRefreshMode;
|
|
53
|
+
schedule?: string;
|
|
54
|
+
onChange?: ReportSource[];
|
|
55
|
+
/**
|
|
56
|
+
* Milliseconds before collection reads trigger a synchronous refresh.
|
|
57
|
+
*
|
|
58
|
+
* TTL refresh checks add a read-time MAX(refreshedAt) query, and stale reads
|
|
59
|
+
* perform the refresh before returning list/get results.
|
|
60
|
+
*/
|
|
61
|
+
ttl?: number;
|
|
62
|
+
manual?: boolean;
|
|
63
|
+
watermarkColumn?: string;
|
|
64
|
+
softDeleteColumn?: string;
|
|
65
|
+
fullRebuildSchedule?: string;
|
|
66
|
+
tenantFanout?: boolean;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
declare type ReportRefreshMode = 'rebuild' | 'incremental';
|
|
70
|
+
|
|
71
|
+
declare interface ReportRefreshOptions {
|
|
72
|
+
db?: DatabaseInterface;
|
|
73
|
+
mode?: ReportRefreshMode;
|
|
74
|
+
adapterType?: SqlAdapterType;
|
|
75
|
+
trigger?: ReportRefreshTrigger;
|
|
76
|
+
tenantId?: string | null;
|
|
77
|
+
tenantIds?: string[];
|
|
78
|
+
lock?: boolean;
|
|
79
|
+
lockTtlMs?: number;
|
|
80
|
+
trackRuns?: boolean;
|
|
81
|
+
scheduleId?: string;
|
|
82
|
+
changedRows?: Record<string, unknown>[];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
declare interface ReportRefreshResult {
|
|
86
|
+
rowCount: number;
|
|
87
|
+
refreshedAt: Date;
|
|
88
|
+
mode: ReportRefreshMode;
|
|
89
|
+
tenantId?: string | null;
|
|
90
|
+
runId?: string;
|
|
91
|
+
changedGroupCount?: number;
|
|
92
|
+
skipped?: boolean;
|
|
93
|
+
tenantResults?: ReportRefreshResult[];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare type ReportRefreshTrigger = 'manual' | 'schedule' | 'change' | 'ttl' | 'job';
|
|
97
|
+
|
|
98
|
+
export declare function reportRowIdentity(row: Record<string, any>, definition: ReportDefinition): string;
|
|
99
|
+
|
|
100
|
+
declare type ReportSource = string | (new (...args: any[]) => SmrtObject) | (abstract new (...args: any[]) => SmrtObject);
|
|
101
|
+
|
|
102
|
+
export declare function reportSourceClassName(source: ReportSource): string;
|
|
103
|
+
|
|
104
|
+
declare type ReportTimeBucketUnit = AggregateTimeBucketUnit;
|
|
105
|
+
|
|
106
|
+
export { }
|