vona-core 5.0.62 → 5.0.64

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,6 +1,7 @@
1
+ import type { TypeScopesErrorCodes } from '../../type.ts';
1
2
  declare global {
2
3
  export interface Error {
3
- code?: number | string | undefined;
4
+ code?: TypeScopesErrorCodes | number | undefined;
4
5
  status?: number | undefined;
5
6
  }
6
7
  }
@@ -4,5 +4,5 @@ export interface IModuleError {
4
4
  parseFail: (...args: any[]) => IErrorObject;
5
5
  }
6
6
  export type TypeModuleErrors<T> = {
7
- [prop in string & keyof T]: IModuleError;
7
+ [prop in keyof T]: IModuleError;
8
8
  };
@@ -1,4 +1,5 @@
1
1
  /** bean merge: bean.instance */
2
+ import type { TypeRecordValues } from '../../types/utils/type.ts';
2
3
  import type { IBeanSceneRecord } from '../decorator/interface/beanOptions.ts';
3
4
  import type { TypeErrorsInternal } from './resource/error/errorInternal.ts';
4
5
  export interface IBeanRecordGlobal {
@@ -23,8 +24,10 @@ export type TypeBeanScopeLocaleKeys = keyof IBeanScopeLocale;
23
24
  export interface IBeanScopeErrors {
24
25
  }
25
26
  export type TypeBeanScopeErrorsKeys = keyof IBeanScopeErrors;
26
- export type TypeScopesErrorsHelper<ModuleName extends keyof IBeanScopeErrors> = {
27
- [K in keyof IBeanScopeErrors[ModuleName] as `${ModuleName}:${IBeanScopeErrors[ModuleName][K]}`]: K;
27
+ export type TypeScopesErrorsHelper<ModuleName extends keyof IBeanScopeErrors, Errors extends IBeanScopeErrors[ModuleName]> = {
28
+ [K in keyof Errors as `${ModuleName}:${Errors[K]}`]: K;
28
29
  };
29
- export type TypeScopesErrors = TypeScopesErrorsHelper<keyof IBeanScopeErrors>;
30
- export type TypeAllErrors = TypeScopesErrors & TypeErrorsInternal;
30
+ export type TypeScopesErrorCodes = TypeRecordValues<{
31
+ [ModuleName in keyof IBeanScopeErrors]: keyof TypeScopesErrorsHelper<ModuleName, IBeanScopeErrors[ModuleName]>;
32
+ }>;
33
+ export type TypeAllErrorCodes = TypeScopesErrorCodes | keyof TypeErrorsInternal;
@@ -2,7 +2,7 @@ import type * as ModuleInfo from '@cabloy/module-info';
2
2
  import type { IModule } from '@cabloy/module-info';
3
3
  import type { BinaryToTextEncoding, HashOptions } from 'node:crypto';
4
4
  import type { IInstanceRecord, TypeMonkeyName, VonaConfigEnv, VonaContext } from '../../types/index.ts';
5
- import type { IBeanScopeRecord, TypeBeanScopeRecordKeys } from '../bean/type.ts';
5
+ import type { IBeanRecord, IBeanScopeRecord, TypeBeanScopeRecordKeys } from '../bean/type.ts';
6
6
  import type { IBeanSceneRecord } from '../decorator/interface/beanOptions.ts';
7
7
  import type { ZodLocaleErrors } from './zod-enhance.ts';
8
8
  import { BeanSimple } from '../bean/beanSimple.ts';
@@ -59,7 +59,7 @@ export declare function disposeInstance(instance: any): Promise<void>;
59
59
  export declare function polyfillDispose(instance: any): void;
60
60
  export declare function pathToHref(fileName: string): string;
61
61
  export declare function prepareEnv(env: Partial<NodeJS.ProcessEnv>): VonaConfigEnv;
62
- export declare function beanFullNameFromOnionName(onionName: string, sceneName: keyof IBeanSceneRecord): string;
62
+ export declare function beanFullNameFromOnionName(onionName: string, sceneName: keyof IBeanSceneRecord): keyof IBeanRecord;
63
63
  export declare function onionNameFromBeanFullName(beanFullName: string, sceneName: keyof IBeanSceneRecord): string;
64
64
  export declare function filterHeaders(headers: object | undefined, whitelist: string[]): {} | undefined;
65
65
  export declare function combineFilePathSafe(dir: string, file: string): string | undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-core",
3
3
  "type": "module",
4
- "version": "5.0.62",
4
+ "version": "5.0.64",
5
5
  "description": "vona",
6
6
  "publishConfig": {
7
7
  "access": "public"