speckeeper 0.7.2 → 0.8.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/README.md +70 -15
- package/dist/cli.js +53 -36
- package/dist/cli.js.map +1 -1
- package/dist/config-api-U2pt1aHJ.d.ts +970 -0
- package/dist/dsl/index.d.ts +33 -2
- package/dist/dsl/index.js +197 -3
- package/dist/dsl/index.js.map +1 -1
- package/dist/index.d.ts +3 -504
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/model-BPZMYasZ.d.ts +0 -451
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { S as SpecEntry } from './
|
|
3
|
-
export {
|
|
2
|
+
import { C as CheckContext, a as CheckResult, E as ExportContext, M as ModelDefinition, b as MetaModelRegistry, L as LintContext, c as LintRule, d as LintIssue, S as SpecEntry } from './config-api-U2pt1aHJ.js';
|
|
3
|
+
export { A as ArtifactConfig, B as BaseModelInstance, e as CheckError, f as CheckErrorSchema, g as CheckResult, h as CheckResultSchema, i as CheckWarning, j as CheckWarningSchema, k as CoverageChecker, l as CoverageResult, m as Exporter, n as ExternalChecker, I as InferModelType, J as JsonSchemaExporter, o as LintIssueSchema, p as LintResult, q as LintRule, r as MarkdownExporter, s as MergedDesign, t as MermaidExporter, u as MetaModelConfig, v as Model, w as ModelDefinitionInput, x as ModelLevel, R as RELATION_CONSTRAINTS, y as RELATION_TYPES, z as ReferenceDefinition, D as ReferenceDefinitionSchema, F as Relation, G as RelationSchema, H as RelationValidationError, K as RelationsFieldSchema, N as RenderContext, O as Renderer, P as ResolvedSpeckeeperConfig, Q as SpecModule, T as SpeckeeperConfigInput, U as buildRegistryFromConfig, V as createLintRule, W as createMarkdownExporter, X as createMermaidExporter, Y as defineConfig, Z as defineModel, _ as defineSpecs, $ as detectCycles, a0 as findModelTypeFromConfig, a1 as getLevelIndex, a2 as getSpecsFromConfig, a3 as inferModelIdFromSpecId, a4 as loadSpeckeeperConfig, a5 as mergeSpecs, a6 as validateRelationLevel } from './config-api-U2pt1aHJ.js';
|
|
4
4
|
|
|
5
5
|
declare const PhaseSchema: z.ZodEnum<["REQ", "HLD", "LLD", "IMPL", "OPS", "CI"]>;
|
|
6
6
|
type Phase = z.infer<typeof PhaseSchema>;
|
|
@@ -150,333 +150,6 @@ interface ModelRegistrySchema {
|
|
|
150
150
|
terms: Map<TermId, unknown>;
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
/**
|
|
154
|
-
* Export Context
|
|
155
|
-
* Context information passed to exporter functions
|
|
156
|
-
*/
|
|
157
|
-
interface ExportContext {
|
|
158
|
-
/** Access to all models (MetaModelRegistry type, using unknown to avoid circular references) */
|
|
159
|
-
registry: unknown;
|
|
160
|
-
/** Configuration (SpeckeeperConfig type, using unknown to avoid circular references) */
|
|
161
|
-
config: unknown;
|
|
162
|
-
/** Output base directory */
|
|
163
|
-
outputDir: string;
|
|
164
|
-
/** Current date/time */
|
|
165
|
-
generatedAt: Date;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Lint Context
|
|
169
|
-
* Context information passed to lint functions
|
|
170
|
-
*/
|
|
171
|
-
interface LintContext {
|
|
172
|
-
/** Access to all models (MetaModelRegistry type) */
|
|
173
|
-
registry: unknown;
|
|
174
|
-
/** Current phase */
|
|
175
|
-
phase?: 'REQ' | 'HLD' | 'LLD' | 'OPS';
|
|
176
|
-
/** Strict mode */
|
|
177
|
-
strict?: boolean;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Check Context
|
|
181
|
-
* Context information passed to external SSOT check functions
|
|
182
|
-
*/
|
|
183
|
-
interface CheckContext {
|
|
184
|
-
/** Access to all models (MetaModelRegistry type) */
|
|
185
|
-
registry: unknown;
|
|
186
|
-
/** External SSOT file path */
|
|
187
|
-
sourcePath: string;
|
|
188
|
-
/** Configuration (SpeckeeperConfig type) */
|
|
189
|
-
config: unknown;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Lint Issue
|
|
193
|
-
*/
|
|
194
|
-
interface LintIssue {
|
|
195
|
-
/** Issue message */
|
|
196
|
-
message: string;
|
|
197
|
-
/** Problematic field (optional) */
|
|
198
|
-
field?: string;
|
|
199
|
-
/** Fix suggestion (optional) */
|
|
200
|
-
suggestion?: string;
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Check Result
|
|
204
|
-
*/
|
|
205
|
-
interface CheckResult {
|
|
206
|
-
/** Whether successful */
|
|
207
|
-
success: boolean;
|
|
208
|
-
/** List of error messages */
|
|
209
|
-
errors: CheckError[];
|
|
210
|
-
/** List of warning messages */
|
|
211
|
-
warnings: CheckWarning[];
|
|
212
|
-
}
|
|
213
|
-
interface CheckError {
|
|
214
|
-
/** Error message */
|
|
215
|
-
message: string;
|
|
216
|
-
/** Target model ID */
|
|
217
|
-
modelId: string;
|
|
218
|
-
/** External SSOT reference */
|
|
219
|
-
externalRef?: string;
|
|
220
|
-
}
|
|
221
|
-
interface CheckWarning {
|
|
222
|
-
/** Warning message */
|
|
223
|
-
message: string;
|
|
224
|
-
/** Target model ID */
|
|
225
|
-
modelId: string;
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Markdown Exporter
|
|
229
|
-
*/
|
|
230
|
-
interface MarkdownExporter<T> {
|
|
231
|
-
/** Single document generation */
|
|
232
|
-
single: (model: T, context: ExportContext) => string;
|
|
233
|
-
/** Index page generation (optional) */
|
|
234
|
-
index?: (models: T[], context: ExportContext) => string;
|
|
235
|
-
/** Output directory (relative path from docs/) */
|
|
236
|
-
outputDir: string;
|
|
237
|
-
/** Filename generation (default is model.id) */
|
|
238
|
-
filename?: (model: T) => string;
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Mermaid Diagram Exporter
|
|
242
|
-
*/
|
|
243
|
-
interface MermaidExporter<T> {
|
|
244
|
-
/** Diagram type */
|
|
245
|
-
diagramType: 'flowchart' | 'sequenceDiagram' | 'erDiagram' | 'stateDiagram' | 'C4Context' | 'C4Container' | 'C4Component' | 'custom';
|
|
246
|
-
/** Diagram generation function */
|
|
247
|
-
generate: (models: T[], context: ExportContext) => string;
|
|
248
|
-
/** Output file path (relative path from docs/) */
|
|
249
|
-
outputPath: string;
|
|
250
|
-
/** Diagram title */
|
|
251
|
-
title?: string;
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* JSON Schema Exporter Settings
|
|
255
|
-
*/
|
|
256
|
-
interface JsonSchemaExporter {
|
|
257
|
-
/** Enabled */
|
|
258
|
-
enabled: boolean;
|
|
259
|
-
/** Output directory (relative path from specs/) */
|
|
260
|
-
outputDir: string;
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Lint Rule
|
|
264
|
-
*/
|
|
265
|
-
interface LintRule<T> {
|
|
266
|
-
/** Rule ID */
|
|
267
|
-
id: string;
|
|
268
|
-
/** Rule description */
|
|
269
|
-
description: string;
|
|
270
|
-
/** Severity */
|
|
271
|
-
severity: 'error' | 'warning' | 'info';
|
|
272
|
-
/** Check function */
|
|
273
|
-
check: (model: T, context: LintContext) => LintIssue | null;
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* External SSOT Checker
|
|
277
|
-
*/
|
|
278
|
-
interface ExternalChecker<T> {
|
|
279
|
-
/** External SSOT type to check */
|
|
280
|
-
targetType: 'openapi' | 'ddl' | 'iac' | 'custom';
|
|
281
|
-
/** Execute check */
|
|
282
|
-
check: (model: T, externalSource: unknown, context: CheckContext) => CheckResult;
|
|
283
|
-
/** Get external SSOT file path (from model) */
|
|
284
|
-
getSourcePath?: (model: T) => string | undefined;
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Inter-model Reference Definition (for traceability)
|
|
288
|
-
*/
|
|
289
|
-
interface ReferenceDefinition {
|
|
290
|
-
/** Field name with reference */
|
|
291
|
-
field: string;
|
|
292
|
-
/** Referenced model ID */
|
|
293
|
-
targetModel: string;
|
|
294
|
-
/** Whether reference is required */
|
|
295
|
-
required?: boolean;
|
|
296
|
-
/** Whether reference is array */
|
|
297
|
-
isArray?: boolean;
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* Model Definition
|
|
301
|
-
* Interface for users to define new entities
|
|
302
|
-
*/
|
|
303
|
-
interface ModelDefinition<T extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
304
|
-
/** Model unique identifier (kebab-case recommended) */
|
|
305
|
-
id: string;
|
|
306
|
-
/** Model name (PascalCase recommended) */
|
|
307
|
-
name: string;
|
|
308
|
-
/** Model description */
|
|
309
|
-
description: string;
|
|
310
|
-
/** Zod Schema */
|
|
311
|
-
schema: T;
|
|
312
|
-
/** ID prefix for generation */
|
|
313
|
-
idPrefix: string;
|
|
314
|
-
/** Exporter settings */
|
|
315
|
-
exporters?: {
|
|
316
|
-
/** Markdown exporter */
|
|
317
|
-
markdown?: MarkdownExporter<z.infer<T>>;
|
|
318
|
-
/** Mermaid diagram exporter (multiple allowed) */
|
|
319
|
-
mermaid?: MermaidExporter<z.infer<T>> | MermaidExporter<z.infer<T>>[];
|
|
320
|
-
/** JSON Schema exporter */
|
|
321
|
-
jsonSchema?: JsonSchemaExporter;
|
|
322
|
-
};
|
|
323
|
-
/** Lint rules */
|
|
324
|
-
lintRules?: LintRule<z.infer<T>>[];
|
|
325
|
-
/** External SSOT checker */
|
|
326
|
-
externalChecker?: ExternalChecker<z.infer<T>>;
|
|
327
|
-
/** Reference definitions (for traceability) */
|
|
328
|
-
references?: ReferenceDefinition[];
|
|
329
|
-
/** DSL function name (the Xxx part of defineXxx) */
|
|
330
|
-
dslName?: string;
|
|
331
|
-
/** Phase (the phase where this model is primarily used) */
|
|
332
|
-
phase?: 'REQ' | 'HLD' | 'LLD' | 'OPS';
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* Meta Model Registry
|
|
336
|
-
* Manages registered model definitions and model instances
|
|
337
|
-
*/
|
|
338
|
-
interface MetaModelRegistry {
|
|
339
|
-
/** Registered model definitions */
|
|
340
|
-
definitions: Map<string, ModelDefinition>;
|
|
341
|
-
/** Model instances (Map<instanceId, instance> for each model ID) */
|
|
342
|
-
instances: Map<string, Map<string, unknown>>;
|
|
343
|
-
}
|
|
344
|
-
/**
|
|
345
|
-
* Additional settings for meta model
|
|
346
|
-
*/
|
|
347
|
-
interface MetaModelConfig {
|
|
348
|
-
/** Custom model definitions */
|
|
349
|
-
models?: ModelDefinition[];
|
|
350
|
-
/** External SSOT settings */
|
|
351
|
-
externalSsot?: {
|
|
352
|
-
openapi?: {
|
|
353
|
-
enabled: boolean;
|
|
354
|
-
paths: string[];
|
|
355
|
-
};
|
|
356
|
-
ddl?: {
|
|
357
|
-
enabled: boolean;
|
|
358
|
-
type: 'ddl' | 'prisma' | 'typeorm' | 'drizzle';
|
|
359
|
-
path: string;
|
|
360
|
-
};
|
|
361
|
-
iac?: {
|
|
362
|
-
enabled: boolean;
|
|
363
|
-
type: 'cloudformation' | 'cdk' | 'terraform';
|
|
364
|
-
path: string;
|
|
365
|
-
};
|
|
366
|
-
};
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* Base type for model instances
|
|
370
|
-
* All model instances have an id
|
|
371
|
-
*/
|
|
372
|
-
interface BaseModelInstance {
|
|
373
|
-
id: string;
|
|
374
|
-
}
|
|
375
|
-
/**
|
|
376
|
-
* Helper type for creating type-safe model definitions
|
|
377
|
-
*/
|
|
378
|
-
type InferModelType<T extends ModelDefinition> = z.infer<T['schema']>;
|
|
379
|
-
declare const ReferenceDefinitionSchema: z.ZodObject<{
|
|
380
|
-
field: z.ZodString;
|
|
381
|
-
targetModel: z.ZodString;
|
|
382
|
-
required: z.ZodOptional<z.ZodBoolean>;
|
|
383
|
-
isArray: z.ZodOptional<z.ZodBoolean>;
|
|
384
|
-
}, "strip", z.ZodTypeAny, {
|
|
385
|
-
field: string;
|
|
386
|
-
targetModel: string;
|
|
387
|
-
required?: boolean | undefined;
|
|
388
|
-
isArray?: boolean | undefined;
|
|
389
|
-
}, {
|
|
390
|
-
field: string;
|
|
391
|
-
targetModel: string;
|
|
392
|
-
required?: boolean | undefined;
|
|
393
|
-
isArray?: boolean | undefined;
|
|
394
|
-
}>;
|
|
395
|
-
declare const LintIssueSchema: z.ZodObject<{
|
|
396
|
-
message: z.ZodString;
|
|
397
|
-
field: z.ZodOptional<z.ZodString>;
|
|
398
|
-
suggestion: z.ZodOptional<z.ZodString>;
|
|
399
|
-
}, "strip", z.ZodTypeAny, {
|
|
400
|
-
message: string;
|
|
401
|
-
field?: string | undefined;
|
|
402
|
-
suggestion?: string | undefined;
|
|
403
|
-
}, {
|
|
404
|
-
message: string;
|
|
405
|
-
field?: string | undefined;
|
|
406
|
-
suggestion?: string | undefined;
|
|
407
|
-
}>;
|
|
408
|
-
declare const CheckErrorSchema: z.ZodObject<{
|
|
409
|
-
message: z.ZodString;
|
|
410
|
-
modelId: z.ZodString;
|
|
411
|
-
externalRef: z.ZodOptional<z.ZodString>;
|
|
412
|
-
}, "strip", z.ZodTypeAny, {
|
|
413
|
-
message: string;
|
|
414
|
-
modelId: string;
|
|
415
|
-
externalRef?: string | undefined;
|
|
416
|
-
}, {
|
|
417
|
-
message: string;
|
|
418
|
-
modelId: string;
|
|
419
|
-
externalRef?: string | undefined;
|
|
420
|
-
}>;
|
|
421
|
-
declare const CheckWarningSchema: z.ZodObject<{
|
|
422
|
-
message: z.ZodString;
|
|
423
|
-
modelId: z.ZodString;
|
|
424
|
-
}, "strip", z.ZodTypeAny, {
|
|
425
|
-
message: string;
|
|
426
|
-
modelId: string;
|
|
427
|
-
}, {
|
|
428
|
-
message: string;
|
|
429
|
-
modelId: string;
|
|
430
|
-
}>;
|
|
431
|
-
declare const CheckResultSchema: z.ZodObject<{
|
|
432
|
-
success: z.ZodBoolean;
|
|
433
|
-
errors: z.ZodArray<z.ZodObject<{
|
|
434
|
-
message: z.ZodString;
|
|
435
|
-
modelId: z.ZodString;
|
|
436
|
-
externalRef: z.ZodOptional<z.ZodString>;
|
|
437
|
-
}, "strip", z.ZodTypeAny, {
|
|
438
|
-
message: string;
|
|
439
|
-
modelId: string;
|
|
440
|
-
externalRef?: string | undefined;
|
|
441
|
-
}, {
|
|
442
|
-
message: string;
|
|
443
|
-
modelId: string;
|
|
444
|
-
externalRef?: string | undefined;
|
|
445
|
-
}>, "many">;
|
|
446
|
-
warnings: z.ZodArray<z.ZodObject<{
|
|
447
|
-
message: z.ZodString;
|
|
448
|
-
modelId: z.ZodString;
|
|
449
|
-
}, "strip", z.ZodTypeAny, {
|
|
450
|
-
message: string;
|
|
451
|
-
modelId: string;
|
|
452
|
-
}, {
|
|
453
|
-
message: string;
|
|
454
|
-
modelId: string;
|
|
455
|
-
}>, "many">;
|
|
456
|
-
}, "strip", z.ZodTypeAny, {
|
|
457
|
-
success: boolean;
|
|
458
|
-
errors: {
|
|
459
|
-
message: string;
|
|
460
|
-
modelId: string;
|
|
461
|
-
externalRef?: string | undefined;
|
|
462
|
-
}[];
|
|
463
|
-
warnings: {
|
|
464
|
-
message: string;
|
|
465
|
-
modelId: string;
|
|
466
|
-
}[];
|
|
467
|
-
}, {
|
|
468
|
-
success: boolean;
|
|
469
|
-
errors: {
|
|
470
|
-
message: string;
|
|
471
|
-
modelId: string;
|
|
472
|
-
externalRef?: string | undefined;
|
|
473
|
-
}[];
|
|
474
|
-
warnings: {
|
|
475
|
-
message: string;
|
|
476
|
-
modelId: string;
|
|
477
|
-
}[];
|
|
478
|
-
}>;
|
|
479
|
-
|
|
480
153
|
/**
|
|
481
154
|
* Register model definition
|
|
482
155
|
*/
|
|
@@ -594,180 +267,6 @@ declare function getModelRegistryStats(): {
|
|
|
594
267
|
totalInstances: number;
|
|
595
268
|
};
|
|
596
269
|
|
|
597
|
-
/**
|
|
598
|
-
* speckeeper configuration type
|
|
599
|
-
*/
|
|
600
|
-
interface SpeckeeperConfigInput {
|
|
601
|
-
/** Project name */
|
|
602
|
-
projectName?: string;
|
|
603
|
-
/** Project version */
|
|
604
|
-
version?: string;
|
|
605
|
-
/** Design files directory */
|
|
606
|
-
designDir?: string;
|
|
607
|
-
/** Docs output directory */
|
|
608
|
-
docsDir?: string;
|
|
609
|
-
/** Specs output directory */
|
|
610
|
-
specsDir?: string;
|
|
611
|
-
/** Custom model definitions (Model instances or ModelDefinition objects) */
|
|
612
|
-
models?: any[];
|
|
613
|
-
/** Spec data entries from design/index.ts via mergeSpecs() */
|
|
614
|
-
specs?: SpecEntry[];
|
|
615
|
-
/** External SSOT configuration */
|
|
616
|
-
externalSsot?: {
|
|
617
|
-
openapi?: {
|
|
618
|
-
enabled: boolean;
|
|
619
|
-
paths: string[];
|
|
620
|
-
};
|
|
621
|
-
ddl?: {
|
|
622
|
-
enabled: boolean;
|
|
623
|
-
type: 'ddl' | 'prisma' | 'typeorm' | 'drizzle';
|
|
624
|
-
path: string;
|
|
625
|
-
};
|
|
626
|
-
iac?: {
|
|
627
|
-
enabled: boolean;
|
|
628
|
-
type: 'cloudformation' | 'cdk' | 'terraform';
|
|
629
|
-
path: string;
|
|
630
|
-
};
|
|
631
|
-
};
|
|
632
|
-
/** External SSOT file paths — maps node IDs to file paths/globs */
|
|
633
|
-
externalPaths?: Record<string, string>;
|
|
634
|
-
/** Lint configuration */
|
|
635
|
-
lint?: {
|
|
636
|
-
/** Strict mode */
|
|
637
|
-
strict?: boolean;
|
|
638
|
-
/** Disable specific rules */
|
|
639
|
-
disabledRules?: string[];
|
|
640
|
-
};
|
|
641
|
-
}
|
|
642
|
-
/**
|
|
643
|
-
* Resolved speckeeper configuration
|
|
644
|
-
*/
|
|
645
|
-
interface ResolvedSpeckeeperConfig extends SpeckeeperConfigInput {
|
|
646
|
-
designDir: string;
|
|
647
|
-
docsDir: string;
|
|
648
|
-
specsDir: string;
|
|
649
|
-
}
|
|
650
|
-
/**
|
|
651
|
-
* Define speckeeper configuration
|
|
652
|
-
*
|
|
653
|
-
* @example
|
|
654
|
-
* ```typescript
|
|
655
|
-
* // speckeeper.config.ts
|
|
656
|
-
* import { defineConfig, defineModel } from 'speckeeper';
|
|
657
|
-
*
|
|
658
|
-
* export default defineConfig({
|
|
659
|
-
* projectName: 'My Project',
|
|
660
|
-
* models: [
|
|
661
|
-
* // Custom model definitions
|
|
662
|
-
* ],
|
|
663
|
-
* });
|
|
664
|
-
* ```
|
|
665
|
-
*/
|
|
666
|
-
declare function defineConfig(input: SpeckeeperConfigInput): ResolvedSpeckeeperConfig;
|
|
667
|
-
/**
|
|
668
|
-
* Model definition input type
|
|
669
|
-
*/
|
|
670
|
-
interface ModelDefinitionInput<T extends z.ZodTypeAny> {
|
|
671
|
-
/** Unique identifier for the model (kebab-case recommended) */
|
|
672
|
-
id: string;
|
|
673
|
-
/** Model name (PascalCase recommended) */
|
|
674
|
-
name: string;
|
|
675
|
-
/** Model description */
|
|
676
|
-
description: string;
|
|
677
|
-
/** Zod schema */
|
|
678
|
-
schema: T;
|
|
679
|
-
/** Prefix for ID generation */
|
|
680
|
-
idPrefix: string;
|
|
681
|
-
/** Exporter configuration */
|
|
682
|
-
exporters?: {
|
|
683
|
-
markdown?: MarkdownExporter<z.infer<T>>;
|
|
684
|
-
mermaid?: MermaidExporter<z.infer<T>> | MermaidExporter<z.infer<T>>[];
|
|
685
|
-
jsonSchema?: JsonSchemaExporter;
|
|
686
|
-
};
|
|
687
|
-
/** Lint rules */
|
|
688
|
-
lintRules?: LintRule<z.infer<T>>[];
|
|
689
|
-
/** External SSOT checker */
|
|
690
|
-
externalChecker?: ExternalChecker<z.infer<T>>;
|
|
691
|
-
/** Reference definitions */
|
|
692
|
-
references?: ReferenceDefinition[];
|
|
693
|
-
/** DSL function name */
|
|
694
|
-
dslName?: string;
|
|
695
|
-
/** Phase */
|
|
696
|
-
phase?: 'REQ' | 'HLD' | 'LLD' | 'OPS';
|
|
697
|
-
}
|
|
698
|
-
/**
|
|
699
|
-
* Create a custom model definition
|
|
700
|
-
*
|
|
701
|
-
* @example
|
|
702
|
-
* ```typescript
|
|
703
|
-
* const RetryPolicyModel = defineModel({
|
|
704
|
-
* id: 'retry-policy',
|
|
705
|
-
* name: 'RetryPolicy',
|
|
706
|
-
* description: 'Retry policy definition',
|
|
707
|
-
* schema: z.object({
|
|
708
|
-
* id: z.string(),
|
|
709
|
-
* name: z.string(),
|
|
710
|
-
* maxAttempts: z.number().min(1),
|
|
711
|
-
* initialDelay: z.number().min(0),
|
|
712
|
-
* backoffMultiplier: z.number().min(1),
|
|
713
|
-
* }),
|
|
714
|
-
* idPrefix: 'RETRY',
|
|
715
|
-
* exporters: {
|
|
716
|
-
* markdown: {
|
|
717
|
-
* single: (m) => `# ${m.name}\n\n- Max Attempts: ${m.maxAttempts}`,
|
|
718
|
-
* outputDir: 'docs/retry-policies',
|
|
719
|
-
* },
|
|
720
|
-
* },
|
|
721
|
-
* lintRules: [
|
|
722
|
-
* {
|
|
723
|
-
* id: 'retry-max-limit',
|
|
724
|
-
* description: 'maxAttempts should not exceed 10',
|
|
725
|
-
* severity: 'warning',
|
|
726
|
-
* check: (m) => m.maxAttempts > 10
|
|
727
|
-
* ? { message: `maxAttempts ${m.maxAttempts} exceeds recommended limit` }
|
|
728
|
-
* : null,
|
|
729
|
-
* },
|
|
730
|
-
* ],
|
|
731
|
-
* });
|
|
732
|
-
* ```
|
|
733
|
-
*/
|
|
734
|
-
declare function defineModel<T extends z.ZodTypeAny>(input: ModelDefinitionInput<T>): ModelDefinition<T>;
|
|
735
|
-
/**
|
|
736
|
-
* Helper to create Markdown exporter
|
|
737
|
-
*/
|
|
738
|
-
declare function createMarkdownExporter<T>(config: {
|
|
739
|
-
outputDir: string;
|
|
740
|
-
single: (model: T, context: unknown) => string;
|
|
741
|
-
index?: (models: T[], context: unknown) => string;
|
|
742
|
-
filename?: (model: T) => string;
|
|
743
|
-
}): MarkdownExporter<T>;
|
|
744
|
-
/**
|
|
745
|
-
* Helper to create Mermaid diagram exporter
|
|
746
|
-
*/
|
|
747
|
-
declare function createMermaidExporter<T>(config: {
|
|
748
|
-
diagramType: MermaidExporter<T>['diagramType'];
|
|
749
|
-
outputPath: string;
|
|
750
|
-
generate: (models: T[], context: unknown) => string;
|
|
751
|
-
title?: string;
|
|
752
|
-
}): MermaidExporter<T>;
|
|
753
|
-
/**
|
|
754
|
-
* Helper to create lint rule
|
|
755
|
-
*/
|
|
756
|
-
declare function createLintRule<T>(config: {
|
|
757
|
-
id: string;
|
|
758
|
-
description: string;
|
|
759
|
-
severity: 'error' | 'warning' | 'info';
|
|
760
|
-
check: (model: T, context: unknown) => {
|
|
761
|
-
message: string;
|
|
762
|
-
field?: string;
|
|
763
|
-
suggestion?: string;
|
|
764
|
-
} | null;
|
|
765
|
-
}): LintRule<T>;
|
|
766
|
-
/**
|
|
767
|
-
* Load speckeeper.config.ts file and register custom models
|
|
768
|
-
*/
|
|
769
|
-
declare function loadSpeckeeperConfig(configPath?: string): Promise<ResolvedSpeckeeperConfig | null>;
|
|
770
|
-
|
|
771
270
|
/**
|
|
772
271
|
* Specification-compliant output path definitions
|
|
773
272
|
*
|
|
@@ -913,4 +412,4 @@ declare function findDefinitionFiles(srcDir: string, subDir: string): Promise<st
|
|
|
913
412
|
declare function generateDocsPath(baseDir: string, category: string, filename: string): string;
|
|
914
413
|
declare function generateSpecsPath(baseDir: string, category: string, filename: string): string;
|
|
915
414
|
|
|
916
|
-
export { type APIRefId, type ActorId, type
|
|
415
|
+
export { type APIRefId, type ActorId, type BatchRefId, type BatchWriteResult, type BoundaryId, CheckContext, type ComponentId, type ConcretizationSlot, ConcretizationSlotSchema, type DTORequirementId, type DriftResult, type EntityId, type ErrorCaseId, type EventRequirementId, ExportContext, type FormId, ID_PATTERNS, type IaCRefId, type LayerId, type Link, LinkSchema, LintContext, LintIssue, MetaModelRegistry, ModelDefinition, type ModelRegistrySchema, type OutputPaths, type Phase, PhaseSchema, type Priority, PrioritySchema, type ProcessFlowId, type RelationId, type RequirementId, type RuleId, type ScreenId, type Severity, SpecEntry, type SpeckeeperConfig, type StateId, type TableRefId, type TermId, type TransitionId, type UIComponentId, type UseCaseId, type ValidationError, type ValidationResult, type WriteResult, batchWriteFiles, checkBatchDrift, checkExternalSsot, checkFileDrift, checkReferenceIntegrity, computeHash, createAPIRefId, createActorId, createBatchRefId, createBoundaryId, createComponentId, createDTORequirementId, createEntityId, createErrorCaseId, createEventRequirementId, createFormId, createIaCRefId, createLayerId, createProcessFlowId, createRelationId, createRequirementId, createRuleId, createScreenId, createStateId, createTableRefId, createTermId, createTransitionId, createUIComponentId, createUseCaseId, ensureDir, exportAllModels, exportMarkdown, exportMermaid, findConfigFile, findDefinitionFiles, findFiles, findTypeScriptFiles, generateDocsPath, generateSpecsPath, getAllInstances, getAllModelDefinitions, getAllModelInstances, getExpectedOutputDirs, getGlobalModelRegistry, getModelDefinition, getModelInstance, getModelRegistryStats, getOutputPaths, lintAllModels, lintModel, loadConfig, registerModelDefinition, registerModelDefinitions, registerModelInstance, resetModelInstances, resetModelRegistry, resolveReference, validateConfig, validateOutputPaths, writeFile, writeJsonFile };
|