@checkdigit/eslint-plugin 7.18.0-PR.143-13e8 → 7.18.0-PR.143-c222

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.
Files changed (38) hide show
  1. package/LICENSE.txt +1 -1
  2. package/dist-mjs/openapi/service-schema-generator.mjs +26 -64
  3. package/package.json +1 -1
  4. package/src/openapi/service-schema-generator.ts +26 -74
  5. package/src/services/interchange/v1/swagger.schema.deref.json +16 -15
  6. package/src/services/ledger/v1/swagger.schema.deref.json +81 -81
  7. package/src/services/ledger/v2/swagger.schema.deref.json +4119 -0
  8. package/src/services/link/v1/swagger.schema.deref.json +13 -12
  9. package/src/services/link/{v1/swagger.schema.json → v2/swagger.schema.deref.json} +98 -28
  10. package/src/services/message/v1/swagger.schema.deref.json +731 -731
  11. package/src/services/message/v2/swagger.schema.deref.json +1017 -1017
  12. package/src/services/paymentCard/v1/swagger.schema.deref.json +248 -238
  13. package/src/services/paymentCard/v2/swagger.schema.deref.json +257 -274
  14. package/src/services/paymentCard/v3/swagger.schema.deref.json +2843 -0
  15. package/src/services/person/v1/swagger.schema.deref.json +111 -96
  16. package/src/services/person/v2/swagger.schema.deref.json +4931 -0
  17. package/src/services/teampayApproval/v1/swagger.schema.deref.json +2 -165
  18. package/src/services/teampayCardManagement/v1/swagger.schema.deref.json +220 -1768
  19. package/src/services/teampayClientManagement/v1/swagger.schema.deref.json +217 -217
  20. package/src/athena/ATHENA.md +0 -387
  21. package/src/athena/PLAN.md +0 -355
  22. package/src/services/interchange/v1/swagger.schema.json +0 -423
  23. package/src/services/interchange/v1/swagger.yml +0 -414
  24. package/src/services/ledger/v1/swagger.schema.json +0 -1048
  25. package/src/services/ledger/v1/swagger.yml +0 -1094
  26. package/src/services/link/v1/swagger.yml +0 -343
  27. package/src/services/message/v1/swagger.schema.json +0 -2944
  28. package/src/services/message/v1/swagger.yml +0 -2798
  29. package/src/services/message/v2/swagger.schema.json +0 -3040
  30. package/src/services/message/v2/swagger.yml +0 -3009
  31. package/src/services/paymentCard/v1/swagger.schema.json +0 -1687
  32. package/src/services/paymentCard/v1/swagger.yml +0 -1161
  33. package/src/services/paymentCard/v2/swagger.schema.json +0 -1649
  34. package/src/services/paymentCard/v2/swagger.yml +0 -1149
  35. package/src/services/person/v1/swagger.schema.json +0 -979
  36. package/src/services/person/v1/swagger.yml +0 -1157
  37. package/src/services/teampayClientManagement/v1/swagger.schema.json +0 -1598
  38. package/src/services/teampayClientManagement/v1/swagger.yml +0 -1376
package/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2021-2024 Check Digit, LLC
3
+ Copyright (c) 2021-2026 Check Digit, LLC
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,5 +1,4 @@
1
1
  // src/openapi/service-schema-generator.ts
2
- import { execFileSync } from "node:child_process";
3
2
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
4
3
  import debug from "debug";
5
4
  import { buildApiSchemaFromYaml } from "./generate-schema.mjs";
@@ -33,17 +32,6 @@ function derefApiSchemas(schemas) {
33
32
  }
34
33
  return { apis: resolvedApis };
35
34
  }
36
- function fetchUrlSync(url) {
37
- try {
38
- return execFileSync(process.execPath, ["--input-type=module"], {
39
- input: `const r=await fetch(${JSON.stringify(url)});if(!r.ok)process.exit(1);process.stdout.write(await r.text());`,
40
- encoding: "utf-8",
41
- timeout: 15e3
42
- });
43
- } catch {
44
- return null;
45
- }
46
- }
47
35
  function readServiceConfig(packageJsonContent, org, serviceName) {
48
36
  const packageJson = JSON.parse(packageJsonContent);
49
37
  const apiRoot = packageJson.service?.api?.root;
@@ -73,74 +61,46 @@ function findServiceLocally(serviceFolder, org, serviceName) {
73
61
  return null;
74
62
  }
75
63
  function findServiceInProject(serviceName) {
76
- const packageJsonString = readFileSync(`./package.json`, "utf-8");
77
- const packageJson = JSON.parse(packageJsonString);
78
- const [org, projectName] = packageJson.name.slice(1).split("/");
79
- if (org === void 0) {
64
+ const packageJson = JSON.parse(readFileSync("./package.json", "utf-8"));
65
+ const [org, projectName] = (packageJson.name ?? "").slice(1).split("/");
66
+ if (org === void 0 || projectName !== serviceName) {
80
67
  return null;
81
68
  }
82
- if (projectName === serviceName) {
83
- log("service is the current project, looking for API schemas locally", serviceName);
84
- const serviceSource = findServiceLocally(".", org, serviceName);
85
- if (serviceSource !== null) {
86
- return serviceSource;
87
- }
88
- }
89
- return null;
69
+ log(`[schema-generator] '${serviceName}' is the current project, reading local swagger files`);
70
+ return findServiceLocally(".", org, serviceName);
90
71
  }
91
72
  function findServiceInNodeModules(serviceName) {
92
73
  for (const org of GITHUB_ORGANIZATIONS) {
93
74
  const serviceFolder = `node_modules/@${org}/${serviceName}`;
94
75
  if (!existsSync(serviceFolder)) {
76
+ log(`[schema-generator] not found in node_modules: @${org}/${serviceName}`);
95
77
  continue;
96
78
  }
97
79
  try {
98
- const serviceSource = findServiceLocally(serviceFolder, org, serviceName);
99
- if (serviceSource !== null) {
100
- return serviceSource;
80
+ log(`[schema-generator] found in node_modules: @${org}/${serviceName}, reading swagger files`);
81
+ const source = findServiceLocally(serviceFolder, org, serviceName);
82
+ if (source !== null) {
83
+ return source;
101
84
  }
102
- } catch {
103
- }
104
- }
105
- return null;
106
- }
107
- function findServiceOnGitHub(serviceName) {
108
- for (const org of GITHUB_ORGANIZATIONS) {
109
- const pkgUrl = `https://raw.githubusercontent.com/${org}/${serviceName}/main/package.json`;
110
- log(`fetching package.json from ${pkgUrl}`);
111
- const pkgContent = fetchUrlSync(pkgUrl);
112
- if (pkgContent === null) {
113
- continue;
114
- }
115
- try {
116
- const config = readServiceConfig(pkgContent, org, serviceName);
117
- if (config === null) {
118
- continue;
119
- }
120
- const endpoints = [];
121
- for (const endpoint of config.endpoints) {
122
- const swaggerUrl = `https://raw.githubusercontent.com/${org}/${serviceName}/main/${config.apiRoot}/${endpoint}/swagger.yml`;
123
- log(`fetching swagger.yml from ${swaggerUrl}`);
124
- const yamlContent = fetchUrlSync(swaggerUrl);
125
- if (yamlContent !== null) {
126
- endpoints.push({ path: endpoint, yamlContent });
127
- }
128
- }
129
- if (endpoints.length > 0) {
130
- return { organization: config.organization, serviceName: config.serviceName, endpoints };
131
- }
132
- } catch {
85
+ log(`[schema-generator] no swagger schema inside node_modules/@${org}/${serviceName}`);
86
+ } catch (error) {
87
+ log(
88
+ `[schema-generator] error reading node_modules/@${org}/${serviceName}: ${error instanceof Error ? error.message : String(error)}`
89
+ );
133
90
  }
134
91
  }
135
92
  return null;
136
93
  }
137
94
  function generateSchemasForService(serviceName, outputDir) {
138
- log("generating schemas for service", serviceName);
139
- const source = findServiceInProject(serviceName) ?? findServiceInNodeModules(serviceName) ?? findServiceOnGitHub(serviceName);
95
+ log(`[schema-generator] locating service '${serviceName}'`);
96
+ const source = findServiceInProject(serviceName) ?? findServiceInNodeModules(serviceName);
140
97
  if (source === null) {
141
- log("no swagger source found for service", serviceName);
98
+ log(
99
+ `[schema-generator] '${serviceName}' not found \u2014 ensure it is listed as a devDependency or the repo is accessible via git`
100
+ );
142
101
  return [];
143
102
  }
103
+ log(`[schema-generator] found '${serviceName}' (${source.endpoints.length.toString()} endpoint(s))`);
144
104
  const results = [];
145
105
  for (const { path: endpoint, yamlContent } of source.endpoints) {
146
106
  try {
@@ -155,10 +115,12 @@ function generateSchemasForService(serviceName, outputDir) {
155
115
  const dir = `${outputDir}/${versionFolder}`;
156
116
  mkdirSync(dir, { recursive: true });
157
117
  writeFileSync(`${dir}/${SWAGGER_SCHEMA_DEREF_FILENAME}`, JSON.stringify(schema, void 0, 2));
158
- log(`cached schema to ${dir}/${SWAGGER_SCHEMA_DEREF_FILENAME}`);
118
+ log(`[schema-generator] cached schema to ${dir}/${SWAGGER_SCHEMA_DEREF_FILENAME}`);
159
119
  }
160
120
  } catch (error) {
161
- log("error generating schema for endpoint", endpoint, error);
121
+ log(
122
+ `[schema-generator] error processing endpoint ${endpoint}: ${error instanceof Error ? error.message : String(error)}`
123
+ );
162
124
  }
163
125
  }
164
126
  return results;
@@ -166,4 +128,4 @@ function generateSchemasForService(serviceName, outputDir) {
166
128
  export {
167
129
  generateSchemasForService
168
130
  };
169
- //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vc3JjL29wZW5hcGkvc2VydmljZS1zY2hlbWEtZ2VuZXJhdG9yLnRzIl0sCiAgIm1hcHBpbmdzIjogIjtBQUVBLFNBQVMsb0JBQW9CO0FBQzdCLFNBQVMsWUFBWSxXQUFXLGNBQWMscUJBQXFCO0FBRW5FLE9BQU8sV0FBVztBQUVsQixTQUEwQiw4QkFBOEI7QUFFeEQsSUFBTSxNQUFNLE1BQU0sK0NBQStDO0FBRWpFLElBQU0sdUJBQXVCLENBQUMsY0FBYyxtQkFBbUI7QUFDL0QsSUFBTSxnQ0FBZ0M7QUFhdEMsU0FBUyxnQkFBZ0IsU0FBaUM7QUFDeEQsUUFBTSxjQUFjLFFBQVEsZUFBZSxDQUFDO0FBRTVDLFdBQVMsV0FBVyxPQUFnQixZQUF5QixvQkFBSSxJQUFZLEdBQVk7QUFDdkYsUUFBSSxVQUFVLFFBQVEsT0FBTyxVQUFVLFVBQVU7QUFDL0MsYUFBTztBQUFBLElBQ1Q7QUFDQSxRQUFJLE1BQU0sUUFBUSxLQUFLLEdBQUc7QUFDeEIsYUFBTyxNQUFNLElBQUksQ0FBQyxTQUFTLFdBQVcsTUFBTSxTQUFTLENBQUM7QUFBQSxJQUN4RDtBQUNBLFVBQU0sTUFBTTtBQUNaLFFBQUksT0FBTyxJQUFJLE1BQU0sTUFBTSxVQUFVO0FBQ25DLFlBQU0sVUFBVSxrQ0FBa0MsS0FBSyxJQUFJLE1BQU0sQ0FBQyxHQUFHLFNBQVMsTUFBTTtBQUNwRixVQUFJLFlBQVksVUFBYSxDQUFDLFVBQVUsSUFBSSxPQUFPLEd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ANGED
@@ -1 +1 @@
1
- {"name":"@checkdigit/eslint-plugin","version":"7.18.0-PR.143-13e8","description":"Check Digit eslint plugins","keywords":["eslint","eslintplugin"],"homepage":"https://github.com/checkdigit/eslint-plugin#readme","bugs":{"url":"https://github.com/checkdigit/eslint-plugin/issues"},"repository":{"type":"git","url":"https://github.com/checkdigit/eslint-plugin"},"license":"MIT","author":"Check Digit, LLC","sideEffects":false,"type":"module","exports":{".":{"types":"./dist-types/index.d.ts","import":"./dist-mjs/index.mjs","default":"./dist-mjs/index.mjs"}},"files":["src","dist-types","dist-mjs","!src/**/test/**","!src/**/*.test.ts","!src/**/*.spec.ts","!dist-types/**/test/**","!dist-types/**/*.test.d.ts","!dist-types/**/*.spec.d.ts","!dist-mjs/**/test/**","!dist-mjs/**/*.test.mjs","!dist-mjs/**/*.spec.mjs","SECURITY.md"],"scripts":{"build:dist-mjs":"rimraf dist-mjs && npx builder --type=module --sourceMap --outDir=dist-mjs && node dist-mjs/index.mjs","build:dist-types":"rimraf dist-types && npx builder --type=types --outDir=dist-types","ci:compile":"tsc --noEmit","ci:coverage":"NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=true","ci:lint":"npm run lint","ci:style":"npm run prettier","ci:test":"NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=false","lint":"eslint --max-warnings 0 .","lint:fix":"eslint --max-warnings 0 --fix .","peggy":"for file in ./src/peggy/*.peggy; do peggy \"$file\" --format es --output \"${file%.peggy}-peggy.ts\"; done","peggy-watch":"for file in ./src/peggy/*.peggy; do peggy \"$file\" --format=es --watch --output=\"${file%.peggy}-peggy.ts\"; done","prepare":"","prepublishOnly":"npm run build:dist-types && npm run build:dist-mjs","prettier":"prettier --ignore-path .gitignore --list-different .","prettier:fix":"prettier --ignore-path .gitignore --write .","test":"npm run ci:compile && npm run ci:test && npm run ci:lint && npm run ci:style"},"prettier":"@checkdigit/prettier-config","jest":{"preset":"@checkdigit/jest-config"},"dependencies":{"@apidevtools/json-schema-ref-parser":"^15.3.5","@typescript-eslint/type-utils":"^8.60.1","@typescript-eslint/utils":"^8.60.1","ajv":"^8.20.0","debug":"^4.4.3","glob":"^13.0.6","http-status-codes":"^2.3.0","js-yaml":"^4.2.0","json-pointer":"^0.6.2","jsonpath-plus":"^10.4.0","ts-api-utils":"^2.5.0"},"devDependencies":{"@checkdigit/jest-config":"^6.0.2","@checkdigit/prettier-config":"^6.1.0","@checkdigit/typescript-config":"10.0.0","@eslint/js":"^9.37.0","@types/debug":"^4.1.13","@types/eslint":"^9.6.1","@types/eslint-config-prettier":"^6.11.3","@types/js-yaml":"^4.0.9","@types/json-pointer":"^1.0.34","@typescript-eslint/parser":"^8.60.1","@typescript-eslint/rule-tester":"^8.60.1","eslint":"^9.37.0","eslint-config-prettier":"^10.1.8","eslint-import-resolver-typescript":"^4.4.5","eslint-plugin-eslint-plugin":"^6.4.0","eslint-plugin-import":"^2.32.0","eslint-plugin-no-only-tests":"^3.4.0","eslint-plugin-no-secrets":"^2.3.3","eslint-plugin-node":"^11.1.0","eslint-plugin-sonarjs":"^1.0.4","openapi-types":"^12.1.3","peggy":"^4.2.0","rimraf":"^6.1.3","typescript-eslint":"^8.60.1"},"peerDependencies":{"eslint":">=9 <10"},"engines":{"node":">=22.18"},"service":{"api":{"root":"src","endpoints":["api/v1"]}}}
1
+ {"name":"@checkdigit/eslint-plugin","version":"7.18.0-PR.143-c222","description":"Check Digit eslint plugins","keywords":["eslint","eslintplugin"],"homepage":"https://github.com/checkdigit/eslint-plugin#readme","bugs":{"url":"https://github.com/checkdigit/eslint-plugin/issues"},"repository":{"type":"git","url":"https://github.com/checkdigit/eslint-plugin"},"license":"MIT","author":"Check Digit, LLC","sideEffects":false,"type":"module","exports":{".":{"types":"./dist-types/index.d.ts","import":"./dist-mjs/index.mjs","default":"./dist-mjs/index.mjs"}},"files":["src","dist-types","dist-mjs","!src/**/test/**","!src/**/*.test.ts","!src/**/*.spec.ts","!dist-types/**/test/**","!dist-types/**/*.test.d.ts","!dist-types/**/*.spec.d.ts","!dist-mjs/**/test/**","!dist-mjs/**/*.test.mjs","!dist-mjs/**/*.spec.mjs","SECURITY.md"],"scripts":{"build:dist-mjs":"rimraf dist-mjs && npx builder --type=module --sourceMap --outDir=dist-mjs && node dist-mjs/index.mjs","build:dist-types":"rimraf dist-types && npx builder --type=types --outDir=dist-types","ci:compile":"tsc --noEmit","ci:coverage":"NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=true","ci:lint":"npm run lint","ci:style":"npm run prettier","ci:test":"NODE_OPTIONS=\"--disable-warning ExperimentalWarning --experimental-vm-modules\" jest --coverage=false","lint":"eslint --max-warnings 0 .","lint:fix":"eslint --max-warnings 0 --fix .","peggy":"for file in ./src/peggy/*.peggy; do peggy \"$file\" --format es --output \"${file%.peggy}-peggy.ts\"; done","peggy-watch":"for file in ./src/peggy/*.peggy; do peggy \"$file\" --format=es --watch --output=\"${file%.peggy}-peggy.ts\"; done","prepare":"","prepublishOnly":"npm run build:dist-types && npm run build:dist-mjs","prettier":"prettier --ignore-path .gitignore --list-different .","prettier:fix":"prettier --ignore-path .gitignore --write .","test":"npm run ci:compile && npm run ci:test && npm run ci:lint && npm run ci:style"},"prettier":"@checkdigit/prettier-config","jest":{"preset":"@checkdigit/jest-config"},"dependencies":{"@apidevtools/json-schema-ref-parser":"^15.3.5","@typescript-eslint/type-utils":"^8.60.1","@typescript-eslint/utils":"^8.60.1","ajv":"^8.20.0","debug":"^4.4.3","glob":"^13.0.6","http-status-codes":"^2.3.0","js-yaml":"^4.2.0","json-pointer":"^0.6.2","jsonpath-plus":"^10.4.0","ts-api-utils":"^2.5.0"},"devDependencies":{"@checkdigit/jest-config":"^6.0.2","@checkdigit/prettier-config":"^6.1.0","@checkdigit/typescript-config":"10.0.0","@eslint/js":"^9.37.0","@types/debug":"^4.1.13","@types/eslint":"^9.6.1","@types/eslint-config-prettier":"^6.11.3","@types/js-yaml":"^4.0.9","@types/json-pointer":"^1.0.34","@typescript-eslint/parser":"^8.60.1","@typescript-eslint/rule-tester":"^8.60.1","eslint":"^9.37.0","eslint-config-prettier":"^10.1.8","eslint-import-resolver-typescript":"^4.4.5","eslint-plugin-eslint-plugin":"^6.4.0","eslint-plugin-import":"^2.32.0","eslint-plugin-no-only-tests":"^3.4.0","eslint-plugin-no-secrets":"^2.3.3","eslint-plugin-node":"^11.1.0","eslint-plugin-sonarjs":"^1.0.4","openapi-types":"^12.1.3","peggy":"^4.2.0","rimraf":"^6.1.3","typescript-eslint":"^8.60.1"},"peerDependencies":{"eslint":">=9 <10"},"engines":{"node":">=24.14.1"},"service":{"api":{"root":"src","endpoints":["api/v1"]}}}
@@ -1,6 +1,5 @@
1
1
  // openapi/service-schema-generator.ts
2
2
 
3
- import { execFileSync } from 'node:child_process';
4
3
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
5
4
 
6
5
  import debug from 'debug';
@@ -53,18 +52,6 @@ function derefApiSchemas(schemas: ApiSchemas): ApiSchemas {
53
52
  return { apis: resolvedApis };
54
53
  }
55
54
 
56
- function fetchUrlSync(url: string): string | null {
57
- try {
58
- return execFileSync(process.execPath, ['--input-type=module'], {
59
- input: `const r=await fetch(${JSON.stringify(url)});if(!r.ok)process.exit(1);process.stdout.write(await r.text());`,
60
- encoding: 'utf-8',
61
- timeout: 15_000,
62
- });
63
- } catch {
64
- return null;
65
- }
66
- }
67
-
68
55
  function readServiceConfig(
69
56
  packageJsonContent: string,
70
57
  org: string,
@@ -105,73 +92,33 @@ function findServiceLocally(serviceFolder: string, org: string, serviceName: str
105
92
  }
106
93
 
107
94
  function findServiceInProject(serviceName: string): ServiceSource | null {
108
- const packageJsonString = readFileSync(`./package.json`, 'utf-8');
109
- const packageJson = JSON.parse(packageJsonString) as unknown as { name: string };
110
- const [org, projectName] = packageJson.name.slice(1).split('/');
111
- if (org === undefined) {
95
+ const packageJson = JSON.parse(readFileSync('./package.json', 'utf-8')) as { name?: string };
96
+ const [org, projectName] = (packageJson.name ?? '').slice(1).split('/');
97
+ if (org === undefined || projectName !== serviceName) {
112
98
  return null;
113
99
  }
114
-
115
- if (projectName === serviceName) {
116
- log('service is the current project, looking for API schemas locally', serviceName);
117
- const serviceSource = findServiceLocally('.', org, serviceName);
118
- if (serviceSource !== null) {
119
- return serviceSource;
120
- }
121
- }
122
-
123
- return null;
100
+ log(`[schema-generator] '${serviceName}' is the current project, reading local swagger files`);
101
+ return findServiceLocally('.', org, serviceName);
124
102
  }
125
103
 
126
104
  function findServiceInNodeModules(serviceName: string): ServiceSource | null {
127
105
  for (const org of GITHUB_ORGANIZATIONS) {
128
106
  const serviceFolder = `node_modules/@${org}/${serviceName}`;
129
107
  if (!existsSync(serviceFolder)) {
108
+ log(`[schema-generator] not found in node_modules: @${org}/${serviceName}`);
130
109
  continue;
131
110
  }
132
-
133
- try {
134
- const serviceSource = findServiceLocally(serviceFolder, org, serviceName);
135
- if (serviceSource !== null) {
136
- return serviceSource;
137
- }
138
- } catch {
139
- // continue to next org
140
- }
141
- }
142
- return null;
143
- }
144
-
145
- function findServiceOnGitHub(serviceName: string): ServiceSource | null {
146
- for (const org of GITHUB_ORGANIZATIONS) {
147
- const pkgUrl = `https://raw.githubusercontent.com/${org}/${serviceName}/main/package.json`;
148
- log(`fetching package.json from ${pkgUrl}`);
149
- const pkgContent = fetchUrlSync(pkgUrl);
150
- if (pkgContent === null) {
151
- continue;
152
- }
153
-
154
111
  try {
155
- const config = readServiceConfig(pkgContent, org, serviceName);
156
- if (config === null) {
157
- continue;
158
- }
159
-
160
- const endpoints: ServiceEndpoint[] = [];
161
- for (const endpoint of config.endpoints) {
162
- const swaggerUrl = `https://raw.githubusercontent.com/${org}/${serviceName}/main/${config.apiRoot}/${endpoint}/swagger.yml`;
163
- log(`fetching swagger.yml from ${swaggerUrl}`);
164
- const yamlContent = fetchUrlSync(swaggerUrl);
165
- if (yamlContent !== null) {
166
- endpoints.push({ path: endpoint, yamlContent });
167
- }
112
+ log(`[schema-generator] found in node_modules: @${org}/${serviceName}, reading swagger files`);
113
+ const source = findServiceLocally(serviceFolder, org, serviceName);
114
+ if (source !== null) {
115
+ return source;
168
116
  }
169
-
170
- if (endpoints.length > 0) {
171
- return { organization: config.organization, serviceName: config.serviceName, endpoints };
172
- }
173
- } catch {
174
- // continue to next org
117
+ log(`[schema-generator] no swagger schema inside node_modules/@${org}/${serviceName}`);
118
+ } catch (error) {
119
+ log(
120
+ `[schema-generator] error reading node_modules/@${org}/${serviceName}: ${error instanceof Error ? error.message : String(error)}`,
121
+ );
175
122
  }
176
123
  }
177
124
  return null;
@@ -181,15 +128,18 @@ export function generateSchemasForService(
181
128
  serviceName: string,
182
129
  outputDir?: string,
183
130
  ): { schema: ApiSchemas; endpoint: string }[] {
184
- log('generating schemas for service', serviceName);
131
+ log(`[schema-generator] locating service '${serviceName}'`);
185
132
 
186
- const source =
187
- findServiceInProject(serviceName) ?? findServiceInNodeModules(serviceName) ?? findServiceOnGitHub(serviceName);
133
+ const source = findServiceInProject(serviceName) ?? findServiceInNodeModules(serviceName);
188
134
  if (source === null) {
189
- log('no swagger source found for service', serviceName);
135
+ log(
136
+ `[schema-generator] '${serviceName}' not found — ensure it is listed as a devDependency or the repo is accessible via git`,
137
+ );
190
138
  return [];
191
139
  }
192
140
 
141
+ log(`[schema-generator] found '${serviceName}' (${source.endpoints.length.toString()} endpoint(s))`);
142
+
193
143
  const results: { schema: ApiSchemas; endpoint: string }[] = [];
194
144
  for (const { path: endpoint, yamlContent } of source.endpoints) {
195
145
  try {
@@ -205,10 +155,12 @@ export function generateSchemasForService(
205
155
  const dir = `${outputDir}/${versionFolder}`;
206
156
  mkdirSync(dir, { recursive: true });
207
157
  writeFileSync(`${dir}/${SWAGGER_SCHEMA_DEREF_FILENAME}`, JSON.stringify(schema, undefined, 2));
208
- log(`cached schema to ${dir}/${SWAGGER_SCHEMA_DEREF_FILENAME}`);
158
+ log(`[schema-generator] cached schema to ${dir}/${SWAGGER_SCHEMA_DEREF_FILENAME}`);
209
159
  }
210
160
  } catch (error) {
211
- log('error generating schema for endpoint', endpoint, error);
161
+ log(
162
+ `[schema-generator] error processing endpoint ${endpoint}: ${error instanceof Error ? error.message : String(error)}`,
163
+ );
212
164
  }
213
165
  }
214
166
 
@@ -5,7 +5,7 @@
5
5
  "put": {
6
6
  "request": {
7
7
  "$schema": "https://json-schema.org/draft/2020-12/schema",
8
- "$id": "https://eslint-plugin.checkdigit/interchange/v1/schemas/api/InterchangePutRequestContext",
8
+ "$id": "https://interchange.checkdigit/interchange/v1/schemas/api/InterchangePutRequestContext",
9
9
  "type": "object",
10
10
  "properties": {
11
11
  "params": {
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "body": {
33
33
  "$schema": "https://json-schema.org/draft/2020-12/schema",
34
- "$id": "https://eslint-plugin.checkdigit/interchange/v1/schemas/definitions/Interchange",
34
+ "$id": "https://interchange.checkdigit/interchange/v1/schemas/definitions/Interchange",
35
35
  "type": "object",
36
36
  "additionalProperties": false,
37
37
  "description": "Data that describes an interchange record.",
@@ -281,7 +281,7 @@
281
281
  "allOf": [
282
282
  {
283
283
  "$schema": "https://json-schema.org/draft/2020-12/schema",
284
- "$id": "https://eslint-plugin.checkdigit/interchange/v1/schemas/definitions/Amount",
284
+ "$id": "https://interchange.checkdigit/interchange/v1/schemas/definitions/Amount",
285
285
  "type": "object",
286
286
  "additionalProperties": false,
287
287
  "required": ["amount", "currency"],
@@ -308,7 +308,7 @@
308
308
  "allOf": [
309
309
  {
310
310
  "$schema": "https://json-schema.org/draft/2020-12/schema",
311
- "$id": "https://eslint-plugin.checkdigit/interchange/v1/schemas/definitions/Amount",
311
+ "$id": "https://interchange.checkdigit/interchange/v1/schemas/definitions/Amount",
312
312
  "type": "object",
313
313
  "additionalProperties": false,
314
314
  "required": ["amount", "currency"],
@@ -354,7 +354,7 @@
354
354
  "responses": {
355
355
  "204": {
356
356
  "$schema": "https://json-schema.org/draft/2020-12/schema",
357
- "$id": "https://eslint-plugin.checkdigit/interchange/v1/schemas/api/InterchangePutResponseNoContent",
357
+ "$id": "https://interchange.checkdigit/interchange/v1/schemas/api/InterchangePutResponseNoContent",
358
358
  "type": "object",
359
359
  "properties": {
360
360
  "headers": {
@@ -368,15 +368,16 @@
368
368
  "type": "string",
369
369
  "format": "date-time"
370
370
  }
371
- }
371
+ },
372
+ "required": ["created-on", "updated-on"]
372
373
  }
373
374
  },
374
- "required": [],
375
+ "required": ["headers"],
375
376
  "additionalProperties": false
376
377
  },
377
378
  "default": {
378
379
  "$schema": "https://json-schema.org/draft/2020-12/schema",
379
- "$id": "https://eslint-plugin.checkdigit/interchange/v1/schemas/api/InterchangePutResponseDefault",
380
+ "$id": "https://interchange.checkdigit/interchange/v1/schemas/api/InterchangePutResponseDefault",
380
381
  "type": "object",
381
382
  "properties": {
382
383
  "headers": {
@@ -385,7 +386,7 @@
385
386
  },
386
387
  "body": {
387
388
  "$schema": "https://json-schema.org/draft/2020-12/schema",
388
- "$id": "https://eslint-plugin.checkdigit/interchange/v1/schemas/definitions/Error",
389
+ "$id": "https://interchange.checkdigit/interchange/v1/schemas/definitions/Error",
389
390
  "type": "object",
390
391
  "additionalProperties": false,
391
392
  "properties": {
@@ -410,7 +411,7 @@
410
411
  "definitions": {
411
412
  "Ping": {
412
413
  "$schema": "https://json-schema.org/draft/2020-12/schema",
413
- "$id": "https://eslint-plugin.checkdigit/interchange/v1/schemas/definitions/Ping",
414
+ "$id": "https://interchange.checkdigit/interchange/v1/schemas/definitions/Ping",
414
415
  "type": "object",
415
416
  "additionalProperties": false,
416
417
  "required": ["serverTime"],
@@ -424,7 +425,7 @@
424
425
  },
425
426
  "Error": {
426
427
  "$schema": "https://json-schema.org/draft/2020-12/schema",
427
- "$id": "https://eslint-plugin.checkdigit/interchange/v1/schemas/definitions/Error",
428
+ "$id": "https://interchange.checkdigit/interchange/v1/schemas/definitions/Error",
428
429
  "type": "object",
429
430
  "additionalProperties": false,
430
431
  "properties": {
@@ -440,7 +441,7 @@
440
441
  },
441
442
  "Interchange": {
442
443
  "$schema": "https://json-schema.org/draft/2020-12/schema",
443
- "$id": "https://eslint-plugin.checkdigit/interchange/v1/schemas/definitions/Interchange",
444
+ "$id": "https://interchange.checkdigit/interchange/v1/schemas/definitions/Interchange",
444
445
  "type": "object",
445
446
  "additionalProperties": false,
446
447
  "description": "Data that describes an interchange record.",
@@ -690,7 +691,7 @@
690
691
  "allOf": [
691
692
  {
692
693
  "$schema": "https://json-schema.org/draft/2020-12/schema",
693
- "$id": "https://eslint-plugin.checkdigit/interchange/v1/schemas/definitions/Amount",
694
+ "$id": "https://interchange.checkdigit/interchange/v1/schemas/definitions/Amount",
694
695
  "type": "object",
695
696
  "additionalProperties": false,
696
697
  "required": ["amount", "currency"],
@@ -717,7 +718,7 @@
717
718
  "allOf": [
718
719
  {
719
720
  "$schema": "https://json-schema.org/draft/2020-12/schema",
720
- "$id": "https://eslint-plugin.checkdigit/interchange/v1/schemas/definitions/Amount",
721
+ "$id": "https://interchange.checkdigit/interchange/v1/schemas/definitions/Amount",
721
722
  "type": "object",
722
723
  "additionalProperties": false,
723
724
  "required": ["amount", "currency"],
@@ -758,7 +759,7 @@
758
759
  },
759
760
  "Amount": {
760
761
  "$schema": "https://json-schema.org/draft/2020-12/schema",
761
- "$id": "https://eslint-plugin.checkdigit/interchange/v1/schemas/definitions/Amount",
762
+ "$id": "https://interchange.checkdigit/interchange/v1/schemas/definitions/Amount",
762
763
  "type": "object",
763
764
  "additionalProperties": false,
764
765
  "required": ["amount", "currency"],