silgi 0.10.9 → 0.10.11

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.10.9";
1
+ const version = "0.10.11";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^2.0.2",
4
4
  "@nuxt/kit": "^3.15.3",
@@ -558,8 +558,7 @@ async function prepareServerFiles(silgi) {
558
558
  "silgi/types": {
559
559
  import: [
560
560
  { name: "SilgiRuntimeOptions", type: true, key: "SilgiRuntimeOptions" },
561
- { name: "FrameworkContext", type: true, key: "FrameworkContext" },
562
- { name: "BuildConfig", type: true, key: "BuildConfig" }
561
+ { name: "FrameworkContext", type: true, key: "FrameworkContext" }
563
562
  ],
564
563
  from: "silgi/types"
565
564
  },
@@ -1561,14 +1560,14 @@ async function prepareConfigs(silgi) {
1561
1560
 
1562
1561
  async function prepareCoreFile(data, frameworkContext, silgi) {
1563
1562
  let importItems = {
1564
- "silgi/core": {
1563
+ "silgi": {
1565
1564
  import: [
1566
1565
  {
1567
1566
  name: "createSilgi",
1568
1567
  key: "createSilgi"
1569
1568
  }
1570
1569
  ],
1571
- from: "silgi/core"
1570
+ from: "silgi"
1572
1571
  },
1573
1572
  "silgi/types": {
1574
1573
  import: [
@@ -1583,9 +1582,9 @@ async function prepareCoreFile(data, frameworkContext, silgi) {
1583
1582
  key: "FrameworkContext"
1584
1583
  },
1585
1584
  {
1586
- name: "BuildConfig",
1585
+ name: "SilgiOptions",
1587
1586
  type: true,
1588
- key: "Build"
1587
+ key: "SilgiOptions"
1589
1588
  }
1590
1589
  ],
1591
1590
  from: "silgi/types"
@@ -1674,7 +1673,7 @@ async function prepareCoreFile(data, frameworkContext, silgi) {
1674
1673
  ];
1675
1674
  const importData = [
1676
1675
  "",
1677
- "export async function buildSilgi(framework: FrameworkContext, moduleOptions?: Partial<SilgiRuntimeOptions>,buildOptions?: Partial<BuildConfig>) {",
1676
+ "export async function buildSilgi(framework: FrameworkContext, moduleOptions?: Partial<SilgiRuntimeOptions>,buildOptions?: Partial<SilgiOptions>) {",
1678
1677
  "",
1679
1678
  _data.beforeBuildSilgiExtraContent.length > 0 ? _data.beforeBuildSilgiExtraContent.map(({ value, type }) => {
1680
1679
  return type === "function" ? value : `const ${value}`;
@@ -1689,14 +1688,16 @@ async function prepareCoreFile(data, frameworkContext, silgi) {
1689
1688
  " modulesURIs,",
1690
1689
  ` plugins: [${plugins.join(", ")}],`,
1691
1690
  _data._silgiConfigs.length > 0 ? ` ${_data._silgiConfigs.map((config) => typeof config === "string" ? config : typeof config === "object" ? Object.entries(config).map(([key, value]) => `${key}: ${value}`).join(",\n ") : "").join(",\n ")},` : "",
1692
- " runtimeConfig: {} as SilgiRuntimeOptions,",
1693
- " ...buildOptions,",
1694
1691
  " options: mergeDeep(",
1692
+ " {",
1693
+ " runtimeConfig: {} as SilgiRuntimeOptions,",
1694
+ " },",
1695
1695
  " moduleOptions || {},",
1696
1696
  " {",
1697
1697
  ` present: '${silgi.options.preset}',`,
1698
1698
  " ...cliConfigs,",
1699
1699
  " },",
1700
+ " buildOptions,",
1700
1701
  " ) as any,",
1701
1702
  " })",
1702
1703
  "",
@@ -326,6 +326,9 @@ function parseURI(uri, uris) {
326
326
  }
327
327
  });
328
328
  }
329
+ if (query && query.method) {
330
+ delete query.method;
331
+ }
329
332
  return {
330
333
  namespaceName,
331
334
  serviceName,
@@ -334,7 +337,7 @@ function parseURI(uri, uris) {
334
337
  raw: normalizedUri,
335
338
  parts: [namespaceName, serviceName, methodName, actionName],
336
339
  routerParams: {},
337
- query: method ? void 0 : query,
340
+ query,
338
341
  uri: baseUri
339
342
  };
340
343
  }
@@ -494,7 +497,7 @@ async function createSilgi(config) {
494
497
  scannedHandlers: /* @__PURE__ */ new Map(),
495
498
  plugins: config.plugins ?? [],
496
499
  framework: config.framework ?? void 0,
497
- storage: config.storage ?? void 0,
500
+ storage: config.options.putStorage ?? void 0,
498
501
  options: config.options ?? {},
499
502
  hooks,
500
503
  callHook: hooks.callHook,
@@ -504,7 +507,6 @@ async function createSilgi(config) {
504
507
  return hooks.callHook("ready", silgi);
505
508
  },
506
509
  envOptions: config.envOptions ?? {},
507
- runtimeConfig: config.runtimeConfig ?? {},
508
510
  close: () => hooks.callHook("close", silgi),
509
511
  logger: createConsola(defu(config.options?.consolaOptions ?? {}, {
510
512
  tag: "silgi"
@@ -512,6 +514,7 @@ async function createSilgi(config) {
512
514
  captureError: config.captureError ?? (() => {
513
515
  })
514
516
  };
517
+ silgi.hooks.addHooks(silgi.options.hooks);
515
518
  await runSilgiPlugins(silgi);
516
519
  await scanAction(silgi);
517
520
  if (!silgi.storage) {
@@ -520,7 +523,7 @@ async function createSilgi(config) {
520
523
  silgi.shared.storage = (...data) => {
521
524
  return useSilgiStorage(...data);
522
525
  };
523
- silgi.shared.runtimeConfig = silgi.runtimeConfig;
526
+ silgi.shared.runtimeConfig = silgi.options.runtimeConfig;
524
527
  if (silgiCtx.tryUse()) {
525
528
  silgiCtx.unset();
526
529
  silgiCtx.set(silgi);
@@ -274,7 +274,7 @@ function useSilgiRuntimeConfig(event) {
274
274
  applyEnv(runtimeConfig, envOptions);
275
275
  return runtimeConfig;
276
276
  }
277
- return applyEnv(klona(silgi.runtimeConfig), {
277
+ return applyEnv(klona(silgi.options.runtimeConfig), {
278
278
  prefix: "NITRO_",
279
279
  altPrefix: "NUXT_",
280
280
  silgiPrefix: "SILGI_",
@@ -1,4 +1,4 @@
1
- const version = "0.10.9";
1
+ const version = "0.10.11";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^2.0.2",
4
4
  "@nuxt/kit": "^3.15.3",
@@ -1,4 +1,4 @@
1
- const version = "0.10.9";
1
+ const version = "0.10.11";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^2.0.2",
4
4
  "@nuxt/kit": "^3.15.3",
@@ -10,7 +10,7 @@ import { ResolvedServiceType as ResolvedServiceType$1, SilgiRuntimeShareds as Si
10
10
  import { UnimportPluginOptions } from 'unimport/unplugin';
11
11
  import { Defu } from 'defu';
12
12
  import { Unimport } from 'unimport';
13
- import { Storage, BuiltinDriverName, TransactionOptions, StorageValue } from 'unstorage';
13
+ import { Storage, TransactionOptions, BuiltinDriverName, StorageValue } from 'unstorage';
14
14
  import { StandardSchemaV1 } from '@standard-schema/spec';
15
15
  import { ProviderName } from 'std-env';
16
16
  import { s as silgi } from '../shared/silgi.D608K9c5.mjs';
@@ -783,6 +783,88 @@ interface EnvOptions {
783
783
  envExpansion?: boolean;
784
784
  }
785
785
 
786
+ interface SilgiAppPlugin {
787
+ (silgi: Silgi): Promise<void> | void;
788
+ }
789
+
790
+ interface CapturedErrorContext {
791
+ event?: SilgiEvents;
792
+ [key: string]: unknown;
793
+ }
794
+ type CaptureError = (error: Error, context: CapturedErrorContext) => void;
795
+
796
+ type SilgiServiceInterface<T extends BaseSchemaType<StandardSchemaV1>> = {
797
+ [Action in keyof T]: T[Action] extends Record<string, any> ? {
798
+ [Method in keyof T[Action]]: {
799
+ input: T[Action][Method]['input'];
800
+ output: T[Action][Method]['output'];
801
+ router: T[Action][Method]['router'];
802
+ source: T[Action][Method]['source'];
803
+ };
804
+ } : never;
805
+ };
806
+ type ServiceType<T> = Partial<{
807
+ [Namespace in keyof T]: T[Namespace] extends Record<string, any> ? {
808
+ [Service in keyof T[Namespace]]?: Partial<MethodHandlerType<T[Namespace][Service]>>;
809
+ } : never;
810
+ }>;
811
+ type RequiredServiceType<T> = {
812
+ [K in keyof T]-?: T[K] extends Record<string, any> ? {
813
+ [P in keyof T[K]]-?: MethodHandlerType<T[K][P]>;
814
+ } : never;
815
+ };
816
+ /**
817
+ * const test: ResolvedServiceType = {
818
+ aaa: {
819
+ bbb: {
820
+ delete: {
821
+ storage: {
822
+ handler: () => {}
823
+ },
824
+ },
825
+ },
826
+ },
827
+ }
828
+ */
829
+ type ResolvedServiceType = {
830
+ [K in string]: {
831
+ [P in string]: {
832
+ [Q in BaseSilgiMethodType]?: {
833
+ [M in string]: ResolvedMethodHandlerType;
834
+ };
835
+ };
836
+ };
837
+ };
838
+
839
+ interface FrameworkContext {
840
+ }
841
+ interface Silgi {
842
+ schemas: any;
843
+ services: ResolvedServiceType;
844
+ shared: SilgiRuntimeShareds;
845
+ uris: Record<string, any>;
846
+ modulesURIs: Partial<Record<keyof SilgiRuntimeOptions | (string & {}), any>>;
847
+ scannedHandlers: Map<string, ResolvedMethodHandlerType>;
848
+ plugins: SilgiAppPlugin[];
849
+ framework: FrameworkContext;
850
+ _ignore?: Ignore;
851
+ hooks: Hookable<SilgiRuntimeHooks & DefaultHooks>;
852
+ hook: Silgi['hooks']['hook'];
853
+ callHook: Silgi['hooks']['callHook'];
854
+ addHooks: Silgi['hooks']['addHooks'];
855
+ ready: () => Promise<void>;
856
+ close: () => Promise<void>;
857
+ logger: ConsolaInstance;
858
+ storage: Storage;
859
+ envOptions: EnvOptions;
860
+ options: SilgiOptions & SilgiRuntimeOptions;
861
+ captureError: CaptureError;
862
+ }
863
+ interface SilgiConfig extends Partial<Omit<Silgi, 'options'>>, Partial<SilgiRuntimeOptions> {
864
+ options: DeepPartial<SilgiOptions>;
865
+ }
866
+ type SilgiFunction = typeof silgi;
867
+
786
868
  type CustomDriverName = string & {
787
869
  _custom?: any;
788
870
  };
@@ -871,97 +953,10 @@ interface SilgiRuntimeHooks {
871
953
  'error': CaptureError;
872
954
  }
873
955
 
874
- type SilgiServiceInterface<T extends BaseSchemaType<StandardSchemaV1>> = {
875
- [Action in keyof T]: T[Action] extends Record<string, any> ? {
876
- [Method in keyof T[Action]]: {
877
- input: T[Action][Method]['input'];
878
- output: T[Action][Method]['output'];
879
- router: T[Action][Method]['router'];
880
- source: T[Action][Method]['source'];
881
- };
882
- } : never;
883
- };
884
- type ServiceType<T> = Partial<{
885
- [Namespace in keyof T]: T[Namespace] extends Record<string, any> ? {
886
- [Service in keyof T[Namespace]]?: Partial<MethodHandlerType<T[Namespace][Service]>>;
887
- } : never;
888
- }>;
889
- type RequiredServiceType<T> = {
890
- [K in keyof T]-?: T[K] extends Record<string, any> ? {
891
- [P in keyof T[K]]-?: MethodHandlerType<T[K][P]>;
892
- } : never;
893
- };
894
- /**
895
- * const test: ResolvedServiceType = {
896
- aaa: {
897
- bbb: {
898
- delete: {
899
- storage: {
900
- handler: () => {}
901
- },
902
- },
903
- },
904
- },
905
- }
906
- */
907
- type ResolvedServiceType = {
908
- [K in string]: {
909
- [P in string]: {
910
- [Q in BaseSilgiMethodType]?: {
911
- [M in string]: ResolvedMethodHandlerType;
912
- };
913
- };
914
- };
915
- };
916
-
917
- interface FrameworkContext {
918
- }
919
- interface Silgi {
920
- schemas: any;
921
- services: ResolvedServiceType;
922
- shared: SilgiRuntimeShareds;
923
- uris: Record<string, any>;
924
- modulesURIs: Partial<Record<keyof SilgiRuntimeOptions | (string & {}), any>>;
925
- scannedHandlers: Map<string, ResolvedMethodHandlerType>;
926
- plugins: SilgiAppPlugin[];
927
- framework: FrameworkContext;
928
- _ignore?: Ignore;
929
- hooks: Hookable<SilgiRuntimeHooks & DefaultHooks>;
930
- hook: Silgi['hooks']['hook'];
931
- callHook: Silgi['hooks']['callHook'];
932
- addHooks: Silgi['hooks']['addHooks'];
933
- ready: () => Promise<void>;
934
- close: () => Promise<void>;
935
- logger: ConsolaInstance;
936
- storage: Storage;
937
- envOptions: EnvOptions;
938
- runtimeConfig: SilgiRuntimeOptions & {
939
- [key: string]: any;
940
- };
941
- options: SilgiOptions & SilgiRuntimeOptions;
942
- captureError: CaptureError;
943
- }
944
- interface SilgiConfig extends Partial<Omit<Silgi, 'options'>>, Partial<SilgiRuntimeOptions> {
945
- options: DeepPartial<SilgiOptions>;
946
- }
947
- interface BuildConfig extends Partial<Pick<SilgiConfig, 'hooks' | 'hook' | 'callHook' | 'addHooks' | 'logger' | 'storage' | 'envOptions' | 'runtimeConfig' | 'options'>> {
948
- options: DeepPartial<SilgiOptions>;
949
- }
950
- type SilgiFunction = typeof silgi;
951
-
952
- interface SilgiAppPlugin {
953
- (silgi: Silgi): Promise<void> | void;
954
- }
955
-
956
- interface CapturedErrorContext {
957
- event?: SilgiEvents;
958
- [key: string]: unknown;
959
- }
960
- type CaptureError = (error: Error, context: CapturedErrorContext) => void;
961
-
962
956
  interface SilgiOptions {
963
957
  consolaOptions?: Partial<ConsolaOptions>;
964
958
  present: PresetNameInput;
959
+ hooks: SilgiRuntimeHooks & DefaultHooks;
965
960
  /**
966
961
  * Set to `true` to enable debug mode.
967
962
  *
@@ -971,6 +966,10 @@ interface SilgiOptions {
971
966
  */
972
967
  debug: boolean;
973
968
  storage: StorageMounts;
969
+ putStorage?: Storage<StorageValue>;
970
+ runtimeConfig: SilgiRuntimeOptions & {
971
+ [key: string]: any;
972
+ };
974
973
  captureError: CaptureError;
975
974
  [key: string]: any;
976
975
  }
@@ -1025,4 +1024,4 @@ type Namespaces<T extends BaseNamespaceType> = {
1025
1024
 
1026
1025
  declare const autoImportTypes: string[];
1027
1026
 
1028
- export { type AppConfig, type Awaitable, type BaseNamespaceType, type BaseSchemaType, type BaseSilgiMethodType, type BuildConfig, type CaptureError, type CapturedErrorContext, type CommandType, type CreateScope, type DeepPartial, type DefaultHooks, type DefaultNamespaces, type DotenvOptions, type EnvOptions, 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 PrepareCore, type RequiredServiceType, type ResolvedMethodHandlerType, type ResolvedModuleMeta, type ResolvedModuleOptions, type ResolvedServiceType, type ResolvedSilgiTemplate, type ScanFile, 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 };
1027
+ export { type AppConfig, type Awaitable, type BaseNamespaceType, type BaseSchemaType, type BaseSilgiMethodType, type CaptureError, type CapturedErrorContext, type CommandType, type CreateScope, type DeepPartial, type DefaultHooks, type DefaultNamespaces, type DotenvOptions, type EnvOptions, 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 PrepareCore, type RequiredServiceType, type ResolvedMethodHandlerType, type ResolvedModuleMeta, type ResolvedModuleOptions, type ResolvedServiceType, type ResolvedSilgiTemplate, type ScanFile, 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 };
@@ -10,7 +10,7 @@ import { ResolvedServiceType as ResolvedServiceType$1, SilgiRuntimeShareds as Si
10
10
  import { UnimportPluginOptions } from 'unimport/unplugin';
11
11
  import { Defu } from 'defu';
12
12
  import { Unimport } from 'unimport';
13
- import { Storage, BuiltinDriverName, TransactionOptions, StorageValue } from 'unstorage';
13
+ import { Storage, TransactionOptions, BuiltinDriverName, StorageValue } from 'unstorage';
14
14
  import { StandardSchemaV1 } from '@standard-schema/spec';
15
15
  import { ProviderName } from 'std-env';
16
16
  import { s as silgi } from '../shared/silgi.D608K9c5.js';
@@ -783,6 +783,88 @@ interface EnvOptions {
783
783
  envExpansion?: boolean;
784
784
  }
785
785
 
786
+ interface SilgiAppPlugin {
787
+ (silgi: Silgi): Promise<void> | void;
788
+ }
789
+
790
+ interface CapturedErrorContext {
791
+ event?: SilgiEvents;
792
+ [key: string]: unknown;
793
+ }
794
+ type CaptureError = (error: Error, context: CapturedErrorContext) => void;
795
+
796
+ type SilgiServiceInterface<T extends BaseSchemaType<StandardSchemaV1>> = {
797
+ [Action in keyof T]: T[Action] extends Record<string, any> ? {
798
+ [Method in keyof T[Action]]: {
799
+ input: T[Action][Method]['input'];
800
+ output: T[Action][Method]['output'];
801
+ router: T[Action][Method]['router'];
802
+ source: T[Action][Method]['source'];
803
+ };
804
+ } : never;
805
+ };
806
+ type ServiceType<T> = Partial<{
807
+ [Namespace in keyof T]: T[Namespace] extends Record<string, any> ? {
808
+ [Service in keyof T[Namespace]]?: Partial<MethodHandlerType<T[Namespace][Service]>>;
809
+ } : never;
810
+ }>;
811
+ type RequiredServiceType<T> = {
812
+ [K in keyof T]-?: T[K] extends Record<string, any> ? {
813
+ [P in keyof T[K]]-?: MethodHandlerType<T[K][P]>;
814
+ } : never;
815
+ };
816
+ /**
817
+ * const test: ResolvedServiceType = {
818
+ aaa: {
819
+ bbb: {
820
+ delete: {
821
+ storage: {
822
+ handler: () => {}
823
+ },
824
+ },
825
+ },
826
+ },
827
+ }
828
+ */
829
+ type ResolvedServiceType = {
830
+ [K in string]: {
831
+ [P in string]: {
832
+ [Q in BaseSilgiMethodType]?: {
833
+ [M in string]: ResolvedMethodHandlerType;
834
+ };
835
+ };
836
+ };
837
+ };
838
+
839
+ interface FrameworkContext {
840
+ }
841
+ interface Silgi {
842
+ schemas: any;
843
+ services: ResolvedServiceType;
844
+ shared: SilgiRuntimeShareds;
845
+ uris: Record<string, any>;
846
+ modulesURIs: Partial<Record<keyof SilgiRuntimeOptions | (string & {}), any>>;
847
+ scannedHandlers: Map<string, ResolvedMethodHandlerType>;
848
+ plugins: SilgiAppPlugin[];
849
+ framework: FrameworkContext;
850
+ _ignore?: Ignore;
851
+ hooks: Hookable<SilgiRuntimeHooks & DefaultHooks>;
852
+ hook: Silgi['hooks']['hook'];
853
+ callHook: Silgi['hooks']['callHook'];
854
+ addHooks: Silgi['hooks']['addHooks'];
855
+ ready: () => Promise<void>;
856
+ close: () => Promise<void>;
857
+ logger: ConsolaInstance;
858
+ storage: Storage;
859
+ envOptions: EnvOptions;
860
+ options: SilgiOptions & SilgiRuntimeOptions;
861
+ captureError: CaptureError;
862
+ }
863
+ interface SilgiConfig extends Partial<Omit<Silgi, 'options'>>, Partial<SilgiRuntimeOptions> {
864
+ options: DeepPartial<SilgiOptions>;
865
+ }
866
+ type SilgiFunction = typeof silgi;
867
+
786
868
  type CustomDriverName = string & {
787
869
  _custom?: any;
788
870
  };
@@ -871,97 +953,10 @@ interface SilgiRuntimeHooks {
871
953
  'error': CaptureError;
872
954
  }
873
955
 
874
- type SilgiServiceInterface<T extends BaseSchemaType<StandardSchemaV1>> = {
875
- [Action in keyof T]: T[Action] extends Record<string, any> ? {
876
- [Method in keyof T[Action]]: {
877
- input: T[Action][Method]['input'];
878
- output: T[Action][Method]['output'];
879
- router: T[Action][Method]['router'];
880
- source: T[Action][Method]['source'];
881
- };
882
- } : never;
883
- };
884
- type ServiceType<T> = Partial<{
885
- [Namespace in keyof T]: T[Namespace] extends Record<string, any> ? {
886
- [Service in keyof T[Namespace]]?: Partial<MethodHandlerType<T[Namespace][Service]>>;
887
- } : never;
888
- }>;
889
- type RequiredServiceType<T> = {
890
- [K in keyof T]-?: T[K] extends Record<string, any> ? {
891
- [P in keyof T[K]]-?: MethodHandlerType<T[K][P]>;
892
- } : never;
893
- };
894
- /**
895
- * const test: ResolvedServiceType = {
896
- aaa: {
897
- bbb: {
898
- delete: {
899
- storage: {
900
- handler: () => {}
901
- },
902
- },
903
- },
904
- },
905
- }
906
- */
907
- type ResolvedServiceType = {
908
- [K in string]: {
909
- [P in string]: {
910
- [Q in BaseSilgiMethodType]?: {
911
- [M in string]: ResolvedMethodHandlerType;
912
- };
913
- };
914
- };
915
- };
916
-
917
- interface FrameworkContext {
918
- }
919
- interface Silgi {
920
- schemas: any;
921
- services: ResolvedServiceType;
922
- shared: SilgiRuntimeShareds;
923
- uris: Record<string, any>;
924
- modulesURIs: Partial<Record<keyof SilgiRuntimeOptions | (string & {}), any>>;
925
- scannedHandlers: Map<string, ResolvedMethodHandlerType>;
926
- plugins: SilgiAppPlugin[];
927
- framework: FrameworkContext;
928
- _ignore?: Ignore;
929
- hooks: Hookable<SilgiRuntimeHooks & DefaultHooks>;
930
- hook: Silgi['hooks']['hook'];
931
- callHook: Silgi['hooks']['callHook'];
932
- addHooks: Silgi['hooks']['addHooks'];
933
- ready: () => Promise<void>;
934
- close: () => Promise<void>;
935
- logger: ConsolaInstance;
936
- storage: Storage;
937
- envOptions: EnvOptions;
938
- runtimeConfig: SilgiRuntimeOptions & {
939
- [key: string]: any;
940
- };
941
- options: SilgiOptions & SilgiRuntimeOptions;
942
- captureError: CaptureError;
943
- }
944
- interface SilgiConfig extends Partial<Omit<Silgi, 'options'>>, Partial<SilgiRuntimeOptions> {
945
- options: DeepPartial<SilgiOptions>;
946
- }
947
- interface BuildConfig extends Partial<Pick<SilgiConfig, 'hooks' | 'hook' | 'callHook' | 'addHooks' | 'logger' | 'storage' | 'envOptions' | 'runtimeConfig' | 'options'>> {
948
- options: DeepPartial<SilgiOptions>;
949
- }
950
- type SilgiFunction = typeof silgi;
951
-
952
- interface SilgiAppPlugin {
953
- (silgi: Silgi): Promise<void> | void;
954
- }
955
-
956
- interface CapturedErrorContext {
957
- event?: SilgiEvents;
958
- [key: string]: unknown;
959
- }
960
- type CaptureError = (error: Error, context: CapturedErrorContext) => void;
961
-
962
956
  interface SilgiOptions {
963
957
  consolaOptions?: Partial<ConsolaOptions>;
964
958
  present: PresetNameInput;
959
+ hooks: SilgiRuntimeHooks & DefaultHooks;
965
960
  /**
966
961
  * Set to `true` to enable debug mode.
967
962
  *
@@ -971,6 +966,10 @@ interface SilgiOptions {
971
966
  */
972
967
  debug: boolean;
973
968
  storage: StorageMounts;
969
+ putStorage?: Storage<StorageValue>;
970
+ runtimeConfig: SilgiRuntimeOptions & {
971
+ [key: string]: any;
972
+ };
974
973
  captureError: CaptureError;
975
974
  [key: string]: any;
976
975
  }
@@ -1025,4 +1024,4 @@ type Namespaces<T extends BaseNamespaceType> = {
1025
1024
 
1026
1025
  declare const autoImportTypes: string[];
1027
1026
 
1028
- export { type AppConfig, type Awaitable, type BaseNamespaceType, type BaseSchemaType, type BaseSilgiMethodType, type BuildConfig, type CaptureError, type CapturedErrorContext, type CommandType, type CreateScope, type DeepPartial, type DefaultHooks, type DefaultNamespaces, type DotenvOptions, type EnvOptions, 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 PrepareCore, type RequiredServiceType, type ResolvedMethodHandlerType, type ResolvedModuleMeta, type ResolvedModuleOptions, type ResolvedServiceType, type ResolvedSilgiTemplate, type ScanFile, 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 };
1027
+ export { type AppConfig, type Awaitable, type BaseNamespaceType, type BaseSchemaType, type BaseSilgiMethodType, type CaptureError, type CapturedErrorContext, type CommandType, type CreateScope, type DeepPartial, type DefaultHooks, type DefaultNamespaces, type DotenvOptions, type EnvOptions, 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 PrepareCore, type RequiredServiceType, type ResolvedMethodHandlerType, type ResolvedModuleMeta, type ResolvedModuleOptions, type ResolvedServiceType, type ResolvedSilgiTemplate, type ScanFile, 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.10.9",
4
+ "version": "0.10.11",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {