@adhd/apigen-codegen-openapi 0.1.7 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ ## 0.2.1 (2026-07-28)
2
+
3
+
4
+ ### 🔥 Performance
5
+
6
+ - **test:** bound vitest thread pools to curb CPU oversubscription (DEBT-TEST-CPU-OVERSUBSCRIBED-001)
7
+
8
+
9
+ ### ❤️ Thank You
10
+
11
+ - pseudosky
12
+
13
+ ## 0.1.7 (2026-07-25)
14
+
15
+
16
+ ### 🔥 Performance
17
+
18
+ - **test:** bound vitest thread pools to curb CPU oversubscription (DEBT-TEST-CPU-OVERSUBSCRIBED-001)
19
+
20
+
21
+ ### ❤️ Thank You
22
+
23
+ - pseudosky
24
+
1
25
  ## 0.1.6 (2026-07-24)
2
26
 
3
27
  This was a version bump only for apigen-codegen-openapi to align it with other projects, there were no code changes.
package/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ts-morph");require("node:fs");require("node:path");require("ts-json-schema-generator");const y=new Set(["string","number","boolean","integer"]);function h(e){if(typeof e!="object"||e===null)return!1;const n=e;if(n.$ref!==void 0||n.oneOf||n.anyOf||n.allOf)return!1;const{type:o}=n;return typeof o=="string"?y.has(o):Array.isArray(o)?o.every(r=>y.has(r)||r==="null"):Array.isArray(n.enum)&&n.enum.length>0?n.enum.every(r=>["string","number","boolean"].includes(typeof r)):!1}function j(e){if(!e||typeof e!="object")return!1;const n=e.properties;return n===void 0||typeof n!="object"||n===null?!1:Object.values(n).every(h)}const v={"decimal.js":"Decimal"};function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}Object.entries(v).map(([e,n])=>({pattern:new RegExp(`import\\(["'][^"']*${O(e)}[^"']*["']\\)\\.\\w+`,"g"),key:n}));function m(e){return e.words.join("-")}function b(e){return e.words.map(A).join("")}function g(e){return e.words.join("_")}function q(e,n={}){var o,r;const t=[e.namespace,...e.path],i=e.safe||j(e.input)?"GET":"POST",l=((r=(o=n.http)==null?void 0:o.verb)==null?void 0:r[e.id])??i,u="/"+t.map(s=>m(s)).join("/"),a=t.map(s=>g(s)).join("_"),f=t.map(s=>g(s)).slice(0,-1).join("."),p=b(t[t.length-2]??t[0]),c=b(t[t.length-1]),d=t.map(s=>m(s));return{http:{verb:l,route:u},mcp:{name:a},grpc:{package:f,service:p,method:c},cli:{path:d}}}function A(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}function w(e,n={}){const o=n.title??"API",r=n.version??"0.0.0",t={};for(const i of e){const l=q(i),{verb:u,route:a}=l.http,f=u.toLowerCase(),p={operationId:i.id,summary:i.id,responses:{200:S(i.output)}};if(u==="GET")p.parameters=_(i.input);else{const c=i.input;typeof c=="object"&&c!==null&&Object.keys(c).length>0&&(p.requestBody={required:!0,content:{"application/json":{schema:c}}})}t[a]===void 0&&(t[a]={}),t[a][f]=p}return{openapi:"3.1.0",info:{title:o,version:r},paths:t}}function S(e){return typeof e=="object"&&e!==null&&Object.keys(e).length>0?{description:"Success",content:{"application/json":{schema:e}}}:{description:"Success"}}function _(e){if(typeof e!="object"||e===null||typeof e.properties!="object"||e.properties===null)return[];const n=Array.isArray(e.required)?e.required:[],o=e.properties;return Object.entries(o).map(([r,t])=>({name:r,in:"query",required:n.includes(r),schema:t}))}const k="@adhd/apigen-codegen-openapi";exports.__apigen_pkg=k;exports.toOpenApi=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("ts-morph");require("node:fs");require("node:path");require("ts-json-schema-generator");const y=new Set(["string","number","boolean","integer"]);function h(e){if(typeof e!="object"||e===null)return!1;const n=e;if(n.$ref!==void 0||n.oneOf||n.anyOf||n.allOf)return!1;const{type:o}=n;return typeof o=="string"?y.has(o):Array.isArray(o)?o.every(r=>y.has(r)||r==="null"):Array.isArray(n.enum)&&n.enum.length>0?n.enum.every(r=>["string","number","boolean"].includes(typeof r)):!1}function j(e){if(!e||typeof e!="object")return!1;const n=e.properties;return n===void 0||typeof n!="object"||n===null?!1:Object.values(n).every(h)}const v={"decimal.js":"Decimal"};function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}Object.entries(v).map(([e,n])=>({pattern:new RegExp(`import\\(["'][^"']*${O(e)}[^"']*["']\\)\\.\\w+`,"g"),key:n}));function m(e){return e.words.join("-")}function b(e){return e.words.map(A).join("")}function g(e){return e.words.join("_")}function q(e,n={}){var o,r;const t=[e.namespace,...e.path],i=e.safe||j(e.input)?"GET":"POST",l=((r=(o=n.http)==null?void 0:o.verb)==null?void 0:r[e.id])??i,u="/"+t.map(s=>m(s)).join("/"),a=t.map(s=>g(s)).join("_"),f=t.map(s=>g(s)).slice(0,-1).join("."),p=b(t[t.length-2]??t[0]),c=b(t[t.length-1]),d=t.map(s=>m(s));return{http:{verb:l,route:u},mcp:{name:a},grpc:{package:f,service:p,method:c},cli:{path:d}}}function A(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}function _(e,n={}){const o=n.title??"API",r=n.version??"0.0.0",t={};for(const i of e){const l=q(i),{verb:u,route:a}=l.http,f=u.toLowerCase(),p={operationId:i.id,summary:i.id,responses:{200:w(i.output)}};if(u==="GET")p.parameters=S(i.input);else{const c=i.input;typeof c=="object"&&c!==null&&Object.keys(c).length>0&&(p.requestBody={required:!0,content:{"application/json":{schema:c}}})}t[a]===void 0&&(t[a]={}),t[a][f]=p}return{openapi:"3.1.0",info:{title:o,version:r},paths:t}}function w(e){return typeof e=="object"&&e!==null&&Object.keys(e).length>0?{description:"Success",content:{"application/json":{schema:e}}}:{description:"Success"}}function S(e){if(typeof e!="object"||e===null||typeof e.properties!="object"||e.properties===null)return[];const n=Array.isArray(e.required)?e.required:[],o=e.properties;return Object.entries(o).map(([r,t])=>({name:r,in:"query",required:n.includes(r),schema:t}))}const k="@adhd/apigen-codegen-openapi";exports.__apigen_pkg=k;exports.toOpenApi=_;
package/index.mjs CHANGED
@@ -111,8 +111,8 @@ function S(e) {
111
111
  schema: t
112
112
  }));
113
113
  }
114
- const P = "@adhd/apigen-codegen-openapi";
114
+ const x = "@adhd/apigen-codegen-openapi";
115
115
  export {
116
- P as __apigen_pkg,
116
+ x as __apigen_pkg,
117
117
  E as toOpenApi
118
118
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhd/apigen-codegen-openapi",
3
- "version": "0.1.7",
3
+ "version": "0.2.1",
4
4
  "main": "./index.js",
5
5
  "module": "./index.mjs",
6
6
  "typings": "./index.d.ts",
@@ -8,7 +8,7 @@
8
8
  "access": "public"
9
9
  },
10
10
  "dependencies": {
11
- "@adhd/apigen-core-client": "^0.1.5",
12
- "@adhd/apigen-engine-naming": "^0.1.4"
11
+ "@adhd/apigen-core-client": "^0.2.1",
12
+ "@adhd/apigen-engine-naming": "^0.2.1"
13
13
  }
14
14
  }