yapi-apifox-to-typescript 4.2.3 → 5.0.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.
- package/lib/cjs/ApifoxToYApiData.js +312 -588
- package/lib/cjs/Generator.js +507 -1171
- package/lib/cjs/SwaggerToYApiServer.js +125 -336
- package/lib/cjs/_virtual/_rolldown/runtime.js +23 -0
- package/lib/cjs/cli.js +171 -280
- package/lib/cjs/helpers.js +125 -209
- package/lib/cjs/index.js +15 -19
- package/lib/cjs/mini-ut.js +220 -0
- package/lib/cjs/swaggerJsonToYApiData.js +268 -482
- package/lib/cjs/types.js +93 -93
- package/lib/cjs/utils.js +364 -769
- package/lib/esm/ApifoxToYApiData.d.ts +49 -0
- package/lib/esm/ApifoxToYApiData.js +310 -572
- package/lib/esm/Generator.d.ts +53 -0
- package/lib/esm/Generator.js +503 -1146
- package/lib/esm/SwaggerToYApiServer.d.ts +23 -0
- package/lib/esm/SwaggerToYApiServer.js +119 -317
- package/lib/esm/_virtual/_rolldown/runtime.js +7 -0
- package/lib/esm/cli.d.ts +4 -0
- package/lib/esm/cli.js +162 -251
- package/lib/esm/helpers.d.ts +49 -0
- package/lib/esm/helpers.js +125 -198
- package/lib/esm/index.d.ts +2 -897
- package/lib/esm/index.js +3 -2
- package/lib/esm/mini-ut.d.ts +105 -0
- package/lib/esm/mini-ut.js +198 -0
- package/lib/esm/swaggerJsonToYApiData.d.ts +6 -0
- package/lib/esm/swaggerJsonToYApiData.js +265 -469
- package/lib/esm/types.d.ts +698 -0
- package/lib/esm/types.js +87 -73
- package/lib/esm/utils.d.ts +95 -0
- package/lib/esm/utils.js +350 -720
- package/package.json +49 -59
package/lib/cjs/types.js
CHANGED
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.ResponseBodyType = exports.Required = exports.RequestQueryType = exports.RequestParamType = exports.RequestFormItemType = exports.RequestBodyType = exports.QueryStringArrayFormat = exports.Method = void 0;
|
|
5
|
-
|
|
1
|
+
//#region src/types.ts
|
|
6
2
|
/** 请求方式 */
|
|
7
|
-
var Method
|
|
3
|
+
var Method = /* @__PURE__ */ function(Method) {
|
|
4
|
+
Method["GET"] = "GET";
|
|
5
|
+
Method["POST"] = "POST";
|
|
6
|
+
Method["PUT"] = "PUT";
|
|
7
|
+
Method["DELETE"] = "DELETE";
|
|
8
|
+
Method["HEAD"] = "HEAD";
|
|
9
|
+
Method["OPTIONS"] = "OPTIONS";
|
|
10
|
+
Method["PATCH"] = "PATCH";
|
|
11
|
+
return Method;
|
|
12
|
+
}({});
|
|
8
13
|
/** 是否必需 */
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Method["DELETE"] = "DELETE";
|
|
17
|
-
Method["HEAD"] = "HEAD";
|
|
18
|
-
Method["OPTIONS"] = "OPTIONS";
|
|
19
|
-
Method["PATCH"] = "PATCH";
|
|
20
|
-
})(Method || (exports.Method = Method = {}));
|
|
21
|
-
|
|
22
|
-
var Required;
|
|
14
|
+
var Required = /* @__PURE__ */ function(Required) {
|
|
15
|
+
/** 不必需 */
|
|
16
|
+
Required["false"] = "0";
|
|
17
|
+
/** 必需 */
|
|
18
|
+
Required["true"] = "1";
|
|
19
|
+
return Required;
|
|
20
|
+
}({});
|
|
23
21
|
/** 请求数据类型 */
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
var RequestBodyType = /* @__PURE__ */ function(RequestBodyType) {
|
|
23
|
+
/** 查询字符串 */
|
|
24
|
+
RequestBodyType["query"] = "query";
|
|
25
|
+
/** 表单 */
|
|
26
|
+
RequestBodyType["form"] = "form";
|
|
27
|
+
/** JSON */
|
|
28
|
+
RequestBodyType["json"] = "json";
|
|
29
|
+
/** 纯文本 */
|
|
30
|
+
RequestBodyType["text"] = "text";
|
|
31
|
+
/** 文件 */
|
|
32
|
+
RequestBodyType["file"] = "file";
|
|
33
|
+
/** 原始数据 */
|
|
34
|
+
RequestBodyType["raw"] = "raw";
|
|
35
|
+
/** 无请求数据 */
|
|
36
|
+
RequestBodyType["none"] = "none";
|
|
37
|
+
return RequestBodyType;
|
|
38
|
+
}({});
|
|
33
39
|
/** 请求路径参数类型 */
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
RequestBodyType["raw"] = "raw";
|
|
44
|
-
RequestBodyType["none"] = "none";
|
|
45
|
-
})(RequestBodyType || (exports.RequestBodyType = RequestBodyType = {}));
|
|
46
|
-
|
|
47
|
-
var RequestParamType;
|
|
40
|
+
var RequestParamType = /* @__PURE__ */ function(RequestParamType) {
|
|
41
|
+
/** 字符串 */
|
|
42
|
+
RequestParamType["string"] = "string";
|
|
43
|
+
/** 数字 */
|
|
44
|
+
RequestParamType["number"] = "number";
|
|
45
|
+
/** 布尔值 */
|
|
46
|
+
RequestParamType["boolean"] = "boolean";
|
|
47
|
+
return RequestParamType;
|
|
48
|
+
}({});
|
|
48
49
|
/** 请求查询参数类型 */
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var RequestQueryType;
|
|
50
|
+
var RequestQueryType = /* @__PURE__ */ function(RequestQueryType) {
|
|
51
|
+
/** 字符串 */
|
|
52
|
+
RequestQueryType["string"] = "string";
|
|
53
|
+
/** 数字 */
|
|
54
|
+
RequestQueryType["number"] = "number";
|
|
55
|
+
/** 布尔值 */
|
|
56
|
+
RequestQueryType["boolean"] = "boolean";
|
|
57
|
+
return RequestQueryType;
|
|
58
|
+
}({});
|
|
59
59
|
/** 请求表单条目类型 */
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
})(RequestQueryType || (exports.RequestQueryType = RequestQueryType = {}));
|
|
68
|
-
|
|
69
|
-
var RequestFormItemType;
|
|
60
|
+
var RequestFormItemType = /* @__PURE__ */ function(RequestFormItemType) {
|
|
61
|
+
/** 纯文本 */
|
|
62
|
+
RequestFormItemType["text"] = "text";
|
|
63
|
+
/** 文件 */
|
|
64
|
+
RequestFormItemType["file"] = "file";
|
|
65
|
+
return RequestFormItemType;
|
|
66
|
+
}({});
|
|
70
67
|
/** 返回数据类型 */
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
68
|
+
var ResponseBodyType = /* @__PURE__ */ function(ResponseBodyType) {
|
|
69
|
+
/** JSON */
|
|
70
|
+
ResponseBodyType["json"] = "json";
|
|
71
|
+
/** 纯文本 */
|
|
72
|
+
ResponseBodyType["text"] = "text";
|
|
73
|
+
/** XML */
|
|
74
|
+
ResponseBodyType["xml"] = "xml";
|
|
75
|
+
/** 原始数据 */
|
|
76
|
+
ResponseBodyType["raw"] = "raw";
|
|
77
|
+
return ResponseBodyType;
|
|
78
|
+
/** JSON Schema */
|
|
79
|
+
}({});
|
|
80
80
|
/** 查询字符串数组格式化方式 */
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
81
|
+
var QueryStringArrayFormat = /* @__PURE__ */ function(QueryStringArrayFormat) {
|
|
82
|
+
/** 示例: `a[]=b&a[]=c` */
|
|
83
|
+
QueryStringArrayFormat["brackets"] = "brackets";
|
|
84
|
+
/** 示例: `a[0]=b&a[1]=c` */
|
|
85
|
+
QueryStringArrayFormat["indices"] = "indices";
|
|
86
|
+
/** 示例: `a=b&a=c` */
|
|
87
|
+
QueryStringArrayFormat["repeat"] = "repeat";
|
|
88
|
+
/** 示例: `a=b,c` */
|
|
89
|
+
QueryStringArrayFormat["comma"] = "comma";
|
|
90
|
+
/** 示例: `a=["b","c"]` */
|
|
91
|
+
QueryStringArrayFormat["json"] = "json";
|
|
92
|
+
return QueryStringArrayFormat;
|
|
93
|
+
}({});
|
|
94
|
+
//#endregion
|
|
95
|
+
exports.Method = Method;
|
|
94
96
|
exports.QueryStringArrayFormat = QueryStringArrayFormat;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
QueryStringArrayFormat["json"] = "json";
|
|
102
|
-
})(QueryStringArrayFormat || (exports.QueryStringArrayFormat = QueryStringArrayFormat = {}));
|
|
97
|
+
exports.RequestBodyType = RequestBodyType;
|
|
98
|
+
exports.RequestFormItemType = RequestFormItemType;
|
|
99
|
+
exports.RequestParamType = RequestParamType;
|
|
100
|
+
exports.RequestQueryType = RequestQueryType;
|
|
101
|
+
exports.Required = Required;
|
|
102
|
+
exports.ResponseBodyType = ResponseBodyType;
|