open-api-typescript-request-generator 0.0.2 → 0.0.3

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/es/types.js CHANGED
@@ -31,7 +31,7 @@ Object.defineProperty(exports, "__esModule", {
31
31
  exports.ResponseBodyType = exports.RequestFormItemType = exports.RequestQueryType = exports.RequestParamType = exports.RequestBodyType = exports.Required = exports.Method = void 0;
32
32
 
33
33
  __exportStar(require("json-schema"), exports);
34
- /** 请求方式 */
34
+ /** Request method */
35
35
 
36
36
 
37
37
  var Method;
@@ -45,82 +45,82 @@ var Method;
45
45
  Method["OPTIONS"] = "OPTIONS";
46
46
  Method["PATCH"] = "PATCH";
47
47
  })(Method = exports.Method || (exports.Method = {}));
48
- /** 是否必需 */
48
+ /** Required */
49
49
 
50
50
 
51
51
  var Required;
52
52
 
53
53
  (function (Required) {
54
- /** 不必需 */
54
+ /** Not required */
55
55
  Required["false"] = "0";
56
- /** 必需 */
56
+ /** Required */
57
57
 
58
58
  Required["true"] = "1";
59
59
  })(Required = exports.Required || (exports.Required = {}));
60
- /** 请求数据类型 */
60
+ /** Request body type */
61
61
 
62
62
 
63
63
  var RequestBodyType;
64
64
 
65
65
  (function (RequestBodyType) {
66
- /** 查询字符串 */
66
+ /** Query string */
67
67
  RequestBodyType["query"] = "query";
68
- /** 表单 */
68
+ /** Form */
69
69
 
70
70
  RequestBodyType["form"] = "form";
71
71
  /** JSON */
72
72
 
73
73
  RequestBodyType["json"] = "json";
74
- /** 纯文本 */
74
+ /** Plain text */
75
75
 
76
76
  RequestBodyType["text"] = "text";
77
- /** 文件 */
77
+ /** File */
78
78
 
79
79
  RequestBodyType["file"] = "file";
80
- /** 原始数据 */
80
+ /** Raw data */
81
81
 
82
82
  RequestBodyType["raw"] = "raw";
83
- /** 无请求数据 */
83
+ /** No request data */
84
84
 
85
85
  RequestBodyType["none"] = "none";
86
86
  })(RequestBodyType = exports.RequestBodyType || (exports.RequestBodyType = {}));
87
- /** 请求路径参数类型 */
87
+ /** Request path parameter type */
88
88
 
89
89
 
90
90
  var RequestParamType;
91
91
 
92
92
  (function (RequestParamType) {
93
- /** 字符串 */
93
+ /** String */
94
94
  RequestParamType["string"] = "string";
95
- /** 数字 */
95
+ /** Number */
96
96
 
97
97
  RequestParamType["number"] = "number";
98
98
  })(RequestParamType = exports.RequestParamType || (exports.RequestParamType = {}));
99
- /** 请求查询参数类型 */
99
+ /** Request query parameter type */
100
100
 
101
101
 
102
102
  var RequestQueryType;
103
103
 
104
104
  (function (RequestQueryType) {
105
- /** 字符串 */
105
+ /** String */
106
106
  RequestQueryType["string"] = "string";
107
- /** 数字 */
107
+ /** Number */
108
108
 
109
109
  RequestQueryType["number"] = "number";
110
110
  })(RequestQueryType = exports.RequestQueryType || (exports.RequestQueryType = {}));
111
- /** 请求表单条目类型 */
111
+ /** Request form item type */
112
112
 
113
113
 
114
114
  var RequestFormItemType;
115
115
 
116
116
  (function (RequestFormItemType) {
117
- /** 纯文本 */
117
+ /** Plain text */
118
118
  RequestFormItemType["text"] = "text";
119
- /** 文件 */
119
+ /** File */
120
120
 
121
121
  RequestFormItemType["file"] = "file";
122
122
  })(RequestFormItemType = exports.RequestFormItemType || (exports.RequestFormItemType = {}));
123
- /** 返回数据类型 */
123
+ /** Response body type */
124
124
 
125
125
 
126
126
  var ResponseBodyType;
@@ -128,15 +128,15 @@ var ResponseBodyType;
128
128
  (function (ResponseBodyType) {
129
129
  /** JSON */
130
130
  ResponseBodyType["json"] = "json";
131
- /** 纯文本 */
131
+ /** Plain text */
132
132
 
133
133
  ResponseBodyType["text"] = "text";
134
134
  /** XML */
135
135
 
136
136
  ResponseBodyType["xml"] = "xml";
137
- /** 原始数据 */
137
+ /** Raw data */
138
138
 
139
- ResponseBodyType["raw"] = "raw"; // yapi 实际上返回的是 json,有另外的字段指示其是否是 json schema
139
+ ResponseBodyType["raw"] = "raw"; // yapi actually returns json, with another field indicating whether it is json schema
140
140
 
141
141
  /** JSON Schema */
142
142
  // jsonSchema = 'json-schema',
package/lib/Generator.js CHANGED
@@ -676,9 +676,9 @@ function () {
676
676
  }
677
677
 
678
678
  code = (0, vtils_1.dedent)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n ", "\n\n ", "\n ", "\n\n ", "\n "], ["\n ", "\n ", "\n\n ", "\n ", "\n\n ", "\n "])), genComment(function (title) {
679
- return "".concat(title, " \u8BF7\u6C42\u53C2\u6570");
679
+ return "".concat(title, " request parameters");
680
680
  }), requestDataType.trim(), genComment(function (title) {
681
- return "".concat(title, " \u54CD\u5E94\u6570\u636E");
681
+ return "".concat(title, " response data");
682
682
  }), responseDataType.trim(), (0, vtils_1.dedent)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n ", "\n "], ["\n ", "\n ", "\n "])), genComment(function (title) {
683
683
  return "".concat(title);
684
684
  }), requestFunctionTemplate({