zova-module-a-api 5.1.18 → 5.1.21
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/bean/bean.apiBase.ts","../src/config/config.ts","../src/.metadata/this.ts","../src/monkey.ts","../src/.metadata/index.ts","../src/lib/api.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/bean/bean.apiBase.ts","../src/config/config.ts","../src/.metadata/this.ts","../src/monkey.ts","../src/.metadata/index.ts","../src/lib/api.ts"],"sourcesContent":["var _dec, _dec2, _dec3, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { BeanBase, Virtual } from 'zova';\nimport { Bean } from 'zova-module-a-bean';\nexport let BeanApiBase = (_dec = Bean(), _dec2 = Virtual(), _dec3 = __z_BeanInfo({\n module: \"a-api\"\n}), _dec(_class = _dec2(_class = _dec3(_class = class BeanApiBase extends BeanBase {\n $pathTranslate(pathName, pathParams) {\n return this.sys.util.apiActionPathTranslate(pathName, pathParams);\n }\n $configPrepare(baseURL, options, authToken) {\n return this.sys.util.apiActionConfigPrepare(baseURL, options, authToken);\n }\n $formData(body) {\n const formData = new FormData();\n for (const key in body) {\n const value = body[key];\n if (Array.isArray(value)) {\n for (const item of value) {\n formData.append(key, item);\n }\n } else {\n formData.append(key, value);\n }\n }\n return formData;\n }\n}) || _class) || _class) || _class);","export const config = _sys => {\n return {\n defaultModuleApi: 'home-api'\n };\n};","export const __ThisModule__ = 'a-api';\nexport { ScopeModuleAApi as ScopeModule } from './index.js';","import { appResource, BeanSimple, cast } from 'zova';\nimport { __ThisModule__ } from './.metadata/this.js';\nexport class Monkey extends BeanSimple {\n constructor(moduleSelf) {\n super();\n this._moduleSelf = void 0;\n this._defaultModuleApi = void 0;\n this._moduleSelf = moduleSelf;\n }\n async moduleLoading(_module) {}\n async moduleLoaded(module) {\n // load apis\n const promises = [];\n promises.push(this._loadApis(module, 'api'));\n promises.push(this._loadApis(module, 'apiSchema'));\n await Promise.all(promises);\n // self\n if (this._moduleSelf === module) {\n const scopeSelf = await this.bean.getScope(__ThisModule__);\n this._defaultModuleApi = scopeSelf.config.defaultModuleApi;\n await this.app.meta.module.use(this._defaultModuleApi);\n }\n }\n async beanInit(bean, beanInstance) {\n const self = this;\n for (const sceneName of ['api', 'apiSchema']) {\n bean.defineProperty(beanInstance, `$${sceneName}`, {\n enumerable: false,\n configurable: true,\n get() {\n return cast(self.app.bean.scope(self._defaultModuleApi))[sceneName];\n }\n });\n }\n }\n async _loadApis(module, sceneName) {\n const onions = appResource.scenes[sceneName]?.[module.info.relativeName];\n if (!onions) return;\n const scope = this.bean.scope(module.info.relativeName);\n const beanFullNames = Object.keys(onions);\n const promises = [];\n for (const beanFullName of beanFullNames) {\n promises.push(this.bean._getBean(beanFullName, true));\n }\n const values = await Promise.all(promises);\n for (let index = 0; index < beanFullNames.length; index++) {\n const beanFullName = beanFullNames[index];\n const beanOptions = onions[beanFullName];\n scope[sceneName][beanOptions.name] = values[index];\n }\n }\n}","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** bean: begin */\nexport * from '../bean/bean.apiBase.js';\nimport 'zova';\n/** bean: end */\n/** bean: begin */\n\nimport 'zova';\n/** bean: end */\n/** config: begin */\nexport * from '../config/config.js';\n/** config: end */\n/** monkey: begin */\nexport * from '../monkey.js';\n/** monkey: end */\n/** scope: begin */\nimport { BeanScopeBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\nexport let ScopeModuleAApi = (_dec = Scope(), _dec2 = __z_BeanInfo({\n module: \"a-api\"\n}), _dec(_class = _dec2(_class = class ScopeModuleAApi extends BeanScopeBase {}) || _class) || _class);\nimport 'zova';\n\n/** scope: end */","import { createBeanDecorator } from 'zova';\nexport function Api() {\n return createBeanDecorator('api', 'app');\n}\nexport function ApiMeta() {\n return createBeanDecorator('apiMeta', 'app');\n}\nexport function ApiSchema() {\n return createBeanDecorator('apiSchema', 'app');\n}"],"mappings":";;;AAAA,IAAI,QAAM,SAAO,OAAO;AAIxB,IAAW,eAAe,SAAO,KAAK,GAAG,UAAQ,QAAQ,GAAG,QAAQ,SAAa,EAC/E,QAAQ,QACV,CAAC,GAAG,OAAK,WAAS,QAAM,WAAS,MAAM,WAAS,MAAM,oBAAoB,SAAS;CACjF,eAAe,UAAU,YAAY;EACnC,OAAO,KAAK,IAAI,KAAK,uBAAuB,UAAU,UAAU;CAClE;CACA,eAAe,SAAS,SAAS,WAAW;EAC1C,OAAO,KAAK,IAAI,KAAK,uBAAuB,SAAS,SAAS,SAAS;CACzE;CACA,UAAU,MAAM;EACd,MAAM,WAAW,IAAI,SAAS;EAC9B,KAAK,MAAM,OAAO,MAAM;GACtB,MAAM,QAAQ,KAAK;GACnB,IAAI,MAAM,QAAQ,KAAK,GACrB,KAAK,MAAM,QAAQ,OACjB,SAAS,OAAO,KAAK,IAAI;QAG3B,SAAS,OAAO,KAAK,KAAK;EAE9B;EACA,OAAO;CACT;AACF,CAAC,KAAK,QAAM,KAAK,QAAM,KAAK;;;AC3B5B,IAAa,UAAS,SAAQ;CAC5B,OAAO,EACL,kBAAkB,WACpB;AACF;;;ACJA,IAAa,iBAAiB;;;ACE9B,IAAa,SAAb,cAA4B,WAAW;CACrC,YAAY,YAAY;EACtB,MAAM;EACN,KAAK,cAAc,KAAK;EACxB,KAAK,oBAAoB,KAAK;EAC9B,KAAK,cAAc;CACrB;CACA,MAAM,cAAc,SAAS,CAAC;CAC9B,MAAM,aAAa,QAAQ;EAEzB,MAAM,WAAW,CAAC;EAClB,SAAS,KAAK,KAAK,UAAU,QAAQ,KAAK,CAAC;EAC3C,SAAS,KAAK,KAAK,UAAU,QAAQ,WAAW,CAAC;EACjD,MAAM,QAAQ,IAAI,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AO,oBAAoB,WAAW,KAAK;AAC7C;AACA,SAAgB,YAAY;CAC1B,OAAO,oBAAoB,aAAa,KAAK;AAC/C"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-module-a-api",
|
|
3
|
-
"version": "5.1.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "5.1.21",
|
|
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
|
|
32
|
+
"postpack": "clean-package restore"
|
|
33
33
|
},
|
|
34
34
|
"title": "a-api",
|
|
35
35
|
"zovaModule": {
|