qfai 0.4.4 → 0.4.7

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.
@@ -644,14 +644,14 @@ async function collectUiContractFiles(uiRoot) {
644
644
  async function collectApiContractFiles(apiRoot) {
645
645
  return collectFiles(apiRoot, { extensions: [".yaml", ".yml", ".json"] });
646
646
  }
647
- async function collectDataContractFiles(dataRoot) {
648
- return collectFiles(dataRoot, { extensions: [".sql"] });
647
+ async function collectDbContractFiles(dbRoot) {
648
+ return collectFiles(dbRoot, { extensions: [".sql"] });
649
649
  }
650
- async function collectContractFiles(uiRoot, apiRoot, dataRoot) {
650
+ async function collectContractFiles(uiRoot, apiRoot, dbRoot) {
651
651
  const [ui, api, db] = await Promise.all([
652
652
  collectUiContractFiles(uiRoot),
653
653
  collectApiContractFiles(apiRoot),
654
- collectDataContractFiles(dataRoot)
654
+ collectDbContractFiles(dbRoot)
655
655
  ]);
656
656
  return { ui, api, db };
657
657
  }
@@ -699,7 +699,7 @@ async function buildContractIndex(root, config) {
699
699
  const [uiFiles, apiFiles, dbFiles] = await Promise.all([
700
700
  collectUiContractFiles(uiRoot),
701
701
  collectApiContractFiles(apiRoot),
702
- collectDataContractFiles(dbRoot)
702
+ collectDbContractFiles(dbRoot)
703
703
  ]);
704
704
  const index = {
705
705
  ids: /* @__PURE__ */ new Set(),
@@ -1261,8 +1261,8 @@ import { readFile as readFile4 } from "fs/promises";
1261
1261
  import path9 from "path";
1262
1262
  import { fileURLToPath as fileURLToPath2 } from "url";
1263
1263
  async function resolveToolVersion() {
1264
- if ("0.4.4".length > 0) {
1265
- return "0.4.4";
1264
+ if ("0.4.7".length > 0) {
1265
+ return "0.4.7";
1266
1266
  }
1267
1267
  try {
1268
1268
  const packagePath = resolvePackageJsonPath();
@@ -1310,7 +1310,7 @@ async function validateContracts(root, config) {
1310
1310
  const contractsRoot = resolvePath(root, config, "contractsDir");
1311
1311
  issues.push(...await validateUiContracts(path11.join(contractsRoot, "ui")));
1312
1312
  issues.push(...await validateApiContracts(path11.join(contractsRoot, "api")));
1313
- issues.push(...await validateDataContracts(path11.join(contractsRoot, "db")));
1313
+ issues.push(...await validateDbContracts(path11.join(contractsRoot, "db")));
1314
1314
  const contractIndex = await buildContractIndex(root, config);
1315
1315
  issues.push(...validateDuplicateContractIds(contractIndex));
1316
1316
  return issues;
@@ -1438,15 +1438,15 @@ async function validateApiContracts(apiRoot) {
1438
1438
  }
1439
1439
  return issues;
1440
1440
  }
1441
- async function validateDataContracts(dataRoot) {
1442
- const files = await collectDataContractFiles(dataRoot);
1441
+ async function validateDbContracts(dbRoot) {
1442
+ const files = await collectDbContractFiles(dbRoot);
1443
1443
  if (files.length === 0) {
1444
1444
  return [
1445
1445
  issue(
1446
1446
  "QFAI-DB-000",
1447
1447
  "DB \u5951\u7D04\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002",
1448
1448
  "info",
1449
- dataRoot,
1449
+ dbRoot,
1450
1450
  "contracts.db.files"
1451
1451
  )
1452
1452
  ];
@@ -3067,7 +3067,31 @@ function isValidationResult(value) {
3067
3067
  if (!counts) {
3068
3068
  return false;
3069
3069
  }
3070
- return typeof counts.info === "number" && typeof counts.warning === "number" && typeof counts.error === "number";
3070
+ if (typeof counts.info !== "number" || typeof counts.warning !== "number" || typeof counts.error !== "number") {
3071
+ return false;
3072
+ }
3073
+ const traceability = record2.traceability;
3074
+ if (!traceability || typeof traceability !== "object") {
3075
+ return false;
3076
+ }
3077
+ const sc = traceability.sc;
3078
+ const testFiles = traceability.testFiles;
3079
+ if (!sc || !testFiles) {
3080
+ return false;
3081
+ }
3082
+ if (typeof sc.total !== "number" || typeof sc.covered !== "number" || typeof sc.missing !== "number") {
3083
+ return false;
3084
+ }
3085
+ if (!Array.isArray(sc.missingIds)) {
3086
+ return false;
3087
+ }
3088
+ if (!sc.refs || typeof sc.refs !== "object") {
3089
+ return false;
3090
+ }
3091
+ if (!Array.isArray(testFiles.globs) || !Array.isArray(testFiles.excludeGlobs) || typeof testFiles.matchedFileCount !== "number") {
3092
+ return false;
3093
+ }
3094
+ return true;
3071
3095
  }
3072
3096
  function isMissingFileError5(error2) {
3073
3097
  if (!error2 || typeof error2 !== "object") {