asterflow 0.0.2 → 0.0.4

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.
@@ -56,7 +56,7 @@ var h = class {
56
56
  try {
57
57
  return await this.runHandler(i, e, t), await this.runHooks("onResponse", e, t), t;
58
58
  } catch (a) {
59
- return t.badRequest({
59
+ return console.log(a), t.badRequest({
60
60
  statusCode: 400,
61
61
  message: a instanceof l.ErrorLog ? "AST_ERROR" : "ERROR",
62
62
  error: a instanceof l.ErrorLog ? a.message : a
@@ -146,7 +146,7 @@ var h = class {
146
146
  let n = t.getMethod().toLowerCase(), o = e instanceof u.Method ? e.handler : e.methods[n], r = e instanceof u.Method ? e.schema : e.schema?.[n];
147
147
  if (!o) return null;
148
148
  if (r) {
149
- let R = r.safeParse(t.getBody());
149
+ let R = r.safeParse(await t.getBody());
150
150
  if (!R.success)
151
151
  return s.validationError({
152
152
  statusCode: 422,
@@ -160,7 +160,7 @@ var h = class {
160
160
  request: t,
161
161
  response: s,
162
162
  url: t.url,
163
- schema: t.getBody(),
163
+ schema: await t.getBody(),
164
164
  middleware: {},
165
165
  plugins: i
166
166
  };
package/dist/mjs/index.js CHANGED
@@ -42,7 +42,7 @@ var R = class {
42
42
  try {
43
43
  return await this.runHandler(i, e, t), await this.runHooks("onResponse", e, t), t;
44
44
  } catch (a) {
45
- return t.badRequest({
45
+ return console.log(a), t.badRequest({
46
46
  statusCode: 400,
47
47
  message: a instanceof c ? "AST_ERROR" : "ERROR",
48
48
  error: a instanceof c ? a.message : a
@@ -132,7 +132,7 @@ var R = class {
132
132
  let n = t.getMethod().toLowerCase(), o = e instanceof u ? e.handler : e.methods[n], r = e instanceof u ? e.schema : e.schema?.[n];
133
133
  if (!o) return null;
134
134
  if (r) {
135
- let d = r.safeParse(t.getBody());
135
+ let d = r.safeParse(await t.getBody());
136
136
  if (!d.success)
137
137
  return s.validationError({
138
138
  statusCode: 422,
@@ -146,7 +146,7 @@ var R = class {
146
146
  request: t,
147
147
  response: s,
148
148
  url: t.url,
149
- schema: t.getBody(),
149
+ schema: await t.getBody(),
150
150
  middleware: {},
151
151
  plugins: i
152
152
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asterflow",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "main": "dist/cjs/index.cjs",
5
5
  "module": "dist/mjs/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -34,10 +34,10 @@
34
34
  "typescript": "^5.8.3"
35
35
  },
36
36
  "dependencies": {
37
- "@asterflow/adapter": "1.0.10",
38
- "@asterflow/plugin": "1.0.6",
39
- "@asterflow/response": "1.0.7",
40
- "@asterflow/router": "1.0.10",
37
+ "@asterflow/adapter": "1.0.12",
38
+ "@asterflow/plugin": "1.0.8",
39
+ "@asterflow/response": "1.0.9",
40
+ "@asterflow/router": "1.0.12",
41
41
  "@asterflow/url-parser": "^2.0.3",
42
42
  "reminist": "^1.0.5"
43
43
  }