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/README.md +7 -7
- package/es/Generator.js +2 -2
- package/es/types.d.ts +157 -157
- package/es/types.js +24 -24
- package/lib/Generator.js +2 -2
- package/lib/types.d.ts +157 -157
- package/lib/types.js +24 -24
- package/package.json +1 -1
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
|
|
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, "
|
|
679
|
+
return "".concat(title, " request parameters");
|
|
680
680
|
}), requestDataType.trim(), genComment(function (title) {
|
|
681
|
-
return "".concat(title, "
|
|
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({
|