zova-module-a-fetch 5.1.17 → 5.1.20
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 +1 -1
- package/package.json +3 -3
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/service/composer.ts","../src/bean/bean.fetch.ts","../src/bean/bean.interceptorBase.ts","../src/config/config.ts","../src/monkey.ts","../src/.metadata/index.ts","../src/lib/const.ts","../src/lib/interceptor.ts"],"sourcesContent":["import type { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';\n\nimport { BeanBase, cast, deepExtend, SymbolErrorInstanceInfo, Use } from 'zova';\nimport { IOnionItem, IOnionSlice, SysOnion, TypeComposer } from 'zova-module-a-bean';\nimport { Service } from 'zova-module-a-bean';\n\nimport type { BeanFetch } from '../bean/bean.fetch.js';\nimport type {\n IDecoratorInterceptorOptions,\n IInterceptorRecord,\n IInterceptorRequest,\n IInterceptorRequestError,\n IInterceptorResponse,\n IInterceptorResponseError,\n} from '../types/interceptor.js';\n\n@Service()\nexport class ServiceComposer extends BeanBase {\n protected $beanFetch: BeanFetch;\n @Use()\n $$sysOnion: SysOnion;\n\n private _composerRequest: TypeComposer;\n private _composerRequestError: TypeComposer;\n private _composerResponse: TypeComposer;\n private _composerResponseError: TypeComposer;\n\n protected async __init__(\n beanFetch: BeanFetch,\n onionItems?:\n | IOnionItem<IDecoratorInterceptorOptions, keyof IInterceptorRecord>\n | IOnionItem<IDecoratorInterceptorOptions, keyof IInterceptorRecord>[],\n ) {\n this.$beanFetch = beanFetch;\n await this._createComposer(onionItems);\n }\n\n public executeRequest(config: AxiosRequestConfig) {\n return this._composerRequest(config);\n }\n\n public executeRequestError(error: AxiosError) {\n return this._composerRequestError(error);\n }\n\n public executeResponse(response: AxiosResponse) {\n return this._composerResponse(response);\n }\n\n public async executeResponseError(error: AxiosError) {\n error = await this._composerResponseError(error);\n if (error instanceof Error) {\n error[SymbolErrorInstanceInfo] = {\n instance: this.ctx.instance,\n info: 'executeResponseError',\n };\n }\n return error;\n }\n\n private async _createComposer(\n onionItems?:\n | IOnionItem<IDecoratorInterceptorOptions, keyof IInterceptorRecord>\n | IOnionItem<IDecoratorInterceptorOptions, keyof IInterceptorRecord>[],\n ) {\n // onionSlices\n let onionSlices: IOnionSlice<IDecoratorInterceptorOptions, keyof IInterceptorRecord>[];\n if (onionItems) {\n onionSlices = await this.$$sysOnion.interceptor.loadOnions(onionItems);\n } else {\n onionSlices = await this.$$sysOnion.interceptor.loadOnionsFromPackage();\n }\n // create interceptors\n for (const onionSlice of onionSlices) {\n onionSlice.beanInstance = await this.bean._newBean(\n onionSlice.beanFullName as any,\n true,\n this.$beanFetch,\n onionSlice.options,\n );\n }\n // compose\n this._composerRequest = this.$$sysOnion.interceptor.compose(\n onionSlices,\n (onionSlice, config: AxiosRequestConfig, next) => {\n // options\n const options = this._combineOnionOptions(onionSlice, config);\n // enable match ignore\n if (!this.$$sysOnion.checkOnionOptionsEnabled(options, config.url)) {\n return next(config);\n }\n // execute\n const beanInstance = cast<IInterceptorRequest>(onionSlice.beanInstance);\n if (!beanInstance.onRequest) return next(config);\n return beanInstance.onRequest(config, options, next as any);\n },\n );\n this._composerRequestError = this.$$sysOnion.interceptor.compose(\n onionSlices,\n (onionSlice, error: AxiosError, next) => {\n const config = error.config;\n // options\n const options = this._combineOnionOptions(onionSlice, config);\n // enable match ignore\n if (!this.$$sysOnion.checkOnionOptionsEnabled(options, config?.url)) {\n return next(error);\n }\n // execute\n const beanInstance = cast<IInterceptorRequestError>(onionSlice.beanInstance);\n if (!beanInstance.onRequestError) return next(error);\n return beanInstance.onRequestError(error, options, next as any);\n },\n );\n this._composerResponse = this.$$sysOnion.interceptor.compose(\n onionSlices,\n (onionSlice, response: AxiosResponse, next) => {\n const config = response.config;\n // options\n const options = this._combineOnionOptions(onionSlice, config);\n // enable match ignore\n if (!this.$$sysOnion.checkOnionOptionsEnabled(options, config?.url)) {\n return next(response);\n }\n // execute\n const beanInstance = cast<IInterceptorResponse>(onionSlice.beanInstance);\n if (!beanInstance.onResponse) return next(response);\n return beanInstance.onResponse(response, options, next as any);\n },\n );\n this._composerResponseError = this.$$sysOnion.interceptor.compose(\n onionSlices,\n (onionSlice, error: AxiosError, next) => {\n const config = error.config;\n // options\n const options = this._combineOnionOptions(onionSlice, config);\n // enable match ignore\n if (!this.$$sysOnion.checkOnionOptionsEnabled(options, config?.url)) {\n return next(error);\n }\n // execute\n const beanInstance = cast<IInterceptorResponseError>(onionSlice.beanInstance);\n if (!beanInstance.onResponseError) return next(error);\n return beanInstance.onResponseError(error, options, next as any);\n },\n );\n }\n\n private _combineOnionOptions(\n item: IOnionSlice<IDecoratorInterceptorOptions, keyof IInterceptorRecord>,\n config?: AxiosRequestConfig,\n ) {\n // options: dynamic\n let optionsDynamic;\n if (config?.interceptors) {\n optionsDynamic = config?.interceptors[item.name];\n }\n // final options\n const options = optionsDynamic ? deepExtend({}, item.options, optionsDynamic) : item.options;\n // ok\n return options;\n }\n}\n","import type { AxiosInstance } from 'axios';\n\nimport axios, { Axios } from 'axios';\nimport { markRaw } from 'vue';\nimport { BeanBase, deepExtend } from 'zova';\nimport { Bean } from 'zova-module-a-bean';\n\nimport type { IBeanFetchOptions } from '../types/interceptor.js';\n\nimport { ServiceComposer } from '../service/composer.js';\n\nconst SymbolFetch = Symbol('SymbolFetch');\n\nexport interface BeanFetch extends AxiosInstance {}\n\n@Bean()\nexport class BeanFetch extends BeanBase {\n private _composer: ServiceComposer;\n\n protected [SymbolFetch]: AxiosInstance;\n\n protected async __init__(options?: IBeanFetchOptions) {\n patchAxios(Axios);\n // axiosConfig\n const axiosConfig = deepExtend(\n {},\n { baseURL: this.sys.util.getApiBaseURL() },\n this.scope.config.axios.config,\n options?.axiosConfig,\n );\n // composer\n this._composer = await this.bean._newBean(ServiceComposer, true, this, options?.onionItems);\n // axios\n this[SymbolFetch] = markRaw(axios.create(axiosConfig));\n this._addInterceptors(this[SymbolFetch]);\n }\n\n protected __get__(prop: string) {\n return this[SymbolFetch] && this[SymbolFetch][prop];\n }\n\n private _addInterceptors(api: AxiosInstance) {\n // request\n api.interceptors.request.use(\n async config => {\n return await this._composer.executeRequest(config);\n },\n async (_error: any) => {\n if (!(_error instanceof Error)) return Promise.reject(_error);\n const error = await this._composer.executeRequestError(_error as any);\n return Promise.reject(error);\n },\n );\n // response\n api.interceptors.response.use(\n async response => {\n return await this._composer.executeResponse(response);\n },\n async (_error: any) => {\n if (!(_error instanceof Error)) return Promise.reject(_error);\n const error = await this._composer.executeResponseError(_error as any);\n return Promise.reject(error);\n },\n );\n }\n}\n\nfunction patchAxios(_Axios: any) {\n if (_Axios.__requestPatched) return;\n _Axios.__requestPatched = true;\n const requestPrev: Function = _Axios.prototype.request;\n _Axios.prototype.request = async function (...args: any[]) {\n try {\n return await requestPrev.call(this, ...args);\n } catch (err) {\n if (err instanceof Error) throw err;\n return err;\n }\n };\n}\n","import { BeanBase, Virtual } from 'zova';\nimport { Bean } from 'zova-module-a-bean';\n\nimport type { IDecoratorInterceptorOptions } from '../types/interceptor.js';\nimport type { BeanFetch } from './bean.fetch.js';\n\n@Bean()\n@Virtual()\nexport class BeanInterceptorBase<\n T extends IDecoratorInterceptorOptions = IDecoratorInterceptorOptions,\n> extends BeanBase {\n protected $beanFetch: BeanFetch;\n protected $options: T;\n\n constructor(beanFetch: BeanFetch, options: T) {\n super();\n this.$beanFetch = beanFetch;\n this.$options = options;\n }\n}\n","import type { CreateAxiosDefaults } from 'axios';\nimport type { ZovaSys } from 'zova';\n\nexport const config = (_sys: ZovaSys) => {\n return {\n axios: {\n config: {} as CreateAxiosDefaults,\n },\n };\n};\n","import type { BeanBase, BeanContainer, IMonkeyAppInitialize, IMonkeyBeanInit } from 'zova';\n\nimport { BeanSimple } from 'zova';\n\nimport { BeanFetch } from './bean/bean.fetch.js';\n\nexport class Monkey extends BeanSimple implements IMonkeyAppInitialize, IMonkeyBeanInit {\n async appInitialize() {\n // $fetch: should in appInitialize, because should init many interceptors\n this.app.meta.$fetch = await this.bean._getBean(BeanFetch, false);\n }\n\n async beanInit(bean: BeanContainer, beanInstance: BeanBase) {\n const self = this;\n // $fetch\n bean.defineProperty(beanInstance, '$fetch', {\n enumerable: false,\n configurable: true,\n get() {\n return self.app.meta.$fetch;\n },\n });\n }\n}\n","// eslint-disable\n/** bean: begin */\nexport * from '../bean/bean.fetch.js';\nexport * from '../bean/bean.interceptorBase.js';\n\nimport 'zova';\ndeclare module 'zova' {\n \n \n}\ndeclare module 'zova-module-a-fetch' {\n \n export interface BeanFetch {\n /** @internal */\n get scope(): ScopeModuleAFetch;\n }\n\n export interface BeanFetch {\n get $beanFullName(): 'a-fetch.bean.fetch';\n get $onionName(): 'a-fetch:fetch';\n \n } \n}\n/** bean: end */\n/** bean: begin */\nimport { BeanFetch } from '../bean/bean.fetch.js';\nimport { BeanInterceptorBase } from '../bean/bean.interceptorBase.js';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordGeneral {\n 'a-fetch.bean.fetch': BeanFetch;\n'a-fetch.bean.interceptorBase': BeanInterceptorBase;\n }\n}\n/** bean: end */\n/** service: begin */\nexport * from '../service/composer.js';\n\nimport 'zova-module-a-bean';\ndeclare module 'zova-module-a-bean' {\n \n export interface IServiceRecord {\n 'a-fetch:composer': never;\n }\n\n \n}\ndeclare module 'zova-module-a-fetch' {\n \n export interface ServiceComposer {\n /** @internal */\n get scope(): ScopeModuleAFetch;\n }\n\n export interface ServiceComposer {\n get $beanFullName(): 'a-fetch.service.composer';\n get $onionName(): 'a-fetch:composer';\n \n } \n}\n/** service: end */\n/** service: begin */\nimport { ServiceComposer } from '../service/composer.js';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordGeneral {\n 'a-fetch.service.composer': ServiceComposer;\n }\n}\n/** service: end */\n/** config: begin */\nexport * from '../config/config.js';\nimport { config } from '../config/config.js';\n/** config: end */\n/** monkey: begin */\nexport * from '../monkey.js';\n/** monkey: end */\n/** scope: begin */\nimport { BeanScopeBase, type BeanScopeUtil, TypeModuleConfig } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\n\n@Scope()\nexport class ScopeModuleAFetch extends BeanScopeBase {}\n\nexport interface ScopeModuleAFetch {\n util: BeanScopeUtil;\nconfig: TypeModuleConfig<typeof config>;\n}\n\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanScopeRecord {\n 'a-fetch': ScopeModuleAFetch;\n }\n \n export interface IBeanScopeConfig {\n 'a-fetch': ReturnType<typeof config>;\n }\n\n \n\n \n}\n \n/** scope: end */\n","export const SymbolInterceptorBodyResponseFlag = Symbol('SymbolInterceptorBodyResponseFlag');\n","import { createBeanDecorator } from 'zova';\n\nimport type { IDecoratorInterceptorOptions } from '../types/interceptor.js';\n\nexport function Interceptor<T extends IDecoratorInterceptorOptions>(options?: T): ClassDecorator {\n return createBeanDecorator('interceptor', 'new', true, options);\n}\n"],"mappings":";;;;;AAAA,IAAA,QAAO,SAAO,SAAU,SAAE,UAAA,SAAoB;;;;;;;;;AAE9C,SAAS,0BAA0B,GAAE,GAAA,GAAA,GAAA,GAAA;CAAA,IAAA,IAAuB,EAAE;AAAA,QAAM,OAAU,KAAC,EAAA,CAAA,QAAA,SAAA,GAAA;AAAA,IAAA,KAAA,EAAA;GAAA,EAAA,EAAA,aAAA,CAAA,CAAA,EAAA,YAAA,EAAA,eAAA,CAAA,CAAA,EAAA,eAAA,WAAA,KAAA,EAAA,iBAAA,EAAA,WAAA,CAAA,IAAA,IAAA,EAAA,OAAA,CAAA,SAAA,CAAA,OAAA,SAAA,GAAA,GAAA;AAAA,SAAA,EAAA,GAAA,GAAA,EAAA,IAAA;IAAA,EAAA,EAAA,KAAA,KAAA,MAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,cAAA,EAAA,YAAA,KAAA,EAAA,GAAA,KAAA,GAAA,EAAA,cAAA,KAAA,IAAA,KAAA,MAAA,E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AAoC,OAAO,oCAAoC;;;;ACE5F,QAAO,oBAAO,eAA8B,OAAO,MAAG,QAAM"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/service/composer.ts","../src/bean/bean.fetch.ts","../src/bean/bean.interceptorBase.ts","../src/config/config.ts","../src/monkey.ts","../src/.metadata/index.ts","../src/lib/const.ts","../src/lib/interceptor.ts"],"sourcesContent":["import type { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';\n\nimport { BeanBase, cast, deepExtend, SymbolErrorInstanceInfo, Use } from 'zova';\nimport { IOnionItem, IOnionSlice, SysOnion, TypeComposer } from 'zova-module-a-bean';\nimport { Service } from 'zova-module-a-bean';\n\nimport type { BeanFetch } from '../bean/bean.fetch.js';\nimport type {\n IDecoratorInterceptorOptions,\n IInterceptorRecord,\n IInterceptorRequest,\n IInterceptorRequestError,\n IInterceptorResponse,\n IInterceptorResponseError,\n} from '../types/interceptor.js';\n\n@Service()\nexport class ServiceComposer extends BeanBase {\n protected $beanFetch: BeanFetch;\n @Use()\n $$sysOnion: SysOnion;\n\n private _composerRequest: TypeComposer;\n private _composerRequestError: TypeComposer;\n private _composerResponse: TypeComposer;\n private _composerResponseError: TypeComposer;\n\n protected async __init__(\n beanFetch: BeanFetch,\n onionItems?:\n | IOnionItem<IDecoratorInterceptorOptions, keyof IInterceptorRecord>\n | IOnionItem<IDecoratorInterceptorOptions, keyof IInterceptorRecord>[],\n ) {\n this.$beanFetch = beanFetch;\n await this._createComposer(onionItems);\n }\n\n public executeRequest(config: AxiosRequestConfig) {\n return this._composerRequest(config);\n }\n\n public executeRequestError(error: AxiosError) {\n return this._composerRequestError(error);\n }\n\n public executeResponse(response: AxiosResponse) {\n return this._composerResponse(response);\n }\n\n public async executeResponseError(error: AxiosError) {\n error = await this._composerResponseError(error);\n if (error instanceof Error) {\n error[SymbolErrorInstanceInfo] = {\n instance: this.ctx.instance,\n info: 'executeResponseError',\n };\n }\n return error;\n }\n\n private async _createComposer(\n onionItems?:\n | IOnionItem<IDecoratorInterceptorOptions, keyof IInterceptorRecord>\n | IOnionItem<IDecoratorInterceptorOptions, keyof IInterceptorRecord>[],\n ) {\n // onionSlices\n let onionSlices: IOnionSlice<IDecoratorInterceptorOptions, keyof IInterceptorRecord>[];\n if (onionItems) {\n onionSlices = await this.$$sysOnion.interceptor.loadOnions(onionItems);\n } else {\n onionSlices = await this.$$sysOnion.interceptor.loadOnionsFromPackage();\n }\n // create interceptors\n for (const onionSlice of onionSlices) {\n onionSlice.beanInstance = await this.bean._newBean(\n onionSlice.beanFullName as any,\n true,\n this.$beanFetch,\n onionSlice.options,\n );\n }\n // compose\n this._composerRequest = this.$$sysOnion.interceptor.compose(\n onionSlices,\n (onionSlice, config: AxiosRequestConfig, next) => {\n // options\n const options = this._combineOnionOptions(onionSlice, config);\n // enable match ignore\n if (!this.$$sysOnion.checkOnionOptionsEnabled(options, config.url)) {\n return next(config);\n }\n // execute\n const beanInstance = cast<IInterceptorRequest>(onionSlice.beanInstance);\n if (!beanInstance.onRequest) return next(config);\n return beanInstance.onRequest(config, options, next as any);\n },\n );\n this._composerRequestError = this.$$sysOnion.interceptor.compose(\n onionSlices,\n (onionSlice, error: AxiosError, next) => {\n const config = error.config;\n // options\n const options = this._combineOnionOptions(onionSlice, config);\n // enable match ignore\n if (!this.$$sysOnion.checkOnionOptionsEnabled(options, config?.url)) {\n return next(error);\n }\n // execute\n const beanInstance = cast<IInterceptorRequestError>(onionSlice.beanInstance);\n if (!beanInstance.onRequestError) return next(error);\n return beanInstance.onRequestError(error, options, next as any);\n },\n );\n this._composerResponse = this.$$sysOnion.interceptor.compose(\n onionSlices,\n (onionSlice, response: AxiosResponse, next) => {\n const config = response.config;\n // options\n const options = this._combineOnionOptions(onionSlice, config);\n // enable match ignore\n if (!this.$$sysOnion.checkOnionOptionsEnabled(options, config?.url)) {\n return next(response);\n }\n // execute\n const beanInstance = cast<IInterceptorResponse>(onionSlice.beanInstance);\n if (!beanInstance.onResponse) return next(response);\n return beanInstance.onResponse(response, options, next as any);\n },\n );\n this._composerResponseError = this.$$sysOnion.interceptor.compose(\n onionSlices,\n (onionSlice, error: AxiosError, next) => {\n const config = error.config;\n // options\n const options = this._combineOnionOptions(onionSlice, config);\n // enable match ignore\n if (!this.$$sysOnion.checkOnionOptionsEnabled(options, config?.url)) {\n return next(error);\n }\n // execute\n const beanInstance = cast<IInterceptorResponseError>(onionSlice.beanInstance);\n if (!beanInstance.onResponseError) return next(error);\n return beanInstance.onResponseError(error, options, next as any);\n },\n );\n }\n\n private _combineOnionOptions(\n item: IOnionSlice<IDecoratorInterceptorOptions, keyof IInterceptorRecord>,\n config?: AxiosRequestConfig,\n ) {\n // options: dynamic\n let optionsDynamic;\n if (config?.interceptors) {\n optionsDynamic = config?.interceptors[item.name];\n }\n // final options\n const options = optionsDynamic ? deepExtend({}, item.options, optionsDynamic) : item.options;\n // ok\n return options;\n }\n}\n","import type { AxiosInstance } from 'axios';\n\nimport axios, { Axios } from 'axios';\nimport { markRaw } from 'vue';\nimport { BeanBase, deepExtend } from 'zova';\nimport { Bean } from 'zova-module-a-bean';\n\nimport type { IBeanFetchOptions } from '../types/interceptor.js';\n\nimport { ServiceComposer } from '../service/composer.js';\n\nconst SymbolFetch = Symbol('SymbolFetch');\n\nexport interface BeanFetch extends AxiosInstance {}\n\n@Bean()\nexport class BeanFetch extends BeanBase {\n private _composer: ServiceComposer;\n\n protected [SymbolFetch]: AxiosInstance;\n\n protected async __init__(options?: IBeanFetchOptions) {\n patchAxios(Axios);\n // axiosConfig\n const axiosConfig = deepExtend(\n {},\n { baseURL: this.sys.util.getApiBaseURL() },\n this.scope.config.axios.config,\n options?.axiosConfig,\n );\n // composer\n this._composer = await this.bean._newBean(ServiceComposer, true, this, options?.onionItems);\n // axios\n this[SymbolFetch] = markRaw(axios.create(axiosConfig));\n this._addInterceptors(this[SymbolFetch]);\n }\n\n protected __get__(prop: string) {\n return this[SymbolFetch] && this[SymbolFetch][prop];\n }\n\n private _addInterceptors(api: AxiosInstance) {\n // request\n api.interceptors.request.use(\n async config => {\n return await this._composer.executeRequest(config);\n },\n async (_error: any) => {\n if (!(_error instanceof Error)) return Promise.reject(_error);\n const error = await this._composer.executeRequestError(_error as any);\n return Promise.reject(error);\n },\n );\n // response\n api.interceptors.response.use(\n async response => {\n return await this._composer.executeResponse(response);\n },\n async (_error: any) => {\n if (!(_error instanceof Error)) return Promise.reject(_error);\n const error = await this._composer.executeResponseError(_error as any);\n return Promise.reject(error);\n },\n );\n }\n}\n\nfunction patchAxios(_Axios: any) {\n if (_Axios.__requestPatched) return;\n _Axios.__requestPatched = true;\n const requestPrev: Function = _Axios.prototype.request;\n _Axios.prototype.request = async function (...args: any[]) {\n try {\n return await requestPrev.call(this, ...args);\n } catch (err) {\n if (err instanceof Error) throw err;\n return err;\n }\n };\n}\n","import { BeanBase, Virtual } from 'zova';\nimport { Bean } from 'zova-module-a-bean';\n\nimport type { IDecoratorInterceptorOptions } from '../types/interceptor.js';\nimport type { BeanFetch } from './bean.fetch.js';\n\n@Bean()\n@Virtual()\nexport class BeanInterceptorBase<\n T extends IDecoratorInterceptorOptions = IDecoratorInterceptorOptions,\n> extends BeanBase {\n protected $beanFetch: BeanFetch;\n protected $options: T;\n\n constructor(beanFetch: BeanFetch, options: T) {\n super();\n this.$beanFetch = beanFetch;\n this.$options = options;\n }\n}\n","import type { CreateAxiosDefaults } from 'axios';\nimport type { ZovaSys } from 'zova';\n\nexport const config = (_sys: ZovaSys) => {\n return {\n axios: {\n config: {} as CreateAxiosDefaults,\n },\n };\n};\n","import type { BeanBase, BeanContainer, IMonkeyAppInitialize, IMonkeyBeanInit } from 'zova';\n\nimport { BeanSimple } from 'zova';\n\nimport { BeanFetch } from './bean/bean.fetch.js';\n\nexport class Monkey extends BeanSimple implements IMonkeyAppInitialize, IMonkeyBeanInit {\n async appInitialize() {\n // $fetch: should in appInitialize, because should init many interceptors\n this.app.meta.$fetch = await this.bean._getBean(BeanFetch, false);\n }\n\n async beanInit(bean: BeanContainer, beanInstance: BeanBase) {\n const self = this;\n // $fetch\n bean.defineProperty(beanInstance, '$fetch', {\n enumerable: false,\n configurable: true,\n get() {\n return self.app.meta.$fetch;\n },\n });\n }\n}\n","// eslint-disable\n/** bean: begin */\nexport * from '../bean/bean.fetch.js';\nexport * from '../bean/bean.interceptorBase.js';\n\nimport 'zova';\ndeclare module 'zova' {\n \n \n}\ndeclare module 'zova-module-a-fetch' {\n \n export interface BeanFetch {\n /** @internal */\n get scope(): ScopeModuleAFetch;\n }\n\n export interface BeanFetch {\n get $beanFullName(): 'a-fetch.bean.fetch';\n get $onionName(): 'a-fetch:fetch';\n \n } \n}\n/** bean: end */\n/** bean: begin */\nimport { BeanFetch } from '../bean/bean.fetch.js';\nimport { BeanInterceptorBase } from '../bean/bean.interceptorBase.js';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordGeneral {\n 'a-fetch.bean.fetch': BeanFetch;\n'a-fetch.bean.interceptorBase': BeanInterceptorBase;\n }\n}\n/** bean: end */\n/** service: begin */\nexport * from '../service/composer.js';\n\nimport 'zova-module-a-bean';\ndeclare module 'zova-module-a-bean' {\n \n export interface IServiceRecord {\n 'a-fetch:composer': never;\n }\n\n \n}\ndeclare module 'zova-module-a-fetch' {\n \n export interface ServiceComposer {\n /** @internal */\n get scope(): ScopeModuleAFetch;\n }\n\n export interface ServiceComposer {\n get $beanFullName(): 'a-fetch.service.composer';\n get $onionName(): 'a-fetch:composer';\n \n } \n}\n/** service: end */\n/** service: begin */\nimport { ServiceComposer } from '../service/composer.js';\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanRecordGeneral {\n 'a-fetch.service.composer': ServiceComposer;\n }\n}\n/** service: end */\n/** config: begin */\nexport * from '../config/config.js';\nimport { config } from '../config/config.js';\n/** config: end */\n/** monkey: begin */\nexport * from '../monkey.js';\n/** monkey: end */\n/** scope: begin */\nimport { BeanScopeBase, type BeanScopeUtil, TypeModuleConfig } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\n\n@Scope()\nexport class ScopeModuleAFetch extends BeanScopeBase {}\n\nexport interface ScopeModuleAFetch {\n util: BeanScopeUtil;\nconfig: TypeModuleConfig<typeof config>;\n}\n\nimport 'zova';\ndeclare module 'zova' {\n export interface IBeanScopeRecord {\n 'a-fetch': ScopeModuleAFetch;\n }\n \n export interface IBeanScopeConfig {\n 'a-fetch': ReturnType<typeof config>;\n }\n\n \n\n \n}\n \n/** scope: end */\n","export const SymbolInterceptorBodyResponseFlag = Symbol('SymbolInterceptorBodyResponseFlag');\n","import { createBeanDecorator } from 'zova';\n\nimport type { IDecoratorInterceptorOptions } from '../types/interceptor.js';\n\nexport function Interceptor<T extends IDecoratorInterceptorOptions>(options?: T): ClassDecorator {\n return createBeanDecorator('interceptor', 'new', true, options);\n}\n"],"mappings":";;;;;AAAA,IAAA,QAAO,SAAO,SAAU,SAAE,UAAA,SAAoB;;;;;;;;;AAE9C,SAAS,0BAA0B,GAAE,GAAA,GAAA,GAAA,GAAA;CAAA,IAAA,IAAuB,CAAC;CAAC,OAAM,OAAU,KAAC,CAAA,EAAA,QAAA,SAAA,GAAA;EAAA,EAAA,KAAA,EAAA;CAAA,CAAA,GAAA,EAAA,aAAA,CAAA,CAAA,EAAA,YAAA,EAAA,eAAA,CAAA,CAAA,EAAA,eAAA,WAAA,KAAA,EAAA,iBAAA,EAAA,WAAA,CAAA,IAAA,IAAA,EAAA,MAAA,EAAA,QAAA,EAAA,OAAA,SAAA,GAAA,GAAA;EAAA,OAAA,EAAA,GAAA,GAAA,CAAA,KAAA;CAAA,GAAA,CAAA,GAAA,KAAA,KAAA,MAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,cAAA,EAAA,YAAA,KAAA,CAAA,IAAA,KAAA,GAAA,EAAA,cAAA,KAAA,IAAA,KAAA,MAAA,EAAA,eAAA,OAAA,eAAA,GAAA,GAAA,CAAA,GAAA,QAAA;AAAA;AAK/E,IAAW,mBAAC,SAAA,QAAA,GAAA,UAAA,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,CAAA,KAAA,MAAA,KAAA;;;;AC/BnD,IAAa,oCAAoC,OAAO,mCAAmC;;;;CCE3F,OAAO,oBAAO,eAA8B,OAAO,MAAG,OAAM"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-module-a-fetch",
|
|
3
|
-
"version": "5.1.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "5.1.20",
|
|
4
|
+
"gitHead": "3380f8c5d3989242b60dc2a34cbb330f74335cbe",
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Zova Module"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"clean": "rimraf dist tsconfig.build.tsbuildinfo",
|
|
28
|
-
"tsc:publish": "npm run clean && zova :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
28
|
+
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/zova.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
29
29
|
"prepublishOnly": "npm run tsc:publish",
|
|
30
30
|
"prepack": "clean-package",
|
|
31
31
|
"postpack": "clean-package restore && npm run clean"
|