zova-module-a-bean 5.1.28 → 5.1.31

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.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/lib/bean.ts","../src/service/onion_.ts","../src/bean/sys.onion.ts","../src/types/aopMethod.ts","../src/service/aop.ts","../src/monkeySys.ts","../src/lib/scope.ts","../src/.metadata/index.ts","../src/lib/useAopMethod.ts","../src/types/onion.ts"],"sourcesContent":["import { createBeanDecorator } from 'zova';\n\nimport type { IDecoratorAopOptions } from '../types/aop.js';\nimport type { IDecoratorAopMethodOptions } from '../types/aopMethod.js';\n\nexport function Sys(): ClassDecorator {\n return createBeanDecorator('sys', 'sys');\n}\n\nexport function Bean(): ClassDecorator {\n return createBeanDecorator('bean', 'ctx');\n}\n\nexport function Service(): ClassDecorator {\n return createBeanDecorator('service', 'ctx');\n}\n\nexport function Tool(): ClassDecorator {\n return createBeanDecorator('tool', 'app');\n}\n\nexport function Data(): ClassDecorator {\n return createBeanDecorator('data', 'new');\n}\n\nexport function Controller(): ClassDecorator {\n return createBeanDecorator('controller', 'ctx');\n}\n\nexport function Render(): ClassDecorator {\n return createBeanDecorator('render', 'ctx');\n}\n\nexport function Style(): ClassDecorator {\n return createBeanDecorator('style', 'ctx');\n}\n\nexport function Aop(options: IDecoratorAopOptions): ClassDecorator {\n return createBeanDecorator('aop', 'sys', true, options);\n}\n\nexport function AopMethod<T extends IDecoratorAopMethodOptions>(options?: T): ClassDecorator {\n return createBeanDecorator('aopMethod', 'sys', true, options);\n}\n","import type { ISwapDepsItem } from '@cabloy/deps';\nimport type { OnionSceneMeta } from '@cabloy/module-info';\nimport type { PluginZovaModulesMeta } from 'zova';\nimport type { Next } from 'zova';\n\nimport { compose as _compose } from '@cabloy/compose';\nimport { swapDeps } from '@cabloy/deps';\nimport { getOnionScenesMeta } from '@cabloy/module-info';\nimport { appResource, BeanSimple, cast, deepExtend, ProxyDisable } from 'zova';\n\nimport type {\n IOnionExecuteCustom,\n IOnionItem,\n IOnionOptionsDeps,\n IOnionOptionsEnable,\n IOnionOptionsMatch,\n IOnionSlice,\n TypeOnionOptionsMatchRule,\n} from '../types/onion.js';\n\nimport { SysOnion } from '../bean/sys.onion.js';\nimport { Service } from '../lib/bean.js';\n\n// const SymbolOnionsEnabled = Symbol('SymbolOnionsEnabled');\n// const SymbolOnionsEnabledWrapped = Symbol('SymbolOnionsEnabledWrapped');\n\n@ProxyDisable()\n@Service()\nexport class ServiceOnion<OPTIONS, ONIONNAME extends string> extends BeanSimple {\n protected sysOnion: SysOnion;\n sceneName: string;\n sceneMeta: OnionSceneMeta;\n\n onionsAll: IOnionItem<OPTIONS, ONIONNAME>[];\n\n // private [SymbolOnionsEnabled]: Record<string, IOnionSlice<OPTIONS, ONIONNAME>[]> = {};\n // private [SymbolOnionsEnabledWrapped]: Record<string, Function[]> = {};\n\n protected __init__(sceneName: string, sysOnion: SysOnion) {\n if (process.env.DEV && this.bean.containerType !== 'sys') {\n throw new Error('should in sys container');\n }\n const modulesMeta = this.sys.meta.module.getModulesMeta();\n if (!modulesMeta) {\n throw new Error('module registry has been disposed');\n }\n this.sysOnion = sysOnion;\n this.sceneName = sceneName;\n this.sceneMeta = getOnionScenesMeta(modulesMeta.modules)[this.sceneName];\n if (this.sceneMeta.optionsPackage) {\n this._initOnionsAll(modulesMeta);\n this._swapOnions(this.onionsAll);\n }\n }\n\n private _initOnionsAll(modulesMeta: PluginZovaModulesMeta) {\n this.onionsAll = [];\n for (const moduleName in modulesMeta.modules) {\n const module = modulesMeta.modules[moduleName];\n const nodeItems = module.info.onionsMeta?.onionsConfig?.[this.sceneName];\n if (!nodeItems) continue;\n for (const itemName in nodeItems) {\n let itemOptions = nodeItems[itemName];\n // extend config\n const onionName = `${moduleName}:${itemName}`;\n const optionsConfig = this.sys.config.onions[this.sceneName]?.[onionName];\n if (optionsConfig) {\n itemOptions = deepExtend({}, itemOptions, optionsConfig);\n }\n this.onionsAll.push({\n name: onionName,\n options: itemOptions,\n } as any);\n }\n }\n }\n\n private _swapOnions(onions: IOnionItem<OPTIONS, ONIONNAME>[]) {\n swapDeps(onions as ISwapDepsItem[], {\n name: 'name',\n dependencies: item => {\n const onionOptions = cast<IOnionItem<OPTIONS, ONIONNAME>>(item)\n .options as IOnionOptionsDeps<string>;\n return onionOptions.dependencies as any;\n },\n dependents: item => {\n const onionOptions = cast<IOnionItem<OPTIONS, ONIONNAME>>(item)\n .options as IOnionOptionsDeps<string>;\n return onionOptions.dependents as any;\n },\n });\n }\n\n // getOnionsEnabled(selector?: string) {\n // if (!selector) selector = '';\n // if (!this[SymbolOnionsEnabled][selector]) {\n // this[SymbolOnionsEnabled][selector] = this.onionsGlobal.filter(onionSlice => {\n // const onionOptions = onionSlice.beanOptions.options as IOnionOptionsEnable & IOnionOptionsMatch<string>;\n // return this.sysOnion.checkOnionOptionsEnabled(onionOptions, selector);\n // }) as unknown as IOnionSlice<OPTIONS, ONIONNAME>[];\n // }\n // return this[SymbolOnionsEnabled][selector];\n // }\n\n // getOnionsEnabledOfMeta(beanName: string, selector?: string) {\n // return this.getOnionsEnabled(selector).filter(item => item.beanOptions.name === beanName);\n // }\n\n // getOnionsEnabledWrapped(wrapFn: Function, selector?: string) {\n // if (!selector) selector = '';\n // if (!this[SymbolOnionsEnabledWrapped][selector]) {\n // const onions = this.getOnionsEnabled(selector);\n // this[SymbolOnionsEnabledWrapped][selector] = onions.map(item => {\n // return wrapFn(item);\n // });\n // }\n // return this[SymbolOnionsEnabledWrapped][selector];\n // }\n\n // getOnionSlice(onionName: ONIONNAME): IOnionSlice<OPTIONS, ONIONNAME> {\n // return this.onionsNormal[onionName];\n // }\n\n // getOnionOptions<OPTIONS>(onionName: ONIONNAME): OPTIONS | undefined {\n // return this.getOnionSlice(onionName).beanOptions.options as OPTIONS | undefined;\n // }\n\n async loadOnionsFromPackage(\n selector?: string | boolean,\n matchThis?: any,\n ...matchArgs: any[]\n ): Promise<IOnionSlice<OPTIONS, ONIONNAME>[]> {\n // onionItems\n const onionItems = this.getOnionsEnabled(this.onionsAll, selector, matchThis, ...matchArgs);\n // loadOnions\n return await this.loadOnions(onionItems, selector, matchThis, ...matchArgs);\n }\n\n async loadOnions<T>(\n onionItems: IOnionItem<OPTIONS, ONIONNAME> | IOnionItem<OPTIONS, ONIONNAME>[],\n selector?: string | boolean,\n matchThis?: any,\n ...matchArgs: any[]\n ): Promise<IOnionSlice<OPTIONS, ONIONNAME, T>[]> {\n if (!Array.isArray(onionItems)) onionItems = [onionItems];\n if (onionItems.length === 0) return [];\n // load modules\n const moduleNames = onionItems.map(item => item.name.split(':')[0]);\n await this._loadModules(moduleNames);\n // onion slices\n const onionSlices: IOnionSlice<OPTIONS, ONIONNAME, T>[] = [];\n for (const item of onionItems) {\n const beanFullName = item.name.replace(':', `.${this.sceneName}.`);\n const beanOptions = appResource.getBean(beanFullName);\n if (!beanOptions) throw new Error(`behavior not found: ${beanFullName}`);\n // options\n let options;\n if (beanOptions.optionsPrimitive) {\n options = item.options !== undefined ? item.options : beanOptions.options;\n } else {\n options =\n item.options !== undefined\n ? deepExtend({}, beanOptions.options, item.options)\n : beanOptions.options;\n }\n // ok\n onionSlices.push({ name: item.name, options, beanFullName });\n }\n // optionsPackage\n if (this.sceneMeta.optionsPackage) return onionSlices;\n // swap\n this._swapOnions(onionSlices);\n // filter\n return this.getOnionsEnabled(onionSlices, selector, matchThis, ...matchArgs);\n }\n\n getOnionsEnabled<T>(\n onions: IOnionItem<OPTIONS, ONIONNAME>[],\n selector?: string | boolean,\n matchThis?: any,\n ...matchArgs: any[]\n ): IOnionSlice<OPTIONS, ONIONNAME, T>[] {\n if (!onions) return [];\n return onions.filter(onionItem => {\n const onionOptions = onionItem.options as IOnionOptionsEnable &\n IOnionOptionsMatch<TypeOnionOptionsMatchRule<string>>;\n return this.sysOnion.checkOnionOptionsEnabled(\n onionOptions,\n selector,\n matchThis,\n ...matchArgs,\n );\n }) as unknown as IOnionSlice<OPTIONS, ONIONNAME, T>[];\n }\n\n compose(\n onions: IOnionSlice<OPTIONS, ONIONNAME>[],\n executeCustom: IOnionExecuteCustom<OPTIONS, ONIONNAME>,\n ) {\n // fns\n const fns: Function[] = [];\n for (const item of onions) {\n fns.push(this._wrapOnion(item, executeCustom));\n }\n // compose\n return _compose(fns);\n }\n\n async _loadModules(moduleNames: string[]) {\n // load modules\n moduleNames = Array.from(new Set(moduleNames)).filter(item => !this.sys.meta.module.get(item));\n await this.sys.meta.module.loadModules(moduleNames);\n }\n\n /** internal */\n public _wrapOnion(\n item: IOnionSlice<OPTIONS, ONIONNAME>,\n executeCustom: IOnionExecuteCustom<OPTIONS, ONIONNAME>,\n ) {\n const fn = (data: any, next: Next) => {\n return executeCustom(item, data, next);\n };\n fn._name = item.name;\n return fn;\n }\n}\n","import { checkMeta, isNil, matchSelector } from '@cabloy/utils';\nimport { BeanBase, ProxyDisable } from 'zova';\n\nimport type {\n IOnionOptionsEnable,\n IOnionOptionsMatch,\n IOnionOptionsMeta,\n TypeOnionOptionsMatchRules,\n} from '../types/onion.js';\n\nimport { Sys } from '../lib/bean.js';\nimport { ServiceOnion } from '../service/onion_.js';\n\n@ProxyDisable()\n@Sys()\nexport class SysOnion extends BeanBase {\n private __instances: Record<string, any> = {};\n\n protected __get__(prop: string) {\n if (process.env.DEV && this.bean.containerType !== 'sys') {\n throw new Error('should in sys container');\n }\n if (!this.__instances[prop]) {\n this.__instances[prop] = this.bean._newBeanSimple(ServiceOnion, false, prop, this);\n }\n return this.__instances[prop];\n }\n\n public checkOnionOptionsEnabled(\n options: IOnionOptionsEnable & IOnionOptionsMatch<any>,\n selector?: string | boolean,\n matchThis?: any,\n ...matchArgs: any[]\n ) {\n if (options.enable === false) return false;\n if (!this.checkOnionOptionsMeta(options.meta)) return false;\n if (isNil(selector) || selector === false) return true;\n if (isNil(options.match) && isNil(options.ignore)) return true;\n return (\n (!isNil(options.match) &&\n __onionMatchSelector(options.match, selector, matchThis, ...matchArgs)) ||\n (!isNil(options.ignore) &&\n !__onionMatchSelector(options.ignore, selector, matchThis, ...matchArgs))\n );\n }\n\n public checkOnionOptionsMeta(meta?: IOnionOptionsMeta) {\n return checkMeta(meta, this.sys.config.meta);\n }\n}\n\nfunction __onionMatchSelector(\n match: TypeOnionOptionsMatchRules<string>,\n selector: string | boolean,\n matchThis: any,\n ...matchArgs: any[]\n) {\n return matchSelector(match, selector, matchThis, ...matchArgs);\n}\n","import type { Next, NextSync, OmitNever } from 'zova';\n\nimport type { ServiceOnion } from '../service/onion_.js';\nimport type { IOnionOptionsEnable } from './onion.js';\n\nexport const SymbolDecoratorUseAopMethod = Symbol('SymbolDecoratorUseAopMethod');\nexport interface IUseAopMethodPropMetadata<T extends keyof IAopMethodRecord = never> {\n beanInstance?: any;\n onionName?: T;\n options?: Partial<IAopMethodRecord[T]>;\n}\n\nexport interface IAopMethodRecord {}\n\nexport interface IAopMethodGet {\n get(options: IDecoratorAopMethodOptions, next: NextSync, receiver: any, prop: string): any;\n}\n\nexport interface IAopMethodSet {\n set(\n options: IDecoratorAopMethodOptions,\n value: any,\n next: NextSync,\n receiver: any,\n prop: string,\n ): boolean;\n}\n\nexport interface IAopMethodExecute {\n execute(\n options: IDecoratorAopMethodOptions,\n args: [],\n next: Next | NextSync,\n receiver: any,\n prop: string,\n ): Promise<any> | any;\n}\n\nexport interface IDecoratorAopMethodOptions extends IOnionOptionsEnable {}\n\ndeclare module 'zova-module-a-bean' {\n export interface SysOnion {\n aopMethod: ServiceOnion<IDecoratorAopMethodOptions, keyof IAopMethodRecord>;\n }\n}\n\ndeclare module 'zova' {\n export interface ConfigOnions {\n aopMethod: OmitNever<IAopMethodRecord>;\n }\n\n export interface IBeanSceneRecord {\n aopMethod: never;\n }\n}\n","import type { BeanAopMethodBase, Constructable, IBeanRecord } from 'zova';\n\nimport { appMetadata, appResource, BeanBase, ProxyDisable, Use } from 'zova';\n\nimport type { IAopRecord, IDecoratorAopOptions } from '../types/aop.js';\nimport type { IOnionItem, IOnionSlice } from '../types/onion.js';\n\nimport { SysOnion } from '../bean/sys.onion.js';\nimport { Service } from '../lib/bean.js';\nimport {\n IAopMethodRecord,\n IDecoratorAopMethodOptions,\n IUseAopMethodPropMetadata,\n SymbolDecoratorUseAopMethod,\n} from '../types/aopMethod.js';\n\ntype AopMethodsMatchedAll = Record<string, IUseAopMethodPropMetadata[]>;\n\n@ProxyDisable()\n@Service()\nexport class ServiceAop extends BeanBase {\n @Use()\n $$sysOnion: SysOnion;\n\n async findAopsMatched<T>(\n A: Constructable<T>,\n ): Promise<IOnionSlice<IDecoratorAopOptions, keyof IAopRecord>[] | undefined>;\n async findAopsMatched<K extends keyof IBeanRecord>(\n beanFullName: K,\n ): Promise<IOnionSlice<IDecoratorAopOptions, keyof IAopRecord>[] | undefined>;\n async findAopsMatched(\n beanFullName: string,\n ): Promise<IOnionSlice<IDecoratorAopOptions, keyof IAopRecord>[] | undefined>;\n async findAopsMatched<T>(\n beanFullName: Constructable<T> | string,\n ): Promise<IOnionSlice<IDecoratorAopOptions, keyof IAopRecord>[] | undefined> {\n if (process.env.DEV && this.bean.containerType !== 'sys') {\n throw new Error('should in sys container');\n }\n // beanOptions\n const beanOptions = appResource.getBean(beanFullName as any);\n if (!beanOptions) return;\n // loadOnions\n return await this.$$sysOnion.aop.loadOnionsFromPackage(beanOptions.beanFullName);\n }\n\n async findAopMethodsMatched<T>(A: Constructable<T>): Promise<AopMethodsMatchedAll | undefined>;\n async findAopMethodsMatched<K extends keyof IBeanRecord>(\n beanFullName: K,\n ): Promise<AopMethodsMatchedAll | undefined>;\n async findAopMethodsMatched(beanFullName: string): Promise<AopMethodsMatchedAll | undefined>;\n async findAopMethodsMatched<T>(\n beanFullName: Constructable<T> | string,\n ): Promise<AopMethodsMatchedAll | undefined> {\n if (process.env.DEV && this.bean.containerType !== 'sys') {\n throw new Error('should in sys container');\n }\n // beanOptions\n const beanOptions = appResource.getBean(beanFullName as any);\n if (!beanOptions) return;\n const aopMethodsMatchedAll: AopMethodsMatchedAll = {};\n const uses = appMetadata.getMetadata<Record<string, IUseAopMethodPropMetadata[]>>(\n SymbolDecoratorUseAopMethod,\n beanOptions.beanClass.prototype,\n );\n for (const prop in uses) {\n const onionItems: IOnionItem<IDecoratorAopMethodOptions, keyof IAopMethodRecord>[] = [];\n const aopMethods: IUseAopMethodPropMetadata[] = uses[prop];\n for (const aopMethod of aopMethods) {\n onionItems.push({\n name: aopMethod.onionName as never,\n options: aopMethod.options,\n });\n }\n // load onions\n const onionSlices = await this.$$sysOnion.aopMethod.loadOnions<BeanAopMethodBase>(onionItems);\n // aopMethodsMatched\n const aopMethodsMatched: IUseAopMethodPropMetadata[] = [];\n for (const onionSlice of onionSlices) {\n const beanInstance = await this.sys.bean._getBean(onionSlice.beanFullName as any, true);\n aopMethodsMatched.push({\n onionName: onionSlice.name as any,\n beanInstance,\n options: onionSlice.options as any,\n });\n }\n aopMethodsMatchedAll[prop] = aopMethodsMatched;\n }\n return Object.keys(aopMethodsMatchedAll).length === 0 ? undefined : aopMethodsMatchedAll;\n }\n}\n","import type { IMonkeySysInitialize } from 'zova';\n\nimport { BeanSimple } from 'zova';\n\nexport class MonkeySys extends BeanSimple implements IMonkeySysInitialize {\n async sysInitialize() {\n const modulesMeta = this.sys.meta.module.getModulesMeta();\n if (!modulesMeta) {\n throw new Error('module registry has been disposed');\n }\n let beansPreload: string[] = [];\n for (const moduleName in modulesMeta.modules) {\n const module = modulesMeta.modules[moduleName];\n if (!module.info.onionsMeta?.beansPreload) continue;\n beansPreload = beansPreload.concat(module.info.onionsMeta?.beansPreload);\n }\n const promises: Promise<any>[] = beansPreload.map(item => {\n return this.sys.bean._getBean(item as any, false);\n });\n await Promise.all(promises);\n }\n}\n","import { createBeanDecorator } from 'zova';\n\nexport function Scope(): ClassDecorator {\n return createBeanDecorator('scope', 'app', false);\n}\n","// eslint-disable\n/** sys: begin */\nexport * from '../bean/sys.onion.js';\n\nimport 'zova';\ndeclare module 'zova' {\n \n \n}\ndeclare module 'zova-module-a-bean' {\n \n export interface SysOnion {\n /** @internal */\n get scope(): ScopeModuleABean;\n }\n\n export interface SysOnion {\n get $beanFullName(): 'a-bean.sys.onion';\n get $onionName(): 'a-bean:onion';\n \n } \n}\n/** sys: end */\n/** sys: begin */\nimport { SysOnion } from '../bean/sys.onion.js';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordGeneral {\n 'a-bean.sys.onion': SysOnion;\n }\n}\n/** sys: end */\n/** service: begin */\nexport * from '../service/aop.js';\nexport * from '../service/onion_.js';\n\nimport 'zova-module-a-bean';\ndeclare module 'zova-module-a-bean' {\n \n export interface IServiceRecord {\n 'a-bean:aop': never;\n }\n\n \n}\ndeclare module 'zova-module-a-bean' {\n \n export interface ServiceAop {\n /** @internal */\n get scope(): ScopeModuleABean;\n }\n\n export interface ServiceAop {\n get $beanFullName(): 'a-bean.service.aop';\n get $onionName(): 'a-bean:aop';\n \n } \n}\n/** service: end */\n/** service: begin */\nimport { ServiceAop } from '../service/aop.js';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordGeneral {\n 'a-bean.service.aop': ServiceAop;\n }\n}\n/** service: end */\n/** monkeySys: begin */\nexport * from '../monkeySys.js';\n/** monkeySys: end */\n/** scope: begin */\nimport { BeanScopeBase, type BeanScopeUtil } from 'zova';\nimport { Scope } from '../lib/scope.js';\n\n@Scope()\nexport class ScopeModuleABean extends BeanScopeBase {}\n\nexport interface ScopeModuleABean {\n util: BeanScopeUtil;\n}\n\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanScopeRecord {\n 'a-bean': ScopeModuleABean;\n }\n \n \n\n \n\n \n}\n \n/** scope: end */\n","import type { MetadataKey } from 'zova';\n\nimport { appMetadata, registerMappedClassMetadataKey } from 'zova';\n\nimport type { IAopMethodRecord, IUseAopMethodPropMetadata } from '../types/aopMethod.js';\n\nimport { SymbolDecoratorUseAopMethod } from '../types/aopMethod.js';\n\nexport function UseAopMethod<T extends keyof IAopMethodRecord>(\n aopMethodName: T,\n options?: Partial<IAopMethodRecord[T]>,\n): PropertyDescriptor & MethodDecorator {\n return function (target: object, prop: MetadataKey, descriptor?: PropertyDescriptor) {\n registerMappedClassMetadataKey(target, SymbolDecoratorUseAopMethod);\n const uses = appMetadata.getOwnMetadataMap<MetadataKey, IUseAopMethodPropMetadata<T>[]>(\n true,\n SymbolDecoratorUseAopMethod,\n target,\n );\n if (!uses[prop]) uses[prop] = [];\n uses[prop].push({ onionName: aopMethodName, options });\n return descriptor;\n } as any;\n}\n","import type { ZovaOnionOptionsMeta } from '@cabloy/module-info';\n\nexport const SymbolUseOnionLocal = Symbol('SymbolUseOnionLocal');\nexport const SymbolUseOnionOptions = Symbol('SymbolUseOnionOptions');\n\nexport type TypeComposer = (context: any, next?: any) => any;\n\nexport type IOnionExecuteCustom<OPTIONS, ONIONNAME> = (\n onionSlice: IOnionSlice<OPTIONS, ONIONNAME>,\n data: any,\n next: Function,\n) => any;\n\nexport type TypeUseOnionGlobalBaseOptions<T> = Omit<\n T,\n 'global' | 'dependencies' | 'dependents' | 'ignore' | 'match'\n>;\n\nexport interface IOnionOptionsEnable {\n enable?: boolean;\n meta?: IOnionOptionsMeta;\n}\n\nexport type TypeOnionOptionsMatchFunction = (this: any, ...args: any[]) => boolean;\nexport type TypeOnionOptionsMatchRule<T> = T | RegExp | TypeOnionOptionsMatchFunction;\nexport type TypeOnionOptionsMatchRules<T> =\n | TypeOnionOptionsMatchRule<T>[]\n | TypeOnionOptionsMatchRule<T>;\n\nexport interface IOnionOptionsMatch<T> {\n match?: T[] | T;\n ignore?: T[] | T;\n}\n\nexport interface IOnionOptionsDeps<T> {\n dependencies?: T[] | T;\n dependents?: T[] | T;\n}\n\nexport interface IOnionOptionsMeta extends ZovaOnionOptionsMeta {}\n\nexport interface IOnionOptionsBase<T extends string>\n extends IOnionOptionsEnable, IOnionOptionsMatch<TypeOnionOptionsMatchRule<T>> {}\n\nexport interface IOnionSlice<OPTIONS = unknown, ONIONNAME = string, T = unknown> {\n name: ONIONNAME;\n options: OPTIONS;\n beanFullName: string;\n beanInstance?: T;\n}\n\nexport interface IOnionItem<OPTIONS = unknown, ONIONNAME = string> {\n name: ONIONNAME;\n options?: Partial<OPTIONS>;\n}\n\nexport interface ConfigOnions {}\n\ndeclare module 'zova' {\n export interface ZovaConfig {\n onions: ConfigOnions;\n }\n}\n"],"mappings":";;;;;;;;CAEA,OAAO,oBAAO,OAAsB,KAAK;AACzC;;CAEA,OAAO,oBAAgB,QAAc,KAAC;AACtC;AACA,SAAA,UAAA;;AAEA;AACA,SAAS,OAAA;CACT,OAAA,oBAAA,QAAA,KAAA;;AAEA,SAAgB,OAAO;CACrB,OAAO,oBAAoB,QAAQ,KAAI;AACzC;;CAEA,OAAO,oBAAiB,cAAe,KAAA;AACvC;AACA,SAAA,SAAA;;AAEA;AACA,SAAS,QAAA;CACT,OAAA,oBAAA,SAAA,KAAA;;AAEA,SAAgB,IAAA,SAAa;CAC3B,OAAO,oBAAoB,OAAC,OAAa,MAAM,OAAA;AACjD;;CAEA,OAAO,oBAAmB,aAAe,OAAA,MAAA,OAAA;AACzC;;;AC9BA,IAAA,QAAO,SAAO,SAAA;AAWd,IAAE,gBAAmB,SAAA,aAAA,GAAA,UAAA,QAAA,GAAA,UAAA,SAAA,EACnB,QAAA,SACF,CAAC,GAAC,OAAA,WAAA,QAAiB,WAAA,QAAA,WAAA,MAAA,qBAAA,WAAA;CACjB,YAAA,GAAA,MAAmB;EACnB,MAAA,GAAA,IAAA;EACA,KAAA,WAAW,KAAA;EACX,KAAA,YAAA,KAAA;EACA,KAAO,YAAQ,KAAS;;CAE1B;CAIE,SAAO,WAAA,UAAA;4DAER,MAAA,IAAa,MAAA,yBAAA;EAEd,MAAO,cAAM,KAAa,IAAO,KAAE,OAAU,eAAe;EAC1D,IAAA,CAAA,aACA,MAAU,IAAC,MAAM,mCAAA;;EAGjB,KAAA,YAAW;;EAET,IAAC,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BAAsB,OAAO,qBAAqB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/lib/bean.ts","../src/service/onion_.ts","../src/bean/sys.onion.ts","../src/types/aopMethod.ts","../src/service/aop.ts","../src/monkeySys.ts","../src/lib/scope.ts","../src/.metadata/index.ts","../src/lib/useAopMethod.ts","../src/types/onion.ts"],"sourcesContent":["import { createBeanDecorator } from 'zova';\nexport function Sys() {\n return createBeanDecorator('sys', 'sys');\n}\nexport function Bean() {\n return createBeanDecorator('bean', 'ctx');\n}\nexport function Service() {\n return createBeanDecorator('service', 'ctx');\n}\nexport function Tool() {\n return createBeanDecorator('tool', 'app');\n}\nexport function Data() {\n return createBeanDecorator('data', 'new');\n}\nexport function Controller() {\n return createBeanDecorator('controller', 'ctx');\n}\nexport function Render() {\n return createBeanDecorator('render', 'ctx');\n}\nexport function Style() {\n return createBeanDecorator('style', 'ctx');\n}\nexport function Aop(options) {\n return createBeanDecorator('aop', 'sys', true, options);\n}\nexport function AopMethod(options) {\n return createBeanDecorator('aopMethod', 'sys', true, options);\n}","var _dec, _dec2, _dec3, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { compose as _compose } from '@cabloy/compose';\nimport { swapDeps } from '@cabloy/deps';\nimport { getOnionScenesMeta } from '@cabloy/module-info';\nimport { appResource, BeanSimple, cast, deepExtend, ProxyDisable } from 'zova';\nimport { Service } from '../lib/bean.js';\n\n// const SymbolOnionsEnabled = Symbol('SymbolOnionsEnabled');\n// const SymbolOnionsEnabledWrapped = Symbol('SymbolOnionsEnabledWrapped');\n\nexport let ServiceOnion = (_dec = ProxyDisable(), _dec2 = Service(), _dec3 = __z_BeanInfo({\n module: \"a-bean\"\n}), _dec(_class = _dec2(_class = _dec3(_class = class ServiceOnion extends BeanSimple {\n constructor(...args) {\n super(...args);\n this.sysOnion = void 0;\n this.sceneName = void 0;\n this.sceneMeta = void 0;\n this.onionsAll = void 0;\n }\n // private [SymbolOnionsEnabled]: Record<string, IOnionSlice<OPTIONS, ONIONNAME>[]> = {};\n // private [SymbolOnionsEnabledWrapped]: Record<string, Function[]> = {};\n\n __init__(sceneName, sysOnion) {\n if (process.env.DEV && this.bean.containerType !== 'sys') {\n throw new Error('should in sys container');\n }\n const modulesMeta = this.sys.meta.module.getModulesMeta();\n if (!modulesMeta) {\n throw new Error('module registry has been disposed');\n }\n this.sysOnion = sysOnion;\n this.sceneName = sceneName;\n this.sceneMeta = getOnionScenesMeta(modulesMeta.modules)[this.sceneName];\n if (this.sceneMeta.optionsPackage) {\n this._initOnionsAll(modulesMeta);\n this._swapOnions(this.onionsAll);\n }\n }\n _initOnionsAll(modulesMeta) {\n this.onionsAll = [];\n for (const moduleName in modulesMeta.modules) {\n const module = modulesMeta.modules[moduleName];\n const nodeItems = module.info.onionsMeta?.onionsConfig?.[this.sceneName];\n if (!nodeItems) continue;\n for (const itemName in nodeItems) {\n let itemOptions = nodeItems[itemName];\n // extend config\n const onionName = `${moduleName}:${itemName}`;\n const optionsConfig = this.sys.config.onions[this.sceneName]?.[onionName];\n if (optionsConfig) {\n itemOptions = deepExtend({}, itemOptions, optionsConfig);\n }\n this.onionsAll.push({\n name: onionName,\n options: itemOptions\n });\n }\n }\n }\n _swapOnions(onions) {\n swapDeps(onions, {\n name: 'name',\n dependencies: item => {\n const onionOptions = cast(item).options;\n return onionOptions.dependencies;\n },\n dependents: item => {\n const onionOptions = cast(item).options;\n return onionOptions.dependents;\n }\n });\n }\n\n // getOnionsEnabled(selector?: string) {\n // if (!selector) selector = '';\n // if (!this[SymbolOnionsEnabled][selector]) {\n // this[SymbolOnionsEnabled][selector] = this.onionsGlobal.filter(onionSlice => {\n // const onionOptions = onionSlice.beanOptions.options as IOnionOptionsEnable & IOnionOptionsMatch<string>;\n // return this.sysOnion.checkOnionOptionsEnabled(onionOptions, selector);\n // }) as unknown as IOnionSlice<OPTIONS, ONIONNAME>[];\n // }\n // return this[SymbolOnionsEnabled][selector];\n // }\n\n // getOnionsEnabledOfMeta(beanName: string, selector?: string) {\n // return this.getOnionsEnabled(selector).filter(item => item.beanOptions.name === beanName);\n // }\n\n // getOnionsEnabledWrapped(wrapFn: Function, selector?: string) {\n // if (!selector) selector = '';\n // if (!this[SymbolOnionsEnabledWrapped][selector]) {\n // const onions = this.getOnionsEnabled(selector);\n // this[SymbolOnionsEnabledWrapped][selector] = onions.map(item => {\n // return wrapFn(item);\n // });\n // }\n // return this[SymbolOnionsEnabledWrapped][selector];\n // }\n\n // getOnionSlice(onionName: ONIONNAME): IOnionSlice<OPTIONS, ONIONNAME> {\n // return this.onionsNormal[onionName];\n // }\n\n // getOnionOptions<OPTIONS>(onionName: ONIONNAME): OPTIONS | undefined {\n // return this.getOnionSlice(onionName).beanOptions.options as OPTIONS | undefined;\n // }\n\n async loadOnionsFromPackage(selector, matchThis, ...matchArgs) {\n // onionItems\n const onionItems = this.getOnionsEnabled(this.onionsAll, selector, matchThis, ...matchArgs);\n // loadOnions\n return await this.loadOnions(onionItems, selector, matchThis, ...matchArgs);\n }\n async loadOnions(onionItems, selector, matchThis, ...matchArgs) {\n if (!Array.isArray(onionItems)) onionItems = [onionItems];\n if (onionItems.length === 0) return [];\n // load modules\n const moduleNames = onionItems.map(item => item.name.split(':')[0]);\n await this._loadModules(moduleNames);\n // onion slices\n const onionSlices = [];\n for (const item of onionItems) {\n const beanFullName = item.name.replace(':', `.${this.sceneName}.`);\n const beanOptions = appResource.getBean(beanFullName);\n if (!beanOptions) throw new Error(`behavior not found: ${beanFullName}`);\n // options\n let options;\n if (beanOptions.optionsPrimitive) {\n options = item.options !== undefined ? item.options : beanOptions.options;\n } else {\n options = item.options !== undefined ? deepExtend({}, beanOptions.options, item.options) : beanOptions.options;\n }\n // ok\n onionSlices.push({\n name: item.name,\n options,\n beanFullName\n });\n }\n // optionsPackage\n if (this.sceneMeta.optionsPackage) return onionSlices;\n // swap\n this._swapOnions(onionSlices);\n // filter\n return this.getOnionsEnabled(onionSlices, selector, matchThis, ...matchArgs);\n }\n getOnionsEnabled(onions, selector, matchThis, ...matchArgs) {\n if (!onions) return [];\n return onions.filter(onionItem => {\n const onionOptions = onionItem.options;\n return this.sysOnion.checkOnionOptionsEnabled(onionOptions, selector, matchThis, ...matchArgs);\n });\n }\n compose(onions, executeCustom) {\n // fns\n const fns = [];\n for (const item of onions) {\n fns.push(this._wrapOnion(item, executeCustom));\n }\n // compose\n return _compose(fns);\n }\n async _loadModules(moduleNames) {\n // load modules\n moduleNames = Array.from(new Set(moduleNames)).filter(item => !this.sys.meta.module.get(item));\n await this.sys.meta.module.loadModules(moduleNames);\n }\n\n /** internal */\n _wrapOnion(item, executeCustom) {\n const fn = (data, next) => {\n return executeCustom(item, data, next);\n };\n fn._name = item.name;\n return fn;\n }\n}) || _class) || _class) || _class);","var _dec, _dec2, _dec3, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { checkMeta, isNil, matchSelector } from '@cabloy/utils';\nimport { BeanBase, ProxyDisable } from 'zova';\nimport { Sys } from '../lib/bean.js';\nimport { ServiceOnion } from '../service/onion_.js';\nexport let SysOnion = (_dec = ProxyDisable(), _dec2 = Sys(), _dec3 = __z_BeanInfo({\n module: \"a-bean\"\n}), _dec(_class = _dec2(_class = _dec3(_class = class SysOnion extends BeanBase {\n constructor(...args) {\n super(...args);\n this.__instances = {};\n }\n __get__(prop) {\n if (process.env.DEV && this.bean.containerType !== 'sys') {\n throw new Error('should in sys container');\n }\n if (!this.__instances[prop]) {\n this.__instances[prop] = this.bean._newBeanSimple(ServiceOnion, false, prop, this);\n }\n return this.__instances[prop];\n }\n checkOnionOptionsEnabled(options, selector, matchThis, ...matchArgs) {\n if (options.enable === false) return false;\n if (!this.checkOnionOptionsMeta(options.meta)) return false;\n if (isNil(selector) || selector === false) return true;\n if (isNil(options.match) && isNil(options.ignore)) return true;\n return !isNil(options.match) && __onionMatchSelector(options.match, selector, matchThis, ...matchArgs) || !isNil(options.ignore) && !__onionMatchSelector(options.ignore, selector, matchThis, ...matchArgs);\n }\n checkOnionOptionsMeta(meta) {\n return checkMeta(meta, this.sys.config.meta);\n }\n}) || _class) || _class) || _class);\nfunction __onionMatchSelector(match, selector, matchThis, ...matchArgs) {\n return matchSelector(match, selector, matchThis, ...matchArgs);\n}","export const SymbolDecoratorUseAopMethod = Symbol('SymbolDecoratorUseAopMethod');","var _dec, _dec2, _dec3, _dec4, _dec5, _class, _class2, _descriptor;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { appMetadata, appResource, BeanBase, ProxyDisable, Use } from 'zova';\nimport { SysOnion } from '../bean/sys.onion.js';\nimport { Service } from '../lib/bean.js';\nimport { SymbolDecoratorUseAopMethod } from '../types/aopMethod.js';\nexport let ServiceAop = (_dec = ProxyDisable(), _dec2 = Service(), _dec3 = __z_BeanInfo({\n module: \"a-bean\"\n}), _dec4 = Use(), _dec5 = Reflect.metadata(\"design:type\", typeof SysOnion === \"undefined\" ? Object : SysOnion), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class ServiceAop extends BeanBase {\n constructor(...args) {\n super(...args);\n _initializerDefineProperty(this, \"$$sysOnion\", _descriptor, this);\n }\n async findAopsMatched(beanFullName) {\n if (process.env.DEV && this.bean.containerType !== 'sys') {\n throw new Error('should in sys container');\n }\n // beanOptions\n const beanOptions = appResource.getBean(beanFullName);\n if (!beanOptions) return;\n // loadOnions\n return await this.$$sysOnion.aop.loadOnionsFromPackage(beanOptions.beanFullName);\n }\n async findAopMethodsMatched(beanFullName) {\n if (process.env.DEV && this.bean.containerType !== 'sys') {\n throw new Error('should in sys container');\n }\n // beanOptions\n const beanOptions = appResource.getBean(beanFullName);\n if (!beanOptions) return;\n const aopMethodsMatchedAll = {};\n const uses = appMetadata.getMetadata(SymbolDecoratorUseAopMethod, beanOptions.beanClass.prototype);\n for (const prop in uses) {\n const onionItems = [];\n const aopMethods = uses[prop];\n for (const aopMethod of aopMethods) {\n onionItems.push({\n name: aopMethod.onionName,\n options: aopMethod.options\n });\n }\n // load onions\n const onionSlices = await this.$$sysOnion.aopMethod.loadOnions(onionItems);\n // aopMethodsMatched\n const aopMethodsMatched = [];\n for (const onionSlice of onionSlices) {\n const beanInstance = await this.sys.bean._getBean(onionSlice.beanFullName, true);\n aopMethodsMatched.push({\n onionName: onionSlice.name,\n beanInstance,\n options: onionSlice.options\n });\n }\n aopMethodsMatchedAll[prop] = aopMethodsMatched;\n }\n return Object.keys(aopMethodsMatchedAll).length === 0 ? undefined : aopMethodsMatchedAll;\n }\n}, _descriptor = _applyDecoratedDescriptor(_class2.prototype, \"$$sysOnion\", [_dec4, _dec5], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _class2)) || _class) || _class) || _class);","import { BeanSimple } from 'zova';\nexport class MonkeySys extends BeanSimple {\n async sysInitialize() {\n const modulesMeta = this.sys.meta.module.getModulesMeta();\n if (!modulesMeta) {\n throw new Error('module registry has been disposed');\n }\n let beansPreload = [];\n for (const moduleName in modulesMeta.modules) {\n const module = modulesMeta.modules[moduleName];\n if (!module.info.onionsMeta?.beansPreload) continue;\n beansPreload = beansPreload.concat(module.info.onionsMeta?.beansPreload);\n }\n const promises = beansPreload.map(item => {\n return this.sys.bean._getBean(item, false);\n });\n await Promise.all(promises);\n }\n}","import { createBeanDecorator } from 'zova';\nexport function Scope() {\n return createBeanDecorator('scope', 'app', false);\n}","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** sys: begin */\nexport * from '../bean/sys.onion.js';\nimport 'zova';\n/** sys: end */\n/** sys: begin */\nimport { SysOnion } from '../bean/sys.onion.js';\nimport 'zova';\n/** sys: end */\n/** service: begin */\nexport * from '../service/aop.js';\nexport * from '../service/onion_.js';\nimport 'zova-module-a-bean';\n/** service: end */\n/** service: begin */\nimport { ServiceAop } from '../service/aop.js';\nimport 'zova';\n/** service: end */\n/** monkeySys: begin */\nexport * from '../monkeySys.js';\n/** monkeySys: end */\n/** scope: begin */\nimport { BeanScopeBase } from 'zova';\nimport { Scope } from '../lib/scope.js';\nexport let ScopeModuleABean = (_dec = Scope(), _dec2 = __z_BeanInfo({\n module: \"a-bean\"\n}), _dec(_class = _dec2(_class = class ScopeModuleABean extends BeanScopeBase {}) || _class) || _class);\nimport 'zova';\n\n/** scope: end */","import { appMetadata, registerMappedClassMetadataKey } from 'zova';\nimport { SymbolDecoratorUseAopMethod } from '../types/aopMethod.js';\nexport function UseAopMethod(aopMethodName, options) {\n return function (target, prop, descriptor) {\n registerMappedClassMetadataKey(target, SymbolDecoratorUseAopMethod);\n const uses = appMetadata.getOwnMetadataMap(true, SymbolDecoratorUseAopMethod, target);\n if (!uses[prop]) uses[prop] = [];\n uses[prop].push({\n onionName: aopMethodName,\n options\n });\n return descriptor;\n };\n}","export const SymbolUseOnionLocal = Symbol('SymbolUseOnionLocal');\nexport const SymbolUseOnionOptions = Symbol('SymbolUseOnionOptions');"],"mappings":";;;;;;;AACA,SAAgB,MAAM;CACpB,OAAO,oBAAoB,OAAO,KAAK;AACzC;AACA,SAAgB,OAAO;CACrB,OAAO,oBAAoB,QAAQ,KAAK;AAC1C;AACA,SAAgB,UAAU;CACxB,OAAO,oBAAoB,WAAW,KAA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,CAAC,aACH,MAAM,IAAI,MAAM,mCAAmC;EAErD,IAAI,eAAe,CAAC;EACpB,KAAK,MAAM,cAAc,YAAY,SAAS;GAC5C,MAAM,SAAS,YAAY,QAAQ;GACnC,IAAI,CAAC,OAAO,KAAK,YAAY,cAAc;GAC3C,eAAe,aAAa,OAAO,OAAO,KAAK,YAAY,YAAY;EACzE;EACA,MAAM,WAAW,aAAa,KAAI,SAAQ;GACxC,OAAO,KAAK,IAAI,KAAK,SAAS,MAAM,KAAK;EAC3C,CAAC;EACD,MAAM,QAAQ,IAAI,QAAQ;CAC5B;AACF;;;ACjBA,SAAgB,QAAQ;CACtB,OAAO,oBAAoB,SAAS,OAAO,KAAK;AAClD;;;;;ACHA,IAAI,MAAM,OAAO;AA0BjB,IAAW,oBAAoB,OAAO,MAAM,GAAG,QAAQ,SAAa,EAClE,QAAQ,SACV,CAAC,GAAG,KAAK,SAAS,MAAM,SAAS,MAAM,yBAAyB,cAAc,CAAC,CAAC,KAAK,MAAM,KAAK;;;;AC1BhG,SAAgB,aAAa,eAAe,SAAS;CACnD,OAAO,SAAU,QAAQ,MAAM,YAAY;EACzC,+BAA+B,QAAQ,2BAA2B;EAClE,MAAM,OAAO,YAAY,kBAAkB,MAAM,6BAA6B,MAAM;EACpF,IAAI,CAAC,KAAK,OAAO,KAAK,QAAQ,CAAC;EAC/B,KAAK,KAAK,CAAC,KAAK;GACd,WAAW;GACX;EACF,CAAC;EACD,OAAO;CACT;AACF;;;ACbA,IAAa,sBAAsB,OAAO,qBAAqB;AAC/D,IAAa,wBAAwB,OAAO,uBAAuB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zova-module-a-bean",
3
- "version": "5.1.28",
4
- "gitHead": "3380f8c5d3989242b60dc2a34cbb330f74335cbe",
3
+ "version": "5.1.31",
4
+ "gitHead": "1a39e8008e1b48001cfeff475ddd53a2a0d867c4",
5
5
  "description": "",
6
6
  "keywords": [
7
7
  "Zova Module"
@@ -29,7 +29,7 @@
29
29
  "tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/zova.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json && tsc -p tsconfig.cli.json",
30
30
  "prepublishOnly": "npm run tsc:publish",
31
31
  "prepack": "clean-package",
32
- "postpack": "clean-package restore && npm run clean"
32
+ "postpack": "clean-package restore"
33
33
  },
34
34
  "dependencies": {
35
35
  "globby": "^14.1.0"