@open-norantec/utilities 2.9.0 → 2.9.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/dist/hono-util.class.js +3 -3
- package/package.json +1 -1
package/dist/hono-util.class.js
CHANGED
|
@@ -109,7 +109,7 @@ class HonoUtil {
|
|
|
109
109
|
},
|
|
110
110
|
};
|
|
111
111
|
app.post(pathname, (c) => __awaiter(this, void 0, void 0, function* () {
|
|
112
|
-
const wrapped = (yield Promise.resolve(onBeforeHandling === null || onBeforeHandling === void 0 ? void 0 : onBeforeHandling(Object.assign(Object.assign({}, hookContext), { globals: globals }))));
|
|
112
|
+
const wrapped = (yield Promise.resolve(onBeforeHandling === null || onBeforeHandling === void 0 ? void 0 : onBeforeHandling(Object.assign(Object.assign({}, hookContext), { globals: Object.assign({}, globals) }))));
|
|
113
113
|
const input = typeof inputSchema === 'string' ? c.req.raw.body.getReader() : inputSchema.parse(yield c.req.json());
|
|
114
114
|
const headers = c.req.header();
|
|
115
115
|
const baseContext = {
|
|
@@ -152,11 +152,11 @@ class HonoUtil {
|
|
|
152
152
|
return c.json({ error: authenticateResult.message }, authenticateResult instanceof StatusError ? authenticateResult.status : 400);
|
|
153
153
|
}
|
|
154
154
|
const { authentication, authenticationValue } = authenticateResult;
|
|
155
|
-
let output = yield attempt_util_class_1.AttemptUtil.execPromise(handler(Object.assign({ input, authentication: authentication, identifier: authenticationValue, wrapped: wrapped }, baseContext)));
|
|
155
|
+
let output = yield attempt_util_class_1.AttemptUtil.execPromise(handler(Object.assign({ input, authentication: authentication, identifier: authenticationValue, wrapped: Object.assign({}, wrapped) }, baseContext)));
|
|
156
156
|
if (!(output instanceof Error) && typeof outputSchema !== 'string') {
|
|
157
157
|
output = attempt_util_class_1.AttemptUtil.exec(() => outputSchema.parse(output));
|
|
158
158
|
}
|
|
159
|
-
onAfterHandling === null || onAfterHandling === void 0 ? void 0 : onAfterHandling(Object.assign(Object.assign(Object.assign({}, hookContext), baseContext), { wrapped: wrapped, authentication: authentication, identifier: authenticationValue, globals: globals }), output instanceof Error ? output : null);
|
|
159
|
+
onAfterHandling === null || onAfterHandling === void 0 ? void 0 : onAfterHandling(Object.assign(Object.assign(Object.assign({}, hookContext), baseContext), { wrapped: Object.assign({}, wrapped), authentication: authentication, identifier: authenticationValue, globals: Object.assign({}, globals) }), output instanceof Error ? output : null);
|
|
160
160
|
return typeof outputSchema === 'string'
|
|
161
161
|
? c.body(output, 200, { 'Content-Type': outputSchema })
|
|
162
162
|
: c.json(output instanceof Error ? { error: output.message } : { data: output }, output instanceof Error ? (output instanceof StatusError ? output.status : 500) : 200);
|