silgi 0.7.43 → 0.7.44

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.43";
1
+ const version = "0.7.44";
2
2
  const packageJson = {
3
3
  version: version};
4
4
 
@@ -538,7 +538,7 @@ async function schemaTemplate(silgi) {
538
538
  " interface SilgiURIs extends SilgiURIsMerge {}",
539
539
  " interface SilgiRuntimeContext extends SilgiModuleContextExtends {}",
540
540
  " interface SilgiEvents extends SilgiModuleEventsExtends {}",
541
- " interface SilgiShareds extends SilgiModuleSharedExtends {}",
541
+ " interface SilgiRuntimeShareds extends SilgiModuleSharedExtends {}",
542
542
  " interface SilgiRuntimeActions extends RuntimeActionExtends {}",
543
543
  " interface SilgiModuleOptions extends SilgiModuleOptionExtend {}",
544
544
  " interface SilgiRuntimeOptions extends SilgiRuntimeOptionExtends {}",
@@ -888,10 +888,10 @@ async function registerModuleExportScan(silgi) {
888
888
  });
889
889
  options.actions.push({ key: configKey, value: importName });
890
890
  }
891
- if (exportedTypes.includes("ModuleRuntimeShared")) {
891
+ if (exportedTypes.includes("ModuleRuntimeShareds")) {
892
892
  const importName = pascalCase(`${configKey}Shared`);
893
893
  options.importItems[configKey].import.push({
894
- name: `ModuleRuntimeShared as ${importName}`,
894
+ name: `ModuleRuntimeShareds as ${importName}`,
895
895
  type: true
896
896
  });
897
897
  options.shareds.push({ key: configKey, value: importName });
@@ -1,8 +1,8 @@
1
- import { SilgiConfig, Silgi, SilgiOperation, MergedSilgiSchema, ServiceType, SilgiSchema, RequiredServiceType, ModuleRuntimeShared, SilgiEvents, DefaultNamespaces, BaseSchemaType, SilgiCLI } from 'silgi/types';
2
- export { c as createStorage, s as silgi, u as useSilgiStorage } from '../shared/silgi.sABAerQU.mjs';
1
+ import { SilgiConfig, Silgi, SilgiOperation, MergedSilgiSchema, ServiceType, SilgiSchema, RequiredServiceType, SilgiRuntimeSharedExtends, SilgiEvents, DefaultNamespaces, BaseSchemaType, StorageConfig, SilgiCLI } from 'silgi/types';
2
+ export { s as silgi } from '../shared/silgi.D608K9c5.mjs';
3
3
  import { StandardSchemaV1 } from '@standard-schema/spec';
4
+ import { Storage, StorageValue } from 'unstorage';
4
5
  import * as unctx from 'unctx';
5
- import 'unstorage';
6
6
 
7
7
  declare function createSilgi(config: SilgiConfig): Promise<Silgi>;
8
8
 
@@ -19,7 +19,7 @@ declare function parseURI(uri: string, uris: Record<string, URITemplate>): Silgi
19
19
  type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
20
20
  declare function mergeSchemas<T extends MergedSilgiSchema[]>(typesOrArray: [...T] | T): UnionToIntersection<T[number]>;
21
21
  declare function mergeServices<T extends ServiceType<SilgiSchema>[]>(servicesOrArray: [...T] | T): RequiredServiceType<SilgiSchema>;
22
- declare function mergeShared<T extends ModuleRuntimeShared[]>(sharedOrArray: [...T] | T): UnionToIntersection<T[number]>;
22
+ declare function mergeShared<T extends SilgiRuntimeSharedExtends[]>(sharedOrArray: [...T] | T): UnionToIntersection<T[number]>;
23
23
 
24
24
  declare function getEvent<T>(event?: SilgiEvents): T;
25
25
 
@@ -31,7 +31,10 @@ declare function createSchema<T extends Partial<Record<keyof DefaultNamespaces,
31
31
 
32
32
  declare function createService<T extends SilgiSchema>(variables: ServiceType<T>): ServiceType<T>;
33
33
 
34
- declare function createShared(shared: Partial<ModuleRuntimeShared>): ModuleRuntimeShared;
34
+ declare function createShared(shared: Partial<SilgiRuntimeSharedExtends>): SilgiRuntimeSharedExtends;
35
+
36
+ declare function createStorage(silgi: Silgi): Promise<Storage<StorageValue>>;
37
+ declare function useSilgiStorage<T extends StorageValue = StorageValue>(base?: StorageConfig<T>['base'] | (string & {})): Storage<T>;
35
38
 
36
39
  declare enum HttpStatus {
37
40
  /** [100] Server has received the request headers and client should proceed to send the request body */
@@ -253,4 +256,4 @@ declare function useSilgiCLI(): SilgiCLI;
253
256
  */
254
257
  declare function tryUseSilgiCLI(): SilgiCLI | null;
255
258
 
256
- export { type BaseError, ErrorCategory, ErrorFactory, type ErrorMetadata, ErrorSeverity, HttpStatus, SilgiError, createSchema, createService, createShared, createSilgi, getEvent, isBaseError, mergeSchemas, mergeServices, mergeShared, parseURI, silgiCLICtx, silgiCtx, tryUseSilgi, tryUseSilgiCLI, useSilgi, useSilgiCLI };
259
+ export { type BaseError, ErrorCategory, ErrorFactory, type ErrorMetadata, ErrorSeverity, HttpStatus, SilgiError, createSchema, createService, createShared, createSilgi, createStorage, getEvent, isBaseError, mergeSchemas, mergeServices, mergeShared, parseURI, silgiCLICtx, silgiCtx, tryUseSilgi, tryUseSilgiCLI, useSilgi, useSilgiCLI, useSilgiStorage };
@@ -1,8 +1,8 @@
1
- import { SilgiConfig, Silgi, SilgiOperation, MergedSilgiSchema, ServiceType, SilgiSchema, RequiredServiceType, ModuleRuntimeShared, SilgiEvents, DefaultNamespaces, BaseSchemaType, SilgiCLI } from 'silgi/types';
2
- export { c as createStorage, s as silgi, u as useSilgiStorage } from '../shared/silgi.sABAerQU.js';
1
+ import { SilgiConfig, Silgi, SilgiOperation, MergedSilgiSchema, ServiceType, SilgiSchema, RequiredServiceType, SilgiRuntimeSharedExtends, SilgiEvents, DefaultNamespaces, BaseSchemaType, StorageConfig, SilgiCLI } from 'silgi/types';
2
+ export { s as silgi } from '../shared/silgi.D608K9c5.js';
3
3
  import { StandardSchemaV1 } from '@standard-schema/spec';
4
+ import { Storage, StorageValue } from 'unstorage';
4
5
  import * as unctx from 'unctx';
5
- import 'unstorage';
6
6
 
7
7
  declare function createSilgi(config: SilgiConfig): Promise<Silgi>;
8
8
 
@@ -19,7 +19,7 @@ declare function parseURI(uri: string, uris: Record<string, URITemplate>): Silgi
19
19
  type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
20
20
  declare function mergeSchemas<T extends MergedSilgiSchema[]>(typesOrArray: [...T] | T): UnionToIntersection<T[number]>;
21
21
  declare function mergeServices<T extends ServiceType<SilgiSchema>[]>(servicesOrArray: [...T] | T): RequiredServiceType<SilgiSchema>;
22
- declare function mergeShared<T extends ModuleRuntimeShared[]>(sharedOrArray: [...T] | T): UnionToIntersection<T[number]>;
22
+ declare function mergeShared<T extends SilgiRuntimeSharedExtends[]>(sharedOrArray: [...T] | T): UnionToIntersection<T[number]>;
23
23
 
24
24
  declare function getEvent<T>(event?: SilgiEvents): T;
25
25
 
@@ -31,7 +31,10 @@ declare function createSchema<T extends Partial<Record<keyof DefaultNamespaces,
31
31
 
32
32
  declare function createService<T extends SilgiSchema>(variables: ServiceType<T>): ServiceType<T>;
33
33
 
34
- declare function createShared(shared: Partial<ModuleRuntimeShared>): ModuleRuntimeShared;
34
+ declare function createShared(shared: Partial<SilgiRuntimeSharedExtends>): SilgiRuntimeSharedExtends;
35
+
36
+ declare function createStorage(silgi: Silgi): Promise<Storage<StorageValue>>;
37
+ declare function useSilgiStorage<T extends StorageValue = StorageValue>(base?: StorageConfig<T>['base'] | (string & {})): Storage<T>;
35
38
 
36
39
  declare enum HttpStatus {
37
40
  /** [100] Server has received the request headers and client should proceed to send the request body */
@@ -253,4 +256,4 @@ declare function useSilgiCLI(): SilgiCLI;
253
256
  */
254
257
  declare function tryUseSilgiCLI(): SilgiCLI | null;
255
258
 
256
- export { type BaseError, ErrorCategory, ErrorFactory, type ErrorMetadata, ErrorSeverity, HttpStatus, SilgiError, createSchema, createService, createShared, createSilgi, getEvent, isBaseError, mergeSchemas, mergeServices, mergeShared, parseURI, silgiCLICtx, silgiCtx, tryUseSilgi, tryUseSilgiCLI, useSilgi, useSilgiCLI };
259
+ export { type BaseError, ErrorCategory, ErrorFactory, type ErrorMetadata, ErrorSeverity, HttpStatus, SilgiError, createSchema, createService, createShared, createSilgi, createStorage, getEvent, isBaseError, mergeSchemas, mergeServices, mergeShared, parseURI, silgiCLICtx, silgiCtx, tryUseSilgi, tryUseSilgiCLI, useSilgi, useSilgiCLI, useSilgiStorage };
@@ -1,3 +1,3 @@
1
- const version = "0.7.43";
1
+ const version = "0.7.44";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
- const version = "0.7.43";
1
+ const version = "0.7.44";
2
2
 
3
3
  export { version };
@@ -0,0 +1,7 @@
1
+ import { SilgiEvents, SilgiURIs, ExtractInputFromURI, ExtractSourceFromURI, ExtractOutputFromURI } from 'silgi/types';
2
+
3
+ declare function silgi(event?: SilgiEvents | Record<string, any>): {
4
+ execute: <TURI extends keyof SilgiURIs>(uriString: TURI, input: ExtractInputFromURI<TURI>, source?: ExtractSourceFromURI<TURI>) => Promise<ExtractOutputFromURI<TURI>>;
5
+ };
6
+
7
+ export { silgi as s };
@@ -0,0 +1,7 @@
1
+ import { SilgiEvents, SilgiURIs, ExtractInputFromURI, ExtractSourceFromURI, ExtractOutputFromURI } from 'silgi/types';
2
+
3
+ declare function silgi(event?: SilgiEvents | Record<string, any>): {
4
+ execute: <TURI extends keyof SilgiURIs>(uriString: TURI, input: ExtractInputFromURI<TURI>, source?: ExtractSourceFromURI<TURI>) => Promise<ExtractOutputFromURI<TURI>>;
5
+ };
6
+
7
+ export { silgi as s };
@@ -6,14 +6,14 @@ import { Hookable, NestedHooks } from 'hookable';
6
6
  import { Ignore, Options } from 'ignore';
7
7
  import { TSConfig } from 'pkg-types';
8
8
  import { PresetName, PresetOptions, PresetNameInput } from 'silgi/presets';
9
- import { ResolvedServiceType as ResolvedServiceType$1, SilgiShareds as SilgiShareds$1, SilgiRuntimeOptions as SilgiRuntimeOptions$1, ModuleMeta as ModuleMeta$1, SilgiCLIHooks as SilgiCLIHooks$1, StorageMounts as StorageMounts$1, SilgiTemplate as SilgiTemplate$1, SilgiFrameworkInfo as SilgiFrameworkInfo$1 } from 'silgi/types';
9
+ import { ResolvedServiceType as ResolvedServiceType$1, SilgiRuntimeShareds as SilgiRuntimeShareds$1, SilgiRuntimeOptions as SilgiRuntimeOptions$1, ModuleMeta as ModuleMeta$1, SilgiCLIHooks as SilgiCLIHooks$1, StorageMounts as StorageMounts$1, SilgiTemplate as SilgiTemplate$1, SilgiFrameworkInfo as SilgiFrameworkInfo$1 } from 'silgi/types';
10
10
  import { UnimportPluginOptions } from 'unimport/unplugin';
11
11
  import { StandardSchemaV1 } from '@standard-schema/spec';
12
12
  import { Defu } from 'defu';
13
13
  import { Unimport } from 'unimport';
14
- import { Storage, BuiltinDriverName, TransactionOptions } from 'unstorage';
14
+ import { Storage, BuiltinDriverName, TransactionOptions, StorageValue } from 'unstorage';
15
15
  import { ProviderName } from 'std-env';
16
- import { u as useSilgiStorage, s as silgi } from '../shared/silgi.sABAerQU.mjs';
16
+ import { s as silgi } from '../shared/silgi.D608K9c5.mjs';
17
17
 
18
18
  type HookResult = Promise<void> | void;
19
19
 
@@ -124,7 +124,7 @@ interface ImportItem {
124
124
  interface SilgiCLI {
125
125
  _ignore?: Ignore;
126
126
  services: ResolvedServiceType$1;
127
- shareds: SilgiShareds$1;
127
+ shareds: SilgiRuntimeShareds$1;
128
128
  uris: Record<string, any>;
129
129
  schemas: Record<string, any>;
130
130
  modulesURIs: Partial<Record<keyof SilgiRuntimeOptions$1 | (string & {}), any>>;
@@ -742,15 +742,6 @@ interface LoadConfigOptions {
742
742
  compatibilityDate?: CompatibilityDateSpec;
743
743
  }
744
744
 
745
- interface SilgiShareds extends ModuleRuntimeShared {
746
- storage: (...data: Parameters<typeof useSilgiStorage>) => ReturnType<typeof useSilgiStorage>;
747
- silgi: SilgiFunction;
748
- }
749
- interface ModuleRuntimeShared {
750
- }
751
- interface ExtendShared {
752
- }
753
-
754
745
  type CustomDriverName = string & {
755
746
  _custom?: any;
756
747
  };
@@ -777,6 +768,15 @@ interface StorageKeyParams<TInput = unknown> {
777
768
  storageOptions?: Pick<StorageConfig<TInput>, 'base' | 'options' | 'scope'>;
778
769
  }
779
770
 
771
+ interface SilgiRuntimeShareds extends SilgiRuntimeSharedExtends {
772
+ storage: <T extends StorageValue = StorageValue>(base: StorageConfig<T>['base']) => Storage<T>;
773
+ silgi: SilgiFunction;
774
+ }
775
+ interface SilgiRuntimeSharedExtends {
776
+ }
777
+ interface ExtendShared {
778
+ }
779
+
780
780
  type EventHandlerResponse<T = undefined> = T extends undefined ? void : void | T | Promise<T>;
781
781
  type MethodHandlerType<T> = {
782
782
  [Action in keyof T]: T[Action] extends Record<string, any> ? {
@@ -786,7 +786,7 @@ type MethodHandlerType<T> = {
786
786
  output?: StandardSchemaV1.InferInput<T[Action][Method]['output']>;
787
787
  source?: StandardSchemaV1.InferInput<T[Action][Method]['source']>;
788
788
  };
789
- handler: (router: StandardSchemaV1.InferInput<T[Action][Method]['router']>, input: StandardSchemaV1.InferInput<T[Action][Method]['input']>, shared: SilgiShareds, event: SilgiEvents, source: StandardSchemaV1.InferInput<T[Action][Method]['source']>) => EventHandlerResponse<StandardSchemaV1.InferOutput<T[Action][Method]['output']>>;
789
+ handler: (router: StandardSchemaV1.InferInput<T[Action][Method]['router']>, input: StandardSchemaV1.InferInput<T[Action][Method]['input']>, shared: SilgiRuntimeShareds, event: SilgiEvents, source: StandardSchemaV1.InferInput<T[Action][Method]['source']>) => EventHandlerResponse<StandardSchemaV1.InferOutput<T[Action][Method]['output']>>;
790
790
  modules?: Partial<SilgiRuntimeActions>;
791
791
  storage?: StorageConfig<T[Action][Method]['input']>;
792
792
  };
@@ -795,10 +795,10 @@ type MethodHandlerType<T> = {
795
795
  interface ResolvedMethodHandlerType {
796
796
  input?: Partial<BaseSchemaType<any>>;
797
797
  output: Partial<BaseSchemaType<any>>;
798
- handler: (router: StandardSchemaV1.InferInput<any>, input: StandardSchemaV1.InferInput<any>, shared: SilgiShareds, event: SilgiEvents, source: StandardSchemaV1.InferInput<any>) => Promise<StandardSchemaV1.InferInput<any>>;
798
+ handler: (router: StandardSchemaV1.InferInput<any>, input: StandardSchemaV1.InferInput<any>, shared: SilgiRuntimeShareds, event: SilgiEvents, source: StandardSchemaV1.InferInput<any>) => Promise<StandardSchemaV1.InferInput<any>>;
799
799
  modules?: Partial<SilgiRuntimeActions>;
800
800
  storage?: StorageConfig<StandardSchemaV1.InferInput<any>>;
801
- execute: (input: StandardSchemaV1.InferInput<any>, shared: SilgiShareds, event: SilgiEvents, source: StandardSchemaV1.InferInput<any>) => Promise<StandardSchemaV1.InferInput<any>>;
801
+ execute: (input: StandardSchemaV1.InferInput<any>, shared: SilgiRuntimeShareds, event: SilgiEvents, source: StandardSchemaV1.InferInput<any>) => Promise<StandardSchemaV1.InferInput<any>>;
802
802
  }
803
803
 
804
804
  /**
@@ -874,7 +874,7 @@ interface FrameworkContext {
874
874
  interface Silgi {
875
875
  schemas: any;
876
876
  services: ResolvedServiceType;
877
- shared: SilgiShareds;
877
+ shared: SilgiRuntimeShareds;
878
878
  uris: Record<string, any>;
879
879
  modulesURIs: Partial<Record<keyof SilgiRuntimeOptions | (string & {}), any>>;
880
880
  scannedHandlers: Map<string, ResolvedMethodHandlerType>;
@@ -948,4 +948,4 @@ type Namespaces<T extends BaseNamespaceType> = {
948
948
 
949
949
  declare const autoImportTypes: string[];
950
950
 
951
- export { type AppConfig, type Awaitable, type BaseNamespaceType, type BaseSchemaType, type BaseSilgiMethodType, type BuildConfig, type CaptureError, type CapturedErrorContext, type CoreTs, type CreateScope, type DeepPartial, type DefaultHooks, type DefaultNamespaces, type EventHandlerResponse, type ExtendContext, type ExtendShared, type ExtractInputFromURI, type ExtractOutputFromURI, type ExtractRouterParamsFromURI, type ExtractSourceFromURI, type FrameworkContext, type GenerateAppOptions, type GraphQLJSON, type HookResult, type ImportItem, type LoadConfigOptions, type MergedSilgiSchema, type MethodHandlerType, type ModuleDefinition, type ModuleHookContext, type ModuleMeta, type ModuleOptionsCustom, type ModuleRuntimeShared, type ModuleSetupInstallResult, type ModuleSetupReturn, type Namespaces, type NitroBuildInfo, type RequiredServiceType, type ResolvedMethodHandlerType, type ResolvedModuleMeta, type ResolvedModuleOptions, type ResolvedServiceType, type ResolvedSilgiTemplate, type SchemaPreparationOptions, type ServiceType, type Silgi, type SilgiAppPlugin, type SilgiCLI, type SilgiCLIConfig, type SilgiCLIDynamicConfig, type SilgiCLIHooks, type SilgiCLIOptions, type SilgiCompatibility, type SilgiCompatibilityIssue, type SilgiCompatibilityIssues, type SilgiConfig, type SilgiEvents, type SilgiFrameworkInfo, type SilgiFunction, type SilgiHooks, type SilgiModule, type SilgiModuleInput, type SilgiModuleOptions, type SilgiNamespaces, type SilgiOperation, type SilgiOptions, type SilgiPreset, type SilgiPresetMeta, type SilgiRouterTypes, type SilgiRuntimeActions, type SilgiRuntimeContext, type SilgiRuntimeHooks, type SilgiRuntimeMethods, type SilgiRuntimeOptions, type SilgiSchema, type SilgiServiceInterface, type SilgiShareds, type SilgiStorageBase, type SilgiTemplate, type SilgiURIs, type StorageConfig, type StorageKeyGenerator, type StorageKeyParams, type StorageMounts, type TSReference, type URIsTypes, autoImportTypes };
951
+ export { type AppConfig, type Awaitable, type BaseNamespaceType, type BaseSchemaType, type BaseSilgiMethodType, type BuildConfig, type CaptureError, type CapturedErrorContext, type CoreTs, type CreateScope, type DeepPartial, type DefaultHooks, type DefaultNamespaces, type EventHandlerResponse, type ExtendContext, type ExtendShared, type ExtractInputFromURI, type ExtractOutputFromURI, type ExtractRouterParamsFromURI, type ExtractSourceFromURI, type FrameworkContext, type GenerateAppOptions, type GraphQLJSON, type HookResult, type ImportItem, type LoadConfigOptions, type MergedSilgiSchema, type MethodHandlerType, type ModuleDefinition, type ModuleHookContext, type ModuleMeta, type ModuleOptionsCustom, type ModuleSetupInstallResult, type ModuleSetupReturn, type Namespaces, type NitroBuildInfo, type RequiredServiceType, type ResolvedMethodHandlerType, type ResolvedModuleMeta, type ResolvedModuleOptions, type ResolvedServiceType, type ResolvedSilgiTemplate, type SchemaPreparationOptions, type ServiceType, type Silgi, type SilgiAppPlugin, type SilgiCLI, type SilgiCLIConfig, type SilgiCLIDynamicConfig, type SilgiCLIHooks, type SilgiCLIOptions, type SilgiCompatibility, type SilgiCompatibilityIssue, type SilgiCompatibilityIssues, type SilgiConfig, type SilgiEvents, type SilgiFrameworkInfo, type SilgiFunction, type SilgiHooks, type SilgiModule, type SilgiModuleInput, type SilgiModuleOptions, type SilgiNamespaces, type SilgiOperation, type SilgiOptions, type SilgiPreset, type SilgiPresetMeta, type SilgiRouterTypes, type SilgiRuntimeActions, type SilgiRuntimeContext, type SilgiRuntimeHooks, type SilgiRuntimeMethods, type SilgiRuntimeOptions, type SilgiRuntimeSharedExtends, type SilgiRuntimeShareds, type SilgiSchema, type SilgiServiceInterface, type SilgiStorageBase, type SilgiTemplate, type SilgiURIs, type StorageConfig, type StorageKeyGenerator, type StorageKeyParams, type StorageMounts, type TSReference, type URIsTypes, autoImportTypes };
@@ -6,14 +6,14 @@ import { Hookable, NestedHooks } from 'hookable';
6
6
  import { Ignore, Options } from 'ignore';
7
7
  import { TSConfig } from 'pkg-types';
8
8
  import { PresetName, PresetOptions, PresetNameInput } from 'silgi/presets';
9
- import { ResolvedServiceType as ResolvedServiceType$1, SilgiShareds as SilgiShareds$1, SilgiRuntimeOptions as SilgiRuntimeOptions$1, ModuleMeta as ModuleMeta$1, SilgiCLIHooks as SilgiCLIHooks$1, StorageMounts as StorageMounts$1, SilgiTemplate as SilgiTemplate$1, SilgiFrameworkInfo as SilgiFrameworkInfo$1 } from 'silgi/types';
9
+ import { ResolvedServiceType as ResolvedServiceType$1, SilgiRuntimeShareds as SilgiRuntimeShareds$1, SilgiRuntimeOptions as SilgiRuntimeOptions$1, ModuleMeta as ModuleMeta$1, SilgiCLIHooks as SilgiCLIHooks$1, StorageMounts as StorageMounts$1, SilgiTemplate as SilgiTemplate$1, SilgiFrameworkInfo as SilgiFrameworkInfo$1 } from 'silgi/types';
10
10
  import { UnimportPluginOptions } from 'unimport/unplugin';
11
11
  import { StandardSchemaV1 } from '@standard-schema/spec';
12
12
  import { Defu } from 'defu';
13
13
  import { Unimport } from 'unimport';
14
- import { Storage, BuiltinDriverName, TransactionOptions } from 'unstorage';
14
+ import { Storage, BuiltinDriverName, TransactionOptions, StorageValue } from 'unstorage';
15
15
  import { ProviderName } from 'std-env';
16
- import { u as useSilgiStorage, s as silgi } from '../shared/silgi.sABAerQU.js';
16
+ import { s as silgi } from '../shared/silgi.D608K9c5.js';
17
17
 
18
18
  type HookResult = Promise<void> | void;
19
19
 
@@ -124,7 +124,7 @@ interface ImportItem {
124
124
  interface SilgiCLI {
125
125
  _ignore?: Ignore;
126
126
  services: ResolvedServiceType$1;
127
- shareds: SilgiShareds$1;
127
+ shareds: SilgiRuntimeShareds$1;
128
128
  uris: Record<string, any>;
129
129
  schemas: Record<string, any>;
130
130
  modulesURIs: Partial<Record<keyof SilgiRuntimeOptions$1 | (string & {}), any>>;
@@ -742,15 +742,6 @@ interface LoadConfigOptions {
742
742
  compatibilityDate?: CompatibilityDateSpec;
743
743
  }
744
744
 
745
- interface SilgiShareds extends ModuleRuntimeShared {
746
- storage: (...data: Parameters<typeof useSilgiStorage>) => ReturnType<typeof useSilgiStorage>;
747
- silgi: SilgiFunction;
748
- }
749
- interface ModuleRuntimeShared {
750
- }
751
- interface ExtendShared {
752
- }
753
-
754
745
  type CustomDriverName = string & {
755
746
  _custom?: any;
756
747
  };
@@ -777,6 +768,15 @@ interface StorageKeyParams<TInput = unknown> {
777
768
  storageOptions?: Pick<StorageConfig<TInput>, 'base' | 'options' | 'scope'>;
778
769
  }
779
770
 
771
+ interface SilgiRuntimeShareds extends SilgiRuntimeSharedExtends {
772
+ storage: <T extends StorageValue = StorageValue>(base: StorageConfig<T>['base']) => Storage<T>;
773
+ silgi: SilgiFunction;
774
+ }
775
+ interface SilgiRuntimeSharedExtends {
776
+ }
777
+ interface ExtendShared {
778
+ }
779
+
780
780
  type EventHandlerResponse<T = undefined> = T extends undefined ? void : void | T | Promise<T>;
781
781
  type MethodHandlerType<T> = {
782
782
  [Action in keyof T]: T[Action] extends Record<string, any> ? {
@@ -786,7 +786,7 @@ type MethodHandlerType<T> = {
786
786
  output?: StandardSchemaV1.InferInput<T[Action][Method]['output']>;
787
787
  source?: StandardSchemaV1.InferInput<T[Action][Method]['source']>;
788
788
  };
789
- handler: (router: StandardSchemaV1.InferInput<T[Action][Method]['router']>, input: StandardSchemaV1.InferInput<T[Action][Method]['input']>, shared: SilgiShareds, event: SilgiEvents, source: StandardSchemaV1.InferInput<T[Action][Method]['source']>) => EventHandlerResponse<StandardSchemaV1.InferOutput<T[Action][Method]['output']>>;
789
+ handler: (router: StandardSchemaV1.InferInput<T[Action][Method]['router']>, input: StandardSchemaV1.InferInput<T[Action][Method]['input']>, shared: SilgiRuntimeShareds, event: SilgiEvents, source: StandardSchemaV1.InferInput<T[Action][Method]['source']>) => EventHandlerResponse<StandardSchemaV1.InferOutput<T[Action][Method]['output']>>;
790
790
  modules?: Partial<SilgiRuntimeActions>;
791
791
  storage?: StorageConfig<T[Action][Method]['input']>;
792
792
  };
@@ -795,10 +795,10 @@ type MethodHandlerType<T> = {
795
795
  interface ResolvedMethodHandlerType {
796
796
  input?: Partial<BaseSchemaType<any>>;
797
797
  output: Partial<BaseSchemaType<any>>;
798
- handler: (router: StandardSchemaV1.InferInput<any>, input: StandardSchemaV1.InferInput<any>, shared: SilgiShareds, event: SilgiEvents, source: StandardSchemaV1.InferInput<any>) => Promise<StandardSchemaV1.InferInput<any>>;
798
+ handler: (router: StandardSchemaV1.InferInput<any>, input: StandardSchemaV1.InferInput<any>, shared: SilgiRuntimeShareds, event: SilgiEvents, source: StandardSchemaV1.InferInput<any>) => Promise<StandardSchemaV1.InferInput<any>>;
799
799
  modules?: Partial<SilgiRuntimeActions>;
800
800
  storage?: StorageConfig<StandardSchemaV1.InferInput<any>>;
801
- execute: (input: StandardSchemaV1.InferInput<any>, shared: SilgiShareds, event: SilgiEvents, source: StandardSchemaV1.InferInput<any>) => Promise<StandardSchemaV1.InferInput<any>>;
801
+ execute: (input: StandardSchemaV1.InferInput<any>, shared: SilgiRuntimeShareds, event: SilgiEvents, source: StandardSchemaV1.InferInput<any>) => Promise<StandardSchemaV1.InferInput<any>>;
802
802
  }
803
803
 
804
804
  /**
@@ -874,7 +874,7 @@ interface FrameworkContext {
874
874
  interface Silgi {
875
875
  schemas: any;
876
876
  services: ResolvedServiceType;
877
- shared: SilgiShareds;
877
+ shared: SilgiRuntimeShareds;
878
878
  uris: Record<string, any>;
879
879
  modulesURIs: Partial<Record<keyof SilgiRuntimeOptions | (string & {}), any>>;
880
880
  scannedHandlers: Map<string, ResolvedMethodHandlerType>;
@@ -948,4 +948,4 @@ type Namespaces<T extends BaseNamespaceType> = {
948
948
 
949
949
  declare const autoImportTypes: string[];
950
950
 
951
- export { type AppConfig, type Awaitable, type BaseNamespaceType, type BaseSchemaType, type BaseSilgiMethodType, type BuildConfig, type CaptureError, type CapturedErrorContext, type CoreTs, type CreateScope, type DeepPartial, type DefaultHooks, type DefaultNamespaces, type EventHandlerResponse, type ExtendContext, type ExtendShared, type ExtractInputFromURI, type ExtractOutputFromURI, type ExtractRouterParamsFromURI, type ExtractSourceFromURI, type FrameworkContext, type GenerateAppOptions, type GraphQLJSON, type HookResult, type ImportItem, type LoadConfigOptions, type MergedSilgiSchema, type MethodHandlerType, type ModuleDefinition, type ModuleHookContext, type ModuleMeta, type ModuleOptionsCustom, type ModuleRuntimeShared, type ModuleSetupInstallResult, type ModuleSetupReturn, type Namespaces, type NitroBuildInfo, type RequiredServiceType, type ResolvedMethodHandlerType, type ResolvedModuleMeta, type ResolvedModuleOptions, type ResolvedServiceType, type ResolvedSilgiTemplate, type SchemaPreparationOptions, type ServiceType, type Silgi, type SilgiAppPlugin, type SilgiCLI, type SilgiCLIConfig, type SilgiCLIDynamicConfig, type SilgiCLIHooks, type SilgiCLIOptions, type SilgiCompatibility, type SilgiCompatibilityIssue, type SilgiCompatibilityIssues, type SilgiConfig, type SilgiEvents, type SilgiFrameworkInfo, type SilgiFunction, type SilgiHooks, type SilgiModule, type SilgiModuleInput, type SilgiModuleOptions, type SilgiNamespaces, type SilgiOperation, type SilgiOptions, type SilgiPreset, type SilgiPresetMeta, type SilgiRouterTypes, type SilgiRuntimeActions, type SilgiRuntimeContext, type SilgiRuntimeHooks, type SilgiRuntimeMethods, type SilgiRuntimeOptions, type SilgiSchema, type SilgiServiceInterface, type SilgiShareds, type SilgiStorageBase, type SilgiTemplate, type SilgiURIs, type StorageConfig, type StorageKeyGenerator, type StorageKeyParams, type StorageMounts, type TSReference, type URIsTypes, autoImportTypes };
951
+ export { type AppConfig, type Awaitable, type BaseNamespaceType, type BaseSchemaType, type BaseSilgiMethodType, type BuildConfig, type CaptureError, type CapturedErrorContext, type CoreTs, type CreateScope, type DeepPartial, type DefaultHooks, type DefaultNamespaces, type EventHandlerResponse, type ExtendContext, type ExtendShared, type ExtractInputFromURI, type ExtractOutputFromURI, type ExtractRouterParamsFromURI, type ExtractSourceFromURI, type FrameworkContext, type GenerateAppOptions, type GraphQLJSON, type HookResult, type ImportItem, type LoadConfigOptions, type MergedSilgiSchema, type MethodHandlerType, type ModuleDefinition, type ModuleHookContext, type ModuleMeta, type ModuleOptionsCustom, type ModuleSetupInstallResult, type ModuleSetupReturn, type Namespaces, type NitroBuildInfo, type RequiredServiceType, type ResolvedMethodHandlerType, type ResolvedModuleMeta, type ResolvedModuleOptions, type ResolvedServiceType, type ResolvedSilgiTemplate, type SchemaPreparationOptions, type ServiceType, type Silgi, type SilgiAppPlugin, type SilgiCLI, type SilgiCLIConfig, type SilgiCLIDynamicConfig, type SilgiCLIHooks, type SilgiCLIOptions, type SilgiCompatibility, type SilgiCompatibilityIssue, type SilgiCompatibilityIssues, type SilgiConfig, type SilgiEvents, type SilgiFrameworkInfo, type SilgiFunction, type SilgiHooks, type SilgiModule, type SilgiModuleInput, type SilgiModuleOptions, type SilgiNamespaces, type SilgiOperation, type SilgiOptions, type SilgiPreset, type SilgiPresetMeta, type SilgiRouterTypes, type SilgiRuntimeActions, type SilgiRuntimeContext, type SilgiRuntimeHooks, type SilgiRuntimeMethods, type SilgiRuntimeOptions, type SilgiRuntimeSharedExtends, type SilgiRuntimeShareds, type SilgiSchema, type SilgiServiceInterface, type SilgiStorageBase, type SilgiTemplate, type SilgiURIs, type StorageConfig, type StorageKeyGenerator, type StorageKeyParams, type StorageMounts, type TSReference, type URIsTypes, autoImportTypes };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.7.43",
4
+ "version": "0.7.44",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {
@@ -1,11 +0,0 @@
1
- import { SilgiEvents, SilgiURIs, ExtractInputFromURI, ExtractSourceFromURI, ExtractOutputFromURI, Silgi, StorageConfig } from 'silgi/types';
2
- import { Storage, StorageValue } from 'unstorage';
3
-
4
- declare function silgi(event?: SilgiEvents | Record<string, any>): {
5
- execute: <TURI extends keyof SilgiURIs>(uriString: TURI, input: ExtractInputFromURI<TURI>, source?: ExtractSourceFromURI<TURI>) => Promise<ExtractOutputFromURI<TURI>>;
6
- };
7
-
8
- declare function createStorage(silgi: Silgi): Promise<Storage<StorageValue>>;
9
- declare function useSilgiStorage<T extends StorageValue = StorageValue>(base?: StorageConfig<T>['base'] | (string & {})): Storage<T>;
10
-
11
- export { createStorage as c, silgi as s, useSilgiStorage as u };
@@ -1,11 +0,0 @@
1
- import { SilgiEvents, SilgiURIs, ExtractInputFromURI, ExtractSourceFromURI, ExtractOutputFromURI, Silgi, StorageConfig } from 'silgi/types';
2
- import { Storage, StorageValue } from 'unstorage';
3
-
4
- declare function silgi(event?: SilgiEvents | Record<string, any>): {
5
- execute: <TURI extends keyof SilgiURIs>(uriString: TURI, input: ExtractInputFromURI<TURI>, source?: ExtractSourceFromURI<TURI>) => Promise<ExtractOutputFromURI<TURI>>;
6
- };
7
-
8
- declare function createStorage(silgi: Silgi): Promise<Storage<StorageValue>>;
9
- declare function useSilgiStorage<T extends StorageValue = StorageValue>(base?: StorageConfig<T>['base'] | (string & {})): Storage<T>;
10
-
11
- export { createStorage as c, silgi as s, useSilgiStorage as u };