silgi 0.41.5 → 0.41.6
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/cli/index.mjs +1 -1
- package/dist/core/index.mjs +12 -5
- package/dist/types/index.d.mts +1 -0
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
package/dist/core/index.mjs
CHANGED
|
@@ -576,10 +576,10 @@ function getUrlPrefix(path, method) {
|
|
|
576
576
|
};
|
|
577
577
|
}
|
|
578
578
|
|
|
579
|
-
async function orchestrate(route, event, _input
|
|
579
|
+
async function orchestrate(route, event, _input) {
|
|
580
580
|
const silgiCtx = useSilgi();
|
|
581
581
|
const silgiURL = getUrlPrefix(route.route || event.req.url, route.method);
|
|
582
|
-
const input = _input || (route.service?.setup.rules?.readBeforeBody === false || graphql ? {} : await parseRequestInput(event.req));
|
|
582
|
+
const input = _input || (route.service?.setup.rules?.readBeforeBody === false || route.graphql ? {} : await parseRequestInput(event.req));
|
|
583
583
|
const hookContext = { earlyReturnValue: false };
|
|
584
584
|
const routerParams = _input ? input.path : getRouterParams(event);
|
|
585
585
|
const queryParams = _input ? input.query : getQuery(event);
|
|
@@ -988,7 +988,14 @@ async function handler(event, url, input) {
|
|
|
988
988
|
const data = middleware(event, url);
|
|
989
989
|
_chain = data;
|
|
990
990
|
if (silgiCtx.router) {
|
|
991
|
-
const match = findRoute(silgiCtx.router, url?.method || event.req.method, pathname)
|
|
991
|
+
const match = !url?.graphql ? findRoute(silgiCtx.router, url?.method || event.req.method, pathname) : {
|
|
992
|
+
data: {
|
|
993
|
+
graphql: true,
|
|
994
|
+
method: url?.method || event.req.method,
|
|
995
|
+
route: url.path
|
|
996
|
+
},
|
|
997
|
+
params: {}
|
|
998
|
+
};
|
|
992
999
|
if (match) {
|
|
993
1000
|
if (_chain) {
|
|
994
1001
|
return _chain.then(async (_previous) => {
|
|
@@ -997,12 +1004,12 @@ async function handler(event, url, input) {
|
|
|
997
1004
|
}
|
|
998
1005
|
event.context.params = match.params;
|
|
999
1006
|
event.context.matchedRoute = match.data;
|
|
1000
|
-
return orchestrate(match.data, event, input
|
|
1007
|
+
return orchestrate(match.data, event, input);
|
|
1001
1008
|
});
|
|
1002
1009
|
} else {
|
|
1003
1010
|
event.context.params = match.params;
|
|
1004
1011
|
event.context.matchedRoute = match.data;
|
|
1005
|
-
return orchestrate(match.data, event, input
|
|
1012
|
+
return orchestrate(match.data, event, input);
|
|
1006
1013
|
}
|
|
1007
1014
|
}
|
|
1008
1015
|
}
|
package/dist/types/index.d.mts
CHANGED