axios-annotations 1.1.4 → 1.1.7

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/README.md CHANGED
@@ -464,29 +464,20 @@ import {authorizer} from "/path/config.js";
464
464
 
465
465
  > #### RequestController
466
466
  > + param: (key, required?) : RequestController
467
- >
468
- + key : string `标记查询串参数`
467
+ > + key : string `标记查询串参数`
469
468
  > + required : boolean `默认false,空字符串,null,undefined 将忽略`
470
469
  > + header: (header, header) : RequestController
471
- >
472
- + header : string `url 附加参数键值`
470
+ > + header : string `url 附加参数键值`
473
471
  > + header : string | function `字符串,或者接收 send 方法参数的函数,该函数应返回合法值。`
474
- >
475
472
  > + body: (key) : RequestController
476
- >
477
- + key : string `标记参数中请求体`
478
- >
473
+ > + key : string `标记参数中请求体`
479
474
  > + config: (cfg) : RequestController
480
- >
481
- + cfg : `AxiosRequestConfig`
475
+ > + cfg : `AxiosRequestConfig`
482
476
  >
483
477
  > + send: (data) : AxiosPromise<any>
484
- >
485
- + data : object `参数键值对`
486
- >
478
+ > + data : object `参数键值对`
487
479
  > + with: (name) : RequestController
488
- >
489
- + name : string `config name : 已注册配置名称`
480
+ > + name : string `config name : 已注册配置名称`
490
481
 
491
482
  ### Decorators
492
483
 
@@ -579,19 +570,21 @@ npm install axios@0.21.0
579
570
  npm install axios-miniprogram-adapter
580
571
  ```
581
572
 
582
- + 编译报错 `module is not defined`, 在`app.js`头部补充声明:
573
+ + 编译报错 `module is not defined`, 在`app.js`头部补充缺失组件的声明:
583
574
 
584
575
  ```javascript
585
- import RequestMapping from "axios-annotations/decorator/request-mapping";
586
- import GetMapping from "axios-annotations/decorator/get-mapping";
587
- import PostMapping from "axios-annotations/decorator/post-mapping";
588
- import PutMapping from "axios-annotations/decorator/put-mapping";
589
- import DeleteMapping from "axios-annotations/decorator/delete-mapping";
590
- import PatchMapping from "axios-annotations/decorator/patch-mapping";
591
- import RequestParam from "axios-annotations/decorator/request-param";
592
- import RequestBody from "axios-annotations/decorator/request-body";
593
- import RequestHeader from "axios-annotations/decorator/request-header";
594
- import RequestConfig from "axios-annotations/decorator/request-config";
576
+ import "axios-annotations/core/service";
577
+ import "axios-annotations/decorator/request-mapping";
578
+ import "axios-annotations/decorator/get-mapping";
579
+ import "axios-annotations/decorator/post-mapping";
580
+ import "axios-annotations/decorator/put-mapping";
581
+ import "axios-annotations/decorator/delete-mapping";
582
+ import "axios-annotations/decorator/patch-mapping";
583
+ import "axios-annotations/decorator/request-param";
584
+ import "axios-annotations/decorator/request-body";
585
+ import "axios-annotations/decorator/request-header";
586
+ import "axios-annotations/decorator/request-config";
587
+ import "axios-annotations/decorator/request-with";
595
588
  ```
596
589
 
597
590
  + 更新开发工具以支持装饰器语法。
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=RequestMapping;var _config=_interopRequireDefault(require("../core/config")),_common=require("../core/common");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function RequestMapping(h){var l=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return function(e,p,t){var s;t?(l=l||"GET",s=t.value,t.value=function(){for(var a=this,e=arguments.length,u=new Array(e),t=0;t<e;t++)u[t]=arguments[t];var r,o,n,f=s.apply(this,u)||{},i=this.for(p),c=i?_config.default.forName(i):null;return f&&Object.hasOwnProperty.call(f,"then")&&"function"==typeof f.then?new Promise(function(n,i){f.then(function(e){var e=a.createRequestConfig(p,a.pathVariable(h||"",e),e,u,u),t=e.path,r=e.body,o=e.config,e=e.query;(c?(0,_common.forward)(c.axios,c.origin,c.prefix,a.path,h,l,e,r,o):a.request(l,t,r,o)).then(n).catch(i)})}):(r=(i=this.createRequestConfig(p,this.pathVariable(h||"",f),f,u,u)).path,o=i.body,n=i.config,i=i.query,c?(0,_common.forward)(c.axios,c.origin,c.prefix,this.path,h,l,i,o,n):this.request(l,r,o,n))}):e.prototype._path=h}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=RequestMapping;var _config=_interopRequireDefault(require("../core/config")),_common=require("../core/common");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function RequestMapping(p){var l=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return function(e,s,r){var h;r?(l=l||"GET",h=r.value,r.value=function(){for(var a=this,e=arguments.length,u=new Array(e),r=0;r<e;r++)u[r]=arguments[r];var t=h.apply(this,u)||{};if("function"!=typeof this.for)throw new Error('Make sure your service inherited "core/Service".');var o,i,n,f=this.for(s),c=f?_config.default.forName(f):null;return t&&Object.hasOwnProperty.call(t,"then")&&"function"==typeof t.then?new Promise(function(i,n){t.then(function(e){var e=a.createRequestConfig(s,a.pathVariable(p||"",e),e,u,u),r=e.path,t=e.body,o=e.config,e=e.query;(c?(0,_common.forward)(c.axios,c.origin,c.prefix,a.path,p,l,e,t,o):a.request(l,r,t,o)).then(i).catch(n)})}):(o=(f=this.createRequestConfig(s,this.pathVariable(p||"",t),t,u,u)).path,i=f.body,n=f.config,f=f.query,c?(0,_common.forward)(c.axios,c.origin,c.prefix,this.path,p,l,f,i,n):this.request(l,o,i,n))}):e.prototype._path=p}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axios-annotations",
3
- "version": "1.1.4",
3
+ "version": "1.1.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+ssh://git@github.com/sitorhy/axios-annotations.git"
@@ -0,0 +1 @@
1
+ module.exports = require("../../lib/plugins/cache/index");
@@ -1 +0,0 @@
1
- "use strict";function CachePlugin(){return function(e){var t=e.axios.defaults.adapter;e.axios.defaults.adapter=function(e){return t(e)}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=CachePlugin;