silgi 0.37.2 → 0.37.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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
3
 
4
- const version = "0.37.2";
4
+ const version = "0.37.4";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -538,13 +538,16 @@ async function orchestrate(route, event) {
538
538
  const routerParams = getRouterParams(event);
539
539
  const queryParams = getQuery(event);
540
540
  const service = route.service;
541
+ const earlyReturnValue = false;
541
542
  const cachePromise = cacheExecute(input, route, silgiURL, event);
542
543
  const beforeHookPromise = silgiCtx.callHook("fetch:before", {
543
544
  url: silgiURL,
544
545
  input,
545
546
  event,
546
- route
547
+ route,
548
+ earlyReturnValue
547
549
  });
550
+ if (earlyReturnValue !== false) ;
548
551
  const cacheData = await cachePromise;
549
552
  await beforeHookPromise;
550
553
  if (cacheData?.success) {
@@ -554,6 +557,7 @@ async function orchestrate(route, event) {
554
557
  input,
555
558
  result: cacheData.data,
556
559
  success: true,
560
+ cached: true,
557
561
  // modules: setup.modules,
558
562
  route
559
563
  });
@@ -825,6 +825,7 @@ type ModuleHookContext = Readonly<{
825
825
  error?: Error;
826
826
  success?: boolean;
827
827
  cached?: boolean;
828
+ earlyReturnValue?: null | undefined | false;
828
829
  }>;
829
830
  /** The options received. */
830
831
  type ModuleOptionsCustom = Record<string, any>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.37.2",
4
+ "version": "0.37.4",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {