qfai 0.2.5 → 0.2.8
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 +1 -1
- package/assets/init/.qfai/README.md +42 -0
- package/assets/init/.qfai/contracts/README.md +61 -0
- package/assets/init/{qfai → .qfai}/contracts/api/api-0001-sample.yaml +3 -0
- package/assets/init/{qfai → .qfai}/contracts/db/db-0001-sample.sql +3 -2
- package/assets/init/.qfai/contracts/ui/ui-0001-sample.yaml +6 -0
- package/assets/init/.qfai/out/README.md +17 -0
- package/assets/init/.qfai/prompts/README.md +32 -0
- package/assets/init/{qfai → .qfai}/prompts/makeBusinessFlow.md +1 -1
- package/assets/init/{qfai → .qfai}/prompts/makeOverview.md +1 -1
- package/assets/init/.qfai/spec/README.md +80 -0
- package/assets/init/.qfai/spec/decisions/ADR-0001.md +9 -0
- package/assets/init/.qfai/spec/decisions/README.md +36 -0
- package/assets/init/.qfai/spec/scenarios/scenarios.feature +6 -0
- package/assets/init/.qfai/spec/spec-0001-sample.md +36 -0
- package/assets/init/root/qfai.config.yaml +8 -8
- package/dist/cli/index.cjs +498 -206
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.mjs +495 -203
- package/dist/cli/index.mjs.map +1 -1
- package/dist/index.cjs +471 -177
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -4
- package/dist/index.d.ts +135 -2
- package/dist/index.mjs +470 -177
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/assets/init/qfai/README.md +0 -6
- package/assets/init/qfai/contracts/ui/ui-0001-sample.yaml +0 -4
- package/assets/init/qfai/spec/decisions/ADR-0001.md +0 -7
- package/assets/init/qfai/spec/scenarios.feature +0 -6
- package/assets/init/qfai/spec/spec-0001-sample.md +0 -29
- package/dist/cli/commands/init.d.ts +0 -8
- package/dist/cli/commands/init.d.ts.map +0 -1
- package/dist/cli/commands/init.js +0 -30
- package/dist/cli/commands/init.js.map +0 -1
- package/dist/cli/commands/report.d.ts +0 -8
- package/dist/cli/commands/report.d.ts.map +0 -1
- package/dist/cli/commands/report.js +0 -83
- package/dist/cli/commands/report.js.map +0 -1
- package/dist/cli/commands/validate.d.ts +0 -10
- package/dist/cli/commands/validate.d.ts.map +0 -1
- package/dist/cli/commands/validate.js +0 -66
- package/dist/cli/commands/validate.js.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -7
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/lib/args.d.ts +0 -19
- package/dist/cli/lib/args.d.ts.map +0 -1
- package/dist/cli/lib/args.js +0 -107
- package/dist/cli/lib/args.js.map +0 -1
- package/dist/cli/lib/assets.d.ts +0 -2
- package/dist/cli/lib/assets.d.ts.map +0 -1
- package/dist/cli/lib/assets.js +0 -8
- package/dist/cli/lib/assets.js.map +0 -1
- package/dist/cli/lib/failOn.d.ts +0 -5
- package/dist/cli/lib/failOn.d.ts.map +0 -1
- package/dist/cli/lib/failOn.js +0 -10
- package/dist/cli/lib/failOn.js.map +0 -1
- package/dist/cli/lib/fs.d.ts +0 -11
- package/dist/cli/lib/fs.d.ts.map +0 -1
- package/dist/cli/lib/fs.js +0 -91
- package/dist/cli/lib/fs.js.map +0 -1
- package/dist/cli/lib/logger.d.ts +0 -4
- package/dist/cli/lib/logger.d.ts.map +0 -1
- package/dist/cli/lib/logger.js +0 -10
- package/dist/cli/lib/logger.js.map +0 -1
- package/dist/cli/main.d.ts +0 -2
- package/dist/cli/main.d.ts.map +0 -1
- package/dist/cli/main.js +0 -73
- package/dist/cli/main.js.map +0 -1
- package/dist/core/config.d.ts +0 -46
- package/dist/core/config.d.ts.map +0 -1
- package/dist/core/config.js +0 -224
- package/dist/core/config.js.map +0 -1
- package/dist/core/discovery.d.ts +0 -11
- package/dist/core/discovery.d.ts.map +0 -1
- package/dist/core/discovery.js +0 -31
- package/dist/core/discovery.js.map +0 -1
- package/dist/core/fs.d.ts +0 -6
- package/dist/core/fs.d.ts.map +0 -1
- package/dist/core/fs.js +0 -55
- package/dist/core/fs.js.map +0 -1
- package/dist/core/ids.d.ts +0 -5
- package/dist/core/ids.d.ts.map +0 -1
- package/dist/core/ids.js +0 -49
- package/dist/core/ids.js.map +0 -1
- package/dist/core/index.d.ts +0 -11
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -11
- package/dist/core/index.js.map +0 -1
- package/dist/core/report.d.ts +0 -41
- package/dist/core/report.d.ts.map +0 -1
- package/dist/core/report.js +0 -238
- package/dist/core/report.js.map +0 -1
- package/dist/core/types.d.ts +0 -27
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js +0 -2
- package/dist/core/types.js.map +0 -1
- package/dist/core/validate.d.ts +0 -4
- package/dist/core/validate.d.ts.map +0 -1
- package/dist/core/validate.js +0 -32
- package/dist/core/validate.js.map +0 -1
- package/dist/core/validators/contracts.d.ts +0 -5
- package/dist/core/validators/contracts.d.ts.map +0 -1
- package/dist/core/validators/contracts.js +0 -157
- package/dist/core/validators/contracts.js.map +0 -1
- package/dist/core/validators/scenario.d.ts +0 -5
- package/dist/core/validators/scenario.d.ts.map +0 -1
- package/dist/core/validators/scenario.js +0 -82
- package/dist/core/validators/scenario.js.map +0 -1
- package/dist/core/validators/spec.d.ts +0 -5
- package/dist/core/validators/spec.d.ts.map +0 -1
- package/dist/core/validators/spec.js +0 -69
- package/dist/core/validators/spec.js.map +0 -1
- package/dist/core/validators/traceability.d.ts +0 -4
- package/dist/core/validators/traceability.d.ts.map +0 -1
- package/dist/core/validators/traceability.js +0 -148
- package/dist/core/validators/traceability.js.map +0 -1
- package/dist/core/version.d.ts +0 -2
- package/dist/core/version.d.ts.map +0 -1
- package/dist/core/version.js +0 -25
- package/dist/core/version.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,135 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type IssueSeverity = "info" | "warning" | "error";
|
|
2
|
+
declare const VALIDATION_SCHEMA_VERSION: "0.2";
|
|
3
|
+
type IssueLocation = {
|
|
4
|
+
line: number;
|
|
5
|
+
column?: number;
|
|
6
|
+
};
|
|
7
|
+
type Issue = {
|
|
8
|
+
code: string;
|
|
9
|
+
severity: IssueSeverity;
|
|
10
|
+
message: string;
|
|
11
|
+
file?: string;
|
|
12
|
+
refs?: string[];
|
|
13
|
+
rule?: string;
|
|
14
|
+
loc?: IssueLocation;
|
|
15
|
+
};
|
|
16
|
+
type ValidationCounts = {
|
|
17
|
+
info: number;
|
|
18
|
+
warning: number;
|
|
19
|
+
error: number;
|
|
20
|
+
};
|
|
21
|
+
type ValidationResult = {
|
|
22
|
+
schemaVersion: typeof VALIDATION_SCHEMA_VERSION;
|
|
23
|
+
toolVersion: string;
|
|
24
|
+
issues: Issue[];
|
|
25
|
+
counts: ValidationCounts;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type FailOn = "never" | "warning" | "error";
|
|
29
|
+
type OutputFormat = "text" | "json" | "github";
|
|
30
|
+
type TraceabilitySeverity = "warning" | "error";
|
|
31
|
+
type QfaiPaths = {
|
|
32
|
+
specDir: string;
|
|
33
|
+
decisionsDir: string;
|
|
34
|
+
scenariosDir: string;
|
|
35
|
+
contractsDir: string;
|
|
36
|
+
uiContractsDir: string;
|
|
37
|
+
apiContractsDir: string;
|
|
38
|
+
dataContractsDir: string;
|
|
39
|
+
srcDir: string;
|
|
40
|
+
testsDir: string;
|
|
41
|
+
};
|
|
42
|
+
type QfaiValidationConfig = {
|
|
43
|
+
failOn: FailOn;
|
|
44
|
+
require: {
|
|
45
|
+
specSections: string[];
|
|
46
|
+
};
|
|
47
|
+
traceability: {
|
|
48
|
+
brMustHaveSc: boolean;
|
|
49
|
+
scMustTouchContracts: boolean;
|
|
50
|
+
allowOrphanContracts: boolean;
|
|
51
|
+
unknownContractIdSeverity: TraceabilitySeverity;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
type QfaiOutputConfig = {
|
|
55
|
+
format: OutputFormat;
|
|
56
|
+
jsonPath: string;
|
|
57
|
+
};
|
|
58
|
+
type QfaiConfig = {
|
|
59
|
+
paths: QfaiPaths;
|
|
60
|
+
validation: QfaiValidationConfig;
|
|
61
|
+
output: QfaiOutputConfig;
|
|
62
|
+
};
|
|
63
|
+
type ConfigPathKey = keyof QfaiPaths;
|
|
64
|
+
type ConfigLoadResult = {
|
|
65
|
+
config: QfaiConfig;
|
|
66
|
+
issues: Issue[];
|
|
67
|
+
configPath: string;
|
|
68
|
+
};
|
|
69
|
+
declare const defaultConfig: QfaiConfig;
|
|
70
|
+
declare function getConfigPath(root: string): string;
|
|
71
|
+
declare function loadConfig(root: string): Promise<ConfigLoadResult>;
|
|
72
|
+
declare function resolvePath(root: string, config: QfaiConfig, key: ConfigPathKey): string;
|
|
73
|
+
|
|
74
|
+
type IdPrefix = "SPEC" | "BR" | "SC" | "UI" | "API" | "DATA";
|
|
75
|
+
type IdFormatPrefix = IdPrefix | "ADR";
|
|
76
|
+
declare function extractIds(text: string, prefix: IdPrefix): string[];
|
|
77
|
+
declare function extractAllIds(text: string): string[];
|
|
78
|
+
declare function extractInvalidIds(text: string, prefixes: IdFormatPrefix[]): string[];
|
|
79
|
+
|
|
80
|
+
type ReportSummary = {
|
|
81
|
+
specs: number;
|
|
82
|
+
scenarios: number;
|
|
83
|
+
decisions: number;
|
|
84
|
+
contracts: {
|
|
85
|
+
api: number;
|
|
86
|
+
ui: number;
|
|
87
|
+
db: number;
|
|
88
|
+
};
|
|
89
|
+
counts: ValidationCounts;
|
|
90
|
+
};
|
|
91
|
+
type ReportIds = {
|
|
92
|
+
spec: string[];
|
|
93
|
+
br: string[];
|
|
94
|
+
sc: string[];
|
|
95
|
+
ui: string[];
|
|
96
|
+
api: string[];
|
|
97
|
+
data: string[];
|
|
98
|
+
};
|
|
99
|
+
type ReportTraceability = {
|
|
100
|
+
upstreamIdsFound: number;
|
|
101
|
+
referencedInCodeOrTests: boolean;
|
|
102
|
+
};
|
|
103
|
+
type ReportData = {
|
|
104
|
+
tool: "qfai";
|
|
105
|
+
version: string;
|
|
106
|
+
generatedAt: string;
|
|
107
|
+
root: string;
|
|
108
|
+
configPath: string;
|
|
109
|
+
summary: ReportSummary;
|
|
110
|
+
ids: ReportIds;
|
|
111
|
+
traceability: ReportTraceability;
|
|
112
|
+
issues: Issue[];
|
|
113
|
+
};
|
|
114
|
+
declare function createReportData(root: string, validation?: ValidationResult, configResult?: ConfigLoadResult): Promise<ReportData>;
|
|
115
|
+
declare function formatReportMarkdown(data: ReportData): string;
|
|
116
|
+
declare function formatReportJson(data: ReportData): string;
|
|
117
|
+
|
|
118
|
+
declare function validateProject(root: string, configResult?: ConfigLoadResult): Promise<ValidationResult>;
|
|
119
|
+
|
|
120
|
+
declare function resolveToolVersion(): Promise<string>;
|
|
121
|
+
|
|
122
|
+
declare function validateContracts(root: string, config: QfaiConfig): Promise<Issue[]>;
|
|
123
|
+
declare function lintSql(text: string, file: string): Issue[];
|
|
124
|
+
|
|
125
|
+
declare function validateDefinedIds(root: string, config: QfaiConfig): Promise<Issue[]>;
|
|
126
|
+
|
|
127
|
+
declare function validateScenarios(root: string, config: QfaiConfig): Promise<Issue[]>;
|
|
128
|
+
declare function validateScenarioContent(text: string, file: string): Issue[];
|
|
129
|
+
|
|
130
|
+
declare function validateSpecs(root: string, config: QfaiConfig): Promise<Issue[]>;
|
|
131
|
+
declare function validateSpecContent(text: string, file: string, requiredSections: string[]): Issue[];
|
|
132
|
+
|
|
133
|
+
declare function validateTraceability(root: string, config: QfaiConfig): Promise<Issue[]>;
|
|
134
|
+
|
|
135
|
+
export { type ConfigLoadResult, type ConfigPathKey, type FailOn, type IdFormatPrefix, type IdPrefix, type Issue, type IssueLocation, type IssueSeverity, type OutputFormat, type QfaiConfig, type QfaiOutputConfig, type QfaiPaths, type QfaiValidationConfig, type ReportData, type ReportIds, type ReportSummary, type ReportTraceability, type TraceabilitySeverity, VALIDATION_SCHEMA_VERSION, type ValidationCounts, type ValidationResult, createReportData, defaultConfig, extractAllIds, extractIds, extractInvalidIds, formatReportJson, formatReportMarkdown, getConfigPath, lintSql, loadConfig, resolvePath, resolveToolVersion, validateContracts, validateDefinedIds, validateProject, validateScenarioContent, validateScenarios, validateSpecContent, validateSpecs, validateTraceability };
|