digital-products 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 +9 -0
- package/README.md +535 -0
- package/dist/api.d.ts +99 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +129 -0
- package/dist/api.js.map +1 -0
- package/dist/app.d.ts +79 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +107 -0
- package/dist/app.js.map +1 -0
- package/dist/content.d.ts +58 -0
- package/dist/content.d.ts.map +1 -0
- package/dist/content.js +78 -0
- package/dist/content.js.map +1 -0
- package/dist/data.d.ts +67 -0
- package/dist/data.d.ts.map +1 -0
- package/dist/data.js +107 -0
- package/dist/data.js.map +1 -0
- package/dist/dataset.d.ts +32 -0
- package/dist/dataset.d.ts.map +1 -0
- package/dist/dataset.js +50 -0
- package/dist/dataset.js.map +1 -0
- package/dist/entities/ai.d.ts +53 -0
- package/dist/entities/ai.d.ts.map +1 -0
- package/dist/entities/ai.js +859 -0
- package/dist/entities/ai.js.map +1 -0
- package/dist/entities/content.d.ts +52 -0
- package/dist/entities/content.d.ts.map +1 -0
- package/dist/entities/content.js +784 -0
- package/dist/entities/content.js.map +1 -0
- package/dist/entities/index.d.ts +112 -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/interfaces.d.ts +67 -0
- package/dist/entities/interfaces.d.ts.map +1 -0
- package/dist/entities/interfaces.js +930 -0
- package/dist/entities/interfaces.js.map +1 -0
- package/dist/entities/lifecycle.d.ts +51 -0
- package/dist/entities/lifecycle.d.ts.map +1 -0
- package/dist/entities/lifecycle.js +804 -0
- package/dist/entities/lifecycle.js.map +1 -0
- package/dist/entities/products.d.ts +53 -0
- package/dist/entities/products.d.ts.map +1 -0
- package/dist/entities/products.js +798 -0
- package/dist/entities/products.js.map +1 -0
- package/dist/entities/web.d.ts +44 -0
- package/dist/entities/web.d.ts.map +1 -0
- package/dist/entities/web.js +658 -0
- package/dist/entities/web.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp.d.ts +101 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +140 -0
- package/dist/mcp.js.map +1 -0
- package/dist/product.d.ts +37 -0
- package/dist/product.d.ts.map +1 -0
- package/dist/product.js +54 -0
- package/dist/product.js.map +1 -0
- package/dist/registry.d.ts +9 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +32 -0
- package/dist/registry.js.map +1 -0
- package/dist/sdk.d.ts +99 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/sdk.js +128 -0
- package/dist/sdk.js.map +1 -0
- package/dist/site.d.ts +85 -0
- package/dist/site.d.ts.map +1 -0
- package/dist/site.js +113 -0
- package/dist/site.js.map +1 -0
- package/dist/types.d.ts +528 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/example.ts +236 -0
- package/package.json +35 -0
- package/src/api.ts +140 -0
- package/src/app.ts +117 -0
- package/src/content.ts +82 -0
- package/src/data.ts +129 -0
- package/src/dataset.ts +53 -0
- package/src/entities/ai.ts +932 -0
- package/src/entities/content.ts +851 -0
- package/src/entities/index.ts +156 -0
- package/src/entities/interfaces.ts +1017 -0
- package/src/entities/lifecycle.ts +872 -0
- package/src/entities/products.ts +867 -0
- package/src/entities/web.ts +719 -0
- package/src/index.ts +55 -0
- package/src/mcp.ts +163 -0
- package/src/product.ts +59 -0
- package/src/registry.ts +41 -0
- package/src/sdk.ts +148 -0
- package/src/site.ts +127 -0
- package/src/types.ts +558 -0
- package/test/api.test.ts +247 -0
- package/test/app.test.ts +220 -0
- package/test/content.test.ts +171 -0
- package/test/data.test.ts +201 -0
- package/test/dataset.test.ts +181 -0
- package/test/mcp.test.ts +230 -0
- package/test/product.test.ts +200 -0
- package/test/sdk.test.ts +236 -0
- package/test/site.test.ts +245 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,872 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lifecycle Entity Types (Nouns)
|
|
3
|
+
*
|
|
4
|
+
* Product lifecycle: Version, Release, Deployment, Environment, Feature
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { Noun } from 'ai-database'
|
|
10
|
+
|
|
11
|
+
// =============================================================================
|
|
12
|
+
// Version
|
|
13
|
+
// =============================================================================
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Version entity
|
|
17
|
+
*
|
|
18
|
+
* Product version.
|
|
19
|
+
*/
|
|
20
|
+
export const Version: Noun = {
|
|
21
|
+
singular: 'version',
|
|
22
|
+
plural: 'versions',
|
|
23
|
+
description: 'A version of a digital product',
|
|
24
|
+
|
|
25
|
+
properties: {
|
|
26
|
+
// Identity
|
|
27
|
+
number: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
description: 'Version number (semver)',
|
|
30
|
+
},
|
|
31
|
+
name: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
optional: true,
|
|
34
|
+
description: 'Version name/codename',
|
|
35
|
+
},
|
|
36
|
+
description: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
optional: true,
|
|
39
|
+
description: 'Version description',
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
// Semver
|
|
43
|
+
major: {
|
|
44
|
+
type: 'number',
|
|
45
|
+
optional: true,
|
|
46
|
+
description: 'Major version',
|
|
47
|
+
},
|
|
48
|
+
minor: {
|
|
49
|
+
type: 'number',
|
|
50
|
+
optional: true,
|
|
51
|
+
description: 'Minor version',
|
|
52
|
+
},
|
|
53
|
+
patch: {
|
|
54
|
+
type: 'number',
|
|
55
|
+
optional: true,
|
|
56
|
+
description: 'Patch version',
|
|
57
|
+
},
|
|
58
|
+
prerelease: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
optional: true,
|
|
61
|
+
description: 'Prerelease identifier',
|
|
62
|
+
examples: ['alpha', 'beta', 'rc'],
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
// Changes
|
|
66
|
+
changelog: {
|
|
67
|
+
type: 'string',
|
|
68
|
+
optional: true,
|
|
69
|
+
description: 'Changelog content',
|
|
70
|
+
},
|
|
71
|
+
breakingChanges: {
|
|
72
|
+
type: 'string',
|
|
73
|
+
array: true,
|
|
74
|
+
optional: true,
|
|
75
|
+
description: 'Breaking changes',
|
|
76
|
+
},
|
|
77
|
+
features: {
|
|
78
|
+
type: 'string',
|
|
79
|
+
array: true,
|
|
80
|
+
optional: true,
|
|
81
|
+
description: 'New features',
|
|
82
|
+
},
|
|
83
|
+
fixes: {
|
|
84
|
+
type: 'string',
|
|
85
|
+
array: true,
|
|
86
|
+
optional: true,
|
|
87
|
+
description: 'Bug fixes',
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
// Source
|
|
91
|
+
commitHash: {
|
|
92
|
+
type: 'string',
|
|
93
|
+
optional: true,
|
|
94
|
+
description: 'Git commit hash',
|
|
95
|
+
},
|
|
96
|
+
branch: {
|
|
97
|
+
type: 'string',
|
|
98
|
+
optional: true,
|
|
99
|
+
description: 'Git branch',
|
|
100
|
+
},
|
|
101
|
+
tag: {
|
|
102
|
+
type: 'string',
|
|
103
|
+
optional: true,
|
|
104
|
+
description: 'Git tag',
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
// Artifacts
|
|
108
|
+
artifactUrl: {
|
|
109
|
+
type: 'string',
|
|
110
|
+
optional: true,
|
|
111
|
+
description: 'Build artifact URL',
|
|
112
|
+
},
|
|
113
|
+
checksum: {
|
|
114
|
+
type: 'string',
|
|
115
|
+
optional: true,
|
|
116
|
+
description: 'Artifact checksum',
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
// Dates
|
|
120
|
+
createdAt: {
|
|
121
|
+
type: 'date',
|
|
122
|
+
optional: true,
|
|
123
|
+
description: 'Creation date',
|
|
124
|
+
},
|
|
125
|
+
releasedAt: {
|
|
126
|
+
type: 'date',
|
|
127
|
+
optional: true,
|
|
128
|
+
description: 'Release date',
|
|
129
|
+
},
|
|
130
|
+
deprecatedAt: {
|
|
131
|
+
type: 'date',
|
|
132
|
+
optional: true,
|
|
133
|
+
description: 'Deprecation date',
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
// Status
|
|
137
|
+
status: {
|
|
138
|
+
type: 'string',
|
|
139
|
+
description: 'Version status',
|
|
140
|
+
examples: ['draft', 'prerelease', 'released', 'deprecated', 'yanked'],
|
|
141
|
+
},
|
|
142
|
+
stability: {
|
|
143
|
+
type: 'string',
|
|
144
|
+
optional: true,
|
|
145
|
+
description: 'Stability level',
|
|
146
|
+
examples: ['experimental', 'unstable', 'stable', 'lts'],
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
relationships: {
|
|
151
|
+
product: {
|
|
152
|
+
type: 'DigitalProduct',
|
|
153
|
+
description: 'Parent product',
|
|
154
|
+
},
|
|
155
|
+
releases: {
|
|
156
|
+
type: 'Release[]',
|
|
157
|
+
description: 'Releases of this version',
|
|
158
|
+
},
|
|
159
|
+
previousVersion: {
|
|
160
|
+
type: 'Version',
|
|
161
|
+
required: false,
|
|
162
|
+
description: 'Previous version',
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
actions: [
|
|
167
|
+
'create',
|
|
168
|
+
'update',
|
|
169
|
+
'release',
|
|
170
|
+
'deprecate',
|
|
171
|
+
'yank',
|
|
172
|
+
],
|
|
173
|
+
|
|
174
|
+
events: [
|
|
175
|
+
'created',
|
|
176
|
+
'updated',
|
|
177
|
+
'released',
|
|
178
|
+
'deprecated',
|
|
179
|
+
'yanked',
|
|
180
|
+
],
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// =============================================================================
|
|
184
|
+
// Release
|
|
185
|
+
// =============================================================================
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Release entity
|
|
189
|
+
*
|
|
190
|
+
* Published release of a version.
|
|
191
|
+
*/
|
|
192
|
+
export const Release: Noun = {
|
|
193
|
+
singular: 'release',
|
|
194
|
+
plural: 'releases',
|
|
195
|
+
description: 'A published release of a product version',
|
|
196
|
+
|
|
197
|
+
properties: {
|
|
198
|
+
// Identity
|
|
199
|
+
name: {
|
|
200
|
+
type: 'string',
|
|
201
|
+
description: 'Release name',
|
|
202
|
+
},
|
|
203
|
+
tag: {
|
|
204
|
+
type: 'string',
|
|
205
|
+
optional: true,
|
|
206
|
+
description: 'Release tag',
|
|
207
|
+
},
|
|
208
|
+
description: {
|
|
209
|
+
type: 'string',
|
|
210
|
+
optional: true,
|
|
211
|
+
description: 'Release description',
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
// Type
|
|
215
|
+
type: {
|
|
216
|
+
type: 'string',
|
|
217
|
+
description: 'Release type',
|
|
218
|
+
examples: ['major', 'minor', 'patch', 'hotfix', 'prerelease', 'rc'],
|
|
219
|
+
},
|
|
220
|
+
channel: {
|
|
221
|
+
type: 'string',
|
|
222
|
+
optional: true,
|
|
223
|
+
description: 'Release channel',
|
|
224
|
+
examples: ['stable', 'beta', 'alpha', 'canary', 'nightly'],
|
|
225
|
+
},
|
|
226
|
+
|
|
227
|
+
// Notes
|
|
228
|
+
releaseNotes: {
|
|
229
|
+
type: 'string',
|
|
230
|
+
optional: true,
|
|
231
|
+
description: 'Release notes (markdown)',
|
|
232
|
+
},
|
|
233
|
+
highlights: {
|
|
234
|
+
type: 'string',
|
|
235
|
+
array: true,
|
|
236
|
+
optional: true,
|
|
237
|
+
description: 'Release highlights',
|
|
238
|
+
},
|
|
239
|
+
|
|
240
|
+
// Assets
|
|
241
|
+
assets: {
|
|
242
|
+
type: 'json',
|
|
243
|
+
optional: true,
|
|
244
|
+
description: 'Release assets',
|
|
245
|
+
},
|
|
246
|
+
downloadUrl: {
|
|
247
|
+
type: 'string',
|
|
248
|
+
optional: true,
|
|
249
|
+
description: 'Download URL',
|
|
250
|
+
},
|
|
251
|
+
downloadCount: {
|
|
252
|
+
type: 'number',
|
|
253
|
+
optional: true,
|
|
254
|
+
description: 'Download count',
|
|
255
|
+
},
|
|
256
|
+
|
|
257
|
+
// Compatibility
|
|
258
|
+
minPlatformVersion: {
|
|
259
|
+
type: 'string',
|
|
260
|
+
optional: true,
|
|
261
|
+
description: 'Minimum platform version',
|
|
262
|
+
},
|
|
263
|
+
maxPlatformVersion: {
|
|
264
|
+
type: 'string',
|
|
265
|
+
optional: true,
|
|
266
|
+
description: 'Maximum platform version',
|
|
267
|
+
},
|
|
268
|
+
supportedPlatforms: {
|
|
269
|
+
type: 'string',
|
|
270
|
+
array: true,
|
|
271
|
+
optional: true,
|
|
272
|
+
description: 'Supported platforms',
|
|
273
|
+
},
|
|
274
|
+
|
|
275
|
+
// Dates
|
|
276
|
+
publishedAt: {
|
|
277
|
+
type: 'date',
|
|
278
|
+
optional: true,
|
|
279
|
+
description: 'Publication date',
|
|
280
|
+
},
|
|
281
|
+
endOfLifeAt: {
|
|
282
|
+
type: 'date',
|
|
283
|
+
optional: true,
|
|
284
|
+
description: 'End of life date',
|
|
285
|
+
},
|
|
286
|
+
|
|
287
|
+
// Status
|
|
288
|
+
status: {
|
|
289
|
+
type: 'string',
|
|
290
|
+
description: 'Release status',
|
|
291
|
+
examples: ['draft', 'published', 'latest', 'superseded', 'retracted'],
|
|
292
|
+
},
|
|
293
|
+
isLatest: {
|
|
294
|
+
type: 'boolean',
|
|
295
|
+
optional: true,
|
|
296
|
+
description: 'Is latest release',
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
|
|
300
|
+
relationships: {
|
|
301
|
+
version: {
|
|
302
|
+
type: 'Version',
|
|
303
|
+
description: 'Product version',
|
|
304
|
+
},
|
|
305
|
+
deployments: {
|
|
306
|
+
type: 'Deployment[]',
|
|
307
|
+
description: 'Release deployments',
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
|
|
311
|
+
actions: [
|
|
312
|
+
'create',
|
|
313
|
+
'update',
|
|
314
|
+
'publish',
|
|
315
|
+
'unpublish',
|
|
316
|
+
'setLatest',
|
|
317
|
+
'retract',
|
|
318
|
+
],
|
|
319
|
+
|
|
320
|
+
events: [
|
|
321
|
+
'created',
|
|
322
|
+
'updated',
|
|
323
|
+
'published',
|
|
324
|
+
'unpublished',
|
|
325
|
+
'setAsLatest',
|
|
326
|
+
'retracted',
|
|
327
|
+
],
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// =============================================================================
|
|
331
|
+
// Deployment
|
|
332
|
+
// =============================================================================
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Deployment entity
|
|
336
|
+
*
|
|
337
|
+
* Deployment instance.
|
|
338
|
+
*/
|
|
339
|
+
export const Deployment: Noun = {
|
|
340
|
+
singular: 'deployment',
|
|
341
|
+
plural: 'deployments',
|
|
342
|
+
description: 'A deployment of a product release',
|
|
343
|
+
|
|
344
|
+
properties: {
|
|
345
|
+
// Identity
|
|
346
|
+
id: {
|
|
347
|
+
type: 'string',
|
|
348
|
+
description: 'Deployment ID',
|
|
349
|
+
},
|
|
350
|
+
name: {
|
|
351
|
+
type: 'string',
|
|
352
|
+
optional: true,
|
|
353
|
+
description: 'Deployment name',
|
|
354
|
+
},
|
|
355
|
+
|
|
356
|
+
// Target
|
|
357
|
+
environment: {
|
|
358
|
+
type: 'string',
|
|
359
|
+
description: 'Target environment',
|
|
360
|
+
examples: ['production', 'staging', 'preview', 'development'],
|
|
361
|
+
},
|
|
362
|
+
region: {
|
|
363
|
+
type: 'string',
|
|
364
|
+
optional: true,
|
|
365
|
+
description: 'Deployment region',
|
|
366
|
+
},
|
|
367
|
+
|
|
368
|
+
// Platform
|
|
369
|
+
platform: {
|
|
370
|
+
type: 'string',
|
|
371
|
+
optional: true,
|
|
372
|
+
description: 'Deployment platform',
|
|
373
|
+
examples: ['vercel', 'netlify', 'cloudflare', 'aws', 'gcp', 'azure', 'kubernetes', 'custom'],
|
|
374
|
+
},
|
|
375
|
+
provider: {
|
|
376
|
+
type: 'string',
|
|
377
|
+
optional: true,
|
|
378
|
+
description: 'Cloud provider',
|
|
379
|
+
},
|
|
380
|
+
|
|
381
|
+
// Configuration
|
|
382
|
+
config: {
|
|
383
|
+
type: 'json',
|
|
384
|
+
optional: true,
|
|
385
|
+
description: 'Deployment configuration',
|
|
386
|
+
},
|
|
387
|
+
envVars: {
|
|
388
|
+
type: 'json',
|
|
389
|
+
optional: true,
|
|
390
|
+
description: 'Environment variables (non-sensitive)',
|
|
391
|
+
},
|
|
392
|
+
|
|
393
|
+
// URLs
|
|
394
|
+
url: {
|
|
395
|
+
type: 'string',
|
|
396
|
+
optional: true,
|
|
397
|
+
description: 'Deployment URL',
|
|
398
|
+
},
|
|
399
|
+
previewUrl: {
|
|
400
|
+
type: 'string',
|
|
401
|
+
optional: true,
|
|
402
|
+
description: 'Preview URL',
|
|
403
|
+
},
|
|
404
|
+
customDomain: {
|
|
405
|
+
type: 'string',
|
|
406
|
+
optional: true,
|
|
407
|
+
description: 'Custom domain',
|
|
408
|
+
},
|
|
409
|
+
|
|
410
|
+
// Resources
|
|
411
|
+
instanceCount: {
|
|
412
|
+
type: 'number',
|
|
413
|
+
optional: true,
|
|
414
|
+
description: 'Number of instances',
|
|
415
|
+
},
|
|
416
|
+
memory: {
|
|
417
|
+
type: 'string',
|
|
418
|
+
optional: true,
|
|
419
|
+
description: 'Memory allocation',
|
|
420
|
+
},
|
|
421
|
+
cpu: {
|
|
422
|
+
type: 'string',
|
|
423
|
+
optional: true,
|
|
424
|
+
description: 'CPU allocation',
|
|
425
|
+
},
|
|
426
|
+
|
|
427
|
+
// Build
|
|
428
|
+
buildId: {
|
|
429
|
+
type: 'string',
|
|
430
|
+
optional: true,
|
|
431
|
+
description: 'Build ID',
|
|
432
|
+
},
|
|
433
|
+
buildDurationMs: {
|
|
434
|
+
type: 'number',
|
|
435
|
+
optional: true,
|
|
436
|
+
description: 'Build duration',
|
|
437
|
+
},
|
|
438
|
+
artifactSize: {
|
|
439
|
+
type: 'number',
|
|
440
|
+
optional: true,
|
|
441
|
+
description: 'Artifact size in bytes',
|
|
442
|
+
},
|
|
443
|
+
|
|
444
|
+
// Dates
|
|
445
|
+
createdAt: {
|
|
446
|
+
type: 'date',
|
|
447
|
+
optional: true,
|
|
448
|
+
description: 'Creation date',
|
|
449
|
+
},
|
|
450
|
+
deployedAt: {
|
|
451
|
+
type: 'date',
|
|
452
|
+
optional: true,
|
|
453
|
+
description: 'Deployment date',
|
|
454
|
+
},
|
|
455
|
+
expiresAt: {
|
|
456
|
+
type: 'date',
|
|
457
|
+
optional: true,
|
|
458
|
+
description: 'Expiration date (for previews)',
|
|
459
|
+
},
|
|
460
|
+
|
|
461
|
+
// Status
|
|
462
|
+
status: {
|
|
463
|
+
type: 'string',
|
|
464
|
+
description: 'Deployment status',
|
|
465
|
+
examples: ['queued', 'building', 'deploying', 'ready', 'failed', 'cancelled', 'expired'],
|
|
466
|
+
},
|
|
467
|
+
isProduction: {
|
|
468
|
+
type: 'boolean',
|
|
469
|
+
optional: true,
|
|
470
|
+
description: 'Is production deployment',
|
|
471
|
+
},
|
|
472
|
+
},
|
|
473
|
+
|
|
474
|
+
relationships: {
|
|
475
|
+
product: {
|
|
476
|
+
type: 'DigitalProduct',
|
|
477
|
+
description: 'Product deployed',
|
|
478
|
+
},
|
|
479
|
+
release: {
|
|
480
|
+
type: 'Release',
|
|
481
|
+
required: false,
|
|
482
|
+
description: 'Release deployed',
|
|
483
|
+
},
|
|
484
|
+
environmentRef: {
|
|
485
|
+
type: 'Environment',
|
|
486
|
+
required: false,
|
|
487
|
+
description: 'Target environment',
|
|
488
|
+
},
|
|
489
|
+
},
|
|
490
|
+
|
|
491
|
+
actions: [
|
|
492
|
+
'create',
|
|
493
|
+
'build',
|
|
494
|
+
'deploy',
|
|
495
|
+
'promote',
|
|
496
|
+
'rollback',
|
|
497
|
+
'scale',
|
|
498
|
+
'pause',
|
|
499
|
+
'resume',
|
|
500
|
+
'terminate',
|
|
501
|
+
],
|
|
502
|
+
|
|
503
|
+
events: [
|
|
504
|
+
'created',
|
|
505
|
+
'built',
|
|
506
|
+
'deployed',
|
|
507
|
+
'promoted',
|
|
508
|
+
'rolledBack',
|
|
509
|
+
'scaled',
|
|
510
|
+
'paused',
|
|
511
|
+
'resumed',
|
|
512
|
+
'terminated',
|
|
513
|
+
],
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// =============================================================================
|
|
517
|
+
// Environment
|
|
518
|
+
// =============================================================================
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Environment entity
|
|
522
|
+
*
|
|
523
|
+
* Deployment environment.
|
|
524
|
+
*/
|
|
525
|
+
export const Environment: Noun = {
|
|
526
|
+
singular: 'environment',
|
|
527
|
+
plural: 'environments',
|
|
528
|
+
description: 'A deployment environment',
|
|
529
|
+
|
|
530
|
+
properties: {
|
|
531
|
+
// Identity
|
|
532
|
+
name: {
|
|
533
|
+
type: 'string',
|
|
534
|
+
description: 'Environment name',
|
|
535
|
+
},
|
|
536
|
+
slug: {
|
|
537
|
+
type: 'string',
|
|
538
|
+
optional: true,
|
|
539
|
+
description: 'URL-friendly identifier',
|
|
540
|
+
},
|
|
541
|
+
description: {
|
|
542
|
+
type: 'string',
|
|
543
|
+
optional: true,
|
|
544
|
+
description: 'Environment description',
|
|
545
|
+
},
|
|
546
|
+
|
|
547
|
+
// Type
|
|
548
|
+
type: {
|
|
549
|
+
type: 'string',
|
|
550
|
+
description: 'Environment type',
|
|
551
|
+
examples: ['production', 'staging', 'preview', 'development', 'testing', 'demo'],
|
|
552
|
+
},
|
|
553
|
+
tier: {
|
|
554
|
+
type: 'string',
|
|
555
|
+
optional: true,
|
|
556
|
+
description: 'Environment tier',
|
|
557
|
+
examples: ['production', 'non-production'],
|
|
558
|
+
},
|
|
559
|
+
|
|
560
|
+
// Configuration
|
|
561
|
+
config: {
|
|
562
|
+
type: 'json',
|
|
563
|
+
optional: true,
|
|
564
|
+
description: 'Environment configuration',
|
|
565
|
+
},
|
|
566
|
+
variables: {
|
|
567
|
+
type: 'json',
|
|
568
|
+
optional: true,
|
|
569
|
+
description: 'Environment variables',
|
|
570
|
+
},
|
|
571
|
+
secrets: {
|
|
572
|
+
type: 'string',
|
|
573
|
+
array: true,
|
|
574
|
+
optional: true,
|
|
575
|
+
description: 'Secret names (not values)',
|
|
576
|
+
},
|
|
577
|
+
|
|
578
|
+
// Access
|
|
579
|
+
url: {
|
|
580
|
+
type: 'string',
|
|
581
|
+
optional: true,
|
|
582
|
+
description: 'Environment URL',
|
|
583
|
+
},
|
|
584
|
+
protected: {
|
|
585
|
+
type: 'boolean',
|
|
586
|
+
optional: true,
|
|
587
|
+
description: 'Requires authentication',
|
|
588
|
+
},
|
|
589
|
+
allowedIPs: {
|
|
590
|
+
type: 'string',
|
|
591
|
+
array: true,
|
|
592
|
+
optional: true,
|
|
593
|
+
description: 'Allowed IP addresses',
|
|
594
|
+
},
|
|
595
|
+
|
|
596
|
+
// Promotion
|
|
597
|
+
promotesTo: {
|
|
598
|
+
type: 'string',
|
|
599
|
+
optional: true,
|
|
600
|
+
description: 'Environment to promote to',
|
|
601
|
+
},
|
|
602
|
+
promotesFrom: {
|
|
603
|
+
type: 'string',
|
|
604
|
+
optional: true,
|
|
605
|
+
description: 'Environment promoted from',
|
|
606
|
+
},
|
|
607
|
+
autoPromote: {
|
|
608
|
+
type: 'boolean',
|
|
609
|
+
optional: true,
|
|
610
|
+
description: 'Auto-promote on success',
|
|
611
|
+
},
|
|
612
|
+
|
|
613
|
+
// Resources
|
|
614
|
+
resourceQuota: {
|
|
615
|
+
type: 'json',
|
|
616
|
+
optional: true,
|
|
617
|
+
description: 'Resource quotas',
|
|
618
|
+
},
|
|
619
|
+
scaling: {
|
|
620
|
+
type: 'json',
|
|
621
|
+
optional: true,
|
|
622
|
+
description: 'Scaling configuration',
|
|
623
|
+
},
|
|
624
|
+
|
|
625
|
+
// Status
|
|
626
|
+
status: {
|
|
627
|
+
type: 'string',
|
|
628
|
+
description: 'Environment status',
|
|
629
|
+
examples: ['active', 'inactive', 'maintenance', 'deprecated'],
|
|
630
|
+
},
|
|
631
|
+
healthStatus: {
|
|
632
|
+
type: 'string',
|
|
633
|
+
optional: true,
|
|
634
|
+
description: 'Health status',
|
|
635
|
+
examples: ['healthy', 'degraded', 'unhealthy', 'unknown'],
|
|
636
|
+
},
|
|
637
|
+
},
|
|
638
|
+
|
|
639
|
+
relationships: {
|
|
640
|
+
product: {
|
|
641
|
+
type: 'DigitalProduct',
|
|
642
|
+
description: 'Parent product',
|
|
643
|
+
},
|
|
644
|
+
deployments: {
|
|
645
|
+
type: 'Deployment[]',
|
|
646
|
+
description: 'Environment deployments',
|
|
647
|
+
},
|
|
648
|
+
currentDeployment: {
|
|
649
|
+
type: 'Deployment',
|
|
650
|
+
required: false,
|
|
651
|
+
description: 'Current active deployment',
|
|
652
|
+
},
|
|
653
|
+
},
|
|
654
|
+
|
|
655
|
+
actions: [
|
|
656
|
+
'create',
|
|
657
|
+
'update',
|
|
658
|
+
'configure',
|
|
659
|
+
'activate',
|
|
660
|
+
'deactivate',
|
|
661
|
+
'promote',
|
|
662
|
+
'lock',
|
|
663
|
+
'unlock',
|
|
664
|
+
],
|
|
665
|
+
|
|
666
|
+
events: [
|
|
667
|
+
'created',
|
|
668
|
+
'updated',
|
|
669
|
+
'configured',
|
|
670
|
+
'activated',
|
|
671
|
+
'deactivated',
|
|
672
|
+
'promoted',
|
|
673
|
+
'locked',
|
|
674
|
+
'unlocked',
|
|
675
|
+
],
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
// =============================================================================
|
|
679
|
+
// Feature
|
|
680
|
+
// =============================================================================
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Feature entity
|
|
684
|
+
*
|
|
685
|
+
* Product feature.
|
|
686
|
+
*/
|
|
687
|
+
export const Feature: Noun = {
|
|
688
|
+
singular: 'feature',
|
|
689
|
+
plural: 'features',
|
|
690
|
+
description: 'A product feature or capability',
|
|
691
|
+
|
|
692
|
+
properties: {
|
|
693
|
+
// Identity
|
|
694
|
+
name: {
|
|
695
|
+
type: 'string',
|
|
696
|
+
description: 'Feature name',
|
|
697
|
+
},
|
|
698
|
+
slug: {
|
|
699
|
+
type: 'string',
|
|
700
|
+
optional: true,
|
|
701
|
+
description: 'URL-friendly identifier',
|
|
702
|
+
},
|
|
703
|
+
description: {
|
|
704
|
+
type: 'string',
|
|
705
|
+
optional: true,
|
|
706
|
+
description: 'Feature description',
|
|
707
|
+
},
|
|
708
|
+
|
|
709
|
+
// Classification
|
|
710
|
+
type: {
|
|
711
|
+
type: 'string',
|
|
712
|
+
description: 'Feature type',
|
|
713
|
+
examples: ['core', 'premium', 'addon', 'beta', 'experimental', 'deprecated'],
|
|
714
|
+
},
|
|
715
|
+
category: {
|
|
716
|
+
type: 'string',
|
|
717
|
+
optional: true,
|
|
718
|
+
description: 'Feature category',
|
|
719
|
+
},
|
|
720
|
+
|
|
721
|
+
// Value
|
|
722
|
+
benefit: {
|
|
723
|
+
type: 'string',
|
|
724
|
+
optional: true,
|
|
725
|
+
description: 'User benefit',
|
|
726
|
+
},
|
|
727
|
+
valueProposition: {
|
|
728
|
+
type: 'string',
|
|
729
|
+
optional: true,
|
|
730
|
+
description: 'Value proposition',
|
|
731
|
+
},
|
|
732
|
+
|
|
733
|
+
// Feature Flag
|
|
734
|
+
flagKey: {
|
|
735
|
+
type: 'string',
|
|
736
|
+
optional: true,
|
|
737
|
+
description: 'Feature flag key',
|
|
738
|
+
},
|
|
739
|
+
defaultEnabled: {
|
|
740
|
+
type: 'boolean',
|
|
741
|
+
optional: true,
|
|
742
|
+
description: 'Enabled by default',
|
|
743
|
+
},
|
|
744
|
+
rolloutPercentage: {
|
|
745
|
+
type: 'number',
|
|
746
|
+
optional: true,
|
|
747
|
+
description: 'Rollout percentage (0-100)',
|
|
748
|
+
},
|
|
749
|
+
|
|
750
|
+
// Availability
|
|
751
|
+
availability: {
|
|
752
|
+
type: 'string',
|
|
753
|
+
optional: true,
|
|
754
|
+
description: 'Availability',
|
|
755
|
+
examples: ['all', 'paid', 'enterprise', 'beta', 'internal'],
|
|
756
|
+
},
|
|
757
|
+
requiredPlan: {
|
|
758
|
+
type: 'string',
|
|
759
|
+
optional: true,
|
|
760
|
+
description: 'Minimum required plan',
|
|
761
|
+
},
|
|
762
|
+
addOnPrice: {
|
|
763
|
+
type: 'number',
|
|
764
|
+
optional: true,
|
|
765
|
+
description: 'Add-on price if separate',
|
|
766
|
+
},
|
|
767
|
+
|
|
768
|
+
// Dependencies
|
|
769
|
+
dependsOn: {
|
|
770
|
+
type: 'string',
|
|
771
|
+
array: true,
|
|
772
|
+
optional: true,
|
|
773
|
+
description: 'Dependent features',
|
|
774
|
+
},
|
|
775
|
+
conflictsWith: {
|
|
776
|
+
type: 'string',
|
|
777
|
+
array: true,
|
|
778
|
+
optional: true,
|
|
779
|
+
description: 'Conflicting features',
|
|
780
|
+
},
|
|
781
|
+
|
|
782
|
+
// Lifecycle
|
|
783
|
+
introducedIn: {
|
|
784
|
+
type: 'string',
|
|
785
|
+
optional: true,
|
|
786
|
+
description: 'Version introduced',
|
|
787
|
+
},
|
|
788
|
+
deprecatedIn: {
|
|
789
|
+
type: 'string',
|
|
790
|
+
optional: true,
|
|
791
|
+
description: 'Version deprecated',
|
|
792
|
+
},
|
|
793
|
+
removedIn: {
|
|
794
|
+
type: 'string',
|
|
795
|
+
optional: true,
|
|
796
|
+
description: 'Version removed',
|
|
797
|
+
},
|
|
798
|
+
|
|
799
|
+
// Metrics
|
|
800
|
+
adoptionRate: {
|
|
801
|
+
type: 'number',
|
|
802
|
+
optional: true,
|
|
803
|
+
description: 'Adoption rate (0-1)',
|
|
804
|
+
},
|
|
805
|
+
usageCount: {
|
|
806
|
+
type: 'number',
|
|
807
|
+
optional: true,
|
|
808
|
+
description: 'Total usage count',
|
|
809
|
+
},
|
|
810
|
+
|
|
811
|
+
// Status
|
|
812
|
+
status: {
|
|
813
|
+
type: 'string',
|
|
814
|
+
description: 'Feature status',
|
|
815
|
+
examples: ['planned', 'development', 'beta', 'ga', 'deprecated', 'removed'],
|
|
816
|
+
},
|
|
817
|
+
},
|
|
818
|
+
|
|
819
|
+
relationships: {
|
|
820
|
+
product: {
|
|
821
|
+
type: 'DigitalProduct',
|
|
822
|
+
description: 'Parent product',
|
|
823
|
+
},
|
|
824
|
+
dependentFeatures: {
|
|
825
|
+
type: 'Feature[]',
|
|
826
|
+
description: 'Features that depend on this',
|
|
827
|
+
},
|
|
828
|
+
roadmapItem: {
|
|
829
|
+
type: 'RoadmapItem',
|
|
830
|
+
required: false,
|
|
831
|
+
description: 'Associated roadmap item',
|
|
832
|
+
},
|
|
833
|
+
},
|
|
834
|
+
|
|
835
|
+
actions: [
|
|
836
|
+
'create',
|
|
837
|
+
'update',
|
|
838
|
+
'enable',
|
|
839
|
+
'disable',
|
|
840
|
+
'rollout',
|
|
841
|
+
'deprecate',
|
|
842
|
+
'remove',
|
|
843
|
+
],
|
|
844
|
+
|
|
845
|
+
events: [
|
|
846
|
+
'created',
|
|
847
|
+
'updated',
|
|
848
|
+
'enabled',
|
|
849
|
+
'disabled',
|
|
850
|
+
'rolledOut',
|
|
851
|
+
'deprecated',
|
|
852
|
+
'removed',
|
|
853
|
+
],
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
// =============================================================================
|
|
857
|
+
// Exports
|
|
858
|
+
// =============================================================================
|
|
859
|
+
|
|
860
|
+
export const LifecycleEntities = {
|
|
861
|
+
Version,
|
|
862
|
+
Release,
|
|
863
|
+
Deployment,
|
|
864
|
+
Environment,
|
|
865
|
+
Feature,
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
export const LifecycleCategories = {
|
|
869
|
+
versioning: ['Version', 'Release'],
|
|
870
|
+
deployment: ['Deployment', 'Environment'],
|
|
871
|
+
features: ['Feature'],
|
|
872
|
+
} as const
|