@adhd/apigen-base-errors 0.2.1 → 0.2.2
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 +15 -0
- package/index.js +1 -1
- package/index.mjs +63 -68
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## 0.2.2 (2026-09-26)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **vite-plugins:** absorb perf/test-resolve-fix — test-time @adhd/* source resolution ([3e344506](https://github.com/PseudoSky/adhd/commit/3e344506))
|
|
6
|
+
|
|
7
|
+
### 🩹 Fixes
|
|
8
|
+
|
|
9
|
+
- **vite:** restore import.meta.url in CJS output under vite 8 ([7916e639](https://github.com/PseudoSky/adhd/commit/7916e639))
|
|
10
|
+
- **nx:** finish the ESLint v9 flat-config migration and unblock the gate ([53f4ff3e](https://github.com/PseudoSky/adhd/commit/53f4ff3e))
|
|
11
|
+
|
|
12
|
+
### ❤️ Thank You
|
|
13
|
+
|
|
14
|
+
- pseudosky
|
|
15
|
+
|
|
1
16
|
## 0.2.1 (2026-09-24)
|
|
2
17
|
|
|
3
18
|
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=[`invalid_argument`,`unauthenticated`,`permission_denied`,`not_found`,`internal`],t={invalid_argument:400,unauthenticated:401,permission_denied:403,not_found:404,internal:500},n={invalid_argument:`INVALID_ARGUMENT`,unauthenticated:`UNAUTHENTICATED`,permission_denied:`PERMISSION_DENIED`,not_found:`NOT_FOUND`,internal:`INTERNAL`},r={invalid_argument:2,unauthenticated:3,permission_denied:3,not_found:4,internal:1},i={invalid_argument:`error`,unauthenticated:`error`,permission_denied:`error`,not_found:`error`,internal:`error`},a={http:t,grpc:n,cli:r,mcp:i},o=class extends Error{constructor(e,t,n){super(t),this.name=`ApiError`,this.code=e,this.details=n,Object.setPrototypeOf(this,new.target.prototype)}toJSON(){let e={code:this.code,message:this.message};return this.details!==void 0&&(e.details=this.details),e}};function s(t){return typeof t==`object`&&!!t&&t.name===`ApiError`&&e.includes(t.code)&&typeof t.toJSON==`function`}function c(e,t,n=0){return e===`before-first-chunk`?{phase:e,error:t}:{phase:e,error:t,chunksDelivered:n}}function l(e){return e.phase===`before-first-chunk`}function u(e){return e.phase===`after-first-chunk`}exports.ApiError=o,exports.CLI_EXIT_CODE=r,exports.ERROR_CODES=e,exports.GRPC_CODE=n,exports.HTTP_STATUS=t,exports.MCP_ERROR_KIND=i,exports.isAfterFirstChunk=u,exports.isApiError=s,exports.isBeforeFirstChunk=l,exports.statusMaps=a,exports.toStreamingError=c;
|
package/index.mjs
CHANGED
|
@@ -1,74 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
//#region src/lib/errors.ts
|
|
2
|
+
var e = [
|
|
3
|
+
"invalid_argument",
|
|
4
|
+
"unauthenticated",
|
|
5
|
+
"permission_denied",
|
|
6
|
+
"not_found",
|
|
7
|
+
"internal"
|
|
8
|
+
], t = {
|
|
9
|
+
invalid_argument: 400,
|
|
10
|
+
unauthenticated: 401,
|
|
11
|
+
permission_denied: 403,
|
|
12
|
+
not_found: 404,
|
|
13
|
+
internal: 500
|
|
14
|
+
}, n = {
|
|
15
|
+
invalid_argument: "INVALID_ARGUMENT",
|
|
16
|
+
unauthenticated: "UNAUTHENTICATED",
|
|
17
|
+
permission_denied: "PERMISSION_DENIED",
|
|
18
|
+
not_found: "NOT_FOUND",
|
|
19
|
+
internal: "INTERNAL"
|
|
20
|
+
}, r = {
|
|
21
|
+
invalid_argument: 2,
|
|
22
|
+
unauthenticated: 3,
|
|
23
|
+
permission_denied: 3,
|
|
24
|
+
not_found: 4,
|
|
25
|
+
internal: 1
|
|
26
|
+
}, i = {
|
|
27
|
+
invalid_argument: "error",
|
|
28
|
+
unauthenticated: "error",
|
|
29
|
+
permission_denied: "error",
|
|
30
|
+
not_found: "error",
|
|
31
|
+
internal: "error"
|
|
25
32
|
}, a = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
http: t,
|
|
34
|
+
grpc: n,
|
|
35
|
+
cli: r,
|
|
36
|
+
mcp: i
|
|
37
|
+
}, o = class extends Error {
|
|
38
|
+
constructor(e, t, n) {
|
|
39
|
+
super(t), this.name = "ApiError", this.code = e, this.details = n, Object.setPrototypeOf(this, new.target.prototype);
|
|
40
|
+
}
|
|
41
|
+
toJSON() {
|
|
42
|
+
let e = {
|
|
43
|
+
code: this.code,
|
|
44
|
+
message: this.message
|
|
45
|
+
};
|
|
46
|
+
return this.details !== void 0 && (e.details = this.details), e;
|
|
47
|
+
}
|
|
36
48
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
super(e), this.name = "ApiError", this.code = n, this.details = i, Object.setPrototypeOf(this, new.target.prototype);
|
|
40
|
-
}
|
|
41
|
-
/** Serialise to a plain object suitable for JSON transport. */
|
|
42
|
-
toJSON() {
|
|
43
|
-
const n = {
|
|
44
|
-
code: this.code,
|
|
45
|
-
message: this.message
|
|
46
|
-
};
|
|
47
|
-
return this.details !== void 0 && (n.details = this.details), n;
|
|
48
|
-
}
|
|
49
|
+
function s(t) {
|
|
50
|
+
return typeof t == "object" && !!t && t.name === "ApiError" && e.includes(t.code) && typeof t.toJSON == "function";
|
|
49
51
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
+
function c(e, t, n = 0) {
|
|
53
|
+
return e === "before-first-chunk" ? {
|
|
54
|
+
phase: e,
|
|
55
|
+
error: t
|
|
56
|
+
} : {
|
|
57
|
+
phase: e,
|
|
58
|
+
error: t,
|
|
59
|
+
chunksDelivered: n
|
|
60
|
+
};
|
|
52
61
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
62
|
+
function l(e) {
|
|
63
|
+
return e.phase === "before-first-chunk";
|
|
55
64
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
65
|
+
function u(e) {
|
|
66
|
+
return e.phase === "after-first-chunk";
|
|
58
67
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
export {
|
|
63
|
-
c as ApiError,
|
|
64
|
-
u as CLI_EXIT_CODE,
|
|
65
|
-
r as ERROR_CODES,
|
|
66
|
-
s as GRPC_CODE,
|
|
67
|
-
o as HTTP_STATUS,
|
|
68
|
-
a as MCP_ERROR_KIND,
|
|
69
|
-
h as isAfterFirstChunk,
|
|
70
|
-
_ as isApiError,
|
|
71
|
-
p as isBeforeFirstChunk,
|
|
72
|
-
d as statusMaps,
|
|
73
|
-
f as toStreamingError
|
|
74
|
-
};
|
|
68
|
+
//#endregion
|
|
69
|
+
export { o as ApiError, r as CLI_EXIT_CODE, e as ERROR_CODES, n as GRPC_CODE, t as HTTP_STATUS, i as MCP_ERROR_KIND, u as isAfterFirstChunk, s as isApiError, l as isBeforeFirstChunk, a as statusMaps, c as toStreamingError };
|