business-as-code 2.3.0 → 2.4.0
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/.turbo/turbo-build.log +4 -0
- package/CHANGELOG.md +43 -0
- package/dist/business.d.ts +62 -0
- package/dist/business.d.ts.map +1 -0
- package/dist/business.js +109 -0
- package/dist/business.js.map +1 -0
- package/dist/dollar.d.ts +60 -0
- package/dist/dollar.d.ts.map +1 -0
- package/dist/dollar.js +107 -0
- package/dist/dollar.js.map +1 -0
- package/dist/entities/assets.d.ts +21 -0
- package/dist/entities/assets.d.ts.map +1 -0
- package/dist/entities/assets.js +323 -0
- package/dist/entities/assets.js.map +1 -0
- package/dist/entities/business.d.ts +36 -0
- package/dist/entities/business.d.ts.map +1 -0
- package/dist/entities/business.js +370 -0
- package/dist/entities/business.js.map +1 -0
- package/dist/entities/communication.d.ts +21 -0
- package/dist/entities/communication.d.ts.map +1 -0
- package/dist/entities/communication.js +255 -0
- package/dist/entities/communication.js.map +1 -0
- package/dist/entities/customers.d.ts +58 -0
- package/dist/entities/customers.d.ts.map +1 -0
- package/dist/entities/customers.js +989 -0
- package/dist/entities/customers.js.map +1 -0
- package/dist/entities/financials.d.ts +59 -0
- package/dist/entities/financials.d.ts.map +1 -0
- package/dist/entities/financials.js +932 -0
- package/dist/entities/financials.js.map +1 -0
- package/dist/entities/goals.d.ts +58 -0
- package/dist/entities/goals.d.ts.map +1 -0
- package/dist/entities/goals.js +800 -0
- package/dist/entities/goals.js.map +1 -0
- package/dist/entities/index.d.ts +299 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +198 -0
- package/dist/entities/index.js.map +1 -0
- package/dist/entities/legal.d.ts +21 -0
- package/dist/entities/legal.d.ts.map +1 -0
- package/dist/entities/legal.js +301 -0
- package/dist/entities/legal.js.map +1 -0
- package/dist/entities/market.d.ts +21 -0
- package/dist/entities/market.d.ts.map +1 -0
- package/dist/entities/market.js +301 -0
- package/dist/entities/market.js.map +1 -0
- package/dist/entities/marketing.d.ts +67 -0
- package/dist/entities/marketing.d.ts.map +1 -0
- package/dist/entities/marketing.js +1157 -0
- package/dist/entities/marketing.js.map +1 -0
- package/dist/entities/offerings.d.ts +51 -0
- package/dist/entities/offerings.d.ts.map +1 -0
- package/dist/entities/offerings.js +727 -0
- package/dist/entities/offerings.js.map +1 -0
- package/dist/entities/operations.d.ts +58 -0
- package/dist/entities/operations.d.ts.map +1 -0
- package/dist/entities/operations.js +787 -0
- package/dist/entities/operations.js.map +1 -0
- package/dist/entities/organization.d.ts +61 -0
- package/dist/entities/organization.d.ts.map +1 -0
- package/dist/entities/organization.js +816 -0
- package/dist/entities/organization.js.map +1 -0
- package/dist/entities/partnerships.d.ts +21 -0
- package/dist/entities/partnerships.d.ts.map +1 -0
- package/dist/entities/partnerships.js +300 -0
- package/dist/entities/partnerships.js.map +1 -0
- package/dist/entities/planning.d.ts +87 -0
- package/dist/entities/planning.d.ts.map +1 -0
- package/dist/entities/planning.js +271 -0
- package/dist/entities/planning.js.map +1 -0
- package/dist/entities/projects.d.ts +25 -0
- package/dist/entities/projects.d.ts.map +1 -0
- package/dist/entities/projects.js +349 -0
- package/dist/entities/projects.js.map +1 -0
- package/dist/entities/risk.d.ts +21 -0
- package/dist/entities/risk.d.ts.map +1 -0
- package/dist/entities/risk.js +293 -0
- package/dist/entities/risk.js.map +1 -0
- package/dist/entities/sales.d.ts +72 -0
- package/dist/entities/sales.d.ts.map +1 -0
- package/dist/entities/sales.js +1248 -0
- package/dist/entities/sales.js.map +1 -0
- package/dist/finance/account.d.ts +44 -0
- package/dist/finance/account.d.ts.map +1 -0
- package/dist/finance/account.js +6 -0
- package/dist/finance/account.js.map +1 -0
- package/dist/finance/authority.d.ts +78 -0
- package/dist/finance/authority.d.ts.map +1 -0
- package/dist/finance/authority.js +27 -0
- package/dist/finance/authority.js.map +1 -0
- package/dist/finance/card.d.ts +36 -0
- package/dist/finance/card.d.ts.map +1 -0
- package/dist/finance/card.js +6 -0
- package/dist/finance/card.js.map +1 -0
- package/dist/finance/identity.d.ts +30 -0
- package/dist/finance/identity.d.ts.map +1 -0
- package/dist/finance/identity.js +8 -0
- package/dist/finance/identity.js.map +1 -0
- package/dist/finance/index.d.ts +36 -0
- package/dist/finance/index.d.ts.map +1 -0
- package/dist/finance/index.js +22 -0
- package/dist/finance/index.js.map +1 -0
- package/dist/finance/ledger.d.ts +24 -0
- package/dist/finance/ledger.d.ts.map +1 -0
- package/dist/finance/ledger.js +8 -0
- package/dist/finance/ledger.js.map +1 -0
- package/dist/finance/merchant.d.ts +129 -0
- package/dist/finance/merchant.d.ts.map +1 -0
- package/dist/finance/merchant.js +21 -0
- package/dist/finance/merchant.js.map +1 -0
- package/dist/finance/outcome-contract.d.ts +139 -0
- package/dist/finance/outcome-contract.d.ts.map +1 -0
- package/dist/finance/outcome-contract.js +27 -0
- package/dist/finance/outcome-contract.js.map +1 -0
- package/dist/finance/port.d.ts +121 -0
- package/dist/finance/port.d.ts.map +1 -0
- package/dist/finance/port.js +10 -0
- package/dist/finance/port.js.map +1 -0
- package/dist/finance/pricing.d.ts +154 -0
- package/dist/finance/pricing.d.ts.map +1 -0
- package/dist/finance/pricing.js +79 -0
- package/dist/finance/pricing.js.map +1 -0
- package/dist/finance/proof-predicate.d.ts +92 -0
- package/dist/finance/proof-predicate.d.ts.map +1 -0
- package/dist/finance/proof-predicate.js +80 -0
- package/dist/finance/proof-predicate.js.map +1 -0
- package/dist/finance/refund.d.ts +44 -0
- package/dist/finance/refund.d.ts.map +1 -0
- package/dist/finance/refund.js +41 -0
- package/dist/finance/refund.js.map +1 -0
- package/dist/finance/sla.d.ts +25 -0
- package/dist/finance/sla.d.ts.map +1 -0
- package/dist/finance/sla.js +7 -0
- package/dist/finance/sla.js.map +1 -0
- package/dist/finance/types.d.ts +79 -0
- package/dist/finance/types.d.ts.map +1 -0
- package/dist/finance/types.js +8 -0
- package/dist/finance/types.js.map +1 -0
- package/dist/financials.d.ts +130 -0
- package/dist/financials.d.ts.map +1 -0
- package/dist/financials.js +297 -0
- package/dist/financials.js.map +1 -0
- package/dist/goals.d.ts +106 -0
- package/dist/goals.d.ts.map +1 -0
- package/dist/goals.js +284 -0
- package/dist/goals.js.map +1 -0
- package/dist/index.d.ts +101 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +144 -0
- package/dist/index.js.map +1 -0
- package/dist/kpis.d.ts +137 -0
- package/dist/kpis.d.ts.map +1 -0
- package/dist/kpis.js +297 -0
- package/dist/kpis.js.map +1 -0
- package/dist/metrics.d.ts +448 -0
- package/dist/metrics.d.ts.map +1 -0
- package/dist/metrics.js +330 -0
- package/dist/metrics.js.map +1 -0
- package/dist/okrs.d.ts +157 -0
- package/dist/okrs.d.ts.map +1 -0
- package/dist/okrs.js +391 -0
- package/dist/okrs.js.map +1 -0
- package/dist/organization.d.ts +585 -0
- package/dist/organization.d.ts.map +1 -0
- package/dist/organization.js +173 -0
- package/dist/organization.js.map +1 -0
- package/dist/process.d.ts +112 -0
- package/dist/process.d.ts.map +1 -0
- package/dist/process.js +242 -0
- package/dist/process.js.map +1 -0
- package/dist/product.d.ts +85 -0
- package/dist/product.d.ts.map +1 -0
- package/dist/product.js +145 -0
- package/dist/product.js.map +1 -0
- package/dist/queries.d.ts +304 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +577 -0
- package/dist/queries.js.map +1 -0
- package/dist/roles.d.ts +334 -0
- package/dist/roles.d.ts.map +1 -0
- package/dist/roles.js +282 -0
- package/dist/roles.js.map +1 -0
- package/dist/service.d.ts +61 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +140 -0
- package/dist/service.js.map +1 -0
- package/dist/types.d.ts +459 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/vision.d.ts +38 -0
- package/dist/vision.d.ts.map +1 -0
- package/dist/vision.js +68 -0
- package/dist/vision.js.map +1 -0
- package/dist/workflow.d.ts +115 -0
- package/dist/workflow.d.ts.map +1 -0
- package/dist/workflow.js +248 -0
- package/dist/workflow.js.map +1 -0
- package/package.json +8 -4
- package/src/finance/account.ts +48 -0
- package/src/finance/authority.ts +42 -0
- package/src/finance/card.ts +38 -0
- package/src/finance/identity.ts +31 -0
- package/src/finance/index.ts +117 -0
- package/src/finance/ledger.ts +26 -0
- package/src/finance/merchant.ts +127 -0
- package/src/finance/outcome-contract.ts +157 -0
- package/src/finance/port.ts +144 -0
- package/src/finance/pricing.ts +197 -0
- package/src/finance/proof-predicate.ts +106 -0
- package/src/finance/refund.ts +52 -0
- package/src/finance/sla.ts +33 -0
- package/src/finance/types.ts +75 -0
package/dist/queries.js
ADDED
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live Queries & Views
|
|
3
|
+
*
|
|
4
|
+
* Query definitions for real-time analytics against ai-database (ClickHouse-backed).
|
|
5
|
+
* These are NOT batch reports - they're live, composable queries that execute
|
|
6
|
+
* in real-time against a performant OLAP database.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// Metric Definitions (Standard SaaS Metrics as Queries)
|
|
12
|
+
// =============================================================================
|
|
13
|
+
/**
|
|
14
|
+
* Standard SaaS metric dimensions
|
|
15
|
+
*/
|
|
16
|
+
export const StandardDimensions = {
|
|
17
|
+
// Time
|
|
18
|
+
date: { name: 'date', field: 'date', type: 'date', description: 'Event date' },
|
|
19
|
+
month: { name: 'month', field: 'date', type: 'date', granularity: 'month', description: 'Month' },
|
|
20
|
+
quarter: {
|
|
21
|
+
name: 'quarter',
|
|
22
|
+
field: 'date',
|
|
23
|
+
type: 'date',
|
|
24
|
+
granularity: 'quarter',
|
|
25
|
+
description: 'Quarter',
|
|
26
|
+
},
|
|
27
|
+
year: { name: 'year', field: 'date', type: 'date', granularity: 'year', description: 'Year' },
|
|
28
|
+
// Customer
|
|
29
|
+
customerId: {
|
|
30
|
+
name: 'customerId',
|
|
31
|
+
field: 'customer_id',
|
|
32
|
+
type: 'string',
|
|
33
|
+
description: 'Customer ID',
|
|
34
|
+
},
|
|
35
|
+
customerSegment: {
|
|
36
|
+
name: 'customerSegment',
|
|
37
|
+
field: 'customer_segment',
|
|
38
|
+
type: 'string',
|
|
39
|
+
description: 'Customer segment',
|
|
40
|
+
},
|
|
41
|
+
plan: { name: 'plan', field: 'plan', type: 'string', description: 'Subscription plan' },
|
|
42
|
+
cohort: { name: 'cohort', field: 'cohort', type: 'string', description: 'Customer cohort' },
|
|
43
|
+
// Product
|
|
44
|
+
productId: { name: 'productId', field: 'product_id', type: 'string', description: 'Product ID' },
|
|
45
|
+
productName: {
|
|
46
|
+
name: 'productName',
|
|
47
|
+
field: 'product_name',
|
|
48
|
+
type: 'string',
|
|
49
|
+
description: 'Product name',
|
|
50
|
+
},
|
|
51
|
+
feature: { name: 'feature', field: 'feature', type: 'string', description: 'Feature name' },
|
|
52
|
+
// Geography
|
|
53
|
+
country: { name: 'country', field: 'country', type: 'string', description: 'Country' },
|
|
54
|
+
region: { name: 'region', field: 'region', type: 'string', description: 'Region' },
|
|
55
|
+
// Channel
|
|
56
|
+
channel: {
|
|
57
|
+
name: 'channel',
|
|
58
|
+
field: 'channel',
|
|
59
|
+
type: 'string',
|
|
60
|
+
description: 'Acquisition channel',
|
|
61
|
+
},
|
|
62
|
+
source: { name: 'source', field: 'source', type: 'string', description: 'Traffic source' },
|
|
63
|
+
campaign: {
|
|
64
|
+
name: 'campaign',
|
|
65
|
+
field: 'campaign',
|
|
66
|
+
type: 'string',
|
|
67
|
+
description: 'Marketing campaign',
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Standard SaaS metric measures
|
|
72
|
+
*/
|
|
73
|
+
export const StandardMeasures = {
|
|
74
|
+
// Revenue
|
|
75
|
+
revenue: {
|
|
76
|
+
name: 'revenue',
|
|
77
|
+
field: 'revenue',
|
|
78
|
+
aggregate: 'sum',
|
|
79
|
+
type: 'currency',
|
|
80
|
+
description: 'Total revenue',
|
|
81
|
+
},
|
|
82
|
+
mrr: {
|
|
83
|
+
name: 'mrr',
|
|
84
|
+
field: 'mrr',
|
|
85
|
+
aggregate: 'sum',
|
|
86
|
+
type: 'currency',
|
|
87
|
+
description: 'Monthly recurring revenue',
|
|
88
|
+
},
|
|
89
|
+
newMrr: {
|
|
90
|
+
name: 'newMrr',
|
|
91
|
+
field: 'new_mrr',
|
|
92
|
+
aggregate: 'sum',
|
|
93
|
+
type: 'currency',
|
|
94
|
+
description: 'New MRR',
|
|
95
|
+
},
|
|
96
|
+
expansionMrr: {
|
|
97
|
+
name: 'expansionMrr',
|
|
98
|
+
field: 'expansion_mrr',
|
|
99
|
+
aggregate: 'sum',
|
|
100
|
+
type: 'currency',
|
|
101
|
+
description: 'Expansion MRR',
|
|
102
|
+
},
|
|
103
|
+
contractionMrr: {
|
|
104
|
+
name: 'contractionMrr',
|
|
105
|
+
field: 'contraction_mrr',
|
|
106
|
+
aggregate: 'sum',
|
|
107
|
+
type: 'currency',
|
|
108
|
+
description: 'Contraction MRR',
|
|
109
|
+
},
|
|
110
|
+
churnedMrr: {
|
|
111
|
+
name: 'churnedMrr',
|
|
112
|
+
field: 'churned_mrr',
|
|
113
|
+
aggregate: 'sum',
|
|
114
|
+
type: 'currency',
|
|
115
|
+
description: 'Churned MRR',
|
|
116
|
+
},
|
|
117
|
+
// Customers
|
|
118
|
+
customers: {
|
|
119
|
+
name: 'customers',
|
|
120
|
+
field: 'customer_id',
|
|
121
|
+
aggregate: 'countDistinct',
|
|
122
|
+
type: 'number',
|
|
123
|
+
description: 'Unique customers',
|
|
124
|
+
},
|
|
125
|
+
newCustomers: {
|
|
126
|
+
name: 'newCustomers',
|
|
127
|
+
field: 'new_customer_id',
|
|
128
|
+
aggregate: 'countDistinct',
|
|
129
|
+
type: 'number',
|
|
130
|
+
description: 'New customers',
|
|
131
|
+
},
|
|
132
|
+
churnedCustomers: {
|
|
133
|
+
name: 'churnedCustomers',
|
|
134
|
+
field: 'churned_customer_id',
|
|
135
|
+
aggregate: 'countDistinct',
|
|
136
|
+
type: 'number',
|
|
137
|
+
description: 'Churned customers',
|
|
138
|
+
},
|
|
139
|
+
// Usage
|
|
140
|
+
events: {
|
|
141
|
+
name: 'events',
|
|
142
|
+
field: 'event_id',
|
|
143
|
+
aggregate: 'count',
|
|
144
|
+
type: 'number',
|
|
145
|
+
description: 'Event count',
|
|
146
|
+
},
|
|
147
|
+
sessions: {
|
|
148
|
+
name: 'sessions',
|
|
149
|
+
field: 'session_id',
|
|
150
|
+
aggregate: 'countDistinct',
|
|
151
|
+
type: 'number',
|
|
152
|
+
description: 'Unique sessions',
|
|
153
|
+
},
|
|
154
|
+
activeUsers: {
|
|
155
|
+
name: 'activeUsers',
|
|
156
|
+
field: 'user_id',
|
|
157
|
+
aggregate: 'countDistinct',
|
|
158
|
+
type: 'number',
|
|
159
|
+
description: 'Active users',
|
|
160
|
+
},
|
|
161
|
+
// Costs
|
|
162
|
+
cogs: {
|
|
163
|
+
name: 'cogs',
|
|
164
|
+
field: 'cogs',
|
|
165
|
+
aggregate: 'sum',
|
|
166
|
+
type: 'currency',
|
|
167
|
+
description: 'Cost of goods sold',
|
|
168
|
+
},
|
|
169
|
+
salesSpend: {
|
|
170
|
+
name: 'salesSpend',
|
|
171
|
+
field: 'sales_spend',
|
|
172
|
+
aggregate: 'sum',
|
|
173
|
+
type: 'currency',
|
|
174
|
+
description: 'Sales spend',
|
|
175
|
+
},
|
|
176
|
+
marketingSpend: {
|
|
177
|
+
name: 'marketingSpend',
|
|
178
|
+
field: 'marketing_spend',
|
|
179
|
+
aggregate: 'sum',
|
|
180
|
+
type: 'currency',
|
|
181
|
+
description: 'Marketing spend',
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Calculated SaaS metrics
|
|
186
|
+
*/
|
|
187
|
+
export const CalculatedMetrics = {
|
|
188
|
+
// Revenue metrics
|
|
189
|
+
arr: {
|
|
190
|
+
name: 'arr',
|
|
191
|
+
expression: 'mrr * 12',
|
|
192
|
+
measures: ['mrr'],
|
|
193
|
+
type: 'currency',
|
|
194
|
+
description: 'Annual recurring revenue',
|
|
195
|
+
},
|
|
196
|
+
netNewMrr: {
|
|
197
|
+
name: 'netNewMrr',
|
|
198
|
+
expression: 'newMrr + expansionMrr - contractionMrr - churnedMrr',
|
|
199
|
+
measures: ['newMrr', 'expansionMrr', 'contractionMrr', 'churnedMrr'],
|
|
200
|
+
type: 'currency',
|
|
201
|
+
description: 'Net new MRR',
|
|
202
|
+
},
|
|
203
|
+
arpu: {
|
|
204
|
+
name: 'arpu',
|
|
205
|
+
expression: 'mrr / customers',
|
|
206
|
+
measures: ['mrr', 'customers'],
|
|
207
|
+
type: 'currency',
|
|
208
|
+
description: 'Average revenue per user',
|
|
209
|
+
},
|
|
210
|
+
// Margin metrics
|
|
211
|
+
grossProfit: {
|
|
212
|
+
name: 'grossProfit',
|
|
213
|
+
expression: 'revenue - cogs',
|
|
214
|
+
measures: ['revenue', 'cogs'],
|
|
215
|
+
type: 'currency',
|
|
216
|
+
description: 'Gross profit',
|
|
217
|
+
},
|
|
218
|
+
grossMargin: {
|
|
219
|
+
name: 'grossMargin',
|
|
220
|
+
expression: '(revenue - cogs) / revenue * 100',
|
|
221
|
+
measures: ['revenue', 'cogs'],
|
|
222
|
+
type: 'percent',
|
|
223
|
+
description: 'Gross margin percentage',
|
|
224
|
+
},
|
|
225
|
+
// Efficiency metrics
|
|
226
|
+
cac: {
|
|
227
|
+
name: 'cac',
|
|
228
|
+
expression: '(salesSpend + marketingSpend) / newCustomers',
|
|
229
|
+
measures: ['salesSpend', 'marketingSpend', 'newCustomers'],
|
|
230
|
+
type: 'currency',
|
|
231
|
+
description: 'Customer acquisition cost',
|
|
232
|
+
},
|
|
233
|
+
ltv: {
|
|
234
|
+
name: 'ltv',
|
|
235
|
+
expression: 'arpu * grossMargin / 100 / churnRate',
|
|
236
|
+
measures: ['arpu', 'grossMargin'],
|
|
237
|
+
type: 'currency',
|
|
238
|
+
description: 'Customer lifetime value',
|
|
239
|
+
},
|
|
240
|
+
ltvCacRatio: {
|
|
241
|
+
name: 'ltvCacRatio',
|
|
242
|
+
expression: 'ltv / cac',
|
|
243
|
+
measures: ['ltv', 'cac'],
|
|
244
|
+
type: 'number',
|
|
245
|
+
description: 'LTV:CAC ratio',
|
|
246
|
+
},
|
|
247
|
+
// Churn metrics
|
|
248
|
+
customerChurnRate: {
|
|
249
|
+
name: 'customerChurnRate',
|
|
250
|
+
expression: 'churnedCustomers / customers * 100',
|
|
251
|
+
measures: ['churnedCustomers', 'customers'],
|
|
252
|
+
type: 'percent',
|
|
253
|
+
description: 'Customer churn rate',
|
|
254
|
+
},
|
|
255
|
+
revenueChurnRate: {
|
|
256
|
+
name: 'revenueChurnRate',
|
|
257
|
+
expression: 'churnedMrr / mrr * 100',
|
|
258
|
+
measures: ['churnedMrr', 'mrr'],
|
|
259
|
+
type: 'percent',
|
|
260
|
+
description: 'Revenue churn rate',
|
|
261
|
+
},
|
|
262
|
+
nrr: {
|
|
263
|
+
name: 'nrr',
|
|
264
|
+
expression: '(mrr + expansionMrr - contractionMrr - churnedMrr) / mrr * 100',
|
|
265
|
+
measures: ['mrr', 'expansionMrr', 'contractionMrr', 'churnedMrr'],
|
|
266
|
+
type: 'percent',
|
|
267
|
+
description: 'Net revenue retention',
|
|
268
|
+
},
|
|
269
|
+
// Growth metrics
|
|
270
|
+
quickRatio: {
|
|
271
|
+
name: 'quickRatio',
|
|
272
|
+
expression: '(newMrr + expansionMrr) / (contractionMrr + churnedMrr)',
|
|
273
|
+
measures: ['newMrr', 'expansionMrr', 'contractionMrr', 'churnedMrr'],
|
|
274
|
+
type: 'number',
|
|
275
|
+
description: 'SaaS Quick Ratio',
|
|
276
|
+
},
|
|
277
|
+
magicNumber: {
|
|
278
|
+
name: 'magicNumber',
|
|
279
|
+
expression: 'netNewMrr * 12 / (salesSpend + marketingSpend)',
|
|
280
|
+
measures: ['netNewMrr', 'salesSpend', 'marketingSpend'],
|
|
281
|
+
type: 'number',
|
|
282
|
+
description: 'Magic Number',
|
|
283
|
+
},
|
|
284
|
+
};
|
|
285
|
+
// =============================================================================
|
|
286
|
+
// Query Builder Functions
|
|
287
|
+
// =============================================================================
|
|
288
|
+
/**
|
|
289
|
+
* Create a query
|
|
290
|
+
*/
|
|
291
|
+
export function query(name, source) {
|
|
292
|
+
return new QueryBuilder(name, source);
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Fluent query builder
|
|
296
|
+
*/
|
|
297
|
+
export class QueryBuilder {
|
|
298
|
+
_query;
|
|
299
|
+
constructor(name, source) {
|
|
300
|
+
this._query = { name, source };
|
|
301
|
+
}
|
|
302
|
+
describe(description) {
|
|
303
|
+
this._query.description = description;
|
|
304
|
+
return this;
|
|
305
|
+
}
|
|
306
|
+
dimensions(...dims) {
|
|
307
|
+
this._query.dimensions = dims;
|
|
308
|
+
return this;
|
|
309
|
+
}
|
|
310
|
+
measures(...measures) {
|
|
311
|
+
this._query.measures = measures;
|
|
312
|
+
return this;
|
|
313
|
+
}
|
|
314
|
+
filter(field, operator, value) {
|
|
315
|
+
if (!this._query.filters)
|
|
316
|
+
this._query.filters = [];
|
|
317
|
+
this._query.filters.push({ field, operator, value });
|
|
318
|
+
return this;
|
|
319
|
+
}
|
|
320
|
+
where(filters) {
|
|
321
|
+
this._query.filters = filters;
|
|
322
|
+
return this;
|
|
323
|
+
}
|
|
324
|
+
timeRange(field, start, end, granularity) {
|
|
325
|
+
const timeRange = { field };
|
|
326
|
+
if (start !== undefined)
|
|
327
|
+
timeRange.start = start;
|
|
328
|
+
if (end !== undefined)
|
|
329
|
+
timeRange.end = end;
|
|
330
|
+
if (granularity !== undefined)
|
|
331
|
+
timeRange.granularity = granularity;
|
|
332
|
+
this._query.timeRange = timeRange;
|
|
333
|
+
return this;
|
|
334
|
+
}
|
|
335
|
+
last(duration, field = 'date') {
|
|
336
|
+
this._query.timeRange = { field, start: `-${duration}` };
|
|
337
|
+
return this;
|
|
338
|
+
}
|
|
339
|
+
sort(field, direction = 'desc') {
|
|
340
|
+
if (!this._query.sort)
|
|
341
|
+
this._query.sort = [];
|
|
342
|
+
this._query.sort.push({ field, direction });
|
|
343
|
+
return this;
|
|
344
|
+
}
|
|
345
|
+
limit(n) {
|
|
346
|
+
this._query.limit = n;
|
|
347
|
+
return this;
|
|
348
|
+
}
|
|
349
|
+
offset(n) {
|
|
350
|
+
this._query.offset = n;
|
|
351
|
+
return this;
|
|
352
|
+
}
|
|
353
|
+
tags(...tags) {
|
|
354
|
+
this._query.tags = tags;
|
|
355
|
+
return this;
|
|
356
|
+
}
|
|
357
|
+
owner(owner) {
|
|
358
|
+
this._query.owner = owner;
|
|
359
|
+
return this;
|
|
360
|
+
}
|
|
361
|
+
build() {
|
|
362
|
+
return { ...this._query };
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
// =============================================================================
|
|
366
|
+
// Pre-built SaaS Metric Queries
|
|
367
|
+
// =============================================================================
|
|
368
|
+
/**
|
|
369
|
+
* MRR Overview query
|
|
370
|
+
*/
|
|
371
|
+
export const MrrOverview = query('mrr_overview', 'revenue_events')
|
|
372
|
+
.describe('Monthly recurring revenue breakdown')
|
|
373
|
+
.dimensions('month')
|
|
374
|
+
.measures('mrr', 'newMrr', 'expansionMrr', 'contractionMrr', 'churnedMrr', 'netNewMrr')
|
|
375
|
+
.last('12m')
|
|
376
|
+
.sort('month', 'asc')
|
|
377
|
+
.build();
|
|
378
|
+
/**
|
|
379
|
+
* ARR by segment query
|
|
380
|
+
*/
|
|
381
|
+
export const ArrBySegment = query('arr_by_segment', 'revenue_events')
|
|
382
|
+
.describe('Annual recurring revenue by customer segment')
|
|
383
|
+
.dimensions('customerSegment')
|
|
384
|
+
.measures('arr', 'customers', 'arpu')
|
|
385
|
+
.last('1m')
|
|
386
|
+
.sort('arr', 'desc')
|
|
387
|
+
.build();
|
|
388
|
+
/**
|
|
389
|
+
* Customer cohort retention query
|
|
390
|
+
*/
|
|
391
|
+
export const CohortRetention = query('cohort_retention', 'customer_events')
|
|
392
|
+
.describe('Customer retention by signup cohort')
|
|
393
|
+
.dimensions('cohort', 'month')
|
|
394
|
+
.measures('customers', 'mrr')
|
|
395
|
+
.last('12m')
|
|
396
|
+
.sort('cohort', 'asc')
|
|
397
|
+
.build();
|
|
398
|
+
/**
|
|
399
|
+
* Unit economics query
|
|
400
|
+
*/
|
|
401
|
+
export const UnitEconomics = query('unit_economics', 'financial_events')
|
|
402
|
+
.describe('Key unit economics metrics')
|
|
403
|
+
.dimensions('month')
|
|
404
|
+
.measures('cac', 'ltv', 'ltvCacRatio', 'arpu', 'customerChurnRate')
|
|
405
|
+
.last('12m')
|
|
406
|
+
.sort('month', 'asc')
|
|
407
|
+
.build();
|
|
408
|
+
/**
|
|
409
|
+
* Revenue by channel query
|
|
410
|
+
*/
|
|
411
|
+
export const RevenueByChannel = query('revenue_by_channel', 'revenue_events')
|
|
412
|
+
.describe('Revenue breakdown by acquisition channel')
|
|
413
|
+
.dimensions('channel')
|
|
414
|
+
.measures('mrr', 'newCustomers', 'cac')
|
|
415
|
+
.last('3m')
|
|
416
|
+
.sort('mrr', 'desc')
|
|
417
|
+
.build();
|
|
418
|
+
/**
|
|
419
|
+
* Growth metrics query
|
|
420
|
+
*/
|
|
421
|
+
export const GrowthMetrics = query('growth_metrics', 'financial_events')
|
|
422
|
+
.describe('Key growth and efficiency metrics')
|
|
423
|
+
.dimensions('month')
|
|
424
|
+
.measures('mrr', 'netNewMrr', 'quickRatio', 'nrr', 'magicNumber')
|
|
425
|
+
.last('12m')
|
|
426
|
+
.sort('month', 'asc')
|
|
427
|
+
.build();
|
|
428
|
+
// =============================================================================
|
|
429
|
+
// View Builder
|
|
430
|
+
// =============================================================================
|
|
431
|
+
/**
|
|
432
|
+
* Create a view from a query
|
|
433
|
+
*/
|
|
434
|
+
export function view(name, queryDef) {
|
|
435
|
+
return new ViewBuilder(name, queryDef);
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Fluent view builder
|
|
439
|
+
*/
|
|
440
|
+
export class ViewBuilder {
|
|
441
|
+
_view;
|
|
442
|
+
constructor(name, queryDef) {
|
|
443
|
+
this._view = { name, query: queryDef };
|
|
444
|
+
}
|
|
445
|
+
describe(description) {
|
|
446
|
+
this._view.description = description;
|
|
447
|
+
return this;
|
|
448
|
+
}
|
|
449
|
+
materialize(refreshInterval, retention) {
|
|
450
|
+
this._view.materialized = true;
|
|
451
|
+
if (refreshInterval !== undefined)
|
|
452
|
+
this._view.refreshInterval = refreshInterval;
|
|
453
|
+
if (retention !== undefined)
|
|
454
|
+
this._view.retention = retention;
|
|
455
|
+
return this;
|
|
456
|
+
}
|
|
457
|
+
public() {
|
|
458
|
+
this._view.public = true;
|
|
459
|
+
return this;
|
|
460
|
+
}
|
|
461
|
+
owner(owner) {
|
|
462
|
+
this._view.owner = owner;
|
|
463
|
+
return this;
|
|
464
|
+
}
|
|
465
|
+
tags(...tags) {
|
|
466
|
+
this._view.tags = tags;
|
|
467
|
+
return this;
|
|
468
|
+
}
|
|
469
|
+
build() {
|
|
470
|
+
return { ...this._view };
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
// =============================================================================
|
|
474
|
+
// Dashboard Builder
|
|
475
|
+
// =============================================================================
|
|
476
|
+
/**
|
|
477
|
+
* Create a dashboard
|
|
478
|
+
*/
|
|
479
|
+
export function dashboard(name) {
|
|
480
|
+
return new DashboardBuilder(name);
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Fluent dashboard builder
|
|
484
|
+
*/
|
|
485
|
+
export class DashboardBuilder {
|
|
486
|
+
_dashboard;
|
|
487
|
+
constructor(name) {
|
|
488
|
+
this._dashboard = { name, views: [] };
|
|
489
|
+
}
|
|
490
|
+
describe(description) {
|
|
491
|
+
this._dashboard.description = description;
|
|
492
|
+
return this;
|
|
493
|
+
}
|
|
494
|
+
add(viewDef, options) {
|
|
495
|
+
this._dashboard.views.push(viewDef);
|
|
496
|
+
if (options && this._dashboard.layout) {
|
|
497
|
+
const item = {
|
|
498
|
+
viewName: viewDef.name,
|
|
499
|
+
x: options.x || 0,
|
|
500
|
+
y: options.y || 0,
|
|
501
|
+
width: options.width || 1,
|
|
502
|
+
height: options.height || 1,
|
|
503
|
+
};
|
|
504
|
+
if (options.visualization !== undefined)
|
|
505
|
+
item.visualization = options.visualization;
|
|
506
|
+
this._dashboard.layout.items.push(item);
|
|
507
|
+
}
|
|
508
|
+
return this;
|
|
509
|
+
}
|
|
510
|
+
layout(columns, rows) {
|
|
511
|
+
this._dashboard.layout = { columns, rows, items: [] };
|
|
512
|
+
return this;
|
|
513
|
+
}
|
|
514
|
+
refresh(interval) {
|
|
515
|
+
this._dashboard.refreshInterval = interval;
|
|
516
|
+
return this;
|
|
517
|
+
}
|
|
518
|
+
owner(owner) {
|
|
519
|
+
this._dashboard.owner = owner;
|
|
520
|
+
return this;
|
|
521
|
+
}
|
|
522
|
+
tags(...tags) {
|
|
523
|
+
this._dashboard.tags = tags;
|
|
524
|
+
return this;
|
|
525
|
+
}
|
|
526
|
+
build() {
|
|
527
|
+
return { ...this._dashboard };
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
// =============================================================================
|
|
531
|
+
// Pre-built Dashboards
|
|
532
|
+
// =============================================================================
|
|
533
|
+
/**
|
|
534
|
+
* Executive SaaS Dashboard
|
|
535
|
+
*/
|
|
536
|
+
export const ExecutiveDashboard = dashboard('executive')
|
|
537
|
+
.describe('Executive overview of key SaaS metrics')
|
|
538
|
+
.layout(4, 3)
|
|
539
|
+
.add(view('mrr', MrrOverview).build(), {
|
|
540
|
+
x: 0,
|
|
541
|
+
y: 0,
|
|
542
|
+
width: 2,
|
|
543
|
+
height: 1,
|
|
544
|
+
visualization: 'trend',
|
|
545
|
+
})
|
|
546
|
+
.add(view('arr_segments', ArrBySegment).build(), {
|
|
547
|
+
x: 2,
|
|
548
|
+
y: 0,
|
|
549
|
+
width: 2,
|
|
550
|
+
height: 1,
|
|
551
|
+
visualization: 'bar',
|
|
552
|
+
})
|
|
553
|
+
.add(view('unit_econ', UnitEconomics).build(), {
|
|
554
|
+
x: 0,
|
|
555
|
+
y: 1,
|
|
556
|
+
width: 2,
|
|
557
|
+
height: 1,
|
|
558
|
+
visualization: 'table',
|
|
559
|
+
})
|
|
560
|
+
.add(view('growth', GrowthMetrics).build(), {
|
|
561
|
+
x: 2,
|
|
562
|
+
y: 1,
|
|
563
|
+
width: 2,
|
|
564
|
+
height: 1,
|
|
565
|
+
visualization: 'line',
|
|
566
|
+
})
|
|
567
|
+
.add(view('cohorts', CohortRetention).build(), {
|
|
568
|
+
x: 0,
|
|
569
|
+
y: 2,
|
|
570
|
+
width: 4,
|
|
571
|
+
height: 1,
|
|
572
|
+
visualization: 'cohort',
|
|
573
|
+
})
|
|
574
|
+
.refresh('5m')
|
|
575
|
+
.tags('executive', 'saas', 'metrics')
|
|
576
|
+
.build();
|
|
577
|
+
//# sourceMappingURL=queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../src/queries.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkPH,gFAAgF;AAChF,wDAAwD;AACxD,gFAAgF;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA8B;IAC3D,OAAO;IACP,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE;IAC9E,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE;IACjG,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,M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