silgi 0.37.1 → 0.37.2

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.1";
4
+ const version = "0.37.2";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -306,7 +306,7 @@ async function createSilgi(config) {
306
306
  addRoute(silgi.router, _method, route, {
307
307
  method: _method,
308
308
  route,
309
- setup: methodObject,
309
+ service: methodObject,
310
310
  schema: schemaWrapper
311
311
  });
312
312
  }
@@ -537,7 +537,7 @@ async function orchestrate(route, event) {
537
537
  try {
538
538
  const routerParams = getRouterParams(event);
539
539
  const queryParams = getQuery(event);
540
- const setup = route.setup;
540
+ const service = route.service;
541
541
  const cachePromise = cacheExecute(input, route, silgiURL, event);
542
542
  const beforeHookPromise = silgiCtx.callHook("fetch:before", {
543
543
  url: silgiURL,
@@ -561,7 +561,7 @@ async function orchestrate(route, event) {
561
561
  }
562
562
  silgiCtx.shared.$fetch = silgiFetch;
563
563
  silgiCtx.shared.silgi = silgiCtx;
564
- const result = await setup?.handler(
564
+ const result = await service?.handler(
565
565
  {
566
566
  args: input,
567
567
  parameters: {
@@ -582,12 +582,12 @@ async function orchestrate(route, event) {
582
582
  // modules: setup.modules,
583
583
  route
584
584
  });
585
- if (setup.storage && cacheData?.cachedKey) {
586
- await useSilgiStorage(setup.storage.base).setItem(
585
+ if (service.storage && cacheData?.cachedKey) {
586
+ await useSilgiStorage(service.storage.base).setItem(
587
587
  cacheData.cachedKey,
588
588
  result,
589
589
  // Cast to StorageValue if needed
590
- setup.storage.options
590
+ service.storage.options
591
591
  );
592
592
  }
593
593
  return result;
@@ -616,7 +616,7 @@ async function orchestrate(route, event) {
616
616
  }
617
617
  }
618
618
  async function cacheExecute(input, route, silgiURL, event) {
619
- const setup = route.setup;
619
+ const setup = route.service;
620
620
  if (!setup.storage)
621
621
  return;
622
622
  const cacheKey = setup.storage ? await generateStorageKey({
@@ -366,7 +366,6 @@ interface SilgiRuntimeHooks {
366
366
  * @returns Promise
367
367
  */
368
368
  'close': (silgi: Silgi) => HookResult;
369
- 'app:setup:start': (silgi: Silgi) => HookResult;
370
369
  'request:on': (event: SilgiEvent) => HookResult;
371
370
  'fetch:before': (context: ModuleHookContext) => HookResult;
372
371
  'fetch:after': (context: ModuleHookContext) => HookResult;
@@ -661,7 +660,7 @@ type HTTPMethod = SilgiRuntimeMethods extends Record<string, any> ? keyof SilgiR
661
660
  interface SilgiRoute {
662
661
  route: string;
663
662
  method?: HTTPMethod;
664
- setup: ServiceSetup;
663
+ service: ServiceSetup;
665
664
  schema: ResolvedSchemaDefinition;
666
665
  }
667
666
  interface Silgi {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.37.1",
4
+ "version": "0.37.2",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {