silgi 0.7.48 → 0.7.50
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/_chunks/index.mjs +1 -1
- package/dist/core/index.mjs +12 -5
- package/dist/meta/index.d.mts +1 -1
- package/dist/meta/index.d.ts +1 -1
- package/dist/types/index.d.mts +8 -5
- package/dist/types/index.d.ts +8 -5
- package/package.json +1 -1
package/dist/_chunks/index.mjs
CHANGED
package/dist/core/index.mjs
CHANGED
|
@@ -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
|
-
|
|
638
|
-
|
|
640
|
+
source,
|
|
641
|
+
config
|
|
639
642
|
});
|
|
640
|
-
if (
|
|
643
|
+
if (config.returnNull) {
|
|
641
644
|
return result;
|
|
642
645
|
}
|
|
643
646
|
const cacheData = await cacheExecute(input, operation, handler, event);
|
|
@@ -667,7 +670,8 @@ async function execute(uriString, input, event, source) {
|
|
|
667
670
|
result,
|
|
668
671
|
success,
|
|
669
672
|
source,
|
|
670
|
-
modules: handler.modules
|
|
673
|
+
modules: handler.modules,
|
|
674
|
+
config
|
|
671
675
|
});
|
|
672
676
|
if (!cached) {
|
|
673
677
|
if (success && cacheData?.cachedKey && handler.storage) {
|
|
@@ -681,7 +685,10 @@ async function execute(uriString, input, event, source) {
|
|
|
681
685
|
event,
|
|
682
686
|
source,
|
|
683
687
|
error: err instanceof Error ? err : new Error(String(err)),
|
|
684
|
-
timestamp: Date.now()
|
|
688
|
+
timestamp: Date.now(),
|
|
689
|
+
config: {
|
|
690
|
+
returnNull: false
|
|
691
|
+
}
|
|
685
692
|
});
|
|
686
693
|
silgiCtx.captureError(SilgiError.from(err), {
|
|
687
694
|
event,
|
package/dist/meta/index.d.mts
CHANGED
package/dist/meta/index.d.ts
CHANGED
package/dist/types/index.d.mts
CHANGED
|
@@ -468,19 +468,22 @@ interface ResolvedModuleMeta extends ModuleMeta {
|
|
|
468
468
|
configKey: string;
|
|
469
469
|
name: string;
|
|
470
470
|
}
|
|
471
|
-
|
|
472
|
-
event?:
|
|
473
|
-
operation?:
|
|
471
|
+
type ModuleHookContext = Readonly<{
|
|
472
|
+
event?: SilgiEvents;
|
|
473
|
+
operation?: SilgiOperation;
|
|
474
474
|
input?: unknown;
|
|
475
475
|
source?: any;
|
|
476
476
|
result?: unknown;
|
|
477
|
-
modules?:
|
|
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/dist/types/index.d.ts
CHANGED
|
@@ -468,19 +468,22 @@ interface ResolvedModuleMeta extends ModuleMeta {
|
|
|
468
468
|
configKey: string;
|
|
469
469
|
name: string;
|
|
470
470
|
}
|
|
471
|
-
|
|
472
|
-
event?:
|
|
473
|
-
operation?:
|
|
471
|
+
type ModuleHookContext = Readonly<{
|
|
472
|
+
event?: SilgiEvents;
|
|
473
|
+
operation?: SilgiOperation;
|
|
474
474
|
input?: unknown;
|
|
475
475
|
source?: any;
|
|
476
476
|
result?: unknown;
|
|
477
|
-
modules?:
|
|
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> = {
|