UNPKG

yapi-to-typescript

Version:

根据 YApi 的接口定义生成 TypeScript/JavaScript 的接口类型及其请求函数代码。

100 lines (75 loc) 2.98 kB
"use strict"; exports.__esModule = true; exports.ResponseBodyType = exports.Required = exports.RequestQueryType = exports.RequestParamType = exports.RequestFormItemType = exports.RequestBodyType = exports.QueryStringArrayFormat = exports.Method = void 0; /** 请求方式 */ var Method; /** 是否必需 */ exports.Method = Method; (function (Method) { Method["GET"] = "GET"; Method["POST"] = "POST"; Method["PUT"] = "PUT"; Method["DELETE"] = "DELETE"; Method["HEAD"] = "HEAD"; Method["OPTIONS"] = "OPTIONS"; Method["PATCH"] = "PATCH"; })(Method || (exports.Method = Method = {})); var Required; /** 请求数据类型 */ exports.Required = Required; (function (Required) { Required["false"] = "0"; Required["true"] = "1"; })(Required || (exports.Required = Required = {})); var RequestBodyType; /** 请求路径参数类型 */ exports.RequestBodyType = RequestBodyType; (function (RequestBodyType) { RequestBodyType["query"] = "query"; RequestBodyType["form"] = "form"; RequestBodyType["json"] = "json"; RequestBodyType["text"] = "text"; RequestBodyType["file"] = "file"; RequestBodyType["raw"] = "raw"; RequestBodyType["none"] = "none"; })(RequestBodyType || (exports.RequestBodyType = RequestBodyType = {})); var RequestParamType; /** 请求查询参数类型 */ exports.RequestParamType = RequestParamType; (function (RequestParamType) { RequestParamType["string"] = "string"; RequestParamType["number"] = "number"; })(RequestParamType || (exports.RequestParamType = RequestParamType = {})); var RequestQueryType; /** 请求表单条目类型 */ exports.RequestQueryType = RequestQueryType; (function (RequestQueryType) { RequestQueryType["string"] = "string"; RequestQueryType["number"] = "number"; })(RequestQueryType || (exports.RequestQueryType = RequestQueryType = {})); var RequestFormItemType; /** 返回数据类型 */ exports.RequestFormItemType = RequestFormItemType; (function (RequestFormItemType) { RequestFormItemType["text"] = "text"; RequestFormItemType["file"] = "file"; })(RequestFormItemType || (exports.RequestFormItemType = RequestFormItemType = {})); var ResponseBodyType; /** 查询字符串数组格式化方式 */ exports.ResponseBodyType = ResponseBodyType; (function (ResponseBodyType) { ResponseBodyType["json"] = "json"; ResponseBodyType["text"] = "text"; ResponseBodyType["xml"] = "xml"; ResponseBodyType["raw"] = "raw"; })(ResponseBodyType || (exports.ResponseBodyType = ResponseBodyType = {})); var QueryStringArrayFormat; /** 接口定义 */ exports.QueryStringArrayFormat = QueryStringArrayFormat; (function (QueryStringArrayFormat) { QueryStringArrayFormat["brackets"] = "brackets"; QueryStringArrayFormat["indices"] = "indices"; QueryStringArrayFormat["repeat"] = "repeat"; QueryStringArrayFormat["comma"] = "comma"; QueryStringArrayFormat["json"] = "json"; })(QueryStringArrayFormat || (exports.QueryStringArrayFormat = QueryStringArrayFormat = {}));