@wx-sab/renkei 1.1.0 → 1.2.1

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.
@@ -68,7 +68,7 @@ const generate = (conf) => {
68
68
  onCreateRouteName(routeNameInfo, rawRouteInfo) {
69
69
  var _a, _b, _c;
70
70
  // 自定义请求路由
71
- const newRoute = (_a = config.customRequestUrl) === null || _a === void 0 ? void 0 : _a.call(config, rawRouteInfo);
71
+ const newRoute = (_a = config.customRequestUrl) === null || _a === void 0 ? void 0 : _a.call(config, rawRouteInfo, config);
72
72
  if (typeof newRoute === "string") {
73
73
  rawRouteInfo.route = newRoute;
74
74
  }
@@ -25,6 +25,12 @@ export type BasicConfig = {
25
25
  * 数据模型的命名空间
26
26
  */
27
27
  modelNamespace?: string;
28
+ /**
29
+ * 模型的导出类型,默认是 export
30
+ * export - 需要import进来才能用
31
+ * decalre - 全局声明,无需引用
32
+ */
33
+ modelExportType?: "export" | "declare";
28
34
  /**
29
35
  * 接口服务名
30
36
  */
@@ -46,7 +52,7 @@ export type BasicConfig = {
46
52
  * 自定义组装请求的url
47
53
  * 自定义组装 mock 的url
48
54
  */
49
- customRequestUrl?(routeData: RawRouteInfo): string | {
55
+ customRequestUrl?(routeData: RawRouteInfo, config: Partial<GenerateConfig>): string | {
50
56
  /**
51
57
  * 接口请求路径
52
58
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wx-sab/renkei",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "解析swagger转为ts代码,日本动漫《游戏王》中的‘Renkei’,意为连携或协作。",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
@@ -38,6 +38,9 @@ const getFullType = (type) => {
38
38
  return type
39
39
  }
40
40
 
41
+ if (matchList) {
42
+ return `${modelNamespace}.${serviceName}.${type}[]`
43
+ }
41
44
  return `${modelNamespace}.${serviceName}.${type}`
42
45
  }
43
46