silgi 0.7.48 → 0.7.49

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,4 +1,4 @@
1
- const version = "0.7.48";
1
+ const version = "0.7.49";
2
2
  const packageJson = {
3
3
  version: version};
4
4
 
@@ -616,6 +616,9 @@ async function execute(uriString, input, event, source) {
616
616
  let success = false;
617
617
  let cached = false;
618
618
  let result;
619
+ const config = {
620
+ returnNull: false
621
+ };
619
622
  const handler = silgiCtx.scannedHandlers.get(operation.uri);
620
623
  if (event) {
621
624
  await silgiCtx.callHook("event:before", event, handler);
@@ -634,10 +637,10 @@ async function execute(uriString, input, event, source) {
634
637
  input,
635
638
  event,
636
639
  modules: handler.modules,
637
- result,
638
- source
640
+ source,
641
+ config
639
642
  });
640
- if (result === null) {
643
+ if (config.returnNull) {
641
644
  return result;
642
645
  }
643
646
  const cacheData = await cacheExecute(input, operation, handler, event);
@@ -1,3 +1,3 @@
1
- const version = "0.7.48";
1
+ const version = "0.7.49";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
- const version = "0.7.48";
1
+ const version = "0.7.49";
2
2
 
3
3
  export { version };
@@ -468,19 +468,22 @@ interface ResolvedModuleMeta extends ModuleMeta {
468
468
  configKey: string;
469
469
  name: string;
470
470
  }
471
- interface ModuleHookContext {
472
- event?: Readonly<SilgiEvents>;
473
- operation?: Readonly<SilgiOperation>;
471
+ type ModuleHookContext = Readonly<{
472
+ event?: SilgiEvents;
473
+ operation?: SilgiOperation;
474
474
  input?: unknown;
475
475
  source?: any;
476
476
  result?: unknown;
477
- modules?: Readonly<SilgiRuntimeActions>;
477
+ modules?: SilgiRuntimeActions;
478
478
  timestamp?: number;
479
479
  meta?: Record<string, unknown>;
480
480
  error?: Error;
481
481
  success?: boolean;
482
482
  cached?: boolean;
483
- }
483
+ config?: {
484
+ returnNull: boolean;
485
+ };
486
+ }>;
484
487
  /** The options received. */
485
488
  type ModuleOptionsCustom = Record<string, any>;
486
489
  type Prettify<T> = {
@@ -468,19 +468,22 @@ interface ResolvedModuleMeta extends ModuleMeta {
468
468
  configKey: string;
469
469
  name: string;
470
470
  }
471
- interface ModuleHookContext {
472
- event?: Readonly<SilgiEvents>;
473
- operation?: Readonly<SilgiOperation>;
471
+ type ModuleHookContext = Readonly<{
472
+ event?: SilgiEvents;
473
+ operation?: SilgiOperation;
474
474
  input?: unknown;
475
475
  source?: any;
476
476
  result?: unknown;
477
- modules?: Readonly<SilgiRuntimeActions>;
477
+ modules?: SilgiRuntimeActions;
478
478
  timestamp?: number;
479
479
  meta?: Record<string, unknown>;
480
480
  error?: Error;
481
481
  success?: boolean;
482
482
  cached?: boolean;
483
- }
483
+ config?: {
484
+ returnNull: boolean;
485
+ };
486
+ }>;
484
487
  /** The options received. */
485
488
  type ModuleOptionsCustom = Record<string, any>;
486
489
  type Prettify<T> = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.7.48",
4
+ "version": "0.7.49",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {