@adhd/apigen-plugin-health 0.2.1 → 0.2.3

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,25 @@
1
+ ## 0.2.3 (2026-09-24)
2
+
3
+ This was a version bump only for apigen-plugin-health to align it with other projects, there were no code changes.
4
+
5
+ ## 0.2.2 (2026-08-07)
6
+
7
+
8
+ ### 🚀 Features
9
+
10
+ - **apigen:** wire MountHostBridge/LayerContext into express, fastify, health
11
+
12
+
13
+ ### 🩹 Fixes
14
+
15
+ - **apigen-cli:** restore 2768 files mass-deleted by 0117eb22 (BUG-APIGEN-052)
16
+
17
+
18
+ ### ❤️ Thank You
19
+
20
+ - parity-harness-self-test
21
+ - pseudosky
22
+
1
23
  ## 0.2.1 (2026-07-28)
2
24
 
3
25
  This was a version bump only for apigen-plugin-health to align it with other projects, there were no code changes.
package/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("ts-morph");require("node:fs");require("node:path");require("ts-json-schema-generator");function i(e){return{raw:e,words:e.split(/(?=[A-Z])|[-_]/).map(a=>a.toLowerCase()).filter(Boolean)}}function h(e,a,t={}){const s=e.split("/");if(s.length<2||s.some(c=>c.length===0))throw new Error(`syntheticOp: id "${e}" must be "<namespace>/<path...>" with non-empty segments`);const[p,...u]=s,l=p.replace(/^_+/,""),o=t.kind??"action",r={id:e,host:a.host,namespace:i(l),path:u.map(i),kind:o,async:t.async??!1,streaming:t.streaming??!1,safe:t.safe??o==="query",input:t.input??{},output:t.output??{},envelope:t.envelope??{},typeText:t.typeText??null};return t.hasCtx!==void 0&&(r.hasCtx=t.hasCtx),t.transports!==void 0&&(r.transports=t.transports),r}const m={"decimal.js":"Decimal"};function d(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}Object.entries(m).map(([e,a])=>({pattern:new RegExp(`import\\(["'][^"']*${d(e)}[^"']*["']\\)\\.\\w+`,"g"),key:a}));function g(e,a={}){return[{...h("_meta/health",e,{kind:"query",safe:!0,output:{type:"object",required:["status","host"],properties:{status:{const:"ok"},host:{type:"string"},meta:{type:"object"}}},transports:["http","grpc"]}),handler:t=>{const s={status:"ok",host:e.host};return a.meta!==void 0&&Object.keys(a.meta).length>0&&(s.meta=a.meta),s}}]}const n={id:"health",description:"Mount plugin: exposes GET /meta/health for gateway readiness (SPEC §13.1)",language:"ts",optionsSchema:{type:"object",properties:{meta:{type:"object",description:"Extra metadata included in the health response"}},additionalProperties:!1},capabilities:{mount:{operations(e,a){return g(e,a)}}}};exports.default=n;exports.healthPlugin=n;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("node:fs");const h=require("node:module");require("node:path");var o=typeof document<"u"?document.currentScript:null;function i(e){return{raw:e,words:e.split(/(?=[A-Z])|[-_]/).map(n=>n.toLowerCase()).filter(Boolean)}}function m(e,n,t={}){const a=e.split("/");if(a.length<2||a.some(d=>d.length===0))throw new Error(`syntheticOp: id "${e}" must be "<namespace>/<path...>" with non-empty segments`);const[p,...l]=a,c=p.replace(/^_+/,""),r=t.kind??"action",s={id:e,host:n.host,namespace:i(c),path:l.map(i),kind:r,async:t.async??!1,streaming:t.streaming??!1,safe:t.safe??r==="query",input:t.input??{},output:t.output??{},envelope:t.envelope??{},typeText:t.typeText??null};return t.hasCtx!==void 0&&(s.hasCtx=t.hasCtx),t.transports!==void 0&&(s.transports=t.transports),s}h.createRequire(typeof document>"u"?require("url").pathToFileURL(__filename).href:o&&o.tagName.toUpperCase()==="SCRIPT"&&o.src||new URL("index.js",document.baseURI).href);const f={"decimal.js":"Decimal"};function g(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}Object.entries(f).map(([e,n])=>({pattern:new RegExp(`import\\(["'][^"']*${g(e)}[^"']*["']\\)\\.\\w+`,"g"),key:n}));function y(e,n={}){return[{...m("_meta/health",e,{kind:"query",safe:!0,output:{type:"object",required:["status","host"],properties:{status:{const:"ok"},host:{type:"string"},meta:{type:"object"}}},transports:["http","grpc"]}),handler:t=>{const a={status:"ok",host:e.host};return n.meta!==void 0&&Object.keys(n.meta).length>0&&(a.meta=n.meta),a}}]}const u={id:"health",description:"Mount plugin: exposes GET /meta/health for gateway readiness (SPEC §13.1)",language:"ts",optionsSchema:{type:"object",properties:{meta:{type:"object",description:"Extra metadata included in the health response"}},additionalProperties:!1},capabilities:{mount:{operations(e,n){return y(e,n)}}}};exports.default=u;exports.healthPlugin=u;
package/index.mjs CHANGED
@@ -1,42 +1,42 @@
1
- import "ts-morph";
2
1
  import "node:fs";
2
+ import { createRequire as c } from "node:module";
3
3
  import "node:path";
4
- import "ts-json-schema-generator";
5
- function n(t) {
4
+ function i(t) {
6
5
  return {
7
6
  raw: t,
8
7
  words: t.split(/(?=[A-Z])|[-_]/).map((a) => a.toLowerCase()).filter(Boolean)
9
8
  };
10
9
  }
11
- function c(t, a, e = {}) {
10
+ function h(t, a, e = {}) {
12
11
  const s = t.split("/");
13
- if (s.length < 2 || s.some((u) => u.length === 0))
12
+ if (s.length < 2 || s.some((l) => l.length === 0))
14
13
  throw new Error(
15
14
  `syntheticOp: id "${t}" must be "<namespace>/<path...>" with non-empty segments`
16
15
  );
17
- const [i, ...p] = s, l = i.replace(/^_+/, ""), r = e.kind ?? "action", o = {
16
+ const [r, ...p] = s, u = r.replace(/^_+/, ""), o = e.kind ?? "action", n = {
18
17
  id: t,
19
18
  host: a.host,
20
- namespace: n(l),
21
- path: p.map(n),
22
- kind: r,
19
+ namespace: i(u),
20
+ path: p.map(i),
21
+ kind: o,
23
22
  async: e.async ?? !1,
24
23
  streaming: e.streaming ?? !1,
25
- safe: e.safe ?? r === "query",
24
+ safe: e.safe ?? o === "query",
26
25
  input: e.input ?? {},
27
26
  output: e.output ?? {},
28
27
  envelope: e.envelope ?? {},
29
28
  typeText: e.typeText ?? null
30
29
  };
31
- return e.hasCtx !== void 0 && (o.hasCtx = e.hasCtx), e.transports !== void 0 && (o.transports = e.transports), o;
30
+ return e.hasCtx !== void 0 && (n.hasCtx = e.hasCtx), e.transports !== void 0 && (n.transports = e.transports), n;
32
31
  }
33
- const h = {
32
+ c(import.meta.url);
33
+ const m = {
34
34
  "decimal.js": "Decimal"
35
35
  };
36
- function m(t) {
36
+ function d(t) {
37
37
  return t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
38
38
  }
39
- Object.entries(h).map(([t, a]) => ({
39
+ Object.entries(m).map(([t, a]) => ({
40
40
  // Matches: import("...{modSpec}...").<anyMemberName> (single or double quotes)
41
41
  // The module specifier appears inside an absolute path, so we allow any
42
42
  // characters between the quote and the specifier, and between the specifier
@@ -44,15 +44,15 @@ Object.entries(h).map(([t, a]) => ({
44
44
  // …) is matched generically (`\w+`) rather than anchored to one spelling —
45
45
  // see the doc comment above for why.
46
46
  pattern: new RegExp(
47
- `import\\(["'][^"']*${m(t)}[^"']*["']\\)\\.\\w+`,
47
+ `import\\(["'][^"']*${d(t)}[^"']*["']\\)\\.\\w+`,
48
48
  "g"
49
49
  ),
50
50
  key: a
51
51
  }));
52
- function d(t, a = {}) {
52
+ function g(t, a = {}) {
53
53
  return [
54
54
  {
55
- ...c("_meta/health", t, {
55
+ ...h("_meta/health", t, {
56
56
  // query + safe → GET /meta/health; gRPC also useful for load-balancer probes.
57
57
  kind: "query",
58
58
  safe: !0,
@@ -81,7 +81,7 @@ function d(t, a = {}) {
81
81
  }
82
82
  ];
83
83
  }
84
- const b = {
84
+ const w = {
85
85
  id: "health",
86
86
  description: "Mount plugin: exposes GET /meta/health for gateway readiness (SPEC §13.1)",
87
87
  language: "ts",
@@ -98,7 +98,7 @@ const b = {
98
98
  capabilities: {
99
99
  mount: {
100
100
  operations(t, a) {
101
- return d(
101
+ return g(
102
102
  t,
103
103
  a
104
104
  );
@@ -107,6 +107,6 @@ const b = {
107
107
  }
108
108
  };
109
109
  export {
110
- b as default,
111
- b as healthPlugin
110
+ w as default,
111
+ w as healthPlugin
112
112
  };
package/package.json CHANGED
@@ -1,13 +1,30 @@
1
1
  {
2
2
  "name": "@adhd/apigen-plugin-health",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "main": "./index.js",
5
5
  "dependencies": {
6
- "@adhd/apigen-core-client": "^0.2.1"
6
+ "@adhd/apigen-core-client": "^0.3.1"
7
7
  },
8
8
  "publishConfig": {
9
9
  "access": "public"
10
10
  },
11
11
  "module": "./index.mjs",
12
- "types": "./index.d.ts"
12
+ "types": "./index.d.ts",
13
+ "description": "Health-check plugin for apigen servers",
14
+ "keywords": [
15
+ "health",
16
+ "apigen",
17
+ "plugin",
18
+ "typescript"
19
+ ],
20
+ "license": "MIT",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/PseudoSky/adhd.git",
24
+ "directory": "packages/apigen/apigen-plugin-health"
25
+ },
26
+ "homepage": "https://github.com/PseudoSky/adhd/tree/main/packages/apigen/apigen-plugin-health#readme",
27
+ "bugs": {
28
+ "url": "https://github.com/PseudoSky/adhd/issues"
29
+ }
13
30
  }