openapi-ts-request 1.6.4 → 1.6.6
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.
|
@@ -121,9 +121,10 @@ class ServiceGenerator {
|
|
|
121
121
|
return;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
+
const tagTypeName = (0, util_2.resolveTypeName)(tag);
|
|
124
125
|
const tagKey = this.config.isCamelCase
|
|
125
|
-
? (0, util_1.camelCase)(
|
|
126
|
-
: (0,
|
|
126
|
+
? (0, util_1.camelCase)(tagTypeName)
|
|
127
|
+
: (0, lodash_1.lowerFirst)(tagTypeName);
|
|
127
128
|
if (!this.apiData[tagKey]) {
|
|
128
129
|
this.apiData[tagKey] = [];
|
|
129
130
|
}
|
|
@@ -366,7 +367,7 @@ class ServiceGenerator {
|
|
|
366
367
|
}
|
|
367
368
|
if (this.config.isGenJsonSchemas) {
|
|
368
369
|
this.schemaList.push({
|
|
369
|
-
typeName: `$${(0, util_2.resolveTypeName)(schemaKey)}`,
|
|
370
|
+
typeName: `$${(0, lodash_1.lowerFirst)((0, util_2.resolveTypeName)(schemaKey))}`,
|
|
370
371
|
type: JSON.stringify((0, patchSchema_1.patchSchema)(schema, (_a = this.openAPIData.components) === null || _a === void 0 ? void 0 : _a.schemas)),
|
|
371
372
|
});
|
|
372
373
|
}
|
|
@@ -584,7 +585,7 @@ class ServiceGenerator {
|
|
|
584
585
|
var _a, _b, _c;
|
|
585
586
|
const namespace = this.config.namespace ? `${this.config.namespace}.` : '';
|
|
586
587
|
const typeName = ((_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.hook) === null || _b === void 0 ? void 0 : _b.customTypeName) === null || _c === void 0 ? void 0 : _c.call(_b, data)) || this.getFunctionName(data);
|
|
587
|
-
return (0, util_2.resolveTypeName)(`${namespace}${typeName !== null && typeName !== void 0 ? typeName : data.operationId}Params`);
|
|
588
|
+
return (0, lodash_1.upperFirst)((0, util_2.resolveTypeName)(`${namespace}${typeName !== null && typeName !== void 0 ? typeName : data.operationId}Params`));
|
|
588
589
|
}
|
|
589
590
|
getBodyTP(requestBody, namespace) {
|
|
590
591
|
var _a;
|
package/dist/generator/util.js
CHANGED
|
@@ -72,10 +72,10 @@ function resolveTypeName(typeName) {
|
|
|
72
72
|
return `Pinyin_${name}`;
|
|
73
73
|
}
|
|
74
74
|
if (!/[\u3220-\uFA29]/.test(name) && !/^\d$/.test(name)) {
|
|
75
|
-
return name;
|
|
75
|
+
return (0, lodash_1.upperFirst)(name);
|
|
76
76
|
}
|
|
77
77
|
const noBlankName = name.replace(/ +/g, '');
|
|
78
|
-
return tiny_pinyin_1.default.convertToPinyin(noBlankName, '', true);
|
|
78
|
+
return (0, lodash_1.upperFirst)(tiny_pinyin_1.default.convertToPinyin(noBlankName, '', true));
|
|
79
79
|
}
|
|
80
80
|
function getRefName(refObject) {
|
|
81
81
|
if (!isReferenceObject(refObject)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openapi-ts-request",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.6",
|
|
4
4
|
"description": "Swagger2/OpenAPI3/Apifox to TypeScript/JavaScript, request client(support any client), request mock service, enum and enum translation, react-query/vue-query, type field label, JSON Schemas",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"js-yaml": "^4.1.0",
|
|
37
37
|
"lodash": "^4.17.21",
|
|
38
38
|
"memoizee": "^0.4.17",
|
|
39
|
-
"minimatch": "^
|
|
39
|
+
"minimatch": "^9.0.5",
|
|
40
40
|
"mockjs": "^1.1.0",
|
|
41
41
|
"nunjucks": "^3.2.4",
|
|
42
42
|
"prettier": "^3.3.2",
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
"@typescript-eslint/parser": "^7.9.0",
|
|
67
67
|
"eslint": "^8.57.1",
|
|
68
68
|
"husky": "^9.0.11",
|
|
69
|
-
"lint-staged": "^
|
|
69
|
+
"lint-staged": "^15.5.2",
|
|
70
70
|
"openapi-types": "^12.1.3",
|
|
71
71
|
"sanitize-filename": "^1.6.3",
|
|
72
72
|
"ts-node": "^10.9.2",
|
|
73
73
|
"typescript": "5.8.3",
|
|
74
|
-
"vitest": "^
|
|
74
|
+
"vitest": "^2.1.9"
|
|
75
75
|
},
|
|
76
76
|
"keywords": [
|
|
77
77
|
"openapi",
|