services-as-software 0.1.0 → 2.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 +5 -0
- package/CHANGELOG.md +10 -0
- package/README.md +235 -225
- package/dist/client.d.ts +25 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +103 -0
- package/dist/client.js.map +1 -0
- package/dist/endpoint.d.ts +102 -0
- package/dist/endpoint.d.ts.map +1 -0
- package/dist/endpoint.js +96 -0
- package/dist/endpoint.js.map +1 -0
- package/dist/entities/billing.d.ts +60 -0
- package/dist/entities/billing.d.ts.map +1 -0
- package/dist/entities/billing.js +954 -0
- package/dist/entities/billing.js.map +1 -0
- package/dist/entities/customers.d.ts +45 -0
- package/dist/entities/customers.d.ts.map +1 -0
- package/dist/entities/customers.js +679 -0
- package/dist/entities/customers.js.map +1 -0
- package/dist/entities/delivery.d.ts +59 -0
- package/dist/entities/delivery.d.ts.map +1 -0
- package/dist/entities/delivery.js +890 -0
- package/dist/entities/delivery.js.map +1 -0
- package/dist/entities/index.d.ts +114 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +89 -0
- package/dist/entities/index.js.map +1 -0
- package/dist/entities/operations.d.ts +59 -0
- package/dist/entities/operations.d.ts.map +1 -0
- package/dist/entities/operations.js +1010 -0
- package/dist/entities/operations.js.map +1 -0
- package/dist/entities/orchestration.d.ts +52 -0
- package/dist/entities/orchestration.d.ts.map +1 -0
- package/dist/entities/orchestration.js +883 -0
- package/dist/entities/orchestration.js.map +1 -0
- package/dist/entities/services.d.ts +50 -0
- package/dist/entities/services.d.ts.map +1 -0
- package/dist/entities/services.js +805 -0
- package/dist/entities/services.js.map +1 -0
- package/dist/helpers.d.ts +362 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +400 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +17 -215
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -172
- package/dist/index.js.map +1 -0
- package/dist/provider.d.ts +85 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +158 -0
- package/dist/provider.js.map +1 -0
- package/dist/service.d.ts +43 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +206 -0
- package/dist/service.js.map +1 -0
- package/dist/types.d.ts +469 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/examples/client-usage.ts +82 -0
- package/examples/translation-service.ts +227 -0
- package/package.json +24 -38
- package/src/client.ts +132 -0
- package/src/endpoint.ts +144 -0
- package/src/entities/billing.ts +1037 -0
- package/src/entities/customers.ts +740 -0
- package/src/entities/delivery.ts +974 -0
- package/src/entities/index.ts +157 -0
- package/src/entities/operations.ts +1099 -0
- package/src/entities/orchestration.ts +956 -0
- package/src/entities/services.ts +872 -0
- package/src/helpers.ts +474 -0
- package/src/index.ts +97 -0
- package/src/provider.ts +183 -0
- package/src/service.test.ts +195 -0
- package/src/service.ts +266 -0
- package/src/types.ts +543 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,805 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service Entity Types (Nouns)
|
|
3
|
+
*
|
|
4
|
+
* Core service entities: ProductizedService, ServiceOffering, ServicePlan, ServiceInstance, ServiceExecution
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
// =============================================================================
|
|
9
|
+
// ProductizedService
|
|
10
|
+
// =============================================================================
|
|
11
|
+
/**
|
|
12
|
+
* ProductizedService entity
|
|
13
|
+
*
|
|
14
|
+
* A service packaged and delivered as software.
|
|
15
|
+
*/
|
|
16
|
+
export const ProductizedService = {
|
|
17
|
+
singular: 'productized-service',
|
|
18
|
+
plural: 'productized-services',
|
|
19
|
+
description: 'A service packaged and delivered as software',
|
|
20
|
+
properties: {
|
|
21
|
+
// Identity
|
|
22
|
+
name: {
|
|
23
|
+
type: 'string',
|
|
24
|
+
description: 'Service name',
|
|
25
|
+
},
|
|
26
|
+
slug: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
optional: true,
|
|
29
|
+
description: 'URL-friendly identifier',
|
|
30
|
+
},
|
|
31
|
+
description: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
optional: true,
|
|
34
|
+
description: 'Service description',
|
|
35
|
+
},
|
|
36
|
+
tagline: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
optional: true,
|
|
39
|
+
description: 'Short marketing tagline',
|
|
40
|
+
},
|
|
41
|
+
// Classification
|
|
42
|
+
type: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
description: 'Service type',
|
|
45
|
+
examples: ['consulting', 'implementation', 'support', 'managed', 'creative', 'technical', 'ai-powered'],
|
|
46
|
+
},
|
|
47
|
+
category: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
optional: true,
|
|
50
|
+
description: 'Service category',
|
|
51
|
+
},
|
|
52
|
+
domain: {
|
|
53
|
+
type: 'string',
|
|
54
|
+
optional: true,
|
|
55
|
+
description: 'Business domain',
|
|
56
|
+
},
|
|
57
|
+
// Delivery Model
|
|
58
|
+
deliveryModel: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
description: 'How service is delivered',
|
|
61
|
+
examples: ['autonomous', 'assisted', 'supervised', 'manual', 'hybrid'],
|
|
62
|
+
},
|
|
63
|
+
automationLevel: {
|
|
64
|
+
type: 'number',
|
|
65
|
+
optional: true,
|
|
66
|
+
description: 'Automation percentage (0-100)',
|
|
67
|
+
},
|
|
68
|
+
// Autonomy
|
|
69
|
+
autonomyLevel: {
|
|
70
|
+
type: 'number',
|
|
71
|
+
optional: true,
|
|
72
|
+
description: 'AI autonomy level (1-5)',
|
|
73
|
+
},
|
|
74
|
+
confidenceThreshold: {
|
|
75
|
+
type: 'number',
|
|
76
|
+
optional: true,
|
|
77
|
+
description: 'Min confidence for auto-completion (0-1)',
|
|
78
|
+
},
|
|
79
|
+
escalationPolicy: {
|
|
80
|
+
type: 'string',
|
|
81
|
+
optional: true,
|
|
82
|
+
description: 'When to escalate to humans',
|
|
83
|
+
examples: ['immediate', 'queue', 'scheduled', 'manual', 'never'],
|
|
84
|
+
},
|
|
85
|
+
// Scope
|
|
86
|
+
inclusions: {
|
|
87
|
+
type: 'string',
|
|
88
|
+
array: true,
|
|
89
|
+
optional: true,
|
|
90
|
+
description: 'What is included',
|
|
91
|
+
},
|
|
92
|
+
exclusions: {
|
|
93
|
+
type: 'string',
|
|
94
|
+
array: true,
|
|
95
|
+
optional: true,
|
|
96
|
+
description: 'What is excluded',
|
|
97
|
+
},
|
|
98
|
+
deliverables: {
|
|
99
|
+
type: 'string',
|
|
100
|
+
array: true,
|
|
101
|
+
optional: true,
|
|
102
|
+
description: 'Service deliverables',
|
|
103
|
+
},
|
|
104
|
+
// Timing
|
|
105
|
+
estimatedDuration: {
|
|
106
|
+
type: 'string',
|
|
107
|
+
optional: true,
|
|
108
|
+
description: 'Estimated delivery time',
|
|
109
|
+
},
|
|
110
|
+
turnaroundTime: {
|
|
111
|
+
type: 'string',
|
|
112
|
+
optional: true,
|
|
113
|
+
description: 'Standard turnaround time',
|
|
114
|
+
examples: ['instant', 'minutes', 'hours', 'days', 'weeks'],
|
|
115
|
+
},
|
|
116
|
+
// Capacity
|
|
117
|
+
capacityModel: {
|
|
118
|
+
type: 'string',
|
|
119
|
+
optional: true,
|
|
120
|
+
description: 'Capacity model',
|
|
121
|
+
examples: ['unlimited', 'limited', 'queue-based', 'appointment'],
|
|
122
|
+
},
|
|
123
|
+
maxConcurrent: {
|
|
124
|
+
type: 'number',
|
|
125
|
+
optional: true,
|
|
126
|
+
description: 'Max concurrent executions',
|
|
127
|
+
},
|
|
128
|
+
// Pricing
|
|
129
|
+
pricingModel: {
|
|
130
|
+
type: 'string',
|
|
131
|
+
optional: true,
|
|
132
|
+
description: 'Pricing model',
|
|
133
|
+
examples: ['fixed', 'per-use', 'subscription', 'tiered', 'custom'],
|
|
134
|
+
},
|
|
135
|
+
basePrice: {
|
|
136
|
+
type: 'number',
|
|
137
|
+
optional: true,
|
|
138
|
+
description: 'Base price',
|
|
139
|
+
},
|
|
140
|
+
currency: {
|
|
141
|
+
type: 'string',
|
|
142
|
+
optional: true,
|
|
143
|
+
description: 'Currency code',
|
|
144
|
+
},
|
|
145
|
+
// Status
|
|
146
|
+
status: {
|
|
147
|
+
type: 'string',
|
|
148
|
+
description: 'Service status',
|
|
149
|
+
examples: ['draft', 'active', 'paused', 'deprecated', 'archived'],
|
|
150
|
+
},
|
|
151
|
+
visibility: {
|
|
152
|
+
type: 'string',
|
|
153
|
+
optional: true,
|
|
154
|
+
description: 'Visibility',
|
|
155
|
+
examples: ['public', 'private', 'invite-only', 'beta'],
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
relationships: {
|
|
159
|
+
provider: {
|
|
160
|
+
type: 'Organization',
|
|
161
|
+
required: false,
|
|
162
|
+
description: 'Service provider',
|
|
163
|
+
},
|
|
164
|
+
plans: {
|
|
165
|
+
type: 'ServicePlan[]',
|
|
166
|
+
description: 'Pricing plans',
|
|
167
|
+
},
|
|
168
|
+
offerings: {
|
|
169
|
+
type: 'ServiceOffering[]',
|
|
170
|
+
description: 'Service offerings/tiers',
|
|
171
|
+
},
|
|
172
|
+
agent: {
|
|
173
|
+
type: 'AgentDelivery',
|
|
174
|
+
required: false,
|
|
175
|
+
description: 'AI agent for delivery',
|
|
176
|
+
},
|
|
177
|
+
sla: {
|
|
178
|
+
type: 'SLA',
|
|
179
|
+
required: false,
|
|
180
|
+
description: 'Service level agreement',
|
|
181
|
+
},
|
|
182
|
+
workflows: {
|
|
183
|
+
type: 'ServiceWorkflow[]',
|
|
184
|
+
description: 'Service workflows',
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
actions: [
|
|
188
|
+
'create',
|
|
189
|
+
'update',
|
|
190
|
+
'publish',
|
|
191
|
+
'pause',
|
|
192
|
+
'resume',
|
|
193
|
+
'execute',
|
|
194
|
+
'escalate',
|
|
195
|
+
'complete',
|
|
196
|
+
'deprecate',
|
|
197
|
+
'archive',
|
|
198
|
+
],
|
|
199
|
+
events: [
|
|
200
|
+
'created',
|
|
201
|
+
'updated',
|
|
202
|
+
'published',
|
|
203
|
+
'paused',
|
|
204
|
+
'resumed',
|
|
205
|
+
'executed',
|
|
206
|
+
'escalated',
|
|
207
|
+
'completed',
|
|
208
|
+
'deprecated',
|
|
209
|
+
'archived',
|
|
210
|
+
],
|
|
211
|
+
};
|
|
212
|
+
// =============================================================================
|
|
213
|
+
// ServiceOffering
|
|
214
|
+
// =============================================================================
|
|
215
|
+
/**
|
|
216
|
+
* ServiceOffering entity
|
|
217
|
+
*
|
|
218
|
+
* A specific offering or tier of a service.
|
|
219
|
+
*/
|
|
220
|
+
export const ServiceOffering = {
|
|
221
|
+
singular: 'service-offering',
|
|
222
|
+
plural: 'service-offerings',
|
|
223
|
+
description: 'A specific offering or tier of a productized service',
|
|
224
|
+
properties: {
|
|
225
|
+
// Identity
|
|
226
|
+
name: {
|
|
227
|
+
type: 'string',
|
|
228
|
+
description: 'Offering name',
|
|
229
|
+
},
|
|
230
|
+
slug: {
|
|
231
|
+
type: 'string',
|
|
232
|
+
optional: true,
|
|
233
|
+
description: 'URL-friendly identifier',
|
|
234
|
+
},
|
|
235
|
+
description: {
|
|
236
|
+
type: 'string',
|
|
237
|
+
optional: true,
|
|
238
|
+
description: 'Offering description',
|
|
239
|
+
},
|
|
240
|
+
// Tier
|
|
241
|
+
tier: {
|
|
242
|
+
type: 'string',
|
|
243
|
+
description: 'Offering tier',
|
|
244
|
+
examples: ['basic', 'standard', 'premium', 'enterprise', 'custom'],
|
|
245
|
+
},
|
|
246
|
+
displayOrder: {
|
|
247
|
+
type: 'number',
|
|
248
|
+
optional: true,
|
|
249
|
+
description: 'Display order',
|
|
250
|
+
},
|
|
251
|
+
highlighted: {
|
|
252
|
+
type: 'boolean',
|
|
253
|
+
optional: true,
|
|
254
|
+
description: 'Featured/highlighted offering',
|
|
255
|
+
},
|
|
256
|
+
// Scope
|
|
257
|
+
scope: {
|
|
258
|
+
type: 'string',
|
|
259
|
+
optional: true,
|
|
260
|
+
description: 'Scope of work',
|
|
261
|
+
},
|
|
262
|
+
inclusions: {
|
|
263
|
+
type: 'string',
|
|
264
|
+
array: true,
|
|
265
|
+
optional: true,
|
|
266
|
+
description: 'What is included',
|
|
267
|
+
},
|
|
268
|
+
limitations: {
|
|
269
|
+
type: 'string',
|
|
270
|
+
array: true,
|
|
271
|
+
optional: true,
|
|
272
|
+
description: 'Limitations',
|
|
273
|
+
},
|
|
274
|
+
// Delivery
|
|
275
|
+
deliveryTime: {
|
|
276
|
+
type: 'string',
|
|
277
|
+
optional: true,
|
|
278
|
+
description: 'Delivery time',
|
|
279
|
+
},
|
|
280
|
+
revisions: {
|
|
281
|
+
type: 'number',
|
|
282
|
+
optional: true,
|
|
283
|
+
description: 'Number of revisions included',
|
|
284
|
+
},
|
|
285
|
+
supportLevel: {
|
|
286
|
+
type: 'string',
|
|
287
|
+
optional: true,
|
|
288
|
+
description: 'Support level',
|
|
289
|
+
examples: ['email', 'priority', 'dedicated', '24/7'],
|
|
290
|
+
},
|
|
291
|
+
// Pricing
|
|
292
|
+
price: {
|
|
293
|
+
type: 'number',
|
|
294
|
+
description: 'Price',
|
|
295
|
+
},
|
|
296
|
+
currency: {
|
|
297
|
+
type: 'string',
|
|
298
|
+
optional: true,
|
|
299
|
+
description: 'Currency code',
|
|
300
|
+
},
|
|
301
|
+
billingType: {
|
|
302
|
+
type: 'string',
|
|
303
|
+
optional: true,
|
|
304
|
+
description: 'Billing type',
|
|
305
|
+
examples: ['one-time', 'recurring', 'usage-based'],
|
|
306
|
+
},
|
|
307
|
+
// Availability
|
|
308
|
+
availability: {
|
|
309
|
+
type: 'string',
|
|
310
|
+
optional: true,
|
|
311
|
+
description: 'Availability',
|
|
312
|
+
examples: ['always', 'limited', 'by-appointment', 'seasonal'],
|
|
313
|
+
},
|
|
314
|
+
maxOrders: {
|
|
315
|
+
type: 'number',
|
|
316
|
+
optional: true,
|
|
317
|
+
description: 'Max orders per period',
|
|
318
|
+
},
|
|
319
|
+
// Status
|
|
320
|
+
status: {
|
|
321
|
+
type: 'string',
|
|
322
|
+
description: 'Offering status',
|
|
323
|
+
examples: ['active', 'inactive', 'sold-out', 'discontinued'],
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
relationships: {
|
|
327
|
+
service: {
|
|
328
|
+
type: 'ProductizedService',
|
|
329
|
+
description: 'Parent service',
|
|
330
|
+
},
|
|
331
|
+
orders: {
|
|
332
|
+
type: 'ServiceOrder[]',
|
|
333
|
+
description: 'Orders for this offering',
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
actions: [
|
|
337
|
+
'create',
|
|
338
|
+
'update',
|
|
339
|
+
'activate',
|
|
340
|
+
'deactivate',
|
|
341
|
+
'updatePricing',
|
|
342
|
+
'discontinue',
|
|
343
|
+
],
|
|
344
|
+
events: [
|
|
345
|
+
'created',
|
|
346
|
+
'updated',
|
|
347
|
+
'activated',
|
|
348
|
+
'deactivated',
|
|
349
|
+
'pricingUpdated',
|
|
350
|
+
'discontinued',
|
|
351
|
+
],
|
|
352
|
+
};
|
|
353
|
+
// =============================================================================
|
|
354
|
+
// ServicePlan
|
|
355
|
+
// =============================================================================
|
|
356
|
+
/**
|
|
357
|
+
* ServicePlan entity
|
|
358
|
+
*
|
|
359
|
+
* A subscription plan for a service.
|
|
360
|
+
*/
|
|
361
|
+
export const ServicePlan = {
|
|
362
|
+
singular: 'service-plan',
|
|
363
|
+
plural: 'service-plans',
|
|
364
|
+
description: 'A subscription plan for a productized service',
|
|
365
|
+
properties: {
|
|
366
|
+
// Identity
|
|
367
|
+
name: {
|
|
368
|
+
type: 'string',
|
|
369
|
+
description: 'Plan name',
|
|
370
|
+
},
|
|
371
|
+
slug: {
|
|
372
|
+
type: 'string',
|
|
373
|
+
optional: true,
|
|
374
|
+
description: 'URL-friendly identifier',
|
|
375
|
+
},
|
|
376
|
+
description: {
|
|
377
|
+
type: 'string',
|
|
378
|
+
optional: true,
|
|
379
|
+
description: 'Plan description',
|
|
380
|
+
},
|
|
381
|
+
// Tier
|
|
382
|
+
tier: {
|
|
383
|
+
type: 'string',
|
|
384
|
+
description: 'Plan tier',
|
|
385
|
+
examples: ['free', 'starter', 'pro', 'business', 'enterprise'],
|
|
386
|
+
},
|
|
387
|
+
displayOrder: {
|
|
388
|
+
type: 'number',
|
|
389
|
+
optional: true,
|
|
390
|
+
description: 'Display order',
|
|
391
|
+
},
|
|
392
|
+
highlighted: {
|
|
393
|
+
type: 'boolean',
|
|
394
|
+
optional: true,
|
|
395
|
+
description: 'Featured plan',
|
|
396
|
+
},
|
|
397
|
+
// Pricing
|
|
398
|
+
price: {
|
|
399
|
+
type: 'number',
|
|
400
|
+
description: 'Plan price',
|
|
401
|
+
},
|
|
402
|
+
currency: {
|
|
403
|
+
type: 'string',
|
|
404
|
+
optional: true,
|
|
405
|
+
description: 'Currency code',
|
|
406
|
+
},
|
|
407
|
+
billingInterval: {
|
|
408
|
+
type: 'string',
|
|
409
|
+
description: 'Billing interval',
|
|
410
|
+
examples: ['monthly', 'quarterly', 'yearly'],
|
|
411
|
+
},
|
|
412
|
+
annualDiscount: {
|
|
413
|
+
type: 'number',
|
|
414
|
+
optional: true,
|
|
415
|
+
description: 'Annual discount percentage',
|
|
416
|
+
},
|
|
417
|
+
// Entitlements
|
|
418
|
+
entitlements: {
|
|
419
|
+
type: 'string',
|
|
420
|
+
array: true,
|
|
421
|
+
optional: true,
|
|
422
|
+
description: 'Plan entitlements',
|
|
423
|
+
},
|
|
424
|
+
features: {
|
|
425
|
+
type: 'string',
|
|
426
|
+
array: true,
|
|
427
|
+
optional: true,
|
|
428
|
+
description: 'Included features',
|
|
429
|
+
},
|
|
430
|
+
// Limits
|
|
431
|
+
limits: {
|
|
432
|
+
type: 'json',
|
|
433
|
+
optional: true,
|
|
434
|
+
description: 'Usage limits',
|
|
435
|
+
},
|
|
436
|
+
executionsPerMonth: {
|
|
437
|
+
type: 'number',
|
|
438
|
+
optional: true,
|
|
439
|
+
description: 'Executions per month',
|
|
440
|
+
},
|
|
441
|
+
supportHours: {
|
|
442
|
+
type: 'number',
|
|
443
|
+
optional: true,
|
|
444
|
+
description: 'Support hours included',
|
|
445
|
+
},
|
|
446
|
+
// Overage
|
|
447
|
+
overagePrice: {
|
|
448
|
+
type: 'number',
|
|
449
|
+
optional: true,
|
|
450
|
+
description: 'Price per overage unit',
|
|
451
|
+
},
|
|
452
|
+
overageEnabled: {
|
|
453
|
+
type: 'boolean',
|
|
454
|
+
optional: true,
|
|
455
|
+
description: 'Allow overage',
|
|
456
|
+
},
|
|
457
|
+
// Trial
|
|
458
|
+
trialDays: {
|
|
459
|
+
type: 'number',
|
|
460
|
+
optional: true,
|
|
461
|
+
description: 'Trial period days',
|
|
462
|
+
},
|
|
463
|
+
trialRequiresCard: {
|
|
464
|
+
type: 'boolean',
|
|
465
|
+
optional: true,
|
|
466
|
+
description: 'Trial requires payment method',
|
|
467
|
+
},
|
|
468
|
+
// Status
|
|
469
|
+
status: {
|
|
470
|
+
type: 'string',
|
|
471
|
+
description: 'Plan status',
|
|
472
|
+
examples: ['active', 'hidden', 'discontinued', 'legacy'],
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
relationships: {
|
|
476
|
+
service: {
|
|
477
|
+
type: 'ProductizedService',
|
|
478
|
+
description: 'Parent service',
|
|
479
|
+
},
|
|
480
|
+
subscriptions: {
|
|
481
|
+
type: 'ServiceSubscription[]',
|
|
482
|
+
description: 'Active subscriptions',
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
actions: [
|
|
486
|
+
'create',
|
|
487
|
+
'update',
|
|
488
|
+
'activate',
|
|
489
|
+
'hide',
|
|
490
|
+
'updatePricing',
|
|
491
|
+
'discontinue',
|
|
492
|
+
],
|
|
493
|
+
events: [
|
|
494
|
+
'created',
|
|
495
|
+
'updated',
|
|
496
|
+
'activated',
|
|
497
|
+
'hidden',
|
|
498
|
+
'pricingUpdated',
|
|
499
|
+
'discontinued',
|
|
500
|
+
],
|
|
501
|
+
};
|
|
502
|
+
// =============================================================================
|
|
503
|
+
// ServiceInstance
|
|
504
|
+
// =============================================================================
|
|
505
|
+
/**
|
|
506
|
+
* ServiceInstance entity
|
|
507
|
+
*
|
|
508
|
+
* A running instance of a service for a customer.
|
|
509
|
+
*/
|
|
510
|
+
export const ServiceInstance = {
|
|
511
|
+
singular: 'service-instance',
|
|
512
|
+
plural: 'service-instances',
|
|
513
|
+
description: 'A running instance of a service for a customer',
|
|
514
|
+
properties: {
|
|
515
|
+
// Identity
|
|
516
|
+
id: {
|
|
517
|
+
type: 'string',
|
|
518
|
+
description: 'Instance ID',
|
|
519
|
+
},
|
|
520
|
+
name: {
|
|
521
|
+
type: 'string',
|
|
522
|
+
optional: true,
|
|
523
|
+
description: 'Instance name',
|
|
524
|
+
},
|
|
525
|
+
// Configuration
|
|
526
|
+
config: {
|
|
527
|
+
type: 'json',
|
|
528
|
+
optional: true,
|
|
529
|
+
description: 'Instance configuration',
|
|
530
|
+
},
|
|
531
|
+
environment: {
|
|
532
|
+
type: 'string',
|
|
533
|
+
optional: true,
|
|
534
|
+
description: 'Environment',
|
|
535
|
+
examples: ['production', 'staging', 'development'],
|
|
536
|
+
},
|
|
537
|
+
// Resources
|
|
538
|
+
resourceAllocation: {
|
|
539
|
+
type: 'json',
|
|
540
|
+
optional: true,
|
|
541
|
+
description: 'Allocated resources',
|
|
542
|
+
},
|
|
543
|
+
// State
|
|
544
|
+
state: {
|
|
545
|
+
type: 'json',
|
|
546
|
+
optional: true,
|
|
547
|
+
description: 'Instance state',
|
|
548
|
+
},
|
|
549
|
+
lastActivityAt: {
|
|
550
|
+
type: 'date',
|
|
551
|
+
optional: true,
|
|
552
|
+
description: 'Last activity timestamp',
|
|
553
|
+
},
|
|
554
|
+
// Dates
|
|
555
|
+
provisionedAt: {
|
|
556
|
+
type: 'date',
|
|
557
|
+
optional: true,
|
|
558
|
+
description: 'Provisioning date',
|
|
559
|
+
},
|
|
560
|
+
expiresAt: {
|
|
561
|
+
type: 'date',
|
|
562
|
+
optional: true,
|
|
563
|
+
description: 'Expiration date',
|
|
564
|
+
},
|
|
565
|
+
// Status
|
|
566
|
+
status: {
|
|
567
|
+
type: 'string',
|
|
568
|
+
description: 'Instance status',
|
|
569
|
+
examples: ['provisioning', 'running', 'paused', 'stopped', 'terminated', 'failed'],
|
|
570
|
+
},
|
|
571
|
+
healthStatus: {
|
|
572
|
+
type: 'string',
|
|
573
|
+
optional: true,
|
|
574
|
+
description: 'Health status',
|
|
575
|
+
examples: ['healthy', 'degraded', 'unhealthy', 'unknown'],
|
|
576
|
+
},
|
|
577
|
+
},
|
|
578
|
+
relationships: {
|
|
579
|
+
service: {
|
|
580
|
+
type: 'ProductizedService',
|
|
581
|
+
description: 'Service type',
|
|
582
|
+
},
|
|
583
|
+
customer: {
|
|
584
|
+
type: 'ServiceCustomer',
|
|
585
|
+
description: 'Customer',
|
|
586
|
+
},
|
|
587
|
+
subscription: {
|
|
588
|
+
type: 'ServiceSubscription',
|
|
589
|
+
required: false,
|
|
590
|
+
description: 'Associated subscription',
|
|
591
|
+
},
|
|
592
|
+
executions: {
|
|
593
|
+
type: 'ServiceExecution[]',
|
|
594
|
+
description: 'Execution history',
|
|
595
|
+
},
|
|
596
|
+
},
|
|
597
|
+
actions: [
|
|
598
|
+
'provision',
|
|
599
|
+
'configure',
|
|
600
|
+
'start',
|
|
601
|
+
'stop',
|
|
602
|
+
'pause',
|
|
603
|
+
'resume',
|
|
604
|
+
'scale',
|
|
605
|
+
'terminate',
|
|
606
|
+
],
|
|
607
|
+
events: [
|
|
608
|
+
'provisioned',
|
|
609
|
+
'configured',
|
|
610
|
+
'started',
|
|
611
|
+
'stopped',
|
|
612
|
+
'paused',
|
|
613
|
+
'resumed',
|
|
614
|
+
'scaled',
|
|
615
|
+
'terminated',
|
|
616
|
+
],
|
|
617
|
+
};
|
|
618
|
+
// =============================================================================
|
|
619
|
+
// ServiceExecution
|
|
620
|
+
// =============================================================================
|
|
621
|
+
/**
|
|
622
|
+
* ServiceExecution entity
|
|
623
|
+
*
|
|
624
|
+
* A single execution or run of a service.
|
|
625
|
+
*/
|
|
626
|
+
export const ServiceExecution = {
|
|
627
|
+
singular: 'service-execution',
|
|
628
|
+
plural: 'service-executions',
|
|
629
|
+
description: 'A single execution or run of a service',
|
|
630
|
+
properties: {
|
|
631
|
+
// Identity
|
|
632
|
+
id: {
|
|
633
|
+
type: 'string',
|
|
634
|
+
description: 'Execution ID',
|
|
635
|
+
},
|
|
636
|
+
requestId: {
|
|
637
|
+
type: 'string',
|
|
638
|
+
optional: true,
|
|
639
|
+
description: 'Request trace ID',
|
|
640
|
+
},
|
|
641
|
+
// Input/Output
|
|
642
|
+
input: {
|
|
643
|
+
type: 'json',
|
|
644
|
+
optional: true,
|
|
645
|
+
description: 'Execution input',
|
|
646
|
+
},
|
|
647
|
+
output: {
|
|
648
|
+
type: 'json',
|
|
649
|
+
optional: true,
|
|
650
|
+
description: 'Execution output',
|
|
651
|
+
},
|
|
652
|
+
context: {
|
|
653
|
+
type: 'json',
|
|
654
|
+
optional: true,
|
|
655
|
+
description: 'Execution context',
|
|
656
|
+
},
|
|
657
|
+
// Execution Details
|
|
658
|
+
executionType: {
|
|
659
|
+
type: 'string',
|
|
660
|
+
optional: true,
|
|
661
|
+
description: 'Type of execution',
|
|
662
|
+
examples: ['sync', 'async', 'batch', 'scheduled', 'triggered'],
|
|
663
|
+
},
|
|
664
|
+
trigger: {
|
|
665
|
+
type: 'string',
|
|
666
|
+
optional: true,
|
|
667
|
+
description: 'What triggered execution',
|
|
668
|
+
examples: ['api', 'schedule', 'webhook', 'manual', 'event'],
|
|
669
|
+
},
|
|
670
|
+
// AI Details
|
|
671
|
+
agentUsed: {
|
|
672
|
+
type: 'boolean',
|
|
673
|
+
optional: true,
|
|
674
|
+
description: 'AI agent was used',
|
|
675
|
+
},
|
|
676
|
+
confidence: {
|
|
677
|
+
type: 'number',
|
|
678
|
+
optional: true,
|
|
679
|
+
description: 'AI confidence score (0-1)',
|
|
680
|
+
},
|
|
681
|
+
humanReviewRequired: {
|
|
682
|
+
type: 'boolean',
|
|
683
|
+
optional: true,
|
|
684
|
+
description: 'Human review needed',
|
|
685
|
+
},
|
|
686
|
+
humanReviewed: {
|
|
687
|
+
type: 'boolean',
|
|
688
|
+
optional: true,
|
|
689
|
+
description: 'Was reviewed by human',
|
|
690
|
+
},
|
|
691
|
+
// Timing
|
|
692
|
+
startedAt: {
|
|
693
|
+
type: 'date',
|
|
694
|
+
optional: true,
|
|
695
|
+
description: 'Start time',
|
|
696
|
+
},
|
|
697
|
+
completedAt: {
|
|
698
|
+
type: 'date',
|
|
699
|
+
optional: true,
|
|
700
|
+
description: 'Completion time',
|
|
701
|
+
},
|
|
702
|
+
durationMs: {
|
|
703
|
+
type: 'number',
|
|
704
|
+
optional: true,
|
|
705
|
+
description: 'Duration in milliseconds',
|
|
706
|
+
},
|
|
707
|
+
// Resources
|
|
708
|
+
tokensUsed: {
|
|
709
|
+
type: 'number',
|
|
710
|
+
optional: true,
|
|
711
|
+
description: 'AI tokens consumed',
|
|
712
|
+
},
|
|
713
|
+
computeUnits: {
|
|
714
|
+
type: 'number',
|
|
715
|
+
optional: true,
|
|
716
|
+
description: 'Compute units used',
|
|
717
|
+
},
|
|
718
|
+
cost: {
|
|
719
|
+
type: 'number',
|
|
720
|
+
optional: true,
|
|
721
|
+
description: 'Execution cost',
|
|
722
|
+
},
|
|
723
|
+
// Errors
|
|
724
|
+
error: {
|
|
725
|
+
type: 'string',
|
|
726
|
+
optional: true,
|
|
727
|
+
description: 'Error message if failed',
|
|
728
|
+
},
|
|
729
|
+
errorCode: {
|
|
730
|
+
type: 'string',
|
|
731
|
+
optional: true,
|
|
732
|
+
description: 'Error code',
|
|
733
|
+
},
|
|
734
|
+
retryCount: {
|
|
735
|
+
type: 'number',
|
|
736
|
+
optional: true,
|
|
737
|
+
description: 'Number of retries',
|
|
738
|
+
},
|
|
739
|
+
// Status
|
|
740
|
+
status: {
|
|
741
|
+
type: 'string',
|
|
742
|
+
description: 'Execution status',
|
|
743
|
+
examples: ['pending', 'running', 'completed', 'failed', 'cancelled', 'timeout', 'escalated'],
|
|
744
|
+
},
|
|
745
|
+
},
|
|
746
|
+
relationships: {
|
|
747
|
+
instance: {
|
|
748
|
+
type: 'ServiceInstance',
|
|
749
|
+
required: false,
|
|
750
|
+
description: 'Service instance',
|
|
751
|
+
},
|
|
752
|
+
service: {
|
|
753
|
+
type: 'ProductizedService',
|
|
754
|
+
description: 'Service',
|
|
755
|
+
},
|
|
756
|
+
customer: {
|
|
757
|
+
type: 'ServiceCustomer',
|
|
758
|
+
description: 'Customer',
|
|
759
|
+
},
|
|
760
|
+
workflow: {
|
|
761
|
+
type: 'ServiceWorkflow',
|
|
762
|
+
required: false,
|
|
763
|
+
description: 'Workflow executed',
|
|
764
|
+
},
|
|
765
|
+
tasks: {
|
|
766
|
+
type: 'ServiceTask[]',
|
|
767
|
+
description: 'Tasks in this execution',
|
|
768
|
+
},
|
|
769
|
+
},
|
|
770
|
+
actions: [
|
|
771
|
+
'start',
|
|
772
|
+
'pause',
|
|
773
|
+
'resume',
|
|
774
|
+
'cancel',
|
|
775
|
+
'retry',
|
|
776
|
+
'escalate',
|
|
777
|
+
'complete',
|
|
778
|
+
'fail',
|
|
779
|
+
],
|
|
780
|
+
events: [
|
|
781
|
+
'started',
|
|
782
|
+
'paused',
|
|
783
|
+
'resumed',
|
|
784
|
+
'cancelled',
|
|
785
|
+
'retried',
|
|
786
|
+
'escalated',
|
|
787
|
+
'completed',
|
|
788
|
+
'failed',
|
|
789
|
+
],
|
|
790
|
+
};
|
|
791
|
+
// =============================================================================
|
|
792
|
+
// Exports
|
|
793
|
+
// =============================================================================
|
|
794
|
+
export const ServiceEntities = {
|
|
795
|
+
ProductizedService,
|
|
796
|
+
ServiceOffering,
|
|
797
|
+
ServicePlan,
|
|
798
|
+
ServiceInstance,
|
|
799
|
+
ServiceExecution,
|
|
800
|
+
};
|
|
801
|
+
export const ServiceCategories = {
|
|
802
|
+
core: ['ProductizedService', 'ServiceOffering', 'ServicePlan'],
|
|
803
|
+
runtime: ['ServiceInstance', 'ServiceExecution'],
|
|
804
|
+
};
|
|
805
|
+
//# sourceMappingURL=services.js.map
|