@rotorsoft/act-http 1.10.24 → 1.11.0
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/dist/.tsbuildinfo +1 -1
- package/dist/@types/api/errors.d.ts +6 -1
- package/dist/@types/api/errors.d.ts.map +1 -1
- package/dist/api/index.cjs +3 -0
- package/dist/api/index.cjs.map +1 -1
- package/dist/api/index.js +2 -2
- package/dist/{chunk-ZQGGGU4E.js → chunk-IIRUQWVH.js} +8 -4
- package/dist/chunk-IIRUQWVH.js.map +1 -0
- package/dist/{chunk-H545LMMV.js → chunk-YDHQXVDD.js} +2 -2
- package/dist/hono/index.cjs +3 -0
- package/dist/hono/index.cjs.map +1 -1
- package/dist/hono/index.js +3 -3
- package/dist/trpc/index.cjs +3 -0
- package/dist/trpc/index.cjs.map +1 -1
- package/dist/trpc/index.js +4 -4
- package/package.json +2 -2
- package/dist/chunk-ZQGGGU4E.js.map +0 -1
- /package/dist/{chunk-H545LMMV.js.map → chunk-YDHQXVDD.js.map} +0 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* error parsers.
|
|
6
6
|
*
|
|
7
7
|
* - `error` — the framework error name (`"ValidationError"`,
|
|
8
|
-
* `"
|
|
8
|
+
* `"PreconditionError"`, …). Stable identifier, safe to switch on.
|
|
9
9
|
* - `detail` — the framework's message text. Human-readable; not
|
|
10
10
|
* parsed by clients.
|
|
11
11
|
* - `code` — a machine-readable status code from {@link ERROR_MAP}
|
|
@@ -38,6 +38,11 @@ export declare const ERROR_MAP: {
|
|
|
38
38
|
readonly status: 422;
|
|
39
39
|
readonly code: "VALIDATION";
|
|
40
40
|
};
|
|
41
|
+
readonly PreconditionError: {
|
|
42
|
+
readonly status: 409;
|
|
43
|
+
readonly code: "PRECONDITION";
|
|
44
|
+
};
|
|
45
|
+
/** @deprecated Thrown only by the deprecated `.given` rules. Removed in 2.0. */
|
|
41
46
|
readonly InvariantError: {
|
|
42
47
|
readonly status: 409;
|
|
43
48
|
readonly code: "INVARIANT";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/api/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/api/errors.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS;;iBACD,MAAM,EAAE,GAAG;iBAAE,IAAI,EAAE,YAAY;;;iBAC7B,MAAM,EAAE,GAAG;iBAAE,IAAI,EAAE,cAAc;;IACtD,gFAAgF;;iBAC9D,MAAM,EAAE,GAAG;iBAAE,IAAI,EAAE,WAAW;;;iBAC5B,MAAM,EAAE,GAAG;iBAAE,IAAI,EAAE,aAAa;;;iBAC/B,MAAM,EAAE,GAAG;iBAAE,IAAI,EAAE,eAAe;;;iBAClC,MAAM,EAAE,GAAG;iBAAE,IAAI,EAAE,eAAe;;CACP,CAAC;AAenD;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAuB3E"}
|
package/dist/api/index.cjs
CHANGED
|
@@ -37,6 +37,8 @@ module.exports = __toCommonJS(api_exports);
|
|
|
37
37
|
var import_act = require("@rotorsoft/act");
|
|
38
38
|
var ERROR_MAP = {
|
|
39
39
|
ValidationError: { status: 422, code: "VALIDATION" },
|
|
40
|
+
PreconditionError: { status: 409, code: "PRECONDITION" },
|
|
41
|
+
/** @deprecated Thrown only by the deprecated `.given` rules. Removed in 2.0. */
|
|
40
42
|
InvariantError: { status: 409, code: "INVARIANT" },
|
|
41
43
|
ConcurrencyError: { status: 412, code: "CONCURRENCY" },
|
|
42
44
|
StreamClosedError: { status: 410, code: "STREAM_CLOSED" },
|
|
@@ -44,6 +46,7 @@ var ERROR_MAP = {
|
|
|
44
46
|
};
|
|
45
47
|
var lookup_known = (err) => {
|
|
46
48
|
if (err instanceof import_act.ValidationError) return { name: "ValidationError" };
|
|
49
|
+
if (err instanceof import_act.PreconditionError) return { name: "PreconditionError" };
|
|
47
50
|
if (err instanceof import_act.InvariantError) return { name: "InvariantError" };
|
|
48
51
|
if (err instanceof import_act.ConcurrencyError) return { name: "ConcurrencyError" };
|
|
49
52
|
if (err instanceof import_act.StreamClosedError) return { name: "StreamClosedError" };
|