@org.ai/examples 0.0.1
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/LICENSE +21 -0
- package/README.md +147 -0
- package/api-business/index.ts +1179 -0
- package/directory/index.ts +1118 -0
- package/dist/api-business/index.d.ts +221 -0
- package/dist/api-business/index.d.ts.map +1 -0
- package/dist/api-business/index.js +1132 -0
- package/dist/api-business/index.js.map +1 -0
- package/dist/directory/index.d.ts +202 -0
- package/dist/directory/index.d.ts.map +1 -0
- package/dist/directory/index.js +1073 -0
- package/dist/directory/index.js.map +1 -0
- package/dist/index.d.ts +75 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +127 -0
- package/dist/index.js.map +1 -0
- package/dist/marketplace/index.d.ts +242 -0
- package/dist/marketplace/index.d.ts.map +1 -0
- package/dist/marketplace/index.js +1249 -0
- package/dist/marketplace/index.js.map +1 -0
- package/dist/saas/index.d.ts +151 -0
- package/dist/saas/index.d.ts.map +1 -0
- package/dist/saas/index.js +1142 -0
- package/dist/saas/index.js.map +1 -0
- package/dist/startup-studio/index.d.ts +285 -0
- package/dist/startup-studio/index.d.ts.map +1 -0
- package/dist/startup-studio/index.js +1252 -0
- package/dist/startup-studio/index.js.map +1 -0
- package/dist/vc-firm/index.d.ts +248 -0
- package/dist/vc-firm/index.d.ts.map +1 -0
- package/dist/vc-firm/index.js +1335 -0
- package/dist/vc-firm/index.js.map +1 -0
- package/index.ts +151 -0
- package/marketplace/index.ts +1295 -0
- package/package.json +58 -0
- package/saas/index.ts +1188 -0
- package/startup-studio/index.ts +1324 -0
- package/tsconfig.json +12 -0
- package/vc-firm/index.ts +1430 -0
|
@@ -0,0 +1,1179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Business Example
|
|
3
|
+
*
|
|
4
|
+
* A complete example of a developer-focused API business modeled using primitives.org.ai
|
|
5
|
+
* Think: Stripe, Twilio, SendGrid, Algolia
|
|
6
|
+
*
|
|
7
|
+
* @example APIHub - A unified API gateway for third-party integrations
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* NOTE: These examples demonstrate the DESIRED API shape for business-as-code.
|
|
13
|
+
* Some types may not exist yet in the actual package. The examples serve as
|
|
14
|
+
* documentation and specification for the ideal primitives API.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// Use any for flexibility - these examples define the ideal API shape
|
|
18
|
+
const Business = (def: any) => def
|
|
19
|
+
const Product = (def: any) => def
|
|
20
|
+
const Service = (def: any) => def
|
|
21
|
+
const Goals = (defs: any[]) => defs
|
|
22
|
+
const Vision = (def: any) => def
|
|
23
|
+
const kpis = (defs: any[]) => defs
|
|
24
|
+
const okrs = (defs: any[]) => defs
|
|
25
|
+
const financials = (def: any) => def
|
|
26
|
+
const Process = (def: any) => def
|
|
27
|
+
const Workflow = (def: any) => def
|
|
28
|
+
const createBusinessRole = (def: any) => def
|
|
29
|
+
|
|
30
|
+
// Re-export Organization type placeholder
|
|
31
|
+
export interface Organization {
|
|
32
|
+
id: string
|
|
33
|
+
name: string
|
|
34
|
+
settings?: any
|
|
35
|
+
departments?: any[]
|
|
36
|
+
teams?: any[]
|
|
37
|
+
roles?: any[]
|
|
38
|
+
approvalChains?: any[]
|
|
39
|
+
routingRules?: any[]
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// $ helper placeholder
|
|
43
|
+
const $ = {
|
|
44
|
+
format: (n: number) => `$${n.toLocaleString()}`,
|
|
45
|
+
growth: (current: number, previous: number) => ((current - previous) / previous * 100).toFixed(1),
|
|
46
|
+
margin: (revenue: number, cost: number) => ((revenue - cost) / revenue * 100).toFixed(1),
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// =============================================================================
|
|
50
|
+
// 1. BUSINESS DEFINITION
|
|
51
|
+
// =============================================================================
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* APIHub - Unified API Gateway Platform
|
|
55
|
+
*/
|
|
56
|
+
export const APIHubBusiness = Business({
|
|
57
|
+
name: 'APIHub Inc.',
|
|
58
|
+
mission: 'Make API integrations simple, reliable, and scalable for every developer',
|
|
59
|
+
values: ['Developer Experience', 'Reliability', 'Transparency', 'Security'],
|
|
60
|
+
industry: 'Developer Tools / API Infrastructure',
|
|
61
|
+
founded: new Date('2021-06-01'),
|
|
62
|
+
stage: 'growth',
|
|
63
|
+
structure: {
|
|
64
|
+
departments: [
|
|
65
|
+
{
|
|
66
|
+
name: 'Engineering',
|
|
67
|
+
headcount: 40,
|
|
68
|
+
budget: 6000000,
|
|
69
|
+
teams: [
|
|
70
|
+
{ name: 'API Platform', headcount: 12, focus: 'Core API infrastructure' },
|
|
71
|
+
{ name: 'Gateway', headcount: 8, focus: 'API gateway & routing' },
|
|
72
|
+
{ name: 'Integrations', headcount: 10, focus: 'Third-party connectors' },
|
|
73
|
+
{ name: 'Infrastructure', headcount: 6, focus: 'Cloud & reliability' },
|
|
74
|
+
{ name: 'Security', headcount: 4, focus: 'API security & compliance' },
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'Product',
|
|
79
|
+
headcount: 8,
|
|
80
|
+
budget: 1200000,
|
|
81
|
+
teams: [
|
|
82
|
+
{ name: 'Product Management', headcount: 4 },
|
|
83
|
+
{ name: 'Developer Experience', headcount: 2, focus: 'SDKs, docs, DX' },
|
|
84
|
+
{ name: 'Design', headcount: 2 },
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'Developer Relations',
|
|
89
|
+
headcount: 6,
|
|
90
|
+
budget: 800000,
|
|
91
|
+
teams: [
|
|
92
|
+
{ name: 'DevRel', headcount: 4, focus: 'Community & advocacy' },
|
|
93
|
+
{ name: 'Technical Writing', headcount: 2 },
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: 'Sales',
|
|
98
|
+
headcount: 10,
|
|
99
|
+
budget: 1500000,
|
|
100
|
+
teams: [
|
|
101
|
+
{ name: 'Enterprise Sales', headcount: 5 },
|
|
102
|
+
{ name: 'Self-Serve Growth', headcount: 3 },
|
|
103
|
+
{ name: 'Solutions Engineering', headcount: 2 },
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'Support',
|
|
108
|
+
headcount: 8,
|
|
109
|
+
budget: 700000,
|
|
110
|
+
teams: [
|
|
111
|
+
{ name: 'Technical Support', headcount: 5 },
|
|
112
|
+
{ name: 'Success Engineering', headcount: 3 },
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
// =============================================================================
|
|
120
|
+
// 2. VISION & GOALS
|
|
121
|
+
// =============================================================================
|
|
122
|
+
|
|
123
|
+
export const APIHubVision = Vision({
|
|
124
|
+
statement: 'Power the connected economy by being the universal API layer for businesses',
|
|
125
|
+
timeHorizon: '2028',
|
|
126
|
+
pillars: [
|
|
127
|
+
'Developer Experience Excellence',
|
|
128
|
+
'Platform Reliability',
|
|
129
|
+
'Integration Ecosystem',
|
|
130
|
+
'Enterprise Security',
|
|
131
|
+
],
|
|
132
|
+
successIndicators: [
|
|
133
|
+
{ name: 'API Calls/Month', target: 100000000000, unit: 'calls' },
|
|
134
|
+
{ name: 'Active Developers', target: 500000 },
|
|
135
|
+
{ name: 'Enterprise Customers', target: 2000 },
|
|
136
|
+
{ name: 'Platform Uptime', target: 99.99, unit: '%' },
|
|
137
|
+
],
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
export const APIHubGoals = Goals([
|
|
141
|
+
{
|
|
142
|
+
name: 'Reach 10B Monthly API Calls',
|
|
143
|
+
category: 'product',
|
|
144
|
+
status: 'in-progress',
|
|
145
|
+
progress: 65,
|
|
146
|
+
dueDate: new Date('2024-12-31'),
|
|
147
|
+
owner: 'VP Engineering',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: 'Launch 50 New Integrations',
|
|
151
|
+
category: 'product',
|
|
152
|
+
status: 'in-progress',
|
|
153
|
+
progress: 40,
|
|
154
|
+
dueDate: new Date('2024-06-30'),
|
|
155
|
+
owner: 'Integrations Lead',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: 'Achieve SOC 2 Type II',
|
|
159
|
+
category: 'operational',
|
|
160
|
+
status: 'in-progress',
|
|
161
|
+
progress: 75,
|
|
162
|
+
dueDate: new Date('2024-03-31'),
|
|
163
|
+
owner: 'Security Lead',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'Grow Developer Community to 100K',
|
|
167
|
+
category: 'growth',
|
|
168
|
+
status: 'in-progress',
|
|
169
|
+
progress: 55,
|
|
170
|
+
dueDate: new Date('2024-09-30'),
|
|
171
|
+
owner: 'DevRel Lead',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: '$20M ARR',
|
|
175
|
+
category: 'financial',
|
|
176
|
+
status: 'in-progress',
|
|
177
|
+
progress: 70,
|
|
178
|
+
dueDate: new Date('2024-12-31'),
|
|
179
|
+
owner: 'CEO',
|
|
180
|
+
},
|
|
181
|
+
])
|
|
182
|
+
|
|
183
|
+
// =============================================================================
|
|
184
|
+
// 3. PRODUCTS & PRICING
|
|
185
|
+
// =============================================================================
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Core API Products
|
|
189
|
+
*/
|
|
190
|
+
export const APIGateway = Product({
|
|
191
|
+
name: 'APIHub Gateway',
|
|
192
|
+
description: 'Unified API gateway with routing, rate limiting, and analytics',
|
|
193
|
+
pricingModel: 'usage-based',
|
|
194
|
+
features: [
|
|
195
|
+
'API routing & load balancing',
|
|
196
|
+
'Rate limiting & throttling',
|
|
197
|
+
'Request/response transformation',
|
|
198
|
+
'Analytics & monitoring',
|
|
199
|
+
'API versioning',
|
|
200
|
+
'Caching',
|
|
201
|
+
'Circuit breaker',
|
|
202
|
+
],
|
|
203
|
+
roadmap: [
|
|
204
|
+
{ name: 'GraphQL Support', status: 'in-progress', priority: 'high', targetDate: new Date('2024-Q1') },
|
|
205
|
+
{ name: 'gRPC Gateway', status: 'planned', priority: 'medium', targetDate: new Date('2024-Q2') },
|
|
206
|
+
{ name: 'AI-Powered Rate Limiting', status: 'planned', priority: 'medium', targetDate: new Date('2024-Q3') },
|
|
207
|
+
],
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
export const IntegrationsHub = Product({
|
|
211
|
+
name: 'Integrations Hub',
|
|
212
|
+
description: 'Pre-built connectors to 200+ third-party APIs',
|
|
213
|
+
pricingModel: 'subscription',
|
|
214
|
+
features: [
|
|
215
|
+
'200+ pre-built integrations',
|
|
216
|
+
'Unified data models',
|
|
217
|
+
'Webhook management',
|
|
218
|
+
'OAuth flow handling',
|
|
219
|
+
'Data transformation',
|
|
220
|
+
'Error handling & retries',
|
|
221
|
+
],
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
export const APIAnalytics = Product({
|
|
225
|
+
name: 'API Analytics',
|
|
226
|
+
description: 'Real-time API monitoring, debugging, and insights',
|
|
227
|
+
pricingModel: 'usage-based',
|
|
228
|
+
features: [
|
|
229
|
+
'Real-time dashboards',
|
|
230
|
+
'Request tracing',
|
|
231
|
+
'Error analysis',
|
|
232
|
+
'Performance metrics',
|
|
233
|
+
'Usage patterns',
|
|
234
|
+
'Alerting',
|
|
235
|
+
],
|
|
236
|
+
})
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Usage-based Pricing
|
|
240
|
+
*/
|
|
241
|
+
export const Pricing = {
|
|
242
|
+
free: {
|
|
243
|
+
name: 'Free',
|
|
244
|
+
monthlyApiCalls: 10000,
|
|
245
|
+
price: 0,
|
|
246
|
+
features: ['10K API calls/month', 'Community support', '5 integrations'],
|
|
247
|
+
},
|
|
248
|
+
developer: {
|
|
249
|
+
name: 'Developer',
|
|
250
|
+
monthlyApiCalls: 1000000,
|
|
251
|
+
price: 49, // base
|
|
252
|
+
overage: 0.0001, // per call over limit
|
|
253
|
+
features: ['1M API calls/month', 'Email support', '50 integrations', 'Analytics'],
|
|
254
|
+
},
|
|
255
|
+
team: {
|
|
256
|
+
name: 'Team',
|
|
257
|
+
monthlyApiCalls: 10000000,
|
|
258
|
+
price: 299, // base
|
|
259
|
+
overage: 0.00005, // per call over limit
|
|
260
|
+
features: ['10M API calls/month', 'Priority support', 'All integrations', 'Team management'],
|
|
261
|
+
},
|
|
262
|
+
enterprise: {
|
|
263
|
+
name: 'Enterprise',
|
|
264
|
+
monthlyApiCalls: 'unlimited',
|
|
265
|
+
price: 'custom',
|
|
266
|
+
features: ['Unlimited API calls', 'Dedicated support', 'SLA', 'SSO', 'Custom integrations', 'VPC deployment'],
|
|
267
|
+
},
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Calculate monthly bill for usage
|
|
272
|
+
*/
|
|
273
|
+
export function calculateMonthlyBill(plan: keyof typeof Pricing, apiCalls: number): number {
|
|
274
|
+
const pricing = Pricing[plan]
|
|
275
|
+
if (pricing.price === 'custom' || pricing.price === 0) return pricing.price === 0 ? 0 : -1
|
|
276
|
+
|
|
277
|
+
const base = pricing.price as number
|
|
278
|
+
const limit = pricing.monthlyApiCalls as number
|
|
279
|
+
const overage = 'overage' in pricing ? pricing.overage as number : 0
|
|
280
|
+
|
|
281
|
+
if (apiCalls <= limit) return base
|
|
282
|
+
return base + (apiCalls - limit) * overage
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// =============================================================================
|
|
286
|
+
// 4. ORGANIZATION & ROLES
|
|
287
|
+
// =============================================================================
|
|
288
|
+
|
|
289
|
+
export const APIHubOrg: Organization = {
|
|
290
|
+
id: 'apihub',
|
|
291
|
+
name: 'APIHub Inc.',
|
|
292
|
+
settings: {
|
|
293
|
+
timezone: 'America/New_York',
|
|
294
|
+
currency: 'USD',
|
|
295
|
+
fiscalYearStart: 1,
|
|
296
|
+
},
|
|
297
|
+
departments: [
|
|
298
|
+
{
|
|
299
|
+
id: 'engineering',
|
|
300
|
+
name: 'Engineering',
|
|
301
|
+
permissions: {
|
|
302
|
+
code: ['read', 'write', 'deploy'],
|
|
303
|
+
infrastructure: ['read', 'write', 'manage'],
|
|
304
|
+
api: ['read', 'write', 'manage'],
|
|
305
|
+
},
|
|
306
|
+
teams: [
|
|
307
|
+
{
|
|
308
|
+
id: 'api-platform',
|
|
309
|
+
name: 'API Platform',
|
|
310
|
+
positions: [
|
|
311
|
+
{ id: 'api-lead', title: 'API Platform Lead', roleId: 'staff-engineer', reportsTo: 'eng-vp' },
|
|
312
|
+
{ id: 'api-eng-1', title: 'Senior API Engineer', roleId: 'senior-engineer', reportsTo: 'api-lead' },
|
|
313
|
+
{ id: 'api-eng-2', title: 'API Engineer', roleId: 'engineer', reportsTo: 'api-lead' },
|
|
314
|
+
],
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
id: 'integrations',
|
|
318
|
+
name: 'Integrations',
|
|
319
|
+
positions: [
|
|
320
|
+
{ id: 'int-lead', title: 'Integrations Lead', roleId: 'senior-engineer', reportsTo: 'eng-vp' },
|
|
321
|
+
],
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
id: 'sre',
|
|
325
|
+
name: 'Site Reliability',
|
|
326
|
+
positions: [
|
|
327
|
+
{ id: 'sre-lead', title: 'SRE Lead', roleId: 'sre', reportsTo: 'eng-vp' },
|
|
328
|
+
],
|
|
329
|
+
},
|
|
330
|
+
],
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
id: 'devrel',
|
|
334
|
+
name: 'Developer Relations',
|
|
335
|
+
permissions: {
|
|
336
|
+
docs: ['read', 'write', 'publish'],
|
|
337
|
+
community: ['read', 'write', 'moderate'],
|
|
338
|
+
content: ['read', 'write', 'publish'],
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
],
|
|
342
|
+
roles: [
|
|
343
|
+
createBusinessRole({
|
|
344
|
+
id: 'staff-engineer',
|
|
345
|
+
name: 'Staff Engineer',
|
|
346
|
+
type: 'engineer',
|
|
347
|
+
level: 7,
|
|
348
|
+
permissions: {
|
|
349
|
+
code: ['read', 'write', 'review', 'merge', 'deploy'],
|
|
350
|
+
architecture: ['read', 'write', 'approve'],
|
|
351
|
+
oncall: ['read', 'write', 'escalate'],
|
|
352
|
+
},
|
|
353
|
+
canHandle: ['architecture', 'incident-commander', 'code-review'],
|
|
354
|
+
canApprove: ['architecture-decision', 'major-release'],
|
|
355
|
+
}),
|
|
356
|
+
createBusinessRole({
|
|
357
|
+
id: 'senior-engineer',
|
|
358
|
+
name: 'Senior Engineer',
|
|
359
|
+
type: 'engineer',
|
|
360
|
+
level: 5,
|
|
361
|
+
permissions: {
|
|
362
|
+
code: ['read', 'write', 'review', 'merge'],
|
|
363
|
+
deployments: ['read', 'write'],
|
|
364
|
+
},
|
|
365
|
+
canHandle: ['coding', 'code-review', 'feature-design'],
|
|
366
|
+
canApprove: ['pull-request'],
|
|
367
|
+
}),
|
|
368
|
+
createBusinessRole({
|
|
369
|
+
id: 'engineer',
|
|
370
|
+
name: 'Engineer',
|
|
371
|
+
type: 'engineer',
|
|
372
|
+
level: 3,
|
|
373
|
+
permissions: {
|
|
374
|
+
code: ['read', 'write'],
|
|
375
|
+
deployments: ['read'],
|
|
376
|
+
},
|
|
377
|
+
canHandle: ['coding', 'bug-fix'],
|
|
378
|
+
}),
|
|
379
|
+
createBusinessRole({
|
|
380
|
+
id: 'sre',
|
|
381
|
+
name: 'Site Reliability Engineer',
|
|
382
|
+
type: 'engineer',
|
|
383
|
+
level: 5,
|
|
384
|
+
permissions: {
|
|
385
|
+
infrastructure: ['read', 'write', 'manage'],
|
|
386
|
+
deployments: ['read', 'write', 'rollback'],
|
|
387
|
+
oncall: ['read', 'write', 'escalate'],
|
|
388
|
+
},
|
|
389
|
+
canHandle: ['incident-response', 'capacity-planning', 'deployment'],
|
|
390
|
+
}),
|
|
391
|
+
createBusinessRole({
|
|
392
|
+
id: 'devrel',
|
|
393
|
+
name: 'Developer Advocate',
|
|
394
|
+
type: 'support',
|
|
395
|
+
level: 4,
|
|
396
|
+
permissions: {
|
|
397
|
+
docs: ['read', 'write', 'publish'],
|
|
398
|
+
community: ['read', 'write', 'moderate'],
|
|
399
|
+
samples: ['read', 'write', 'publish'],
|
|
400
|
+
},
|
|
401
|
+
canHandle: ['documentation', 'sample-code', 'community-support', 'conference-talk'],
|
|
402
|
+
}),
|
|
403
|
+
createBusinessRole({
|
|
404
|
+
id: 'solutions-engineer',
|
|
405
|
+
name: 'Solutions Engineer',
|
|
406
|
+
type: 'support',
|
|
407
|
+
level: 5,
|
|
408
|
+
permissions: {
|
|
409
|
+
customers: ['read', 'write'],
|
|
410
|
+
code: ['read'],
|
|
411
|
+
integrations: ['read', 'write'],
|
|
412
|
+
},
|
|
413
|
+
canHandle: ['technical-demo', 'poc', 'integration-support', 'architecture-review'],
|
|
414
|
+
}),
|
|
415
|
+
createBusinessRole({
|
|
416
|
+
id: 'support-bot',
|
|
417
|
+
name: 'Support Bot',
|
|
418
|
+
type: 'agent',
|
|
419
|
+
level: 1,
|
|
420
|
+
workerType: 'ai',
|
|
421
|
+
permissions: {
|
|
422
|
+
docs: ['read'],
|
|
423
|
+
customers: ['read'],
|
|
424
|
+
support: ['read', 'write'],
|
|
425
|
+
},
|
|
426
|
+
canHandle: ['documentation-query', 'status-check', 'basic-troubleshooting'],
|
|
427
|
+
}),
|
|
428
|
+
],
|
|
429
|
+
approvalChains: [
|
|
430
|
+
{
|
|
431
|
+
id: 'api-change',
|
|
432
|
+
name: 'API Change Approval',
|
|
433
|
+
requestType: 'api-change',
|
|
434
|
+
levels: [
|
|
435
|
+
{ threshold: 1, approvers: [{ type: 'role', roleId: 'senior-engineer' }] }, // Minor
|
|
436
|
+
{ threshold: 2, approvers: [{ type: 'role', roleId: 'staff-engineer' }] }, // Major
|
|
437
|
+
{ threshold: 3, approvers: [{ type: 'department-head' }] }, // Breaking
|
|
438
|
+
],
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
id: 'integration-publish',
|
|
442
|
+
name: 'Integration Publish',
|
|
443
|
+
requestType: 'integration-publish',
|
|
444
|
+
levels: [
|
|
445
|
+
{ threshold: Infinity, approvers: [{ type: 'role', roleId: 'senior-engineer' }, { type: 'role', roleId: 'devrel' }] },
|
|
446
|
+
],
|
|
447
|
+
},
|
|
448
|
+
],
|
|
449
|
+
routingRules: [
|
|
450
|
+
{
|
|
451
|
+
id: 'basic-support',
|
|
452
|
+
taskType: 'documentation-query',
|
|
453
|
+
priority: 1,
|
|
454
|
+
assignTo: { roleId: 'support-bot' },
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
id: 'technical-support',
|
|
458
|
+
taskType: 'integration-issue',
|
|
459
|
+
priority: 2,
|
|
460
|
+
assignTo: { roleId: 'solutions-engineer' },
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
id: 'incident',
|
|
464
|
+
taskType: 'incident',
|
|
465
|
+
priority: 1,
|
|
466
|
+
assignTo: { roleId: 'sre' },
|
|
467
|
+
},
|
|
468
|
+
],
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// =============================================================================
|
|
472
|
+
// 5. KPIs & METRICS
|
|
473
|
+
// =============================================================================
|
|
474
|
+
|
|
475
|
+
export const APIHubKPIs = kpis([
|
|
476
|
+
// Platform Metrics
|
|
477
|
+
{
|
|
478
|
+
name: 'Monthly API Calls',
|
|
479
|
+
category: 'operational',
|
|
480
|
+
target: 10000000000,
|
|
481
|
+
current: 6500000000,
|
|
482
|
+
frequency: 'monthly',
|
|
483
|
+
owner: 'VP Engineering',
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
name: 'API Uptime',
|
|
487
|
+
category: 'operational',
|
|
488
|
+
target: 99.99,
|
|
489
|
+
current: 99.97,
|
|
490
|
+
unit: '%',
|
|
491
|
+
frequency: 'monthly',
|
|
492
|
+
owner: 'SRE Lead',
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
name: 'P99 Latency',
|
|
496
|
+
category: 'operational',
|
|
497
|
+
target: 50,
|
|
498
|
+
current: 45,
|
|
499
|
+
unit: 'ms',
|
|
500
|
+
frequency: 'daily',
|
|
501
|
+
owner: 'API Platform Lead',
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
name: 'Error Rate',
|
|
505
|
+
category: 'operational',
|
|
506
|
+
target: 0.1,
|
|
507
|
+
current: 0.08,
|
|
508
|
+
unit: '%',
|
|
509
|
+
frequency: 'daily',
|
|
510
|
+
owner: 'API Platform Lead',
|
|
511
|
+
},
|
|
512
|
+
// Developer Metrics
|
|
513
|
+
{
|
|
514
|
+
name: 'Active Developers',
|
|
515
|
+
category: 'customer',
|
|
516
|
+
target: 100000,
|
|
517
|
+
current: 65000,
|
|
518
|
+
frequency: 'monthly',
|
|
519
|
+
owner: 'DevRel Lead',
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
name: 'Developer NPS',
|
|
523
|
+
category: 'customer',
|
|
524
|
+
target: 70,
|
|
525
|
+
current: 65,
|
|
526
|
+
frequency: 'quarterly',
|
|
527
|
+
owner: 'VP Product',
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
name: 'Time to First API Call',
|
|
531
|
+
category: 'customer',
|
|
532
|
+
target: 5,
|
|
533
|
+
current: 7,
|
|
534
|
+
unit: 'minutes',
|
|
535
|
+
frequency: 'weekly',
|
|
536
|
+
owner: 'DX Lead',
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
name: 'Documentation Coverage',
|
|
540
|
+
category: 'operational',
|
|
541
|
+
target: 100,
|
|
542
|
+
current: 92,
|
|
543
|
+
unit: '%',
|
|
544
|
+
frequency: 'monthly',
|
|
545
|
+
owner: 'Tech Writing Lead',
|
|
546
|
+
},
|
|
547
|
+
// Revenue Metrics
|
|
548
|
+
{
|
|
549
|
+
name: 'MRR',
|
|
550
|
+
category: 'financial',
|
|
551
|
+
target: 1500000,
|
|
552
|
+
current: 1170000,
|
|
553
|
+
unit: 'USD',
|
|
554
|
+
frequency: 'monthly',
|
|
555
|
+
owner: 'CEO',
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
name: 'Net Revenue Retention',
|
|
559
|
+
category: 'financial',
|
|
560
|
+
target: 130,
|
|
561
|
+
current: 125,
|
|
562
|
+
unit: '%',
|
|
563
|
+
frequency: 'monthly',
|
|
564
|
+
owner: 'VP Sales',
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
name: 'Free to Paid Conversion',
|
|
568
|
+
category: 'sales',
|
|
569
|
+
target: 5,
|
|
570
|
+
current: 3.8,
|
|
571
|
+
unit: '%',
|
|
572
|
+
frequency: 'monthly',
|
|
573
|
+
owner: 'Growth Lead',
|
|
574
|
+
},
|
|
575
|
+
])
|
|
576
|
+
|
|
577
|
+
// =============================================================================
|
|
578
|
+
// 6. OKRs
|
|
579
|
+
// =============================================================================
|
|
580
|
+
|
|
581
|
+
export const APIHubOKRs = okrs([
|
|
582
|
+
{
|
|
583
|
+
objective: 'Build the Best Developer Experience in API Tools',
|
|
584
|
+
owner: 'VP Product',
|
|
585
|
+
period: 'Q1 2024',
|
|
586
|
+
keyResults: [
|
|
587
|
+
{
|
|
588
|
+
description: 'Achieve Time to First API Call under 5 minutes',
|
|
589
|
+
metric: 'TTFAC',
|
|
590
|
+
targetValue: 5,
|
|
591
|
+
currentValue: 7,
|
|
592
|
+
unit: 'minutes',
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
description: 'Launch SDK for 5 new languages',
|
|
596
|
+
metric: 'SDKs Launched',
|
|
597
|
+
targetValue: 5,
|
|
598
|
+
currentValue: 2,
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
description: 'Reach Developer NPS of 70',
|
|
602
|
+
metric: 'Developer NPS',
|
|
603
|
+
targetValue: 70,
|
|
604
|
+
currentValue: 65,
|
|
605
|
+
},
|
|
606
|
+
],
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
objective: 'Achieve Platform Reliability Excellence',
|
|
610
|
+
owner: 'VP Engineering',
|
|
611
|
+
period: 'Q1 2024',
|
|
612
|
+
keyResults: [
|
|
613
|
+
{
|
|
614
|
+
description: 'Maintain 99.99% uptime',
|
|
615
|
+
metric: 'Uptime',
|
|
616
|
+
targetValue: 99.99,
|
|
617
|
+
currentValue: 99.97,
|
|
618
|
+
unit: '%',
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
description: 'Reduce P99 latency to 30ms',
|
|
622
|
+
metric: 'P99 Latency',
|
|
623
|
+
targetValue: 30,
|
|
624
|
+
currentValue: 45,
|
|
625
|
+
unit: 'ms',
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
description: 'Implement multi-region failover',
|
|
629
|
+
metric: 'Regions with Failover',
|
|
630
|
+
targetValue: 3,
|
|
631
|
+
currentValue: 1,
|
|
632
|
+
},
|
|
633
|
+
],
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
objective: 'Expand Integration Ecosystem',
|
|
637
|
+
owner: 'Integrations Lead',
|
|
638
|
+
period: 'Q1 2024',
|
|
639
|
+
keyResults: [
|
|
640
|
+
{
|
|
641
|
+
description: 'Launch 25 new integrations',
|
|
642
|
+
metric: 'Integrations Launched',
|
|
643
|
+
targetValue: 25,
|
|
644
|
+
currentValue: 12,
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
description: 'Achieve 95% integration test coverage',
|
|
648
|
+
metric: 'Test Coverage',
|
|
649
|
+
targetValue: 95,
|
|
650
|
+
currentValue: 82,
|
|
651
|
+
unit: '%',
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
description: 'Partner with 5 major API providers',
|
|
655
|
+
metric: 'Partnerships Signed',
|
|
656
|
+
targetValue: 5,
|
|
657
|
+
currentValue: 2,
|
|
658
|
+
},
|
|
659
|
+
],
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
objective: 'Scale Developer Community',
|
|
663
|
+
owner: 'DevRel Lead',
|
|
664
|
+
period: 'Q1 2024',
|
|
665
|
+
keyResults: [
|
|
666
|
+
{
|
|
667
|
+
description: 'Grow to 100K active developers',
|
|
668
|
+
metric: 'Active Developers',
|
|
669
|
+
targetValue: 100000,
|
|
670
|
+
currentValue: 65000,
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
description: 'Publish 50 technical tutorials',
|
|
674
|
+
metric: 'Tutorials Published',
|
|
675
|
+
targetValue: 50,
|
|
676
|
+
currentValue: 28,
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
description: 'Speak at 10 developer conferences',
|
|
680
|
+
metric: 'Conference Talks',
|
|
681
|
+
targetValue: 10,
|
|
682
|
+
currentValue: 4,
|
|
683
|
+
},
|
|
684
|
+
],
|
|
685
|
+
},
|
|
686
|
+
])
|
|
687
|
+
|
|
688
|
+
// =============================================================================
|
|
689
|
+
// 7. PROCESSES
|
|
690
|
+
// =============================================================================
|
|
691
|
+
|
|
692
|
+
export const IntegrationDevelopmentProcess = Process({
|
|
693
|
+
name: 'Integration Development',
|
|
694
|
+
description: 'Process for building and launching new API integrations',
|
|
695
|
+
owner: 'Integrations Lead',
|
|
696
|
+
steps: [
|
|
697
|
+
{
|
|
698
|
+
order: 1,
|
|
699
|
+
name: 'API Research',
|
|
700
|
+
description: 'Research target API documentation and capabilities',
|
|
701
|
+
automationLevel: 'manual',
|
|
702
|
+
duration: '2 days',
|
|
703
|
+
owner: 'Integration Engineer',
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
order: 2,
|
|
707
|
+
name: 'Schema Design',
|
|
708
|
+
description: 'Design unified schema and data model',
|
|
709
|
+
automationLevel: 'manual',
|
|
710
|
+
duration: '1 day',
|
|
711
|
+
owner: 'Integration Engineer',
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
order: 3,
|
|
715
|
+
name: 'Implementation',
|
|
716
|
+
description: 'Build the integration connector',
|
|
717
|
+
automationLevel: 'manual',
|
|
718
|
+
duration: '1 week',
|
|
719
|
+
owner: 'Integration Engineer',
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
order: 4,
|
|
723
|
+
name: 'Testing',
|
|
724
|
+
description: 'Write and run integration tests',
|
|
725
|
+
automationLevel: 'semi-automated',
|
|
726
|
+
duration: '2 days',
|
|
727
|
+
owner: 'Integration Engineer',
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
order: 5,
|
|
731
|
+
name: 'Documentation',
|
|
732
|
+
description: 'Write API documentation and guides',
|
|
733
|
+
automationLevel: 'manual',
|
|
734
|
+
duration: '1 day',
|
|
735
|
+
owner: 'Technical Writer',
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
order: 6,
|
|
739
|
+
name: 'Security Review',
|
|
740
|
+
description: 'Security and compliance review',
|
|
741
|
+
automationLevel: 'manual',
|
|
742
|
+
duration: '2 days',
|
|
743
|
+
owner: 'Security Engineer',
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
order: 7,
|
|
747
|
+
name: 'Beta Release',
|
|
748
|
+
description: 'Release to beta customers',
|
|
749
|
+
automationLevel: 'automated',
|
|
750
|
+
duration: '1 week',
|
|
751
|
+
},
|
|
752
|
+
{
|
|
753
|
+
order: 8,
|
|
754
|
+
name: 'GA Release',
|
|
755
|
+
description: 'General availability release',
|
|
756
|
+
automationLevel: 'semi-automated',
|
|
757
|
+
duration: '1 day',
|
|
758
|
+
},
|
|
759
|
+
],
|
|
760
|
+
metrics: [
|
|
761
|
+
{ name: 'Time to Ship', target: 3, unit: 'weeks' },
|
|
762
|
+
{ name: 'Test Coverage', target: 95, unit: '%' },
|
|
763
|
+
{ name: 'Documentation Completeness', target: 100, unit: '%' },
|
|
764
|
+
],
|
|
765
|
+
})
|
|
766
|
+
|
|
767
|
+
export const IncidentResponseProcess = Process({
|
|
768
|
+
name: 'Incident Response',
|
|
769
|
+
description: 'Handle production incidents efficiently',
|
|
770
|
+
owner: 'SRE Lead',
|
|
771
|
+
steps: [
|
|
772
|
+
{
|
|
773
|
+
order: 1,
|
|
774
|
+
name: 'Detection',
|
|
775
|
+
description: 'Automated alerting detects incident',
|
|
776
|
+
automationLevel: 'automated',
|
|
777
|
+
duration: '1 minute',
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
order: 2,
|
|
781
|
+
name: 'Triage',
|
|
782
|
+
description: 'On-call determines severity',
|
|
783
|
+
automationLevel: 'manual',
|
|
784
|
+
duration: '5 minutes',
|
|
785
|
+
owner: 'SRE On-Call',
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
order: 3,
|
|
789
|
+
name: 'Notification',
|
|
790
|
+
description: 'Notify stakeholders based on severity',
|
|
791
|
+
automationLevel: 'automated',
|
|
792
|
+
duration: 'instant',
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
order: 4,
|
|
796
|
+
name: 'Investigation',
|
|
797
|
+
description: 'Root cause analysis',
|
|
798
|
+
automationLevel: 'manual',
|
|
799
|
+
duration: '15 minutes',
|
|
800
|
+
owner: 'SRE On-Call',
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
order: 5,
|
|
804
|
+
name: 'Mitigation',
|
|
805
|
+
description: 'Apply fix or workaround',
|
|
806
|
+
automationLevel: 'manual',
|
|
807
|
+
duration: '30 minutes',
|
|
808
|
+
owner: 'SRE On-Call',
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
order: 6,
|
|
812
|
+
name: 'Resolution',
|
|
813
|
+
description: 'Confirm service restored',
|
|
814
|
+
automationLevel: 'semi-automated',
|
|
815
|
+
duration: '10 minutes',
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
order: 7,
|
|
819
|
+
name: 'Communication',
|
|
820
|
+
description: 'Update status page and notify customers',
|
|
821
|
+
automationLevel: 'semi-automated',
|
|
822
|
+
duration: '5 minutes',
|
|
823
|
+
},
|
|
824
|
+
{
|
|
825
|
+
order: 8,
|
|
826
|
+
name: 'Postmortem',
|
|
827
|
+
description: 'Blameless postmortem within 48 hours',
|
|
828
|
+
automationLevel: 'manual',
|
|
829
|
+
duration: '2 hours',
|
|
830
|
+
owner: 'Incident Commander',
|
|
831
|
+
},
|
|
832
|
+
],
|
|
833
|
+
metrics: [
|
|
834
|
+
{ name: 'MTTD (Mean Time to Detect)', target: 1, unit: 'minutes' },
|
|
835
|
+
{ name: 'MTTR (Mean Time to Resolve)', target: 30, unit: 'minutes' },
|
|
836
|
+
{ name: 'Postmortem Completion Rate', target: 100, unit: '%' },
|
|
837
|
+
],
|
|
838
|
+
})
|
|
839
|
+
|
|
840
|
+
export const DeveloperOnboardingProcess = Process({
|
|
841
|
+
name: 'Developer Onboarding',
|
|
842
|
+
description: 'Get developers to first successful API call',
|
|
843
|
+
owner: 'DX Lead',
|
|
844
|
+
steps: [
|
|
845
|
+
{
|
|
846
|
+
order: 1,
|
|
847
|
+
name: 'Signup',
|
|
848
|
+
description: 'Developer creates account',
|
|
849
|
+
automationLevel: 'automated',
|
|
850
|
+
duration: '30 seconds',
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
order: 2,
|
|
854
|
+
name: 'API Key Generation',
|
|
855
|
+
description: 'Generate API credentials',
|
|
856
|
+
automationLevel: 'automated',
|
|
857
|
+
duration: 'instant',
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
order: 3,
|
|
861
|
+
name: 'SDK Selection',
|
|
862
|
+
description: 'Choose language SDK',
|
|
863
|
+
automationLevel: 'semi-automated',
|
|
864
|
+
duration: '1 minute',
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
order: 4,
|
|
868
|
+
name: 'Quick Start',
|
|
869
|
+
description: 'Interactive quick start guide',
|
|
870
|
+
automationLevel: 'semi-automated',
|
|
871
|
+
duration: '3 minutes',
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
order: 5,
|
|
875
|
+
name: 'First API Call',
|
|
876
|
+
description: 'Make first successful API call',
|
|
877
|
+
automationLevel: 'semi-automated',
|
|
878
|
+
duration: '2 minutes',
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
order: 6,
|
|
882
|
+
name: 'Explore',
|
|
883
|
+
description: 'Explore additional features',
|
|
884
|
+
automationLevel: 'semi-automated',
|
|
885
|
+
duration: '10 minutes',
|
|
886
|
+
},
|
|
887
|
+
],
|
|
888
|
+
metrics: [
|
|
889
|
+
{ name: 'Time to First API Call', target: 5, unit: 'minutes' },
|
|
890
|
+
{ name: 'Signup to First Call Conversion', target: 80, unit: '%' },
|
|
891
|
+
{ name: 'Week 1 Retention', target: 50, unit: '%' },
|
|
892
|
+
],
|
|
893
|
+
})
|
|
894
|
+
|
|
895
|
+
// =============================================================================
|
|
896
|
+
// 8. WORKFLOWS
|
|
897
|
+
// =============================================================================
|
|
898
|
+
|
|
899
|
+
export const UsageAlertWorkflow = Workflow({
|
|
900
|
+
name: 'Usage Alert',
|
|
901
|
+
description: 'Alert customers approaching rate limits',
|
|
902
|
+
trigger: { type: 'event', event: 'usage.threshold_reached' },
|
|
903
|
+
actions: [
|
|
904
|
+
{
|
|
905
|
+
order: 1,
|
|
906
|
+
type: 'condition',
|
|
907
|
+
name: 'Check Usage Level',
|
|
908
|
+
condition: 'usage.percent >= 80',
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
order: 2,
|
|
912
|
+
type: 'notification',
|
|
913
|
+
name: 'Email Developer',
|
|
914
|
+
config: {
|
|
915
|
+
template: 'usage_warning',
|
|
916
|
+
channel: 'email',
|
|
917
|
+
data: ['usage.current', 'usage.limit', 'usage.percent'],
|
|
918
|
+
},
|
|
919
|
+
},
|
|
920
|
+
{
|
|
921
|
+
order: 3,
|
|
922
|
+
type: 'condition',
|
|
923
|
+
name: 'Check Critical Level',
|
|
924
|
+
condition: 'usage.percent >= 95',
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
order: 4,
|
|
928
|
+
type: 'notification',
|
|
929
|
+
name: 'Slack Alert',
|
|
930
|
+
config: {
|
|
931
|
+
template: 'usage_critical',
|
|
932
|
+
channel: 'slack',
|
|
933
|
+
priority: 'high',
|
|
934
|
+
},
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
order: 5,
|
|
938
|
+
type: 'task',
|
|
939
|
+
name: 'Create Upsell Opportunity',
|
|
940
|
+
config: {
|
|
941
|
+
type: 'upsell-opportunity',
|
|
942
|
+
assignTo: 'account-manager',
|
|
943
|
+
data: ['customer.id', 'usage.current', 'recommended_plan'],
|
|
944
|
+
},
|
|
945
|
+
},
|
|
946
|
+
],
|
|
947
|
+
})
|
|
948
|
+
|
|
949
|
+
export const IncidentAlertWorkflow = Workflow({
|
|
950
|
+
name: 'Incident Alert',
|
|
951
|
+
description: 'Automated incident detection and response',
|
|
952
|
+
trigger: { type: 'event', event: 'monitor.alert_triggered' },
|
|
953
|
+
actions: [
|
|
954
|
+
{
|
|
955
|
+
order: 1,
|
|
956
|
+
type: 'compute',
|
|
957
|
+
name: 'Determine Severity',
|
|
958
|
+
config: {
|
|
959
|
+
rules: [
|
|
960
|
+
{ condition: 'errorRate > 10', severity: 'critical' },
|
|
961
|
+
{ condition: 'errorRate > 5', severity: 'high' },
|
|
962
|
+
{ condition: 'errorRate > 1', severity: 'medium' },
|
|
963
|
+
{ condition: 'true', severity: 'low' },
|
|
964
|
+
],
|
|
965
|
+
},
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
order: 2,
|
|
969
|
+
type: 'notification',
|
|
970
|
+
name: 'Page On-Call',
|
|
971
|
+
config: {
|
|
972
|
+
channel: 'pagerduty',
|
|
973
|
+
severity: '${severity}',
|
|
974
|
+
},
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
order: 3,
|
|
978
|
+
type: 'task',
|
|
979
|
+
name: 'Create Incident',
|
|
980
|
+
config: {
|
|
981
|
+
type: 'incident',
|
|
982
|
+
severity: '${severity}',
|
|
983
|
+
assignTo: 'sre-oncall',
|
|
984
|
+
},
|
|
985
|
+
},
|
|
986
|
+
{
|
|
987
|
+
order: 4,
|
|
988
|
+
type: 'condition',
|
|
989
|
+
name: 'Check Severity Critical',
|
|
990
|
+
condition: 'severity == "critical"',
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
order: 5,
|
|
994
|
+
type: 'notification',
|
|
995
|
+
name: 'Update Status Page',
|
|
996
|
+
config: {
|
|
997
|
+
channel: 'statuspage',
|
|
998
|
+
status: 'investigating',
|
|
999
|
+
component: '${affected_component}',
|
|
1000
|
+
},
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
order: 6,
|
|
1004
|
+
type: 'notification',
|
|
1005
|
+
name: 'Notify Leadership',
|
|
1006
|
+
config: {
|
|
1007
|
+
channel: 'slack',
|
|
1008
|
+
to: '#engineering-leadership',
|
|
1009
|
+
template: 'critical_incident',
|
|
1010
|
+
},
|
|
1011
|
+
},
|
|
1012
|
+
],
|
|
1013
|
+
})
|
|
1014
|
+
|
|
1015
|
+
export const NewDeveloperWorkflow = Workflow({
|
|
1016
|
+
name: 'New Developer Engagement',
|
|
1017
|
+
description: 'Onboard and engage new developers',
|
|
1018
|
+
trigger: { type: 'event', event: 'developer.signup' },
|
|
1019
|
+
actions: [
|
|
1020
|
+
{
|
|
1021
|
+
order: 1,
|
|
1022
|
+
type: 'notification',
|
|
1023
|
+
name: 'Welcome Email',
|
|
1024
|
+
config: { template: 'developer_welcome', channel: 'email' },
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
order: 2,
|
|
1028
|
+
type: 'wait',
|
|
1029
|
+
name: 'Wait 1 Day',
|
|
1030
|
+
duration: '1 day',
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
order: 3,
|
|
1034
|
+
type: 'condition',
|
|
1035
|
+
name: 'Check First API Call',
|
|
1036
|
+
condition: 'developer.apiCallCount == 0',
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
order: 4,
|
|
1040
|
+
type: 'notification',
|
|
1041
|
+
name: 'Getting Started Nudge',
|
|
1042
|
+
config: { template: 'getting_started', channel: 'email' },
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
order: 5,
|
|
1046
|
+
type: 'wait',
|
|
1047
|
+
name: 'Wait 3 Days',
|
|
1048
|
+
duration: '3 days',
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
order: 6,
|
|
1052
|
+
type: 'condition',
|
|
1053
|
+
name: 'Check Still Inactive',
|
|
1054
|
+
condition: 'developer.apiCallCount < 10',
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
order: 7,
|
|
1058
|
+
type: 'task',
|
|
1059
|
+
name: 'Assign DevRel Outreach',
|
|
1060
|
+
config: {
|
|
1061
|
+
type: 'developer-outreach',
|
|
1062
|
+
assignTo: 'devrel',
|
|
1063
|
+
},
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
order: 8,
|
|
1067
|
+
type: 'wait',
|
|
1068
|
+
name: 'Wait 7 Days',
|
|
1069
|
+
duration: '7 days',
|
|
1070
|
+
},
|
|
1071
|
+
{
|
|
1072
|
+
order: 9,
|
|
1073
|
+
type: 'condition',
|
|
1074
|
+
name: 'Check Active Developer',
|
|
1075
|
+
condition: 'developer.apiCallCount >= 100',
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
order: 10,
|
|
1079
|
+
type: 'notification',
|
|
1080
|
+
name: 'Power User Resources',
|
|
1081
|
+
config: { template: 'power_user_resources', channel: 'email' },
|
|
1082
|
+
},
|
|
1083
|
+
],
|
|
1084
|
+
})
|
|
1085
|
+
|
|
1086
|
+
// =============================================================================
|
|
1087
|
+
// 9. FINANCIALS
|
|
1088
|
+
// =============================================================================
|
|
1089
|
+
|
|
1090
|
+
export const APIHubFinancials = financials({
|
|
1091
|
+
revenue: 14040000, // ARR
|
|
1092
|
+
cogs: 3510000, // 25% (infrastructure heavy)
|
|
1093
|
+
operatingExpenses: 9000000,
|
|
1094
|
+
depreciation: 300000,
|
|
1095
|
+
interestExpense: 0,
|
|
1096
|
+
otherIncome: 50000,
|
|
1097
|
+
taxes: 200000,
|
|
1098
|
+
})
|
|
1099
|
+
|
|
1100
|
+
export const APIMetrics = {
|
|
1101
|
+
mrr: 1170000,
|
|
1102
|
+
arr: 14040000,
|
|
1103
|
+
developers: {
|
|
1104
|
+
total: 65000,
|
|
1105
|
+
active: 45000,
|
|
1106
|
+
paying: 3200,
|
|
1107
|
+
},
|
|
1108
|
+
apiCalls: {
|
|
1109
|
+
monthly: 6500000000,
|
|
1110
|
+
daily: 216666667,
|
|
1111
|
+
peakRps: 50000,
|
|
1112
|
+
},
|
|
1113
|
+
arpu: 365, // MRR / paying developers
|
|
1114
|
+
cac: 250,
|
|
1115
|
+
ltv: 4380, // 12 months avg * ARPU
|
|
1116
|
+
ltvToCac: 17.5,
|
|
1117
|
+
nrr: 125,
|
|
1118
|
+
freeToConversion: 3.8, // %
|
|
1119
|
+
infrastructureCostPerCall: 0.00004, // $
|
|
1120
|
+
grossMargin: 75, // %
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
// =============================================================================
|
|
1124
|
+
// 10. UTILITY FUNCTIONS
|
|
1125
|
+
// =============================================================================
|
|
1126
|
+
|
|
1127
|
+
export function getBusinessSummary() {
|
|
1128
|
+
return {
|
|
1129
|
+
company: APIHubBusiness,
|
|
1130
|
+
vision: APIHubVision,
|
|
1131
|
+
goals: APIHubGoals,
|
|
1132
|
+
products: { gateway: APIGateway, integrations: IntegrationsHub, analytics: APIAnalytics },
|
|
1133
|
+
kpis: APIHubKPIs,
|
|
1134
|
+
okrs: APIHubOKRs,
|
|
1135
|
+
financials: APIHubFinancials,
|
|
1136
|
+
metrics: APIMetrics,
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
export function getPlatformHealth() {
|
|
1141
|
+
return {
|
|
1142
|
+
uptime: `${APIMetrics.apiCalls.monthly > 0 ? 99.97 : 0}%`,
|
|
1143
|
+
latency: '45ms P99',
|
|
1144
|
+
errorRate: '0.08%',
|
|
1145
|
+
throughput: `${(APIMetrics.apiCalls.daily / 1000000).toFixed(0)}M calls/day`,
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
export function getDeveloperMetrics() {
|
|
1150
|
+
return {
|
|
1151
|
+
total: APIMetrics.developers.total.toLocaleString(),
|
|
1152
|
+
active: APIMetrics.developers.active.toLocaleString(),
|
|
1153
|
+
paying: APIMetrics.developers.paying.toLocaleString(),
|
|
1154
|
+
conversionRate: `${((APIMetrics.developers.paying / APIMetrics.developers.total) * 100).toFixed(2)}%`,
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
export default {
|
|
1159
|
+
business: APIHubBusiness,
|
|
1160
|
+
vision: APIHubVision,
|
|
1161
|
+
goals: APIHubGoals,
|
|
1162
|
+
products: { gateway: APIGateway, integrations: IntegrationsHub, analytics: APIAnalytics },
|
|
1163
|
+
pricing: Pricing,
|
|
1164
|
+
organization: APIHubOrg,
|
|
1165
|
+
kpis: APIHubKPIs,
|
|
1166
|
+
okrs: APIHubOKRs,
|
|
1167
|
+
processes: {
|
|
1168
|
+
integrationDevelopment: IntegrationDevelopmentProcess,
|
|
1169
|
+
incidentResponse: IncidentResponseProcess,
|
|
1170
|
+
developerOnboarding: DeveloperOnboardingProcess,
|
|
1171
|
+
},
|
|
1172
|
+
workflows: {
|
|
1173
|
+
usageAlert: UsageAlertWorkflow,
|
|
1174
|
+
incidentAlert: IncidentAlertWorkflow,
|
|
1175
|
+
newDeveloper: NewDeveloperWorkflow,
|
|
1176
|
+
},
|
|
1177
|
+
financials: APIHubFinancials,
|
|
1178
|
+
metrics: APIMetrics,
|
|
1179
|
+
}
|