silgi 0.7.12 → 0.7.13

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.12";
1
+ const version = "0.7.13";
2
2
  const packageJson = {
3
3
  version: version};
4
4
 
@@ -476,7 +476,8 @@ async function schemaTemplate(silgi) {
476
476
  storeBase: [],
477
477
  hooks: [],
478
478
  runtimeHooks: [],
479
- runtimeOptions: []
479
+ runtimeOptions: [],
480
+ methods: []
480
481
  };
481
482
  const storeBase = [];
482
483
  await silgi.callHook("prepare:schema.ts", data);
@@ -513,6 +514,8 @@ async function schemaTemplate(silgi) {
513
514
  "",
514
515
  `type RuntimeActionExtends = ${data.actions?.length ? data.actions.map(({ value }) => `${value}`).join(" & ") : "{}"}`,
515
516
  "",
517
+ `type RuntimeMethodExtends = ${data.methods?.length ? data.methods.map(({ value }) => `${value}`).join(" & ") : "{}"}`,
518
+ "",
516
519
  `type SilgiModuleSharedExtends = ${data.shareds.length ? data.shareds.map(({ value }) => `${value}`).join(" & ") : "{}"}`,
517
520
  "",
518
521
  `type SilgiModuleOptionExtend = ${data.options?.length ? data.options.map(({ value }) => `${value}`).join(" & ") : "{}"}`,
@@ -541,6 +544,7 @@ async function schemaTemplate(silgi) {
541
544
  " interface SilgiRuntimeOptions extends SilgiRuntimeOptionExtends {}",
542
545
  " interface SilgiRuntimeHooks extends SilgiRuntimeHooksExtends {}",
543
546
  " interface SilgiHooks extends ModuleHooksExtend {}",
547
+ " interface SilgiRuntimeMethods extends RuntimeMethodExtends {}",
544
548
  "}",
545
549
  "",
546
550
  "export {}"
@@ -888,6 +892,22 @@ async function registerModuleExportScan(silgi) {
888
892
  });
889
893
  options.runtimeHooks.push({ key: configKey, value: importName });
890
894
  }
895
+ if (exportedTypes.includes("ModuleRuntimeOptions")) {
896
+ const importName = pascalCase(`${configKey}RuntimeOptions`);
897
+ options.importItems[configKey].import.push({
898
+ name: `ModuleRuntimeOptions as ${importName}`,
899
+ type: true
900
+ });
901
+ options.runtimeOptions.push({ key: configKey, value: importName });
902
+ }
903
+ if (exportedTypes.includes("SilgiRuntimeMethods")) {
904
+ const importName = pascalCase(`${configKey}RuntimeMethods`);
905
+ options.importItems[configKey].import.push({
906
+ name: `SilgiRuntimeMethods as ${importName}`,
907
+ type: true
908
+ });
909
+ options.methods.push({ key: configKey, value: importName });
910
+ }
891
911
  }
892
912
  }
893
913
  });
@@ -1,3 +1,3 @@
1
- const version = "0.7.12";
1
+ const version = "0.7.13";
2
2
 
3
3
  export { version };
@@ -1,3 +1,3 @@
1
- const version = "0.7.12";
1
+ const version = "0.7.13";
2
2
 
3
3
  export { version };
@@ -68,7 +68,7 @@ type ExtractInputFromURI<TURI extends keyof SilgiURIs> = GetInput<ExtractPath<TU
68
68
  type ExtractOutputFromURI<TURI extends keyof SilgiURIs> = GetOutput<ExtractPath<TURI>>;
69
69
  type ExtractRouterParamsFromURI<TURI extends keyof SilgiURIs> = GetRouterParams<ExtractPath<TURI>>;
70
70
 
71
- interface SilgiMethods {
71
+ interface SilgiRuntimeMethods {
72
72
  }
73
73
  interface SilgiNamespaces {
74
74
  }
@@ -76,7 +76,7 @@ interface DefaultNamespaces extends SilgiNamespaces {
76
76
  }
77
77
  interface SilgiRouterTypes {
78
78
  }
79
- type BaseSilgiMethodType = 'post' | 'delete' | 'put' | 'get' | keyof SilgiMethods;
79
+ type BaseSilgiMethodType = 'post' | 'delete' | 'put' | 'get' | keyof SilgiRuntimeMethods | (string & {});
80
80
  interface DefaultHooks {
81
81
  }
82
82
  type DeepPartial<T> = T extends void ? T : T extends Record<string, any> ? {
@@ -221,6 +221,10 @@ interface SchemaPreparationOptions extends ImportItem {
221
221
  key: string;
222
222
  value: string;
223
223
  }[];
224
+ methods: {
225
+ key: string;
226
+ value: string;
227
+ }[];
224
228
  contexts: {
225
229
  key: string;
226
230
  value: string;
@@ -934,4 +938,4 @@ type Namespaces<T extends BaseNamespaceType> = {
934
938
 
935
939
  declare const autoImportTypes: string[];
936
940
 
937
- 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 FrameworkContext, type GenerateAppOptions, type GraphQLJSON, type HookResult, type ImportItem, type LoadConfigOptions, type MergedSilgiSchema, type MethodHandlerType, type MethodSchemaType, 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 SilgiMethods, 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 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 };
941
+ 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 FrameworkContext, type GenerateAppOptions, type GraphQLJSON, type HookResult, type ImportItem, type LoadConfigOptions, type MergedSilgiSchema, type MethodHandlerType, type MethodSchemaType, 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 };
@@ -68,7 +68,7 @@ type ExtractInputFromURI<TURI extends keyof SilgiURIs> = GetInput<ExtractPath<TU
68
68
  type ExtractOutputFromURI<TURI extends keyof SilgiURIs> = GetOutput<ExtractPath<TURI>>;
69
69
  type ExtractRouterParamsFromURI<TURI extends keyof SilgiURIs> = GetRouterParams<ExtractPath<TURI>>;
70
70
 
71
- interface SilgiMethods {
71
+ interface SilgiRuntimeMethods {
72
72
  }
73
73
  interface SilgiNamespaces {
74
74
  }
@@ -76,7 +76,7 @@ interface DefaultNamespaces extends SilgiNamespaces {
76
76
  }
77
77
  interface SilgiRouterTypes {
78
78
  }
79
- type BaseSilgiMethodType = 'post' | 'delete' | 'put' | 'get' | keyof SilgiMethods;
79
+ type BaseSilgiMethodType = 'post' | 'delete' | 'put' | 'get' | keyof SilgiRuntimeMethods | (string & {});
80
80
  interface DefaultHooks {
81
81
  }
82
82
  type DeepPartial<T> = T extends void ? T : T extends Record<string, any> ? {
@@ -221,6 +221,10 @@ interface SchemaPreparationOptions extends ImportItem {
221
221
  key: string;
222
222
  value: string;
223
223
  }[];
224
+ methods: {
225
+ key: string;
226
+ value: string;
227
+ }[];
224
228
  contexts: {
225
229
  key: string;
226
230
  value: string;
@@ -934,4 +938,4 @@ type Namespaces<T extends BaseNamespaceType> = {
934
938
 
935
939
  declare const autoImportTypes: string[];
936
940
 
937
- 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 FrameworkContext, type GenerateAppOptions, type GraphQLJSON, type HookResult, type ImportItem, type LoadConfigOptions, type MergedSilgiSchema, type MethodHandlerType, type MethodSchemaType, 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 SilgiMethods, 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 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 };
941
+ 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 FrameworkContext, type GenerateAppOptions, type GraphQLJSON, type HookResult, type ImportItem, type LoadConfigOptions, type MergedSilgiSchema, type MethodHandlerType, type MethodSchemaType, 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 };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.7.12",
4
+ "version": "0.7.13",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {